Skip to content

PivotConfig

Configuration for the pivot plugin.

Pivot mode transforms flat row data into a cross-tabulation (pivot table) by grouping rows along one axis (rowGroupFields), spreading unique values of another field across columns (columnGroupFields), and computing aggregate values (valueFields) at each intersection.

new PivotPlugin({
rowGroupFields: ['department'],
columnGroupFields: ['quarter'],
valueFields: [{ field: 'revenue', aggFunc: 'sum' }],
showTotals: true,
showGrandTotal: true,
})
PropertyTypeDescription
active?booleanWhether pivot view is active on load (default: true when fields are configured)
rowGroupFields?string[]Fields to group rows by (vertical axis). Multiple fields create nested groups.
columnGroupFields?string[]Fields whose unique values become column headers (horizontal axis).
valueFields?PivotValueField[]Value fields to aggregate at each row/column intersection.
showTotals?boolean
showGrandTotal?boolean
defaultExpanded?PivotDefaultExpandedValueWhich groups are expanded by default. - true — expand all (default) - false — collapse all - number — expand group at index - string — expand group with key - string[] — expand groups matching keys
indentWidth?numberIndent width per depth level in pixels (default: 20)
showToolPanel?booleanWhether to show the pivot configuration tool panel (default: true)
animation?ExpandCollapseAnimationAnimation style for expanding/collapsing groups. - false: No animation - 'slide': Slide animation (default) - 'fade': Fade animation
sortRows?PivotSortConfigSort configuration for row groups. When set, groups at each level are sorted by label or aggregate value.
sortColumns?PivotSortDirSort direction for column keys. Default: 'asc' (alphabetical). Set to 'desc' for reverse order.
grandTotalInRowModel?booleanInclude the grand total row in the row model (so it’s included in exports/copy). When false (default), grand total is rendered as a separate sticky footer.
valueDisplayMode?PivotValueDisplayModeDisplay mode for aggregated values.
showSubtotals?booleanWhether to show subtotal rows at each group level in multi-level grouping.

Default: 'slide'


Default: false


Default: 'raw'


Default: false


AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt