Skip to content

Configuration Reference

PivotConfig is the public configuration model for both client-side and server-side Pivot. This page explains every option in the current implementation and how the options interact.

For configuration signatures, see Pivot API; stock constructor signatures are in Pivot Config API. Use this page for defaults, behavior, and practical guidance.

PivotConfig requires rows and values in TypeScript. The plugin’s direct grid.pivot property and updatePivotConfig(nextConfig) accept Partial<PivotConfig> and default missing axis/value collections to empty arrays. updatePivotConfig submits a complete candidate: merge an intended patch into current authored state before calling it. An accepted update returns true; a veto or failed/superseded update does not establish a committed configuration. Use the authoring facade to observe status and history.

For numeric reports, use the recommended explicit policies. The grid setup below uses a compiled finite-number sum callback with nulls skipped and invalid values rejected. Default ID callbacks are separately documented; they are not an input-validation policy.

Interactive example

Minimal configuration

Minimal complete catalog and valid row-only report

The example loads when visible.

// docs-check: complete
import { compileAggregateOperation } from '@revolist/revogrid-pro/aggregations';
import type { PivotConfig } from '@revolist/pivot';
const numeric = {
sum: compileAggregateOperation({ builtin: 'sum', operation: {
version: 1, input: { type: 'finite-number' }, nulls: 'skip',
invalid: 'error', output: { type: 'finite-number' },
} }),
};
const pivot: PivotConfig = {
aggregationSemantics: 'local',
dimensions: [
{ prop: 'region', name: 'Region' },
{ prop: 'quarter', name: 'Quarter' },
{ prop: 'sales', name: 'Sales', aggregators: numeric },
],
rows: ['region'],
columns: ['quarter'],
values: [{ prop: 'sales', aggregator: 'sum' }],
};

Reusable field definitions. This is where you configure field labels, column behavior, and available aggregators.

  • Purpose: Define the fields Pivot can reuse.
  • Accepted value: PivotConfigDimension[]
  • Default: when omitted, plugin/report migration synthesizes definitions for referenced fields; an explicit array is the complete catalog and must contain every referenced field.
  • Important interactions: values[].aggregator resolves against the matching dimension’s registry, falling back to built-ins when its registry is absent or empty.

Provide a catalog to expose unused fields in the configurator, assign useful captions, or register custom operations. Omitting it is convenient for a fixed layout; supplying dimensions: [] does not request inference.

Dimension optionMeaning and default
dimensions[].propRequired physical source property; string or number. Properties must be unique and must not collide after string conversion. $values is reserved.
dimensions[].dataTypeOptional descriptive string, number, date, or boolean metadata; no coercion or inferred formatting.
dimensions[].allowedRolesOptional authoring destinations; omitted permits all, [] permits none. See policy below.
dimensions[].selectionTargetPreferred checkbox destination: rows, columns, or values; a disallowed hint falls back to an allowed role.
dimensions[].fieldGroupDisplay folder label or nested string path for the field list. Does not create analytical hierarchy levels.
dimensions[].descriptionOptional field-list description and search text.
dimensions[].hiddenDefaults false; hides the field from ordinary field lists while retaining configured use.
dimensions[].aggregatorsMap of operation IDs to local functions; a nonempty map replaces built-ins for that field. Omitted/empty uses commonAggregators. New stock measures use its first supported operation; otherwise string/Boolean/date fields prefer count and numeric/unknown fields prefer sum.
dimensions[].filterOptionsExplicit finite scalar choices for the Filters quick selector/member editor. An explicit [] takes priority over async enumeration.

Dimensions also inherit Partial<ColumnRegular>: use Core options such as name, size, minSize, maxSize, pin, sortable, filter, blankSemantics, columnType, cellTemplate, and cellProperties for captions and generated grid presentation. Their complete typed contract is ColumnRegular from @revolist/revogrid. Their meaning is owned by Core; arbitrary extension data does not add Pivot behavior. Portable report columns deliberately accept a narrower JSON-safe subset; runtime templates and other callbacks require named bindings. See Report Specifications.

dimensions[].aggregator and dimensions[].dimension are read-only generated metadata, not authoring settings; configure operations on values instead.

PivotConfigDimension and portable PivotReportField accept optional dataType (string, number, date, or boolean) and allowedRoles (rows, columns, values, or filters). The datatype is descriptive: it does not coerce facts, choose an aggregator, or apply formatting. column.name remains the portable field label; native dimensions use name.

Omitting allowedRoles permits every placement; [] permits none. Role order is preserved, and duplicate or unknown roles are invalid. Report validation, compilation, controller commands and native plugin ingress reject forbidden placements with FIELD_ROLE_UNAVAILABLE, the stable field ID and report path. Controllers validate the final transaction, so a transaction can change a policy and move or remove its previous placement together. Failed changes retain the last committed report and result; successful policy changes participate in history.

The filters role means placement in the dedicated Filters area. It does not prohibit member selections on row or column fields, remove dormant selections, or authorize source predicates or measure HAVING. Backend registry permissions remain separate. Runtime column bindings cannot inject either metadata property; declare them on the field.

The root and headless entries export PivotFieldRole, isPivotFieldRoleAllowed(field, role) and getPreferredPivotFieldRole(field). The preferred checkbox destination is an allowed selectionTarget, otherwise the existing default (Values for a nonempty aggregator map, Rows otherwise), otherwise the first permitted Rows, Columns or Values role. Filter-only and empty restrictions return undefined; the authored hint remains unchanged.

createPivotData and createPivotDataModel are trusted execution helpers for raw configuration, outside this authoring boundary. They do not enforce role policy or provide backend authorization; use report validation/compilation or a controller for authored layouts.

The built-in configurator uses the same placement policy for checkboxes, drag and drop, axis swaps, and context-menu moves. A field restricted to Filters has an Add to Filters button that can be activated from the keyboard; it is disabled once the field is placed there. Fields with no allowed placement show a reason and cannot be dragged. A group drop is rejected as a whole if any field cannot use the destination. Fields selected outside the current search remain selected. dataType is included in field search without changing source values.

For example, allowedRoles: ['columns'] with selectionTarget: 'rows' selects Columns when checked; it does not change the authored hint. allowedRoles: ['filters'] exposes the Filters action, while allowedRoles: [] prevents adding the field to a layout. Member filtering on an existing Rows field remains available even when that field cannot be placed in Filters.

Translate placement messages through i18n (configurator) or fieldPanel.texts (compact panel): fieldRoleUnavailable, fieldNoPlacement, fieldFilterOnly, addToFilters, and axisSwapUnavailable. Context-menu reasons use contextMenu.localeText.fieldRoleUnavailable. Partial overrides inherit the remaining built-in messages.

Ordered row hierarchy.

  • Purpose: Define the vertical analytical hierarchy.
  • Accepted value: ColumnProp[]
  • Default: required
  • Important interactions: row drill-down only becomes meaningful when the effective row hierarchy has more than one level.

Ordered generated column hierarchy.

  • Purpose: Define the horizontal analytical hierarchy.
  • Accepted value: ColumnProp[]
  • Default: []
  • Important interactions: flatHeaders, columnCollapse, and column totals only matter when column fields exist.

Measures to aggregate.

  • Purpose: Define which fields are summarized inside each Pivot cell.
  • Accepted value: PivotConfigValue[]
  • Default: required
  • Important interactions: values can render as columns or as synthetic rows through valuesOnRows.
Measure optionMeaning and default
values[].propRequired source field present in the explicit catalog, if supplied.
values[].aggregatorRequired registered operation ID, such as sum or avg.
values[].idOptional stable, unique measure identity. Supply it when repeating a source field; the plugin assigns missing measure IDs. Keep it stable when changing labels or operations.
values[].labelPreferred display caption; overrides name and the field caption.
values[].nameFallback measure caption when label is absent.
values[].summariesOptional { group?: string; total?: string } independent operations. Each inherits the leaf aggregator when absent; total does not inherit group.
values[].calculationOptional post-aggregation calculation, including ratios, sequences, rank and formulas. Changes result numbers.
values[].formatOptional Intl number, currency, percent, date, or datetime preset, locale/options and blank/invalid display strings. Changes presentation; currency requires a code.
values[].conditionalFormattingOptional { match?: 'first' | 'all'; rules: PivotConditionalFormatRule[] } for measure-wide presentation rules.

Independent summary operations aggregate eligible original facts at group, subtotal/collapsed, and grand-total coordinates; grand totals win at intersections. They require local execution without a supplied adapter/store. Formula carriers inherit dependency summaries rather than defining their own. The stock measure editor preserves unsupported current settings during unrelated edits and admits new calculations according to engine capabilities. See Aggregations, Formatting Presets and Configurator API for detailed settings.

Ordered fields in the dedicated Filters area. Accepts ColumnProp[]; defaults to []. A field can independently remain on an axis or in Values. The filters allowed role controls this placement, not whether row/column members can be filtered.

Member selections keyed by stringified source property. Inclusive scalar arrays keep listed members; { mode: 'exclude', values: [...] } excludes listed members. Missing/empty entries mean All. Scalars are finite numbers, strings, booleans, or null; typed values such as 1 and '1' remain distinct. Selections execute before aggregation. Stock layout edits prune selections when a field leaves its final Rows, Columns or Filters placement; changing Values alone does not clear them. Authored dormant selections are a separate concern. See Sorting And Filtering.

Optional PivotAggregateFilterExpression applied after aggregation (HAVING). Leaves identify a configured measure, column path/kind, operation and value; combine them with [left, 'and' | 'or', right] or ['!', expression]. This is separate from member selection. Use stable measure IDs for repeated source measures and an engine that supports the requested filter semantics.

Interactive example

Filtering and report layout

Top/Bottom N by selected measure with optional Other

The example loads when visible.

Optional local ranking on the first row field: { direction: 'top' | 'bottom', count: number, valueIndex: number, otherLabel?: string }. count is a positive integer; valueIndex is the zero-based configured measure index, so duplicate source measures are unambiguous. Ranking uses all column members after member filtering. Omitted members are excluded unless otherLabel groups them into one aggregate. This is client-side ranking, not an automatic remote ranking endpoint.

Flattens grouped column headers into single labels.

  • Purpose: Reduce visible nesting in generated columns.
  • Accepted value: boolean
  • Default: false
  • Common pitfall: flat headers still preserve analytical grouping, they only change header presentation. With flatHeaders: false, generated Pivot columns use RevoGrid grouped headers so repeated parent labels are visually grouped.

Merges generated value headers into the terminal column header labels.

  • Purpose: Remove repeated measure headers such as Revenue under every generated column member.
  • Accepted value: boolean
  • Default: false
  • Behavior: with one value, terminal columns use the column member label, for example Q1; with multiple values, the value label is appended, for example Q1 Revenue.
  • Important interactions: can be combined with flatHeaders; valuesOnRows already moves measures out of generated value columns.

Moves values into the row hierarchy.

  • Purpose: Render measures as synthetic row members.
  • Accepted value: boolean
  • Default: false
  • Important interactions: affects row drill-down behavior because values become part of the effective row structure.

Controls the effective row hierarchy, including where measures appear.

  • Purpose: Place the $values pseudo-field at the beginning, middle, or end of the row tree.
  • Accepted value: (ColumnProp | '$values')[]
  • Default: derived from rows, with $values appended only when valuesOnRows: true
  • Important interactions: when provided, rowTree overrides the value placement implied by valuesOnRows.

Controls the visible layout of an active multi-level row hierarchy.

  • Purpose: Choose between one compact hierarchy column and one column per row field.
  • Accepted value: 'compact' | 'tabular'
  • Default: 'compact' while row drill-down is active; otherwise 'tabular'
  • Behavior:
    • 'compact' renders group labels and terminal row values in one localized Rows column.
    • 'tabular' preserves separate visible columns for every configured row field.
  • Important note: this changes only the grid presentation. Configured row fields remain separate in aggregation, grouping, configurator state, and remote requests.

In rowAxisLayout: 'tabular', set showRowGroupHeaders: false to hide generated row group headers and display all detail rows with repeated labels in each row field column, like an Excel tabular report. Saved collapsed and expanded state is ignored until headers are shown again. Defaults to true and is ignored in compact mode. Explicit subtotal and grand-total settings still apply; turn those off too for a detail-only report.

rowAxisLayout: 'tabular',
showRowGroupHeaders: false,
totals: { subtotals: false, grandTotal: false },

Enables the built-in Pivot configurator panel.

  • Purpose: Let users rearrange fields visually.
  • Accepted value: boolean
  • Default: false

Custom configurator mount target.

  • Purpose: Render the configurator outside the default grid wrapper.
  • Accepted value: HTMLElement
  • Default: internal grid wrapper mount

Hide or show the configurator columns zone.

  • Purpose: Control configurator UI visibility.
  • Accepted value: boolean
  • Default: true

Hide or show the configurator rows zone.

  • Purpose: Control configurator UI visibility.
  • Accepted value: boolean
  • Default: true

Hide or show the configurator values zone.

  • Purpose: Control configurator UI visibility.
  • Accepted value: boolean
  • Default: true

Shows the configurator Filters area. Accepts boolean; defaults true. Like the other show* options, it changes UI visibility only. An explicit matching fieldPanel.show*Fields setting takes precedence in both stock constructors.

Settings for compact field areas and shared stock configuration controls. The compact panel is opt-in; hasConfigurator independently enables the full panel.

Field-panel optionMeaning and default
fieldPanel.visibleShow the compact in-grid panel; defaults false.
fieldPanel.showResetLayoutShow Reset layout where a reset action is available; defaults false.
fieldPanel.allowFieldDraggingAllow field dragging; defaults true.
fieldPanel.allowFieldActionsShow Add field, Actions and Clear controls; defaults true, independent of dragging.
fieldPanel.allowFieldRemovingAllow Remove/Clear controls; defaults true in the full configurator and false in compact.
fieldPanel.showRowFieldsShow Rows; falls back to showRows, then true.
fieldPanel.showColumnFieldsShow Columns; falls back to showColumns, then true.
fieldPanel.showDataFieldsShow Values; falls back to showValues, then true.
fieldPanel.showFilterFieldsShow Filters; falls back to showFilters, then true.
fieldPanel.textsPartial PivotConfigLocaleInput; overrides root i18n in both stock mount helpers.

These controls are UI policy, not authorization. See Field Panel.

Advanced semantic Pivot menu, enabled by default; false disables it. PivotContextMenuConfig accepts areas and items boolean maps to hide particular surfaces/actions, allowFieldRemoving, drillThrough: false | { pageSize?, columns?, visibleColumns?, columnChooser? }, filter: false | { pageSize? }, clipboard: false | { formatted? }, export: false | { fileName? }, and partial localeText. Omitted switches retain built-in behavior; a visible action can still be disabled by engine support, missing editor integration, or current report status. Menu translations use localeText independently of configurator i18n. See PivotContextMenuConfig.

See Drill Through for the compact detail grid, searchable column chooser, full runtime grid configuration, custom column and cell templates, event hooks, and APIs for updating an open dialog.

Configurator strings.

  • Purpose: Override built-in English labels.
  • Accepted value: PivotConfigLocaleInput (partial strings, callbacks and nested label maps)
  • Default: built-in English copy
  • Precedence: English defaults → root i18n → fieldPanel.texts in stock mount helpers; nested label maps merge by key.

Application field captions, group/member data and saved-view names remain application data. Callback entries translate text containing those values; diagnosticMessage translates host/engine messages. Partial native dictionaries are supported, while explicitly authored portable report nested maps currently require all known keys. Runtime locale callbacks need named bindings for report export. Lightweight state JSON accepts JSON-only strings and partial nested label maps in both locale locations; callback functions remain outside that strict JSON boundary. See Export And State before choosing persistence.

Interactive example

Totals and engine options

Enable/suppress/label/selectively disable totals

The example loads when visible.

Controls grand totals and subtotals.

  • Purpose: Add analytical summary rows and columns.
  • Accepted value: PivotConfigTotals
  • Default: all disabled
Totals optionMeaning and default
totals.grandTotalShow a grand-total row and generated value columns; defaults false.
totals.subtotalsShow intermediate hierarchy totals; defaults false.
totals.disabledSubtotals{ rows?, columns? } with fields?: ColumnProp[] and zero-based levels?: number[]; omit to retain all enabled subtotals.
totals.grandTotalLabelOptional grand-total display caption.
totals.subtotalLabelOptional subtotal display caption.
totals.suppressSingleChildSubtotalsHide a subtotal duplicating its only source-backed leaf; defaults false.
totals.suppressGrandTotalWhenSingleLeafHide a grand-total row duplicating the only source-backed leaf; defaults false.

See Totals for behavior examples.

Initial row drill-down state.

  • Purpose: Enable grouped row expansion behavior.
  • Accepted value: boolean
  • Default: disabled unless expanded is provided or rowAxisLayout: 'compact' is set
  • Important note: only matters when the effective row hierarchy has more than one level

Persisted grouped row expansion state.

  • Purpose: Restore row drill-down state.
  • Accepted value: Record<string, boolean>
  • Default: undefined

Render aggregate values inside grouped Pivot drill-down rows.

  • Purpose: Show grouped branch aggregates under generated Pivot metric columns, not only the group label.
  • Accepted value: boolean
  • Default: false
  • Important note: currently applies to the client-side Pivot path. Server-side Pivot still needs backend-precomputed grouped aggregates for exact support.

Optional 'semantic-v1' opts expanded into typed path keys. Create keys with createPivotExpandedPathKey and preserve the encoding alongside the map. Omitted means comma-joined keys; typed keys avoid collisions between commas, nulls and differently typed members. See Drilldown.

Optional { empty?: string; null?: string } display labels for empty strings and null/undefined axis members. Defaults to empty labels. This affects captions, not member identity or filtering; see Field Metadata.

Controls which visible row cell renders grouped row labels.

  • Purpose: Keep grouped labels visible when grouped fields are hidden with column-hide.
  • Accepted value: 'grouped' | 'firstVisible'
  • Default: 'grouped'
  • Behavior:
    • 'grouped' keeps labels in the grouped field column.
    • 'firstVisible' renders labels in the first currently visible row cell.

Generated column collapse config.

  • Purpose: Enable collapsible Pivot column groups.
  • Accepted value: boolean | PivotColumnCollapseConfig
  • Default: enabled and collapsed when columns is non-empty
  • Disable with: false or { enabled: false }
Column-collapse optionMeaning and default
columnCollapse.enabledEnable generated column drill-down; defaults true when column dimensions exist.
columnCollapse.collapsedDefault collapsed state; defaults true. Persisted group state takes precedence.
columnCollapse.filterableShow aggregate filters on collapsed/group headers; defaults true. Expanded leaves retain their ordinary filters.
columnCollapse.aggregatorOverride collapsed bucket operation for every measure (string) or by value source property (map). Defaults to the normal measure/summary policy.
columnCollapse.placeholderOverride placeholder label/template with a string, ColumnTemplateFunc or ColumnCollapsePlaceholder.

Per-level generated column behavior.

  • Purpose: Override collapse, subtotal, filtering, and sorting behavior for a specific zero-based level in columns.
  • Accepted value: Record<number, PivotColumnLevelConfig>
  • Default: omitted; global Pivot and value-dimension settings apply
Per-level optionMeaning and default
columnLevels[].collapsibleFalls back to columnCollapse.enabled.
columnLevels[].collapsedFalls back to columnCollapse.collapsed.
columnLevels[].subtotalShow this level’s subtotal while global subtotals are enabled. Overrides disabledSubtotals for the level.
columnLevels[].subtotalLabelOptional per-level subtotal caption.
columnLevels[].subtotalPosition'before' (default) or 'after' descendants.
columnLevels[].subtotalValuesOrdered value-property subset; defaults to all configured measures.
columnLevels[].filterableFalls back to the value dimension and columnCollapse policy.
columnLevels[].sortableFalls back to the value dimension’s sortable flag.
columns: ['year', 'quarter', 'month'],
totals: { subtotals: true },
columnLevels: {
0: {
subtotal: true,
subtotalLabel: 'Year Total',
subtotalPosition: 'before',
subtotalValues: ['sales'],
filterable: true,
sortable: true,
},
1: {
subtotal: false,
filterable: false,
sortable: false,
},
}

An explicit subtotal value in columnLevels takes precedence over totals.disabledSubtotals.columns for that level. totals.subtotals remains the global on/off switch.

See Column Totals With Drill-Down for the complete configuration matrix, resolution order, interaction guarantees, and screenshots.

Persisted generated column collapse state.

  • Purpose: Restore collapsed column groups.
  • Accepted value: boolean | Record<string, boolean>
  • Default: undefined

Pins the report to local or server execution before loading data.

  • Accepted value: 'local' | 'server'
  • Default: omitted, preserving existing unpinned report behavior
  • Persistence: retained in native configuration and V1/V2 portable reports

'local' rejects an engine with server mode, an adapter, or a remote store; 'server' rejects local execution. Pin older saved reports before permitting engine rebinding. A pin does not change aggregate policies or certify local/SQL equivalence: default local AVG includes null as zero, whereas SQL AVG skips null. Review KPI results and explicitly migrate the report before changing its pin. Versioned local aggregate operations require local execution. Direct local model, cooperative-work and ClientPivotEngineAdapter APIs enforce the pin before reading facts, using their actual local execution path even with server-looking metadata. Readers must support this property to import pinned reports. See Aggregation policies for defaults, recommended V2 presets and complete examples.

Switches between local and remote analytical execution.

  • Purpose: Select the execution owner; changing engines can change calculation semantics and requires explicit validation.
  • Accepted value: object
  • Default: omitted, which keeps current client-side behavior

Nested options:

  • Accepted value: 'client' | 'server'
  • Default: omitted
  • Behavior: 'server' makes PivotPlugin load through an adapter or remote store
  • Accepted value: PivotEngineAdapter
  • Behavior: custom execution boundary used directly by the plugin
  • Accepted value: PivotRemoteStore
  • Behavior: framework-agnostic HTTP or transport-backed store used by the server adapter

Optional PivotEngineCapabilities for analytical UI admission. aggregation, filter, filterValues, sort, and drilldown are optional booleans; calculations is a boolean or supported PivotValueCalculationType[]. Adapter/store capabilities are read first; explicitly supplied config capability properties win. Omitted or opaque support does not establish availability for commands that require an advertised capability.

Capabilities describe actual execution support; they do not implement it. For example, the HTTP remote store has no built-in member-choice method, so filterValues: true alone does not create an enumeration endpoint. Supply a working adapter/store integration and advertise only what it can execute. See Remote API Reference.

  • Accepted value: string
  • Default: 'default'
  • Behavior: backend semantic view or dataset identifier
  • Accepted value: string
  • Default: 'local'
  • Behavior: field registry version or checksum
  • Accepted value: Partial<PivotAxisViewport>
  • Default: { offset: 0, limit: 100 }
  • Behavior: initial row-axis analytical window hint
  • Accepted value: Partial<PivotAxisViewport>
  • Default: { offset: 0, limit: 24 }
  • Behavior: initial column-axis analytical window and hierarchy frontier. expandedPaths and collapsedPaths use typed analytical paths and are updated automatically by Pivot column expand/collapse controls in server mode.

This layout reuses the numeric callback map from the minimal example.

const pivot: PivotConfig = {
dimensions: [
{ prop: 'region', name: 'Region', sortable: true },
{ prop: 'rep', name: 'Rep' },
{ prop: 'year', name: 'Year' },
{ prop: 'quarter', name: 'Quarter' },
{
prop: 'sales',
name: 'Sales',
aggregators: numeric,
},
],
rows: ['region', 'rep'],
columns: ['year', 'quarter'],
values: [{ prop: 'sales', aggregator: 'sum' }],
totals: { grandTotal: true, subtotals: true },
collapsed: true,
groupAggregations: true,
hasConfigurator: true,
};
  • Supplying an incomplete explicit dimensions catalog. Omit it for inference, or include every referenced field and any additional fields users should discover.
  • Expecting columns to be required. A row-only Pivot is valid.
  • Using columnCollapse without generated column groups.
  • Assuming engine changes the public config shape. It selects the execution path; it does not preserve aggregate semantics automatically, and a mismatching pin rejects the switch.