Class: DataOutput::ScaledOutput

Inherits:
DatasetOutput show all
Defined in:
lib/output/data_output/scaled_output.rb

Overview

Child class of DatasetOutput to visualize a data set within the dimensions of the calling terminal.

Direct Known Subclasses

ScaledDatasetOutput, ScaledDeltaOutput

Instance Attribute Summary collapse

Attributes inherited from DatasetOutput

#meta_data

Attributes inherited from BaseOutput

#data_set, #legend, #with_extreme_values

Instance Method Summary collapse

Methods inherited from DatasetOutput

#print_meta_head, #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

Instance Attribute Details

#scaled_datasetDataSet (readonly, private)

Returns the scaled dataset.

Returns:

  • (DataSet)

    the scaled dataset



14
15
16
# File 'lib/output/data_output/scaled_output.rb', line 14

def scaled_dataset
  @scaled_dataset
end

Instance Method Details

#prepare_attributes(data_set, meta_data, options) ⇒ Object (private)

method to set the required attributes und create the scaled dataset

Parameters:

  • data_set (DataSet)

    the data set which should be visualized

  • meta_data (VisMetaData)

    the corresponding meta data

  • options (Hash)

    hash with the relevant parameter values



20
21
22
23
24
25
26
# File 'lib/output/data_output/scaled_output.rb', line 20

def prepare_attributes(data_set, , options)
  # create meta data and data set for the scaled output
  sc = DatasetScaling.new(, data_set)
  @meta_data = sc.scaled_meta
  @scaled_dataset = sc.scaled_data_set
  set_attributes(@scaled_dataset, options[:extreme_values])
end

creates a headline before printing the data set based on the values of the z dimension

Parameters:

  • index (Integer)

    the number of the dataset



31
32
33
34
35
# File 'lib/output/data_output/scaled_output.rb', line 31

def print_output_head(index, )
  puts "\nPrinting autoscaled dataset for %.2f" %
        (.domain_z.lower + (index * .domain_z.step))
  puts "\n"
end