Class: DataOutput::SingleOutput
- Inherits:
-
DatasetOutput
- Object
- BaseOutput
- DatasetOutput
- DataOutput::SingleOutput
- Defined in:
- lib/output/data_output/single_output.rb
Overview
Simple data output for the terminal visualization and a dataset
Instance Attribute Summary
Attributes inherited from DatasetOutput
Attributes inherited from BaseOutput
#data_set, #legend, #with_extreme_values
Instance Method Summary collapse
-
#initialize(data_series, meta_data, options) ⇒ SingleOutput
constructor
method to visualize the dataset at the index.
-
#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) ⇒ Object
private
creates a headline before printing the data set based on the values of the z dimension.
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) ⇒ SingleOutput
method to visualize the dataset at the index
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/output/data_output/single_output.rb', line 16 def initialize(data_series, , ) @meta_data = set_attributes(data_series.series[[:index]], [:extreme_values]) @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
40 41 42 |
# File 'lib/output/data_output/single_output.rb', line 40 def puts "\nDataset: #{@meta_data.name}" end |
#print_meta_tail ⇒ Object (private)
method to print additional information after the x and y domain informations
46 47 48 49 50 |
# File 'lib/output/data_output/single_output.rb', line 46 def if (@meta_data.domain_z != nil) print_domain_information(@meta_data.domain_z, 'Z') end end |
#print_output_head(index) ⇒ Object (private)
creates a headline before printing the data set based on the values of the z dimension
32 33 34 35 36 |
# File 'lib/output/data_output/single_output.rb', line 32 def print_output_head(index) puts "\nPrinting dataset for %.2f" % (@meta_data.domain_z.lower + (index * @meta_data.domain_z.step)) puts "\n" end |