Class: Treemap::LayoutBase

Inherits:
Object
  • Object
show all
Defined in:
lib/treemap/layout_base.rb

Direct Known Subclasses

SliceLayout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ LayoutBase

Returns a new instance of LayoutBase.

Yields:

  • (_self)

Yield Parameters:



17
18
19
20
21
22
23
24
# File 'lib/treemap/layout_base.rb', line 17

def initialize
    # Similar to the css style position. If set to :fixed x,y bounds calculations
    # should be computed relative to the root bounds. If set to :absolute then they
    # should be computed relative to the parent bounds.
    # See http://www.w3.org/TR/CSS2/visuren.html#positioning-scheme
    @position = :fixed
    yield self if block_given?
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



15
16
17
# File 'lib/treemap/layout_base.rb', line 15

def color
  @color
end

#positionObject

Returns the value of attribute position.



15
16
17
# File 'lib/treemap/layout_base.rb', line 15

def position
  @position
end

Instance Method Details

#process(node, bounds) ⇒ Object

Subclasses will override



27
28
# File 'lib/treemap/layout_base.rb', line 27

def process(node, bounds)
end