Class: DataOutput::ScaledDeltaOutput

Inherits:
ScaledOutput show all
Defined in:
lib/output/data_output/scaled_delta_output.rb

Overview

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

Instance Attribute Summary

Attributes inherited from ScaledOutput

#scaled_dataset

Attributes inherited from DatasetOutput

#meta_data

Attributes inherited from BaseOutput

#data_set, #legend, #with_extreme_values

Instance Method Summary collapse

Methods inherited from ScaledOutput

#prepare_attributes

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) ⇒ ScaledDeltaOutput

method to visualize the difference of two datasets

Parameters:

  • data_set (DataSet)

    the dataset which should be visualized

  • meta_data (VisMetaData)

    the corresponding meta data

  • indices (Hash)

    the indices of the two datasets which should be substracted

  • options (Hash)

    hash with the boolean values for extreme values and extended legend output



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

def initialize(data_set, , indices, options)
  prepare_attributes(data_set, , options)
  @legend = ColorLegend::ColorDelta.new(@scaled_dataset.min_value,
                                        @scaled_dataset.max_value)
  print_output_head(indices)
  print_data(options[:legend], @meta_data.domain_x, @meta_data.domain_y)
end

Instance Method Details

method to print additional information before the x and y domain informations



40
41
42
43
# File 'lib/output/data_output/scaled_delta_output.rb', line 40

def print_meta_head
  puts "\nScaled Dataset: Difference of #{@meta_data.name} between " \
       "the two datasets"
end

creates a headline before printing the data set with the requested indices

Parameters:

  • indices (Hash)

    the indices of the two datasets which should be substracted



33
34
35
36
# File 'lib/output/data_output/scaled_delta_output.rb', line 33

def print_output_head(indices)
      puts "Printing autoscaled difference for datasets " \
           "#{indices[:first]} and #{indices[:second]}.\n\n"
end