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.
-
#legend ⇒ Bool
Decide if the diagram prepare legend.
-
#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.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#fill_by ⇒ Symbol
Returns the column label to decide how to fill sybmols.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#legend ⇒ Bool
Returns decide if the diagram prepare legend.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#shape ⇒ Array<String>
Returns shapes for each symbol.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#shape_by ⇒ Symbol
Returns the column label to decide shapes.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#size ⇒ Array<Numeric>
Returns the range of symbol size.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#size_by ⇒ Symbol
Returns the column label to decide size of symbols.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#stroke_color ⇒ String
Returns color code.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#stroke_width ⇒ Numeric
Returns the width of stroke.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#title ⇒ String
Returns the title of this chart.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#tooltip_contents ⇒ Array<Symbol>
Returns column labels to display in tool-tip box.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#x ⇒ Symbol
Returns the column label from which the line chart is created.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
#y ⇒ Symbol
Returns the column label from which the line chart is created.
171 |
# File 'lib/nyaplot/diagram.rb', line 171 define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend]) |
Instance Method Details
#process_data(df, labels) ⇒ Object
177 178 179 180 181 182 183 184 |
# File 'lib/nyaplot/diagram.rb', line 177 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 |
#tooltips(labels) ⇒ Object
173 174 175 |
# File 'lib/nyaplot/diagram.rb', line 173 def tooltips(labels) tooltip_contents((labels.is_a?(Symbol) ? [labels] : labels)) end |
#zoom? ⇒ Boolean
186 187 188 |
# File 'lib/nyaplot/diagram.rb', line 186 def zoom? true end |