Class: Trackplot::Components::Scatter
- Defined in:
- lib/trackplot/components/scatter.rb
Instance Attribute Summary collapse
-
#data_key ⇒ Object
readonly
Returns the value of attribute data_key.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(data_key, **options) ⇒ Scatter
constructor
A new instance of Scatter.
- #to_config ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(data_key, **options) ⇒ Scatter
Returns a new instance of Scatter.
6 7 8 9 |
# File 'lib/trackplot/components/scatter.rb', line 6 def initialize(data_key, **) @data_key = data_key super(**) end |
Instance Attribute Details
#data_key ⇒ Object (readonly)
Returns the value of attribute data_key.
4 5 6 |
# File 'lib/trackplot/components/scatter.rb', line 4 def data_key @data_key end |
Instance Method Details
#to_config ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/trackplot/components/scatter.rb', line 11 def to_config { type: "scatter", data_key: data_key, x_key: [:x_key], color: [:color], dot_size: [:dot_size] || 5, opacity: [:opacity] || 0.7, shape: [:shape] || "circle", y_axis: [:y_axis]&.to_s, name: [:name] || data_key }.compact end |