Class: DataOutput::ScaledDatasetOutput
- Inherits:
-
ScaledOutput
- Object
- BaseOutput
- DatasetOutput
- ScaledOutput
- DataOutput::ScaledDatasetOutput
- Defined in:
- lib/output/data_output/scaled_dataset_output.rb
Overview
Child class of DatasetOutput to visualize a data set within the dimensions of the calling terminal.
Instance Attribute Summary
Attributes inherited from ScaledOutput
Attributes inherited from DatasetOutput
Attributes inherited from BaseOutput
#data_set, #legend, #with_extreme_values
Instance Method Summary collapse
-
#initialize(data_series, meta_data, options) ⇒ ScaledDatasetOutput
constructor
method to print a given dataset scaled by the terminal size.
-
#print_meta_head ⇒ Object
private
method to print additional information before the x and y domain informations.
-
#print_meta_tail ⇒ Object
private
method to print additional information after the x and y domain informations.
-
#print_output_head(index, meta_data) ⇒ Object
private
creates a headline before printing the data set based on the values of the z dimension.
Methods inherited from ScaledOutput
Methods inherited from DatasetOutput
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_series, meta_data, options) ⇒ ScaledDatasetOutput
method to print a given dataset scaled by the terminal size
17 18 19 20 21 22 23 |
# File 'lib/output/data_output/scaled_dataset_output.rb', line 17 def initialize(data_series, , ) prepare_attributes(data_series.series[[:index]], , ) @legend = ColorLegend::ColorData.new(data_series.min_value, data_series.max_value) print_output_head([:index], ) print_data([:legend], @meta_data.domain_x, @meta_data.domain_y) end |
Instance Method Details
#print_meta_head ⇒ Object (private)
method to print additional information before the x and y domain informations
38 39 40 |
# File 'lib/output/data_output/scaled_dataset_output.rb', line 38 def puts "\nScaled Dataset: #{@meta_data.name}" end |
#print_meta_tail ⇒ Object (private)
method to print additional information after the x and y domain informations
44 45 46 47 48 |
# File 'lib/output/data_output/scaled_dataset_output.rb', line 44 def if (@meta_data.domain_z != nil) print_domain_information(@meta_data.domain_z, 'Z') end end |
#print_output_head(index, meta_data) ⇒ Object (private)
creates a headline before printing the data set based on the values of the z dimension
30 31 32 33 34 |
# File 'lib/output/data_output/scaled_dataset_output.rb', line 30 def print_output_head(index, ) puts "\nPrinting autoscaled dataset for %.2f" % (.domain_z.lower + (index * .domain_z.step)) puts "\n" end |