Class: Charty::Plotters::DistributionPlotter

Inherits:
AbstractPlotter show all
Defined in:
lib/charty/plotters/distribution_plotter.rb

Direct Known Subclasses

HistogramPlotter

Instance Attribute Summary collapse

Attributes inherited from AbstractPlotter

#color, #color_order, #data, #key_color, #palette, #x, #y

Instance Method Summary collapse

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.



10
11
12
13
14
15
# File 'lib/charty/plotters/distribution_plotter.rb', line 10

def initialize(data:, variables:, **options, &block)
  x, y, color = variables.values_at(:x, :y, :color)
  super(x, y, color, data: data, **options, &block)

  setup_variables
end

Instance Attribute Details

#color_normObject

Returns the value of attribute color_norm.



25
26
27
# File 'lib/charty/plotters/distribution_plotter.rb', line 25

def color_norm
  @color_norm
end

#input_formatObject (readonly)

Returns the value of attribute input_format.



44
45
46
# File 'lib/charty/plotters/distribution_plotter.rb', line 44

def input_format
  @input_format
end

#legendObject

Returns the value of attribute legend.



34
35
36
# File 'lib/charty/plotters/distribution_plotter.rb', line 34

def legend
  @legend
end

#plot_dataObject (readonly)

Returns the value of attribute plot_data.



44
45
46
# File 'lib/charty/plotters/distribution_plotter.rb', line 44

def plot_data
  @plot_data
end

#var_typesObject (readonly)

Returns the value of attribute var_types.



44
45
46
# File 'lib/charty/plotters/distribution_plotter.rb', line 44

def var_types
  @var_types
end

#variablesObject (readonly)

Returns the value of attribute variables.



23
24
25
# File 'lib/charty/plotters/distribution_plotter.rb', line 23

def variables
  @variables
end

#weightsObject

Returns the value of attribute weights.



17
18
19
# File 'lib/charty/plotters/distribution_plotter.rb', line 17

def weights
  @weights
end

Instance Method Details

#flat_structureObject



4
5
6
7
8
# File 'lib/charty/plotters/distribution_plotter.rb', line 4

def flat_structure
  {
    x: :values
  }
end