Class: Plot::PlotDefinition
- Inherits:
-
Object
- Object
- Plot::PlotDefinition
- Defined in:
- lib/plot/plot.rb
Instance Attribute Summary collapse
-
#marks ⇒ Object
Returns the value of attribute marks.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #add_mark(id, mark) ⇒ Object
-
#initialize(marks, **options) ⇒ PlotDefinition
constructor
A new instance of PlotDefinition.
- #render(data) ⇒ Object
Constructor Details
#initialize(marks, **options) ⇒ PlotDefinition
Returns a new instance of PlotDefinition.
42 43 44 45 |
# File 'lib/plot/plot.rb', line 42 def initialize(marks, **) @marks = marks.to_h = end |
Instance Attribute Details
#marks ⇒ Object
Returns the value of attribute marks.
40 41 42 |
# File 'lib/plot/plot.rb', line 40 def marks @marks end |
#options ⇒ Object
Returns the value of attribute options.
40 41 42 |
# File 'lib/plot/plot.rb', line 40 def end |
Instance Method Details
#add_mark(id, mark) ⇒ Object
47 48 49 |
# File 'lib/plot/plot.rb', line 47 def add_mark(id, mark) @marks[id.to_s] = mark end |
#render(data) ⇒ Object
51 52 53 |
# File 'lib/plot/plot.rb', line 51 def render(data) Plot.plot(@marks, data, ) end |