DataAdapter

DataAdapter

The DataAdapter class is responsible for handling data normalization and transformation, primarily used in analyzing project data across multiple aggregators. It performs various operations on response data, such as sorting, aggregating, and calculating statistics like proportions, z-tests, and confidence levels.

Constructor

new DataAdapter(projects, aggrMeta)

Source:

Constructs a DataAdapter instance.

Parameters:
Name Type Description
projects Array

Array of available projects for the current user.

aggrMeta Array

Metadata about aggregators supported by the system.

Members

calculateHighValuePercentages

Source:

calculateHighValuePercentages returns the percentage of high values as a proportion of the total responses.

convertToDelta

Source:

Gets the difference between the two sets of data.

convertVerbalScaleToLevels

Source:

convertVerbalScaleToLevels converts all the different verbal scale responses into L1 - L5 categories

data

Source:

Gets the normalized data store.

groupIntoHightNeutralLow

Source:

Groups the given data into High/Neutral/Low categories.

omitted

Source:

Gets the omitted data series.

output

Source:

Gets the output of the adapter after transforming the data.

response

Source:

Gets the API response data in the adapter.

response

Source:

Sets the API response data in the adapter. Normalizes the data based on the aggregator metadata.

transposeVerbalScaleResponses

Source:

Converts verbal scale responses into a format for presentation in charts.

Methods

(static) deepClone(orig) → {*}

Source:

Returns a deep clone of the given object.

Parameters:
Name Type Description
orig *

The object to be cloned

Returns:

A clone of the given object

Type
*

(static) deepMerge(obj1, obj2) → {*}

Source:

Returns a deep merge of the second object into the first and reurns the result.

Parameters:
Name Type Description
obj1 *

The base object (that is changed in place)

obj2 *

The object to be merged

Returns:

A deep merge of the given objects aka obj1

Type
*

(static) getTSMSubmissionTable(ds, data)

Source:

getTSMSubmissionTable returns data for a table of TSM submissions.

Parameters:
Name Type Description
ds Object

Data source object.

data Array

Array of data series containing TSM responses.

(static) getVsatTopBoxPercent(ds, data) → {Number}

Source:

Returns the top box score for the given satisfaction scale data.

Parameters:
Name Type Description
ds Object

Dataset object.

data Object

Data object containing satisfaction scores.

Returns:
  • Top box percentage as a float.
Type
Number

(static) multiplyBy(multiplier) → {function}

Source:

multiplyBy is a higher-order function that returns a function that mutiplies all the data values by the given multiplier.

Parameters:
Name Type Description
multiplier number

The multiplier to be applied to the data values

Returns:
  • A function that mutiplies all the data values by the given multiplier
Type
function

(static) sortUsingSeries(ds, data, seriesName, orderopt) → {Array}

Source:

Sorts all data series using the specified series as the reference.

Parameters:
Name Type Attributes Default Description
ds Object

Dataset object containing metadata.

data Array

Array of data series to be sorted.

seriesName string

The name of the series to be used for sorting.

order string <optional>
'ASC'

The order of sorting, either 'ASC' or 'DESC'.

Returns:
  • Sorted data series array.
Type
Array

(static) zTest(sample1, sample2) → {number}

Source:

Performs a z-test on two independent samples.

Parameters:
Name Type Description
sample1 Object

First sample with count and base properties.

sample2 Object

Second sample with count and base properties.

Returns:
  • Returns 1 if the difference is significant, -1 if inverse, and 0 if not significant.
Type
number

(static) zTestOverall(overall, subset) → {number}

Source:

Performs a z-test where the second sample is a subset of the first.

Parameters:
Name Type Description
overall Object

Overall sample with count and base properties.

subset Object

Subset sample with count and base properties.

Returns:
  • Returns 1 if the difference is significant, -1 if inverse, and 0 if not significant.
Type
number

calculateImpact(ds, data) → {Array}

Source:

Calculates the impact of independent variables on the dependent variable.

Parameters:
Name Type Description
ds Object

Dataset information object.

data Object

Raw data used for calculation.

Returns:
  • Array of calculated impact results.
Type
Array

processComprehendTextAnalysis(ds, data, seriesIdx, thresholds) → {Array}

Source:

Processes text analysis data from Amazon Comprehend for the given dataset.

Parameters:
Name Type Description
ds Object

Dataset information object.

data Array

Raw data array for text analysis.

seriesIdx number

Index of the series in the dataset.

thresholds Array.<number>

Array of thresholds used for filtering themes.

Returns:
  • Processed text analysis result for presentation.
Type
Array