class Nyaplot::Diagram
Diagram
@abstract extended using a module included in Nyaplot::Diagrams
Public Class Methods
new(df, type, labels)
click to toggle source
# File lib/nyaplot/diagram.rb, line 9 def initialize(df, type, labels) init_properties mod = Kernel.const_get("Nyaplot").const_get("Diagrams").const_get(type.to_s.capitalize) self.extend(mod) set_property(:type, type) set_property(:options, {}) set_property(:data, df.name) self.process_data(df, labels) DataBase.instance.add(df) end
Public Instance Methods
configure(&block)
click to toggle source
# File lib/nyaplot/diagram.rb, line 20 def configure(&block) self.instance_eval(&block) if block_given? end
df_name()
click to toggle source
@return [String] the name of dataframe from which this diagram is generated
# File lib/nyaplot/diagram.rb, line 33 def df_name get_property(:data) end
xrange()
click to toggle source
# File lib/nyaplot/diagram.rb, line 24 def xrange @xrange end
yrange()
click to toggle source
# File lib/nyaplot/diagram.rb, line 28 def yrange @yrange end