Class: DataOutput::DeltaOutput
- Inherits:
-
DatasetOutput
- Object
- BaseOutput
- DatasetOutput
- DataOutput::DeltaOutput
- Defined in:
- lib/output/data_output/delta_output.rb
Overview
Data output for the difference of two data sets for the terminal visualization
Instance Attribute Summary
Attributes inherited from DatasetOutput
Attributes inherited from BaseOutput
#data_set, #legend, #with_extreme_values
Instance Method Summary collapse
-
#initialize(data_set, meta_data, indices, options) ⇒ DeltaOutput
constructor
method to visualize the difference of two datasets.
-
#print_meta_head ⇒ Object
private
method to print additional information before the x and y domain informations.
-
#print_output_head(indices) ⇒ Object
private
creates a headline before printing the data set with the requested indices.
Methods inherited from DatasetOutput
#print_meta_information, #print_meta_tail
Methods inherited from BaseOutput
#determine_output_type_and_print_value, #print_data, #print_data_and_get_extrema, #print_domain_information, #print_extreme_information, #print_extreme_values_for, #print_meta_information, #set_attributes
Constructor Details
#initialize(data_set, meta_data, indices, options) ⇒ DeltaOutput
method to visualize the difference of two datasets
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/output/data_output/delta_output.rb', line 19 def initialize(data_set, , indices, ) @meta_data = set_attributes(data_set, [:extreme_values]) @legend = ColorLegend::ColorDelta. new(data_set.min_value, data_set.max_value) print_output_head(indices) print_data([:legend], @meta_data.domain_x, @meta_data.domain_y) nil end |
Instance Method Details
#print_meta_head ⇒ Object (private)
method to print additional information before the x and y domain informations
46 47 48 49 |
# File 'lib/output/data_output/delta_output.rb', line 46 def puts "\nDataset: Difference of #{@meta_data.name} between two datasets" nil end |
#print_output_head(indices) ⇒ Object (private)
creates a headline before printing the data set with the requested indices
36 37 38 39 40 41 42 |
# File 'lib/output/data_output/delta_output.rb', line 36 def print_output_head(indices) first_year = @meta_data.domain_z.lower + indices[:first] second_year = @meta_data.domain_z.lower + indices[:second] puts "Printing difference for the datasets of #{first_year} and "\ "#{second_year}.\n\n" nil end |