Class: Plot::PlotDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/plot/plot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, **options)
    @marks = marks.to_h
    @options = options
end

Instance Attribute Details

#marksObject

Returns the value of attribute marks.



40
41
42
# File 'lib/plot/plot.rb', line 40

def marks
  @marks
end

#optionsObject

Returns the value of attribute options.



40
41
42
# File 'lib/plot/plot.rb', line 40

def options
  @options
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, @options)
end