Class: Charty::Plotters::DistributionPlotter
- Inherits:
-
AbstractPlotter
- Object
- AbstractPlotter
- Charty::Plotters::DistributionPlotter
- Defined in:
- lib/charty/plotters/distribution_plotter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#color_norm ⇒ Object
Returns the value of attribute color_norm.
-
#input_format ⇒ Object
readonly
Returns the value of attribute input_format.
-
#legend ⇒ Object
Returns the value of attribute legend.
-
#plot_data ⇒ Object
readonly
Returns the value of attribute plot_data.
-
#var_types ⇒ Object
readonly
Returns the value of attribute var_types.
-
#variables ⇒ Object
readonly
Returns the value of attribute variables.
-
#weights ⇒ Object
Returns the value of attribute weights.
Attributes inherited from AbstractPlotter
#color, #color_order, #data, #key_color, #palette, #title, #x, #x_label, #y, #y_label
Instance Method Summary collapse
- #flat_structure ⇒ Object
-
#initialize(data:, variables:, **options, &block) ⇒ DistributionPlotter
constructor
A new instance of DistributionPlotter.
- #wide_structure ⇒ Object
Methods inherited from AbstractPlotter
#inspect, #processed_data, #render, #save, #to_iruby, #to_iruby_mimebundle, #var_levels
Constructor Details
#initialize(data:, variables:, **options, &block) ⇒ DistributionPlotter
Returns a new instance of DistributionPlotter.
17 18 19 20 21 22 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 17 def initialize(data:, variables:, **, &block) x, y, color = variables.values_at(:x, :y, :color) super(x, y, color, data: data, **, &block) setup_variables end |
Instance Attribute Details
#color_norm ⇒ Object
Returns the value of attribute color_norm.
32 33 34 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 32 def color_norm @color_norm end |
#input_format ⇒ Object (readonly)
Returns the value of attribute input_format.
51 52 53 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 51 def input_format @input_format end |
#legend ⇒ Object
Returns the value of attribute legend.
41 42 43 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 41 def legend @legend end |
#plot_data ⇒ Object (readonly)
Returns the value of attribute plot_data.
51 52 53 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 51 def plot_data @plot_data end |
#var_types ⇒ Object (readonly)
Returns the value of attribute var_types.
51 52 53 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 51 def var_types @var_types end |
#variables ⇒ Object (readonly)
Returns the value of attribute variables.
30 31 32 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 30 def variables @variables end |
#weights ⇒ Object
Returns the value of attribute weights.
24 25 26 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 24 def weights @weights end |
Instance Method Details
#flat_structure ⇒ Object
4 5 6 7 8 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 4 def flat_structure { x: :@values } end |
#wide_structure ⇒ Object
10 11 12 13 14 15 |
# File 'lib/charty/plotters/distribution_plotter.rb', line 10 def wide_structure { x: :@values, color: :@columns } end |