Summarizer API
Aggregation functions that given a collection of items produce a single value.
deviation#
Computes the standard deviation as per d3-array::deviation.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
first#
Returns the value for the specified key from first item in the collection.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
last#
Returns the value for the specified key from last item in the collection.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
max#
Computes the max value as per d3-array::max.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
mean#
Computes the mean value as per d3-array::mean, using d3-array::fsum to reduce floating point errors.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
meanRate#
Computes the mean for fractional values by summing over the numerator and denominator individually first before dividing.
Parameters#
numerator#
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#
median#
Computes the median value as per d3-array::median.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
min#
Computes the min value as per d3-array::min.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.
Usage#
n#
Computes the number of items in the collection.
Parameters#
options?#
predicate: When provided, only count items that return true when passed to this function.
Usage#
nDistinct#
Computes the number of distinct values for a key in the collection.
Parameters#
key#
The key or function to compute the distinct values over.
options#
includeNull = truewhether or not to countnullas a distinct valueincludeUndefined = falsewhether or not to countundefinedas a distinct value
Usage#
sum#
Computes the sum as per d3-array::fsum.
Parameters#
key#
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#
variance#
Computes the variance as per d3-array::variance.
Parameters#
key#
Either the key to compute the value over or an accessor function that maps a given item to the value to compute over.