Class: Charty::Plotters::StyleMapper

Inherits:
BaseMapper show all
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

Attributes inherited from BaseMapper

#plotter

Instance Method Summary collapse

Methods inherited from BaseMapper

#[], #initialize

Constructor Details

This class inherits a constructor from Charty::Plotters::BaseMapper

Instance Attribute Details

#levelsObject (readonly)

Returns the value of attribute levels.



407
408
409
# File 'lib/charty/plotters/relational_plotter.rb', line 407

def levels
  @levels
end

#lookup_tableObject (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

#normObject (readonly)

Returns the value of attribute norm.



407
408
409
# File 'lib/charty/plotters/relational_plotter.rb', line 407

def norm
  @norm
end

#orderObject (readonly)

Returns the value of attribute order.



407
408
409
# File 'lib/charty/plotters/relational_plotter.rb', line 407

def order
  @order
end

#paletteObject (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