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.
Example
Section titled “Example”new PivotPlugin({ rowGroupFields: ['department'], columnGroupFields: ['quarter'], valueFields: [{ field: 'revenue', aggFunc: 'sum' }], showTotals: true, showGrandTotal: true,})Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
active? | boolean | Whether 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? | PivotDefaultExpandedValue | Which 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? | number | Indent width per depth level in pixels (default: 20) |
showToolPanel? | boolean | Whether to show the pivot configuration tool panel (default: true) |
animation? | ExpandCollapseAnimation | Animation style for expanding/collapsing groups. - false: No animation - 'slide': Slide animation (default) - 'fade': Fade animation |
sortRows? | PivotSortConfig | Sort configuration for row groups. When set, groups at each level are sorted by label or aggregate value. |
sortColumns? | PivotSortDir | Sort direction for column keys. Default: 'asc' (alphabetical). Set to 'desc' for reverse order. |
grandTotalInRowModel? | boolean | Include 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? | PivotValueDisplayMode | Display mode for aggregated values. |
showSubtotals? | boolean | Whether to show subtotal rows at each group level in multi-level grouping. |
Property Details
Section titled “Property Details”animation
Section titled “animation”Default: 'slide'
grandTotalInRowModel
Section titled “grandTotalInRowModel”Default: false
valueDisplayMode
Section titled “valueDisplayMode”Default: 'raw'
showSubtotals
Section titled “showSubtotals”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