Summarizer API
Aggregation functions that given a collection of items produce a single value.
#
deviationComputes the standard deviation as per d3-array::deviation.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
firstReturns the value for the specified key from first item in the collection.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
lastReturns the value for the specified key from last item in the collection.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
maxComputes the max value as per d3-array::max.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
meanComputes the mean value as per d3-array::mean, using d3-array::fsum to reduce floating point errors.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
meanRateComputes the mean for fractional values by summing over the numerator and denominator individually first before dividing.
#
Parametersnumerator
#
Either the key to compute the numerator over or an accessor function that maps a given item to the numerator value to compute over.
denominator
#
Either the key to compute the denominator over or an accessor function that maps a given item to the denominator value to compute over.
#
Usage#
medianComputes the median value as per d3-array::median.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
minComputes the min value as per d3-array::min.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
#
Usage#
nComputes the number of items in the collection.
#
Parametersoptions?
#
predicate
: When provided, only count items that return true when passed to this function.
#
Usage#
nDistinctComputes the number of distinct values for a key in the collection.
#
Parameterskey
#
The key or function to compute the distinct values over.
options
#
includeNull = true
whether or not to countnull
as a distinct valueincludeUndefined = false
whether or not to countundefined
as a distinct value
#
Usage#
sumComputes the sum as per d3-array::fsum.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
options?
#
predicate
: When provided, only sum items that return true when passed to this function.
#
Usage#
varianceComputes the variance as per d3-array::variance.
#
Parameterskey
#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.