@steelbreeze/pivot

A minimal library for pivoting data by 1-n dimensions.

The pivot function slices and dices data by one or more dimensions, returning a Matrix if one Dimension is passed, a Cube if two dimensions are passed, and a Hypercube if more than two dimensions are passed.

Simple dimensions can be created by mapping a set of values using the property function and a property name from the data set to be pivoted.

Once a Cube is created, the query function can be used to perform query operations on the subset of the source data in each cell.

Cube building

dimension
pivot
property
slice

Cube query

average
query
sum

Type declarations

Cube
Dimension
Function
Hypercube
Matrix
Predicate