Summarizers are functions that derive some properties over the data for an entire column.
They all have the signature: summarizer(column, tableData, columns)
where
column is the column definition, tableData is the data for the entire table,
and columns is the configuration for all the columns in the table.
They should return an object with values derived from the column's worth of data.
- Source:
Members
(static, constant) compositeSummarizer
Combines multiple summarizers until a single object.
Expected use in a column definition:
{
...
summarize: compositeSummarizer([meanSummarizer, minMaxSummarizer]),
},
- Source:
(static, constant) weightedAverageSummarizer
Computes a weighted average based on another column's value as the weight.
Available as weightedAverage
.
Does the computation based on the sortValue.
Expected use in a column definition:
{
...
summarize: weightedAverageSummarizer('myWeightColumnId'),
},
- Source:
Methods
(static) frequencySummarizer(column, tableData, columns) → {Object}
Computes the frequency for each value in the dataset and computes the most frequent. If there is a tie for most frequent, it returns just the first encountered value. Does the summary based on the cellData value.
Parameters:
Name | Type | Description |
---|---|---|
column |
Object | The column definition |
tableData |
Array.<Object> | the data for the whole table |
columns |
Array.<Object> | The definitions of columns for the whole table |
- Source:
Returns:
The most frequently occuring value { counts, mostFrequent }
- Type
- Object
(static) meanSummarizer(column, tableData, columns) → {Object}
Computes the mean, sum, and count in a column as mean, sum, count
.
Does the computation based on the sortValue.
Parameters:
Name | Type | Description |
---|---|---|
column |
Object | The column definition |
tableData |
Array.<Object> | the data for the whole table |
columns |
Array.<Object> | The definitions of columns for the whole table |
- Source:
Returns:
The mean of values as { mean, sum, count }
- Type
- Object
(static) minMaxSummarizer(column, tableData, columns) → {Object}
Computes the minimum and maximum values in a column as min
and max
.
Does the computation based on the sortValue.
Parameters:
Name | Type | Description |
---|---|---|
column |
Object | The column definition |
tableData |
Array.<Object> | the data for the whole table |
columns |
Array.<Object> | The definitions of columns for the whole table |
- Source:
Returns:
The minimum and maximum values as { min, max }
- Type
- Object