Class: Charty::Plotters::SizeMapper
- Inherits:
-
BaseMapper
- Object
- BaseMapper
- Charty::Plotters::SizeMapper
- Defined in:
- lib/charty/plotters/relational_plotter.rb
Instance Attribute Summary collapse
-
#levels ⇒ Object
readonly
Returns the value of attribute levels.
-
#lookup_table ⇒ Object
readonly
Returns the value of attribute lookup_table.
-
#map_type ⇒ Object
readonly
Returns the value of attribute map_type.
-
#norm ⇒ Object
readonly
Returns the value of attribute norm.
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#palette ⇒ Object
readonly
Returns the value of attribute palette.
Attributes inherited from BaseMapper
Instance Method Summary collapse
Methods inherited from BaseMapper
Constructor Details
This class inherits a constructor from Charty::Plotters::BaseMapper
Instance Attribute Details
#levels ⇒ Object (readonly)
Returns the value of attribute levels.
325 326 327 |
# File 'lib/charty/plotters/relational_plotter.rb', line 325 def levels @levels end |
#lookup_table ⇒ Object (readonly)
Returns the value of attribute lookup_table.
325 326 327 |
# File 'lib/charty/plotters/relational_plotter.rb', line 325 def lookup_table @lookup_table end |
#map_type ⇒ Object (readonly)
Returns the value of attribute map_type.
325 326 327 |
# File 'lib/charty/plotters/relational_plotter.rb', line 325 def map_type @map_type end |
#norm ⇒ Object (readonly)
Returns the value of attribute norm.
325 326 327 |
# File 'lib/charty/plotters/relational_plotter.rb', line 325 def norm @norm end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
325 326 327 |
# File 'lib/charty/plotters/relational_plotter.rb', line 325 def order @order end |
#palette ⇒ Object (readonly)
Returns the value of attribute palette.
325 326 327 |
# File 'lib/charty/plotters/relational_plotter.rb', line 325 def palette @palette end |
Instance Method Details
#lookup_single_value(key) ⇒ Object
327 328 329 330 331 332 333 334 335 336 |
# File 'lib/charty/plotters/relational_plotter.rb', line 327 def lookup_single_value(key) if @lookup_table.key?(key) @lookup_table[key] else normed = @norm.(key) || Float::NAN size_values = @lookup_table.values min, max = size_values.min, size_values.max min + normed * (max - min) end end |