Skip to content

AggregatorTemplates

Scotty Aslan edited this page Sep 17, 2017 · 2 revisions

The $rndrAggregatorsTemplates module

The $rndrAggregatorsTemplates dictionary ships with rndr and essentially provides some functions for creating an aggregator-generating functions compatible with the $rndrAggregators dictionary.

  • count(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which returns the formatted count of the number of values observed of the given attribute for records which match the cell.
  • countUnique(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as the arg parameter and returns the formatted count of the number of unique values observed.
  • listUnique(sep): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg parameter and returns a list of the unique values observed seperated by the sep parameter.
  • sum(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg parameter and returns the formatted sum of the values observed.
  • min(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg parameter and returns the formatted minimum value observed.
  • max(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg parameter and returns the formatted maximum value observed.
  • average(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg parameter and returns the formatted average of the values observed.
  • sumOverSum(formatter): take as an argument a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg array of length 2 where the first element of the arg array parameter represents the numerator and the 2 element of the arg array parameter represents the denominator and returns the formatted quotient of the values observed.
  • sumOverSumBound80(upper, formatter): take as arguments a boolean to denote whether "upper" or "lower" 80 bound and a Data-Formatter and returns an aggregator-generating function which takes in each of the values of the given attribute for records which match the cell as an arg array of length 2 where the first element of the arg array parameter represents the numerator and the 2 element of the arg array parameter represents the denominator and returns the formatted quotient "upper" or "lower" 80 bound of the values observed.
  • fractionOf(wrapped, type, formatter): take as arguments an aggregator-generating function, a string to denote the "comparer" (i.e. 'row', 'col', or 'total' to compare observed values to), and a Data-Formatter and returns an aggregator-generating function which returns the formatted percentage of the values observed to the "comparer".
  • quantile(formatter, q): take as arguments a Data-Formatter and a quantile returns an aggregator-generating function which returns the formatted values in the quatile.
  • runningStat(formatter, mode, ddof): take as arguments a Data-Formatter, a string to denote the "mode" (i.e. 'var', or 'stdev') for calculating statistics, and a ddof to set the degrees of freedon and returns an aggregator-generating function which returns the formatted statistical value.
  • add(name, aggregatorTemplate): Adds an aggregator-generating function by name for fast lookup.
  • list(), Lists the available aggregator-generating functions.
Clone this wiki locally