Class: Charty::Plotters::SizeMapper
- Inherits:
-
BaseMapper
- Object
- BaseMapper
- Charty::Plotters::SizeMapper
- Defined in:
- lib/charty/plotters/relational_plotter.rb
Defined Under Namespace
Classes: SimpleNormalizer
Instance Attribute Summary collapse
-
#levels ⇒ Object
readonly
Returns the value of attribute levels.
-
#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.
252 253 254 |
# File 'lib/charty/plotters/relational_plotter.rb', line 252 def levels @levels end |
#norm ⇒ Object (readonly)
Returns the value of attribute norm.
252 253 254 |
# File 'lib/charty/plotters/relational_plotter.rb', line 252 def norm @norm end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
252 253 254 |
# File 'lib/charty/plotters/relational_plotter.rb', line 252 def order @order end |
#palette ⇒ Object (readonly)
Returns the value of attribute palette.
252 253 254 |
# File 'lib/charty/plotters/relational_plotter.rb', line 252 def palette @palette end |
Instance Method Details
#lookup_single_value(key) ⇒ Object
254 255 256 257 258 259 260 261 262 263 |
# File 'lib/charty/plotters/relational_plotter.rb', line 254 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 |