Releases: steelbreeze/landscape
Bump pivot and types libraries
3.8.1 Bump type and pivot lib versions
getElement takes full CallbackFunction
The call to getElement takes a callback function akin to those in the Array.prototype.filter
function.
Minor refactoring
3.7.1 Prep 3.7.1 release
Externalise leastCommonMultiple
The leastCommonMultiple
function has moved into a separate library called math.js.
Revert to passing the method to split cells as a parameter to the table
function (which defaults to Math.max
, but can be leastCommonMultiple
).
Further refactoring.
Bump pivot lib; minor edit to dynamic example
3.6.4 Bump pivot lib
Remove precise param from table function; use @steelbreeze/types
Remove the precise
parameter from the table
function. This has been replaced with a function setMode
.
setMode
takes as a parameter a function used to calculate the number of rows or columns to split at cube row or column into when expanding it; the prototype for this function is:
(...values: Array<number>) => number
By default, Math.max
is used, but as an alternative, landscape.leastCommonMultiple
can also be used to yield more precise rendering (which sadly browser rendering engines don't seem to respect).
Refactoring after last major change
General code tidying and optimisation after last major change.
Simpler data passthrough
Previously, the original source data context that formed a merged cell was passed though in the resultant table; this is not very performant for large datasets, adding considerable overheads when splitting and merging.
In its place, the callback to get the data used to render an element has been enhanced to:
interface Element {
key: string | number; // the source in the data that the value property originates
value: any; // a value to use for merging cells and the elements text when rendered
style: string; // a value to use for merging cells and the elements style when rendered
text?: string; // an optional override for the elements text when rendered
}
This provides an ability to derive the source data context filtering using key and value.
Remove maxSplits and replace with param to table function
Add a parameter to the table function to control rough or precise rendering of the table. The precise rendering will split rows or columns into the least common multiple of the counts in that row or column; rough rendering will split rows or columns into the max count of the row or column. Rough is the default.
Control max number of splits
Add a configuration parameter, maxSplits
to limit the number of cells an entry can be split into.