Class: Trackplot::Components::ReferenceLine
- Defined in:
- lib/trackplot/components/reference_line.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(**options) ⇒ ReferenceLine
constructor
A new instance of ReferenceLine.
- #to_config ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(**options) ⇒ ReferenceLine
Returns a new instance of ReferenceLine.
4 5 6 |
# File 'lib/trackplot/components/reference_line.rb', line 4 def initialize(**) super end |
Instance Method Details
#to_config ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/trackplot/components/reference_line.rb', line 8 def to_config direction = [:y] ? "y" : "x" value = [:y] || [:x] { type: "reference_line", direction: direction, value: value, label: [:label], color: [:color] || "#ef4444", dashed: .fetch(:dashed, true), stroke_width: [:stroke_width] || 1.5 }.compact end |