Class: Plotrb::Transform
- Includes:
- Base
- Defined in:
- lib/plotrb/transforms.rb
Overview
Data transform performs operations on a data set prior to
visualization.
Constant Summary collapse
- TYPES =
all available types of transforms defined by Vega
%i(array copy cross facet filter flatten fold formula slice sort stats truncate unique window zip force geo geopath link pie stack treemap wordcloud)
Instance Method Summary collapse
- #extra_fields ⇒ Object
-
#initialize(type, &block) ⇒ Transform
constructor
A new instance of Transform.
- #type ⇒ Object
Methods included from Base
#add_attributes, #attributes, #classify, #collect_attributes, #define_boolean_attribute, #define_boolean_attributes, #define_multi_val_attribute, #define_multi_val_attributes, #define_single_val_attribute, #define_single_val_attributes, #defined_attributes, included, #set_attributes
Constructor Details
#initialize(type, &block) ⇒ Transform
Returns a new instance of Transform.
25 26 27 28 29 30 31 32 |
# File 'lib/plotrb/transforms.rb', line 25 def initialize(type, &block) @type = type @extra_fields = [:index, :data] self.send(@type) self.instance_eval(&block) if block_given? ::Plotrb::Kernel.transforms << self self end |