Class: Treemap::OutputBase

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

Direct Known Subclasses

HtmlOutput, ImageOutput, SvgOutput

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OutputBase.

Yields:

  • (_self)

Yield Parameters:



19
20
21
22
23
24
25
26
27
# File 'lib/treemap/output_base.rb', line 19

def initialize
    @width = 800
    @height = 600
    @margin_top = 0
    @margin_left = 0
    @layout = Treemap::SquarifiedLayout.new
    @color = Treemap::GradientColor.new
    yield self if block_given?
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



17
18
19
# File 'lib/treemap/output_base.rb', line 17

def color
  @color
end

#heightObject

Returns the value of attribute height.



17
18
19
# File 'lib/treemap/output_base.rb', line 17

def height
  @height
end

#layoutObject

Returns the value of attribute layout.



17
18
19
# File 'lib/treemap/output_base.rb', line 17

def layout
  @layout
end

#margin_leftObject

Returns the value of attribute margin_left.



17
18
19
# File 'lib/treemap/output_base.rb', line 17

def margin_left
  @margin_left
end

#margin_topObject

Returns the value of attribute margin_top.



17
18
19
# File 'lib/treemap/output_base.rb', line 17

def margin_top
  @margin_top
end

#widthObject

Returns the value of attribute width.



17
18
19
# File 'lib/treemap/output_base.rb', line 17

def width
  @width
end