Class: RubyvisCharts::AbstractChart
- Inherits:
-
Object
- Object
- RubyvisCharts::AbstractChart
- Defined in:
- lib/rubyvis_charts/abstract_chart.rb
Direct Known Subclasses
Defined Under Namespace
Modules: DefaultArguments
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#inner_box_height ⇒ Object
readonly
Returns the value of attribute inner_box_height.
-
#inner_box_width ⇒ Object
readonly
Returns the value of attribute inner_box_width.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#parent_layer ⇒ Object
readonly
Returns the value of attribute parent_layer.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(values:, width: DefaultArguments::WIDTH, height: DefaultArguments::HEIGHT, padding: DefaultArguments::PADDING) ⇒ AbstractChart
constructor
A new instance of AbstractChart.
- #render ⇒ Object
Constructor Details
#initialize(values:, width: DefaultArguments::WIDTH, height: DefaultArguments::HEIGHT, padding: DefaultArguments::PADDING) ⇒ AbstractChart
Returns a new instance of AbstractChart.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 15 def initialize( values:, width: DefaultArguments::WIDTH, height: DefaultArguments::HEIGHT, padding: DefaultArguments::PADDING ) @values = values @width = width @height = height @padding = padding @inner_box_width = width - padding.left - padding.right @inner_box_height = height - padding.top - padding.bottom initialize_parent_layer! end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def height @height end |
#inner_box_height ⇒ Object (readonly)
Returns the value of attribute inner_box_height.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def inner_box_height @inner_box_height end |
#inner_box_width ⇒ Object (readonly)
Returns the value of attribute inner_box_width.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def inner_box_width @inner_box_width end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def padding @padding end |
#parent_layer ⇒ Object (readonly)
Returns the value of attribute parent_layer.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def parent_layer @parent_layer end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def values @values end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
11 12 13 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 11 def width @width end |
Instance Method Details
#render ⇒ Object
32 33 34 35 |
# File 'lib/rubyvis_charts/abstract_chart.rb', line 32 def render @parent_layer.render @parent_layer.to_svg end |