Module: Nyaplot::Diagrams::Scatter
- Includes:
- Jsonizable
- Defined in:
- lib/nyaplot/diagram.rb
Instance Attribute Summary collapse
-
#color ⇒ Array<String>
Color code.
-
#fill_by ⇒ Symbol
The column label to decide how to fill sybmols.
-
#shape ⇒ Array<String>
Shapes for each symbol.
-
#shape_by ⇒ Symbol
The column label to decide shapes.
-
#size ⇒ Array<Numeric>
The range of symbol size.
-
#size_by ⇒ Symbol
The column label to decide size of symbols.
-
#stroke_color ⇒ String
Color code.
-
#stroke_width ⇒ Numeric
The width of stroke.
-
#title ⇒ String
The title of this chart.
-
#tooltip_contents ⇒ Array<Symbol>
Column labels to display in tool-tip box.
-
#x ⇒ Symbol
The column label from which the line chart is created.
-
#y ⇒ Symbol
The column label from which the line chart is created.
Instance Method Summary collapse
Methods included from Jsonizable
#before_to_json, #get_property, included, #init_properties, #set_property, #to_json
Instance Attribute Details
#color ⇒ Array<String>
Returns color code.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#fill_by ⇒ Symbol
Returns the column label to decide how to fill sybmols.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#shape ⇒ Array<String>
Returns shapes for each symbol.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#shape_by ⇒ Symbol
Returns the column label to decide shapes.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#size ⇒ Array<Numeric>
Returns the range of symbol size.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#size_by ⇒ Symbol
Returns the column label to decide size of symbols.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#stroke_color ⇒ String
Returns color code.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#stroke_width ⇒ Numeric
Returns the width of stroke.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#title ⇒ String
Returns the title of this chart.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#tooltip_contents ⇒ Array<Symbol>
Returns column labels to display in tool-tip box.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#x ⇒ Symbol
Returns the column label from which the line chart is created.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
#y ⇒ Symbol
Returns the column label from which the line chart is created.
165 |
# File 'lib/nyaplot/diagram.rb', line 165 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents]) |
Instance Method Details
#process_data(df, labels) ⇒ Object
167 168 169 170 171 172 173 174 |
# File 'lib/nyaplot/diagram.rb', line 167 def process_data(df, labels) label_x = labels[0] label_y = labels[1] x(label_x) y(label_y) @xrange = [df[label_x].to_a.min, df[label_x].to_a.max] @yrange = [df[label_y].to_a.min, df[label_y].to_a.max] end |
#zoom? ⇒ Boolean
176 177 178 |
# File 'lib/nyaplot/diagram.rb', line 176 def zoom? true end |