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.
407 408 409 |
# File 'lib/charty/plotters/relational_plotter.rb', line 407 def levels @levels end |
#lookup_table ⇒ Object (readonly)
Returns the value of attribute lookup_table.
407 408 409 |
# File 'lib/charty/plotters/relational_plotter.rb', line 407 def lookup_table @lookup_table end |
#norm ⇒ Object (readonly)
Returns the value of attribute norm.
407 408 409 |
# File 'lib/charty/plotters/relational_plotter.rb', line 407 def norm @norm end |
#order ⇒ Object (readonly)
Returns the value of attribute order.
407 408 409 |
# File 'lib/charty/plotters/relational_plotter.rb', line 407 def order @order end |
#palette ⇒ Object (readonly)
Returns the value of attribute palette.
407 408 409 |
# File 'lib/charty/plotters/relational_plotter.rb', line 407 def palette @palette end |
Instance Method Details
#inverse_lookup_table(attr) ⇒ Object
409 410 411 |
# File 'lib/charty/plotters/relational_plotter.rb', line 409 def inverse_lookup_table(attr) lookup_table.map { |k, v| [v[attr], k] }.to_h end |
#lookup_single_value(key, attr = nil) ⇒ Object
413 414 415 416 417 418 419 420 |
# File 'lib/charty/plotters/relational_plotter.rb', line 413 def lookup_single_value(key, attr=nil) case attr when nil @lookup_table[key] else @lookup_table[key][attr] end end |