Module: Rubyvis::Layout::NodeLink
Instance Attribute Summary collapse
-
#_h ⇒ Object
Returns the value of attribute _h.
-
#_ir ⇒ Object
Returns the value of attribute _ir.
-
#_or ⇒ Object
Returns the value of attribute _or.
-
#_orient ⇒ Object
Returns the value of attribute _orient.
-
#_w ⇒ Object
Returns the value of attribute _w.
Instance Method Summary collapse
Instance Attribute Details
#_h ⇒ Object
Returns the value of attribute _h.
63 64 65 |
# File 'lib/rubyvis/layout/hierarchy.rb', line 63 def _h @_h end |
#_ir ⇒ Object
Returns the value of attribute _ir.
63 64 65 |
# File 'lib/rubyvis/layout/hierarchy.rb', line 63 def _ir @_ir end |
#_or ⇒ Object
Returns the value of attribute _or.
63 64 65 |
# File 'lib/rubyvis/layout/hierarchy.rb', line 63 def _or @_or end |
#_orient ⇒ Object
Returns the value of attribute _orient.
63 64 65 |
# File 'lib/rubyvis/layout/hierarchy.rb', line 63 def _orient @_orient end |
#_w ⇒ Object
Returns the value of attribute _w.
63 64 65 |
# File 'lib/rubyvis/layout/hierarchy.rb', line 63 def _w @_w end |
Instance Method Details
#node_link_build_implied(s) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/rubyvis/layout/hierarchy.rb', line 64 def node_link_build_implied(s) nodes = s.nodes @_orient= s.orient horizontal= case @_orient when /^(top|bottom)$/ true else false end @_w = s.width @_h = s.height # /* Compute default inner and outer radius. */ if (@_orient == "radial") @_ir = s.inner_radius @_or = s.outer_radius @_ir||=0 @_or||=[@_w,@_h].min / 2.0 end nodes.each_with_index{|n,i| n.mid_angle = (@_orient == "radial") ? mid_angle(n) : (horizontal ? Math::PI / 2.0 : 0) n.x = node_link_x(n) n.y = node_link_y(n) n.mid_angle+=Math::PI if (n.first_child) } false end |