Pivot Config
DimensionsPanel
Section titled “DimensionsPanel”Owns the shared search control and the empty state around the dimensions grid.
DimensionsPanel: ({ dimensions, selection, allowFieldDragging, onDragStart, onDragEnd, onSelectionChange, search, onSearch, i18n, }: DimensionsPanelProps) => preact.JSX.Element;filterPivotDimensions
Section titled “filterPivotDimensions”export function filterPivotDimensions( dimensions: PivotConfigDimension[], query = '', options: PivotFieldSearchOptions = {},);PivotFieldSearchOptions
Section titled “PivotFieldSearchOptions”interface PivotFieldSearchOptions { /** Include dimensions marked hidden in the returned field list. */ showHidden?: boolean}pivotConfigUiDependencies
Section titled “pivotConfigUiDependencies”Dependencies
Section titled “Dependencies”- Required
aggregators: Uses Pro aggregation definitions for built-in value aggregation options. - Required
pro-ui: Uses Pro UI helper components and styles for configurator controls.
pivotConfigUiDependencies: PluginDependency[];definePivotConfigurator
Section titled “definePivotConfigurator”The PivotConfigurator component provides a flexible configuration interface
for managing pivot table layouts. It allows users to drag and drop dimensions,
rows, columns, and values into designated zones, facilitating dynamic pivot
table setup.
Features:
- Supports drag-and-drop functionality for configuring rows, columns, and values.
- Enables dynamic selection and removal of dimensions, rows, columns, and values.
- Includes built-in aggregator selection for values based on dimensions.
- Provides customizable i18n support for localization of UI labels and messages.
Usage:
- Import
PivotConfiguratorand pass in the required dimensions, columns, rows, and values as props. - Optionally, provide callbacks for
onUpdateColumns,onUpdateRows, andonUpdateValuesto handle configuration changes.
Example
Section titled “Example”import { definePivotConfigurator } from '@revolist/revogrid-pro'
definePivotConfigurator(yourElement, { dimensions: [...], rows: [...], columns: [...], values: [...],}, { onUpdateColumns: (updatedColumns) => { // Handle column configuration changes }, onUpdateRows: (updatedRows) => { // Handle row configuration changes }, onUpdateValues: (updatedValues) => { // Handle value configuration changes },}, undefined, { columnTypes: grid.columnTypes, additionalData: grid.additionalData,})The PivotConfigurator component is ideal for applications that require
flexible, user-driven pivot table customization, especially in data management,
reporting, and analytics tools.
Mounts the standalone Pivot configurator into any host element.
Use this when you want the drag-and-drop Pivot field panel outside of the
default PivotPlugin wrapper, or when you need to drive Pivot state from an
external UI shell.
definePivotConfigurator: (el: HTMLElement, config?: Partial<PivotConfig>, actions?: Partial<PivotConfigurationActions>, diagnostics?: PivotUiDiagnostics | undefined, templateContext?: { columnTypes?: ColumnTypes; additionalData?: unknown }) => () => void;disposePivotConfigurator
Section titled “disposePivotConfigurator”Unmounts a standalone configurator and removes classes added by its mount helper.
disposePivotConfigurator: (el: HTMLElement) => void;definePivotFieldPanel
Section titled “definePivotFieldPanel”Mounts the compact in-grid Pivot field panel into a host element.
Unlike the standalone configurator, this panel is intended to sit above the Pivot grid and expose the active filter, data, row, and column field areas.
definePivotFieldPanel: (el: HTMLElement, config?: Partial<PivotConfig>, actions?: Partial<PivotConfigurationActions>, layout?: { columns?: (ColumnRegular<ColumnProp, DataType<any, ColumnProp>> | ColumnGrouping<any>)[] | undefined; colSize?: number | undefined; resizedColumns?: ColumnResizeDetail; } | undefined, diagnostics?: PivotUiDiagnostics | undefined, templateContext?: { columnTypes?: ColumnTypes; additionalData?: unknown }) => () => void;disposePivotFieldPanel
Section titled “disposePivotFieldPanel”Unmounts a compact field panel and removes mount-helper presentation state.
disposePivotFieldPanel: (el: HTMLElement) => void;PivotConfigurationActions
Section titled “PivotConfigurationActions”interface PivotConfigurationActions { /** Applies several related layout changes as one Pivot regeneration. */ onUpdateConfiguration?: (patch: PivotConfigurationPatch) => void; /** Called whenever the configurator updates the ordered column dimension list. */ onUpdateColumns?: (cols: ColumnProp[]) => void; /** Called whenever the configurator updates the ordered row dimension list. */ onUpdateRows?: (rows: ColumnProp[]) => void; /** Called whenever the configurator updates the selected measures or aggregators. */ onUpdateValues?: (values: PivotConfigValue[]) => void; /** Called whenever the configurator updates the ordered filter field list. */ onUpdateFilters?: (filters: ColumnProp[]) => void; /** Called whenever the configurator changes selected filter values. */ onUpdateFilterSelections?: (selections: PivotFilterSelectionMap) => void; /** Current sorting order used by the field panel. */ sorting?: SortingOrder; /** Called when a field-panel sort control is toggled. */ onToggleSort?: (prop: ColumnProp) => void; /** Called when the user clears the active Pivot layout. */ onResetLayout?: () => void}PivotConfigurationPatch
Section titled “PivotConfigurationPatch”export type PivotConfigurationPatch = Pick< Partial<PivotConfig>, 'columns' | 'rows' | 'values' | 'filters'>;PivotConfigurator
Section titled “PivotConfigurator”PivotConfigurator: ({ dimensions, columns, rows, values, filters, filterSelections, i18n, fieldPanel, showColumns, showRows, showValues, showFilters, onUpdateConfiguration, onUpdateColumns: onUpdateColumnsCallback, onUpdateRows: onUpdateRowsCallback, onUpdateValues: onUpdateValuesCallback, onUpdateFilters: onUpdateFiltersCallback, onUpdateFilterSelections, onResetLayout, diagnostics, }?: Partial<PivotConfigurationComponentProps>) => preact.JSX.Element;PivotFieldPanel
Section titled “PivotFieldPanel”PivotFieldPanel: ({ dimensions, columns, rows, values, filters, filterSelections, fieldPanel, i18n, showColumns, showRows, showValues, showFilters, onUpdateConfiguration, onUpdateColumns, onUpdateRows, onUpdateValues, onUpdateFilters, onUpdateFilterSelections, sorting, onToggleSort, onResetLayout, diagnostics, }?: Partial<PivotFieldPanelProps>) => preact.JSX.Element;DropZone
Section titled “DropZone”DropZone: ({ title, panel, items, dimensions, placeholder, i18n, renderItem, onRemove, onDrop, onDragOver, onDragEnter, onItemDragStart, onItemDragEnd, allowFieldDragging, }: DropZoneProps) => preact.JSX.Element;ValueSelector
Section titled “ValueSelector”ValueSelector: ({ value, aggregators, ariaLabel, onUpdateValue, }: ValueSelectorProps) => preact.JSX.Element;FilterSelector
Section titled “FilterSelector”FilterSelector: ({ allLabel, ariaLabel, options, selected, onUpdateSelection, }: FilterSelectorProps) => preact.JSX.Element;PIVOT_DIMENSION_DRAG_MIME
Section titled “PIVOT_DIMENSION_DRAG_MIME”PIVOT_DIMENSION_DRAG_MIME: string;DraggingItem
Section titled “DraggingItem”The item being dragged
interface DraggingItem { /** The source panel of the dragging item */ source: PanelType; /** The index of the dragging item in the source panel */ index: number; /** Dragging item */ prop: ColumnProp; /** Ordered field bundle when a dimensions group is dragged. */ props?: ColumnProp[]; /** The drag originated from a synthetic dimensions group row. */ isGroup?: boolean}PIVOT_CONFIG_EN
Section titled “PIVOT_CONFIG_EN”PIVOT_CONFIG_EN: { fields: string; rows: string; columns: string; values: string; filters: string; fieldPanel: string; rowsPanelHint: string; columnsPanelHint: string; valuesPanelHint: string; filtersPanelHint: string; dropFilterFieldsHere: string; dragHereRows: string; dragHereColumns: string; dragHereValues: string; dragHereFilters: string; dragDimension: (label: string) => string; dragDimensionGroup: (label: string) => string; searchFields: string; noFieldsFound: string; otherFields: string; swapRowsColumns: string; resetLayout: string; sortField: (label: string) => string; filterValue: (label: string) => string; all: string; pivotWarnings: string; pivotError: string; remove: string;};getPivotFieldPanelRowsWidth
Section titled “getPivotFieldPanelRowsWidth”Resolves the pixel width of the Pivot “rows” section based on current grid columns and optional live resize payload.
export function getPivotFieldPanelRowsWidth( config: Partial<PivotConfig> | null | undefined, columns: (ColumnGrouping | ColumnRegular)[] = [], defaultSize = 100, resizedColumns?: ColumnResizeDetail,);ColumnResizeDetail
Section titled “ColumnResizeDetail”export type ColumnResizeDetail = Record<number, ColumnRegular> | undefined;hasPivotDiagnostics
Section titled “hasPivotDiagnostics”export function hasPivotDiagnostics(diagnostics?: PivotUiDiagnostics);PivotUiDiagnostics
Section titled “PivotUiDiagnostics”interface PivotUiDiagnostics { warnings?: string[]; error?: string}PivotDiagnostics
Section titled “PivotDiagnostics”PivotDiagnostics: ({ diagnostics, i18n, }: { diagnostics?: PivotUiDiagnostics | undefined; i18n?: { fields: string; rows: string; columns: string; values: string; filters: string; fieldPanel: string; rowsPanelHint: string; columnsPanelHint: string; valuesPanelHint: string; filtersPanelHint: string; dropFilterFieldsHere: string; dragHereRows: string; dragHereColumns: string; dragHereValues: string; dragHereFilters: string; dragDimension: (label: string) => string; dragDimensionGroup: (label: string) => string; searchFields: string; noFieldsFound: string; otherFields: string; swapRowsColumns: string; resetLayout: string; sortField: (label: string) => string; filterValue: (label: string) => string; all: string; pivotWarnings: string; pivotError: string; remove: string; } | undefined; }) => preact.JSX.Element | null;PivotAxes
Section titled “PivotAxes”interface PivotAxes { rows: ColumnProp[]; columns: ColumnProp[]}transposePivotAxes
Section titled “transposePivotAxes”transposePivotAxes: (rows: readonly ColumnProp[], columns: readonly ColumnProp[]) => PivotAxes;PivotAxisSwap
Section titled “PivotAxisSwap”PivotAxisSwap: ({ disabled, label, onClick, }: PivotAxisSwapProps) => preact.JSX.Element;usePivotDimensionColumns
Section titled “usePivotDimensionColumns”export function usePivotDimensionColumns({ allowFieldDragging, nested, selectionRef, groupPropsRef, i18n,}: PivotDimensionColumnsOptions);usePivotDimensionDrag
Section titled “usePivotDimensionDrag”export function usePivotDimensionDrag({ boundaryRef, allDimensions, groupPropsRef, nativeDraggingRef, suppressSelectionEventsRef, cancelPendingSelection, restoreSelectionAfterDragGesture, onDragStartRef, onDragEndRef,}: PivotDimensionDragOptions);PivotDimensionEventController
Section titled “PivotDimensionEventController”Owns DOM subscriptions and adjacent resources for one dimensions-grid scope. Keeping teardown here prevents listener options and cleanup order from drifting across hooks as interactions evolve.
class PivotDimensionEventController { listen<TEvent extends Event>( target: EventTarget, type: string, listener: (event: TEvent) => void, options?: boolean | AddEventListenerOptions, );
addCleanup(cleanup: EventCleanup);
dispose();}usePivotDimensionGridLifecycle
Section titled “usePivotDimensionGridLifecycle”export function usePivotDimensionGridLifecycle({ boundaryRef, gridRef, rows, columns, plugins, grouped, nested, search, groupLabelTemplate, searchRef, expandedGroupsRef, nativeDraggingRef, suppressSelectionEventsRef, syncSelection,}: PivotDimensionGridLifecycleOptions);usePivotDimensionSelection
Section titled “usePivotDimensionSelection”export function usePivotDimensionSelection({ gridRef, rows, selection, nativeDraggingRef, onSelectionChange,}: PivotDimensionSelectionOptions);createExpandedGroupOverlay
Section titled “createExpandedGroupOverlay”export function createExpandedGroupOverlay(): ExpandedGroupOverlay;readExpandedGroups
Section titled “readExpandedGroups”export function readExpandedGroups( source: Record<string, unknown>[], overlay: ExpandedGroupOverlay,);resolvePivotDimensionGrouping
Section titled “resolvePivotDimensionGrouping”export function resolvePivotDimensionGrouping( rows: PivotDimensionGridRow[], search: string, overlay: ExpandedGroupOverlay, groupLabelTemplate: GroupLabelTemplateFunc,): GroupingOptions;getPivotDimensionRowSelectPlugin
Section titled “getPivotDimensionRowSelectPlugin”export function getPivotDimensionRowSelectPlugin(plugins: unknown[]);isPivotDimensionsGridReady
Section titled “isPivotDimensionsGridReady”export function isPivotDimensionsGridReady(grid: HTMLRevoGridElement);getPivotDimensionsViewportHeight
Section titled “getPivotDimensionsViewportHeight”export function getPivotDimensionsViewportHeight( dimensions: PivotConfigDimension[], grouped: boolean, otherFieldsLabel: string,);createPivotDimensionGroupProps
Section titled “createPivotDimensionGroupProps”export function createPivotDimensionGroupProps( dimensions: PivotConfigDimension[], nested: boolean, otherFieldsLabel: string, getGroupId: (path: string[]) => string,);PIVOT_DIMENSION_GROUP_PROP
Section titled “PIVOT_DIMENSION_GROUP_PROP”PIVOT_DIMENSION_GROUP_PROP: string;PIVOT_DIMENSION_ROW_TYPE
Section titled “PIVOT_DIMENSION_ROW_TYPE”PIVOT_DIMENSION_ROW_TYPE: string;PIVOT_DIMENSION_COMPACT_ROW_SIZE
Section titled “PIVOT_DIMENSION_COMPACT_ROW_SIZE”PIVOT_DIMENSION_COMPACT_ROW_SIZE: 24;CurrentRef
Section titled “CurrentRef”interface CurrentRef { current: T}ExpandedGroupOverlay
Section titled “ExpandedGroupOverlay”interface ExpandedGroupOverlay { expanded: Set<string>; collapsed: Set<string>; known: Set<string>}renderPivotDimensionIcon
Section titled “renderPivotDimensionIcon”export function renderPivotDimensionIcon( createElement: HyperFunc<VNode> | typeof import('preact').h, dimension?: Pick<PivotConfigDimension, 'columnType'>,);createPivotDimensionGroupLabelTemplate
Section titled “createPivotDimensionGroupLabelTemplate”export function createPivotDimensionGroupLabelTemplate(): GroupLabelTemplateFunc;createPivotDimensionDragCellTemplate
Section titled “createPivotDimensionDragCellTemplate”export function createPivotDimensionDragCellTemplate({ allowFieldDragging, selectionRef, groupPropsRef, i18n,}: PivotDimensionTemplateOptions): DimensionCellTemplate;createPivotDimensionFieldCellTemplate
Section titled “createPivotDimensionFieldCellTemplate”export function createPivotDimensionFieldCellTemplate(): DimensionCellTemplate;createPivotDimensionFieldCellProperties
Section titled “createPivotDimensionFieldCellProperties”export function createPivotDimensionFieldCellProperties(): DimensionCellProperties;PivotDimensionsGrid
Section titled “PivotDimensionsGrid”PivotDimensionsGrid: ({ dimensions, allDimensions, selection, allowFieldDragging, search, otherFieldsLabel, i18n, onDragStart, onDragEnd, onSelectionChange, }: PivotDimensionsGridProps) => preact.JSX.Element;getPivotDimensionLabel
Section titled “getPivotDimensionLabel”export function getPivotDimensionLabel(dimension: PivotConfigDimension);indexPivotDimensionsByProp
Section titled “indexPivotDimensionsByProp”export function indexPivotDimensionsByProp( dimensions: readonly PivotConfigDimension[],);getUniquePivotDimensions
Section titled “getUniquePivotDimensions”export function getUniquePivotDimensions( dimensions: readonly PivotConfigDimension[],);hasPivotDimensionGroups
Section titled “hasPivotDimensionGroups”export function hasPivotDimensionGroups( dimensions: readonly PivotConfigDimension[],);getPivotDimensionGroupPath
Section titled “getPivotDimensionGroupPath”export function getPivotDimensionGroupPath( dimension: PivotConfigDimension,): string[];hasNestedPivotDimensionGroups
Section titled “hasNestedPivotDimensionGroups”export function hasNestedPivotDimensionGroups( dimensions: readonly PivotConfigDimension[],);createPivotDimensionGridRows
Section titled “createPivotDimensionGridRows”export function createPivotDimensionGridRows( dimensions: readonly PivotConfigDimension[], options: { grouped: boolean; otherFieldsLabel: string; allDimensions?: readonly PivotConfigDimension[]; },): PivotDimensionGridRow[];getPivotDimensionGroupId
Section titled “getPivotDimensionGroupId”export function getPivotDimensionGroupId(path: readonly string[]);createPivotDimensionTreeRows
Section titled “createPivotDimensionTreeRows”Projects variable-depth group paths into a flat source for TreeDataPlugin.
export function createPivotDimensionTreeRows( dimensions: readonly PivotConfigDimension[], options: { otherFieldsLabel: string; allDimensions?: readonly PivotConfigDimension[]; },): PivotDimensionGridRow[];getSelectedPivotDimensionProps
Section titled “getSelectedPivotDimensionProps”export function getSelectedPivotDimensionProps( state: PivotDimensionSelectionState,);resolvePivotDimensionSelectionTarget
Section titled “resolvePivotDimensionSelectionTarget”Resolves where a newly checked dimension should be placed.
export function resolvePivotDimensionSelectionTarget( dimension: PivotConfigDimension,): NonNullable<PivotConfigDimension['selectionTarget']>;reconcilePivotDimensionSelection
Section titled “reconcilePivotDimensionSelection”Reconciles checkbox state for only the rows currently represented by the dimensions grid. Fields hidden by search are deliberately left untouched.
export function reconcilePivotDimensionSelection( state: PivotDimensionSelectionState, visibleDimensions: readonly PivotConfigDimension[], selectedVisibleProps: ReadonlySet<ColumnProp>,): PivotDimensionSelectionState;movePivotDimensionBundle
Section titled “movePivotDimensionBundle”Places an ordered field-group bundle using the same role rules as a single field: axes are exclusive while Filters and Values remain independent.
export function movePivotDimensionBundle( state: PivotDimensionLayoutState, target: Exclude<PanelType, 'dimensions'>, props: readonly ColumnProp[], options: { index?: number; createValue: (prop: ColumnProp) => PivotConfigValue; },): PivotDimensionLayoutState;areColumnPropArraysEqual
Section titled “areColumnPropArraysEqual”export function areColumnPropArraysEqual( left: readonly ColumnProp[], right: readonly ColumnProp[],);arePivotValuesEqual
Section titled “arePivotValuesEqual”export function arePivotValuesEqual( left: readonly PivotConfigValue[], right: readonly PivotConfigValue[],);createPivotConfigValue
Section titled “createPivotConfigValue”export function createPivotConfigValue( prop: ColumnProp, dimension?: PivotConfigDimension,): PivotConfigValue;getPivotDimensionAggregators
Section titled “getPivotDimensionAggregators”export function getPivotDimensionAggregators( dimension?: PivotConfigDimension,);movePivotField
Section titled “movePivotField”Places one source field using Excel-compatible Pivot roles. Rows and Columns are exclusive axis placements. Filters and Values are independent roles, so a field can filter source data without disappearing from an axis or the summarized values.
export function movePivotField( state: PivotFieldLayoutState, _source: PanelType, target: Exclude<PanelType, 'dimensions'>, prop: ColumnProp, options: { index?: number; createValue: (prop: ColumnProp) => PivotConfigValue; },): PivotFieldLayoutState;PIVOT_DIMENSION_MODEL
Section titled “PIVOT_DIMENSION_MODEL”PIVOT_DIMENSION_MODEL: string;PIVOT_DIMENSION_INDEX
Section titled “PIVOT_DIMENSION_INDEX”PIVOT_DIMENSION_INDEX: string;PIVOT_DIMENSION_LABEL
Section titled “PIVOT_DIMENSION_LABEL”PIVOT_DIMENSION_LABEL: string;PIVOT_DIMENSION_TREE_ID
Section titled “PIVOT_DIMENSION_TREE_ID”PIVOT_DIMENSION_TREE_ID: string;PIVOT_DIMENSION_TREE_PARENT_ID
Section titled “PIVOT_DIMENSION_TREE_PARENT_ID”PIVOT_DIMENSION_TREE_PARENT_ID: string;PIVOT_DIMENSION_ROW_CLASS
Section titled “PIVOT_DIMENSION_ROW_CLASS”PIVOT_DIMENSION_ROW_CLASS: string;PIVOT_DIMENSION_GROUP_PATH
Section titled “PIVOT_DIMENSION_GROUP_PATH”PIVOT_DIMENSION_GROUP_PATH: string;PivotDimensionGridRow (Extended from pivot.config.dimension.model.ts)
Section titled “PivotDimensionGridRow (Extended from pivot.config.dimension.model.ts)”interface PivotDimensionGridRow { [PIVOT_DIMENSION_MODEL]?: PivotConfigDimension; [PIVOT_DIMENSION_INDEX]: number; [PIVOT_DIMENSION_LABEL]: string; [PIVOT_DIMENSION_TREE_ID]?: string; [PIVOT_DIMENSION_TREE_PARENT_ID]?: string | null; [PIVOT_DIMENSION_ROW_CLASS]?: string; [PIVOT_DIMENSION_GROUP_PATH]?: string[]; fieldGroup?: string}PivotDimensionSelectionState
Section titled “PivotDimensionSelectionState”interface PivotDimensionSelectionState { rows: ColumnProp[]; columns: ColumnProp[]; values: PivotConfigValue[]}PivotDimensionLayoutState (Extended from pivot.config.dimension.model.ts)
Section titled “PivotDimensionLayoutState (Extended from pivot.config.dimension.model.ts)”interface PivotDimensionLayoutState { filters: ColumnProp[]}PivotDimensionSelectionChangeDetail
Section titled “PivotDimensionSelectionChangeDetail”interface PivotDimensionSelectionChangeDetail { /** More than one visible leaf changed in the same RowSelect event. */ bulk: boolean}