Class: Charty::Plotters::ColorMapper
- Inherits:
-
BaseMapper
- Object
- BaseMapper
- Charty::Plotters::ColorMapper
- 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.
99 100 101 |
# File 'lib/charty/plotters/relational_plotter.rb', line 99 def levels @levels end |
#lookup_table ⇒ Object (readonly)
Returns the value of attribute lookup_table.
99 100 101 |
# File 'lib/charty/plotters/relational_plotter.rb', line 99 def lookup_table @lookup_table end |
#map_type ⇒ Object (readonly)
Returns the value of attribute map_type.
99 100 101 |
# File 'lib/charty/plotters/relational_plotter.rb', line 99 def map_type @map_type end |
#norm ⇒ Object (readonly)
Returns the value of attribute norm.
99 100 101 |
# File 'lib/charty/plotters/relational_plotter.rb', line 99 def norm @norm end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
99 100 101 |
# File 'lib/charty/plotters/relational_plotter.rb', line 99 def order @order end |
#palette ⇒ Object (readonly)
Returns the value of attribute palette.
99 100 101 |
# File 'lib/charty/plotters/relational_plotter.rb', line 99 def palette @palette end |
Instance Method Details
#inverse_lookup_table ⇒ Object
101 102 103 |
# File 'lib/charty/plotters/relational_plotter.rb', line 101 def inverse_lookup_table lookup_table.invert end |
#lookup_single_value(key) ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/charty/plotters/relational_plotter.rb', line 105 def lookup_single_value(key) if @lookup_table.key?(key) @lookup_table[key] elsif @norm # Use the colormap to interpolate between existing datapoints raise NotImplementedError, "Palette interpolation is not implemented yet" # begin # normed = @norm.(key) # rescue ArgumentError, TypeError => err # if key.respond_to?(:nan?) && key.nan? # return "#000000" # else # raise err # end # end end end |