Class: Charty::Plotters::StyleMapper
- Inherits:
-
BaseMapper
- Object
- BaseMapper
- Charty::Plotters::StyleMapper
- Defined in:
- lib/charty/plotters/relational_plotter.rb
Constant Summary collapse
- MARKER_NAMES =
[ :circle, :x, :square, :cross, :diamond, :star_diamond, :triangle_up, :star_square, :triangle_down, :hexagon, :star, :pentagon, ].freeze
Instance Attribute Summary collapse
-
#levels ⇒ Object
readonly
Returns the value of attribute levels.
-
#lookup_table ⇒ Object
readonly
Returns the value of attribute lookup_table.
-
#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.
331 332 333 |
# File 'lib/charty/plotters/relational_plotter.rb', line 331 def levels @levels end |
#lookup_table ⇒ Object (readonly)
Returns the value of attribute lookup_table.
331 332 333 |
# File 'lib/charty/plotters/relational_plotter.rb', line 331 def lookup_table @lookup_table end |
#norm ⇒ Object (readonly)
Returns the value of attribute norm.
331 332 333 |
# File 'lib/charty/plotters/relational_plotter.rb', line 331 def norm @norm end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
331 332 333 |
# File 'lib/charty/plotters/relational_plotter.rb', line 331 def order @order end |
#palette ⇒ Object (readonly)
Returns the value of attribute palette.
331 332 333 |
# File 'lib/charty/plotters/relational_plotter.rb', line 331 def palette @palette end |
Instance Method Details
#inverse_lookup_table(attr) ⇒ Object
333 334 335 |
# File 'lib/charty/plotters/relational_plotter.rb', line 333 def inverse_lookup_table(attr) lookup_table.map { |k, v| [v[attr], k] }.to_h end |
#lookup_single_value(key, attr = nil) ⇒ Object
337 338 339 340 341 342 343 344 |
# File 'lib/charty/plotters/relational_plotter.rb', line 337 def lookup_single_value(key, attr=nil) case attr when nil @lookup_table[key] else @lookup_table[key][attr] end end |