Class: Trackplot::Components::Axis
- Defined in:
- lib/trackplot/components/axis.rb
Constant Summary collapse
- FORMAT_SYMBOLS =
{ currency: "currency", percent: "percent", compact: "compact", decimal: "decimal", integer: "integer" }.freeze
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(direction, **options) ⇒ Axis
constructor
A new instance of Axis.
- #to_config ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(direction, **options) ⇒ Axis
Returns a new instance of Axis.
14 15 16 17 |
# File 'lib/trackplot/components/axis.rb', line 14 def initialize(direction, **) @direction = direction.to_s super(**) end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
12 13 14 |
# File 'lib/trackplot/components/axis.rb', line 12 def direction @direction end |
Instance Method Details
#to_config ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/trackplot/components/axis.rb', line 19 def to_config { type: "axis", direction: direction, data_key: [:data_key], label: [:label], format: resolve_format([:format]), tick_count: [:tick_count], tick_rotation: [:tick_rotation], axis_id: [:axis_id]&.to_s }.compact end |