Class: Nyaplot::Diagram3D Abstract

Inherits:
Object
  • Object
show all
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

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_nameString

Returns the name of dataframe from which this diagram is generated.

Returns:

  • (String)

    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