Class: Charty::Plotters::AbstractPlotter

Inherits:
Object
  • Object
show all
Defined in:
lib/charty/plotters/abstract_plotter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, color, **options) {|_self| ... } ⇒ AbstractPlotter

Returns a new instance of AbstractPlotter.

Yields:

  • (_self)

Yield Parameters:



4
5
6
7
8
9
10
11
12
# File 'lib/charty/plotters/abstract_plotter.rb', line 4

def initialize(x, y, color, **options)
  self.x = x
  self.y = y
  self.color = color
  self.data = data
  self.palette = palette
  substitute_options(options)
  yield self if block_given?
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def color
  @color
end

#color_orderObject

Returns the value of attribute color_order.



15
16
17
# File 'lib/charty/plotters/abstract_plotter.rb', line 15

def color_order
  @color_order
end

#dataObject

Returns the value of attribute data.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def data
  @data
end

#key_colorObject

Returns the value of attribute key_color.



15
16
17
# File 'lib/charty/plotters/abstract_plotter.rb', line 15

def key_color
  @key_color
end

#paletteObject

Returns the value of attribute palette.



15
16
17
# File 'lib/charty/plotters/abstract_plotter.rb', line 15

def palette
  @palette
end

#xObject

Returns the value of attribute x.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def x
  @x
end

#yObject

Returns the value of attribute y.



14
15
16
# File 'lib/charty/plotters/abstract_plotter.rb', line 14

def y
  @y
end

Instance Method Details

#to_irubyObject



150
151
152
153
# File 'lib/charty/plotters/abstract_plotter.rb', line 150

def to_iruby
  result = render
  ["text/html", result] if result
end