Skip to content

Data Helpers

The following API functions provide common use data manipulation and statistical functionality. For more information on how to use these functions, see the API usage page.

pageStore

pageStore.getValues(data, idx)

Returns all values in a given data key/attribute, unsorted

Kind: static method of pageStore

ParamTypeDescription
dataArray/Stringan array of data arrays, or a string representing a chart data key
idxthe key to use for either the object attribute or array column you are trying to get values for

pageStore.getDistinctValues(data, idx, map, sort)

Returns an array of distinct values from an array of arrays or objects by index. If values are strings or numbers they will be sorted, and if an optional array of values is provided as a map it will be used to sort. Sorting can be disabled by setting sort = false.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data arrays, or a string representing a chart data key
idxString/Numberthe key to use for either the object attribute or array column you are trying to get distinct values for
mapArrayan array of values to use as an ordering map in sort
sortBooleantrueboolean to check whether to sort the returning distinct values

pageStore.applyFilterToColumn(filter, column, data, allKey)

Applies the value(s) of a harness filter to a column in a given set of data and returns the filtered result

Kind: static method of pageStore

ParamTypeDefaultDescription
filterStringa key representing a harness filter
columnString/Numberthe column/attribute in the data to apply the filter to
dataArray/Stringan array of data arrays, or a string representing a chart data key
allKeyStringa string representing a potential value for "all". If state is variable is present in the filter, the filter is not applied

pageStore.getMin(data, idx)

Gets the minimum value from an array of data. If an index is supplied, gets the minimum for that index/attribute in the data. Only includes valid numbers in calculations.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getMax(data, idx)

Gets the maximum value from an array of data. If an index is supplied, gets the maximum for that index/attribute in the data. Only includes valid numbers in calculations.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getMedian(data, idx)

Gets the median of an array of data

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key. Only includes valid numbers in calculations.
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getSum(data, idx)

Gets the sum for an array of data. Only includes valid numbers in calculations.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getMean(data, idx)

Gets the mean for an array of data. Only includes valid numbers in calculations.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getGeometricMean(data, idx)

Gets the geometric mean for an array of data. Only includes valid numbers in calculations.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getQuartiles(data, idx)

Gets quartiles for an array of data. Returns in format {minimum, lowerQuartile, median, upperQuartile, maximum, IQR}. Only includes valid numbers in calculations.

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.getOutliers(data, idx)

Returns truncated dataset with outliers for a given array of data. Outliers are identified as any values that equal or lower than the lower quartile - (1.5 x IQR) or equal to or higher than the upper quartile + (1.5 x IQR).

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to

pageStore.removeOutliers(data, idx)

Returns truncated dataset minus outliers for a given array of data. Outliers are identified as any values that equal or lower than the lower quartile - (1.5 x IQR) or equal to or higher than the upper quartile + (1.5 x IQR).

Kind: static method of pageStore

ParamTypeDefaultDescription
dataArray/Stringan array of data/data arrays, or a string representing a chart data key
idxString/Numberthe optional index/attribute in the data to apply the filter to