Releases: steelbreeze/pivot
Performance
API improvements & documentation
Pivot is available from Skypack and can be found here: https://cdn.skypack.dev/@steelbreeze/pivot
API improvements
The API has seen incremental changes in 4.2 and now 4.3 releases. The following are highlights and breaking changes:
- The
Predicate
type has been renamedCriteria
as this more accurately reflects its use inDimension
construction. - The
map
function has been renamedaggregate
as it does not just map the data, it also flattens the data by one dimension. - The
distinct
function has been removed, as it is not strictly required, it was just provided as a utility and can easily be replicated with the code fragment below:
function distinct<TValue>(value: TValue, index: number, source: Array<TValue>): boolean {
return source.indexOf(value) === index;
}
Documentation
All the function call documentation has now been tidied and has example code fragments. Documentation can be found here: https://steelbreeze.net/pivot/api/v4/
Tidy pivot function API and implementation
Refactored the API declaration and implementation of the pivot function for clearer and simpler use and maintenance.
Also simplified the implementations of the helper functions.
More cube creation performance
Remove the last remaining map call in pivotImplementation
Query performance
Just like the cube creation performance improvements, similar techniques applied to cube queries.
Yet more performance
Manual loop optimisation; changed:
for (var di = 0; di < first.length; ++di) {
to
for (var di = 0, dl = first.length; di < dl; ++di) {
Which makes a surprisingly large improvement.
A little more performance
4.1.8 Better typing in test
Start testing
Restructured non-core source code and started on a test suite (with a view to having coverage in place in a later release)
Minor refactor
The prior move to the partition function renders the copying of the source data redundant in the implementation of the pivot function; the latter can now just become an alias with the desired external API applied.
Minor performance tweak
Use var in place of let in for loops as this yields better performance in large data sets.