Skip to content
David Mesquita-Morris edited this page Nov 3, 2021 · 3 revisions

This Wiki shows some common patterns and idioms while using the combination of steelbreeze/pivot and steelbreeze/landscape.

Dimension manipulation

Labelled dimensions

To create a label for a dimension, create the following function:

function labelled(key) {
	return value => [
		{ key: "Label", value: key, predicate: () => true },
		{ key, value, predicate: row => row['position'] === value }
	];
}

Then use it in the last parameter of the dimension function:

const dim = pivot.dimension(values, "position", labelled("position"));
Clone this wiki locally