Module: Nyaplot::Diagrams::Heatmap
- Includes:
- Jsonizable
- Defined in:
- lib/nyaplot/diagram.rb
Instance Attribute Summary collapse
-
#color ⇒ Array<String>
Array of color codes.
-
#fill ⇒ Symbol
The column label.
-
#height ⇒ String
The height.
-
#hover ⇒ Boolean
Whether to change color when hovering.
-
#stroke_color ⇒ String
Color code.
-
#stroke_width ⇒ Numeric
The width of stroke.
-
#title ⇒ String
The title of this chart.
-
#width ⇒ String
The width.
-
#x ⇒ Symbol
The column label from which histogram is created.
-
#y ⇒ Symbol
The column label from which histogram 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 array of color codes.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#fill ⇒ Symbol
Returns the column label.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#height ⇒ String
Returns the height.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#hover ⇒ Boolean
Returns whether to change color when hovering.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#stroke_color ⇒ String
Returns color code.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#stroke_width ⇒ Numeric
Returns the width of stroke.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#title ⇒ String
Returns the title of this chart.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#width ⇒ String
Returns the width.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#x ⇒ Symbol
Returns the column label from which histogram is created.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
#y ⇒ Symbol
Returns the column label from which histogram is created.
311 |
# File 'lib/nyaplot/diagram.rb', line 311 define_group_properties(:options, [:title, :x, :y, :fill, :width, :height, :color, :stroke_color, :stroke_width, :hover]) |
Instance Method Details
#process_data(df, labels) ⇒ Object
313 314 315 316 317 318 319 320 321 322 |
# File 'lib/nyaplot/diagram.rb', line 313 def process_data(df, labels) label_x = labels[0] label_y = labels[1] label_fill = labels[2] x(label_x) y(label_y) fill(label_fill) @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
324 325 326 |
# File 'lib/nyaplot/diagram.rb', line 324 def zoom? true end |