Class: Nyaplot::Diagram3D Abstract
- Inherits:
-
Object
- Object
- Nyaplot::Diagram3D
- Includes:
- Jsonizable
- Defined in:
- lib/nyaplot3d/diagram.rb
Overview
This class is abstract.
extended using a module included in Nyaplot::Diagrams3D
Diagram3D
Instance Method Summary collapse
- #configure(&block) ⇒ Object
-
#df_name ⇒ String
The name of dataframe from which this diagram is generated.
-
#initialize(df, type, labels) ⇒ Diagram3D
constructor
A new instance of Diagram3D.
Methods included from Jsonizable
#before_to_json, #get_property, included, #init_properties, #set_property, #to_json
Constructor Details
#initialize(df, type, labels) ⇒ Diagram3D
Returns a new instance of Diagram3D.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nyaplot3d/diagram.rb', line 10 def initialize(df, type, labels) init_properties mod = Kernel.const_get("Nyaplot").const_get("Diagrams3D").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 |
Instance Method Details
#configure(&block) ⇒ Object
21 22 23 |
# File 'lib/nyaplot3d/diagram.rb', line 21 def configure(&block) self.instance_eval(&block) if block_given? end |
#df_name ⇒ String
Returns the name of dataframe from which this diagram is generated.
26 27 28 |
# File 'lib/nyaplot3d/diagram.rb', line 26 def df_name get_property(:data) end |