Class: D3::Quad
Instance Method Summary collapse
Methods included from Native
Instance Method Details
#children ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/opal/d3/quadtree.rb', line 24 def children return nil if leaf? result = (0..3).map do |i| q = `#@native[i]` if `q == null` nil else D3::Quad.new(q) end end end |
#data ⇒ Object
19 20 21 22 |
# File 'lib/opal/d3/quadtree.rb', line 19 def data return nil if internal? `#@native.data` end |
#internal? ⇒ Boolean
5 6 7 |
# File 'lib/opal/d3/quadtree.rb', line 5 def internal? `#@native.constructor === Array` end |
#leaf? ⇒ Boolean
9 10 11 |
# File 'lib/opal/d3/quadtree.rb', line 9 def leaf? `#@native.constructor !== Array` end |