Module: Nyaplot::Diagrams::Box
- Includes:
- Jsonizable
- Defined in:
- lib/nyaplot/diagram.rb
Instance Attribute Summary collapse
-
#color ⇒ Numeric
The width of stroke.
-
#outlier_r ⇒ Numeric
The radius of outliers.
-
#stroke_color ⇒ String
Color code.
-
#stroke_width ⇒ Numeric
The width of stroke.
-
#title ⇒ String
The title of this chart.
-
#value ⇒ Symbol
The column label from which box chart is created.
-
#width ⇒ Symbol
The width of each box.
Instance Method Summary collapse
Methods included from Jsonizable
#before_to_json, #get_property, included, #init_properties, #set_property, #to_json
Instance Attribute Details
#color ⇒ Numeric
Returns the width of stroke.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
#outlier_r ⇒ Numeric
Returns the radius of outliers.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
#stroke_color ⇒ String
Returns color code.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
#stroke_width ⇒ Numeric
Returns the width of stroke.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
#title ⇒ String
Returns the title of this chart.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
#value ⇒ Symbol
Returns the column label from which box chart is created.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
#width ⇒ Symbol
Returns the width of each box. The specified value should be in the range 0 to 1.
278 |
# File 'lib/nyaplot/diagram.rb', line 278 define_group_properties(:options, [:title, :value, :width, :color, :stroke_color, :stroke_width, :outlier_r]) |
Instance Method Details
#process_data(df, labels) ⇒ Object
280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/nyaplot/diagram.rb', line 280 def process_data(df, labels) value(labels) yrange = [Float::INFINITY, -Float::INFINITY] proc = Proc.new do |column| yrange[0] = [yrange[0], column.min].min yrange[1] = [yrange[1], column.max].max end raw_data = labels.map{|label| df[label].to_a} raw_data.each{|column| proc.call(column)} @xrange = labels @yrange = yrange end |
#zoom? ⇒ Boolean
295 296 297 |
# File 'lib/nyaplot/diagram.rb', line 295 def zoom? false end |