Represents an abstract layout for hierarchy diagrams. This class is a specialization of Rubyvis::Layout::Network, providing the basic structure for both hierarchical node-link diagrams (such as Reingold-Tilford trees) and space-filling hierarchy diagrams (such as sunbursts and treemaps).
<p>Unlike general network layouts, the
need not be defined explicitly. Instead, the links are computed implicitly
parent_node attribute of the node objects, as defined
nodes property. This implementation is also available
as +#links, for reuse with
non-hierarchical layouts; for example, to render a tree using
nodes property is represented as
a union of Rubyvis::Layout::Network::Node} and Rubyvis::Dom::Node. To construct a node
hierarchy from a simple JSON map, use the Rubyvis::Dom operator; this operator also provides
an easy way to sort nodes before passing them to the layout.
<p>For more details on how to use this layout, see Rubyvis::Layout::Network
# File lib/rubyvis/layout/hierarchy.rb, line 36 def initialize super @link.stroke_style("#ccc") end
# File lib/rubyvis/layout/hierarchy.rb, line 40 def build_implied(s) hierarchy_build_implied(s) end
@private Compute the implied links. (Links are null by default.) */
# File lib/rubyvis/layout/hierarchy.rb, line 44 def hierarchy_build_implied(s) s.links=self.links() if !s.links network_build_implied(s) end