# @salmonui/pivot-table API reference

> 94 exported symbols of @salmonui/pivot-table: 4 components, 12 functions, 1 class, 58 interfaces, 18 types and 1 constant.

Canonical: https://salmonui.dev/docs/reference/pivot-table

```ts
import { … } from '@salmonui/pivot-table';
```

## Components

### PivotAxisBar

Kind: component

Page: https://salmonui.dev/docs/reference/pivot-table/PivotAxisBar

```ts
function PivotAxisBar<Row = unknown>(props: PivotAxisBarProps<Row>): ReactNode;
```

The axis bar. Bind it to the same store as the table: `<PivotAxisBar pivot={pivot} />`.

Props: [`PivotAxisBarProps`](https://salmonui.dev/docs/reference/pivot-table/PivotAxisBarProps) (its members are the props)

### PivotFieldList

Kind: component

Page: https://salmonui.dev/docs/reference/pivot-table/PivotFieldList

```ts
function PivotFieldList<Row = unknown>(props: PivotFieldListProps<Row>): ReactNode;
```

The field list. Bind it to the same store as the table: `<PivotFieldList pivot={pivot} />`.

Props: [`PivotFieldListProps`](https://salmonui.dev/docs/reference/pivot-table/PivotFieldListProps) (its members are the props)

### PivotTable

Kind: component

Page: https://salmonui.dev/docs/reference/pivot-table/PivotTable

```ts
function PivotTable<Row = unknown>(own: PivotTableProps<Row>): ReactNode;
```

The pivot table.

Props: [`PivotTableProps`](https://salmonui.dev/docs/reference/pivot-table/PivotTableProps) (its members are the props)

### PivotToolbar

Kind: component

Page: https://salmonui.dev/docs/reference/pivot-table/PivotToolbar

```ts
function PivotToolbar<Row = unknown>(props: PivotToolbarProps<Row>): ReactNode;
```

The toolbar.

Props: [`PivotToolbarProps`](https://salmonui.dev/docs/reference/pivot-table/PivotToolbarProps) (its members are the props)

## Functions

### drillChartPoint

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/drillChartPoint

```ts
function drillChartPoint<Row>(pivot: PivotController<Row>, chart: PivotChartData, seriesId: string, index: number, mode?: PivotChartDrillMode): boolean;
```

Chart point click → pivot: `'auto'` expands the category
member when it can expand, else opens drill through for the point's cell;
`'collapse'` collapses the category's parent (drill up).

### pivotChartImage

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/pivotChartImage

```ts
function pivotChartImage(chart: Pick<ChartApi, 'toBlob' | 'element'>, format?: 'png' | 'jpeg'): Promise<ExportImage>;
```

A chart image for `exportPivot({ format: 'pdf', chart })` or
`api.exportToPdf({ chart })` (table and chart in one PDF): the
chart's PNG (or JPEG) with its drawing size in CSS px.

### pivotChartProps

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/pivotChartProps-function

```ts
function pivotChartProps<Row>(pivot: PivotController<Row>, options?: PivotChartPropsOptions): PivotChartProps;
```

`Chart` props of the controller's current result:
`<Chart {...pivotChartProps(pivot, { type: 'column' })} />`. Not memoized;
in components use `usePivotChartProps()`.

### pivotChartPropsOf

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/pivotChartPropsOf

```ts
function pivotChartPropsOf<Row>(pivot: PivotController<Row>, chart: PivotChartData, options?: PivotChartPropsOptions): PivotChartProps;
```

`ChartProps` of pivot chart data: `data`, `series`, axes and an `onPointClick` that drills the pivot.

### pivotChartSeriesOptions

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/pivotChartSeriesOptions

```ts
function pivotChartSeriesOptions(type: PivotChartSeriesType): PivotChartSeriesShape;
```

The `Chart` series options a pivot chart type draws with (`type`, plus `curve` / `stack` / `closed`).

### pivotToSeries

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/pivotToSeries

```ts
function pivotToSeries(result: PivotResult | null, options?: PivotToSeriesOptions): PivotChartData;
```

Converts a pivot result into `Chart` data and series for one measure.

### usePivot

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/usePivot

```ts
function usePivot<Row = unknown>(own?: UsePivotOptions<Row>): PivotController<Row>;
```

Creates the pivot store shared by `PivotTable`, `PivotFieldList`,
`PivotAxisBar`, `PivotToolbar` and the chart adapters. The component that
calls it re-renders when the result or the status changes.

### usePivotChartData

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/usePivotChartData

```ts
function usePivotChartData<Row>(pivot: PivotController<Row>, options?: PivotToSeriesOptions): PivotChartData;
```

`pivotToSeries()` of the controller's current result, recomputed when the result changes.

### usePivotChartProps

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/usePivotChartProps

```ts
function usePivotChartProps<Row>(pivot: PivotController<Row>, options?: PivotChartPropsOptions): PivotChartProps;
```

`pivotChartProps()` of the store's current result, recomputed only when the result or an option changes.

### usePivotState

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/usePivotState

```ts
function usePivotState<T, Row = unknown>(pivot: PivotController<Row>, selector: (state: PivotState) => T): T;
```

Subscribes to one field of the pivot store. `selector` must return a value that keeps its identity.

## Classes

### PivotController

Kind: class

Page: https://salmonui.dev/docs/reference/pivot-table/PivotController

```ts
class PivotController<Row = unknown> {
    handlers: Handlers<Row>;
    private options;
    private state;
    private readonly listeners;
    private engine;
    private unsubscribeEngine;
    windowed: WindowedPivot | null;
    private memberCache;
    private data;
    private initial;
    private mounted;
    private appliedPropKey;
    private pending;
    constructor(options: UsePivotOptions<Row>);
    readonly subscribe: (listener: Listener) => (() => void);
    readonly getSnapshot: () => PivotState;
    get result(): PivotResult | null;
    get status(): PivotState['status'];
    get model(): PivotModel;
    getData(): readonly Row[];
    private set;
    private engineOptions;
    private createEngine;
    private readonly syncFromEngine;
    mount(): () => void;
    private isLarge;
    private whenReady;
    updateOptions(options: UsePivotOptions<Row>): void;
    applyModelProp(input: PivotModelInput | undefined): void;
    applyDataProp(data: readonly Row[] | undefined): void;
    private event;
    private allowed;
    private emitCompute;
    private emitError;
    private run;
    setModel(input: PivotModelInput | ((model: PivotModel) => PivotModelInput), options?: PivotCommandOptions & {
        readonly action?: PivotAction;
        readonly field?: string | null;
    }): boolean;
    private commit;
    applyDraft(source?: PivotEventSource): boolean;
    cancelDraft(): void;
    beginDraft(): void;
    moveField(field: string, to: PivotAxis | null, index?: number, options?: PivotCommandOptions): boolean;
    stepField(field: string, axis: PivotAxis, step: -1 | 1, options?: PivotCommandOptions): boolean;
    setFilter(field: string, filter: PivotFilter | null, options?: PivotCommandOptions): boolean;
    setSort(field: string, sort: PivotMemberSort, options?: PivotCommandOptions): boolean;
    setValueSort(valueSort: PivotValueSort | null, options?: PivotCommandOptions): boolean;
    setAggregate(index: number, aggregate: PivotAggregate, options?: PivotCommandOptions): boolean;
    aggregateMenuItems(field: string, index: number, items: PivotAggregate[], source?: PivotEventSource): PivotAggregate[] | null;
    setCalculatedField(name: string, calculatedField: PivotCalculatedField | null, options?: PivotCommandOptions & {
        readonly addToValues?: boolean;
    }): boolean;
    setFormat(field: string, format: PivotFormat | null, options?: PivotCommandOptions): boolean;
    setConditionalFormats(conditionalFormats: readonly PivotConditionalFormat[], options?: PivotCommandOptions): boolean;
    setGrouping(field: string, grouping: PivotGrouping | null, options?: PivotCommandOptions): boolean;
    setTotals(totals: Partial<PivotTotals>, options?: PivotCommandOptions): boolean;
    private isExpanded;
    expand(path: PivotMemberPath, options?: PivotCommandOptions): boolean;
    collapse(path: PivotMemberPath, options?: PivotCommandOptions): boolean;
    toggle(node: PivotHeaderNode, options?: PivotCommandOptions): boolean;
    private drill;
    private expandedPathsFromResult;
    expandAll(axis?: 'rows' | 'columns', options?: PivotCommandOptions): boolean;
    collapseAll(axis?: 'rows' | 'columns', options?: PivotCommandOptions): boolean;
    private drillAll;
    setSelection(cells: readonly PivotCellKey[], options?: PivotCommandOptions & {
        readonly confirmed?: boolean;
    }): boolean;
    getMembers(field: string, options?: {
        search?: string;
        limit?: number;
    }): readonly PivotMember[];
    getMembersAsync(field: string, options?: {
        search?: string;
        limit?: number;
    }): Promise<readonly PivotMember[]>;
    getLoadedMembers(field: string): readonly PivotMember[] | null;
    getCellRows(rowIndex: number, columnIndex: number): readonly Row[];
    getCellRowsAsync(rowIndex: number, columnIndex: number): Promise<readonly Row[]>;
    getCellRowIndexes(rowIndex: number, columnIndex: number): readonly number[];
    drillThrough(rowIndex: number, columnIndex: number, options?: PivotCommandOptions & {
        readonly openDialog?: boolean;
    }): boolean;
    updateRows(changes: readonly {
        readonly index: number;
        readonly row: Row | null;
    }[], action?: PivotDataChangeEvent<Row>['action']): void;
    refresh(): void;
    openDialog(dialog: PivotDialogState, source?: PivotEventSource): boolean;
    closeDialog(): void;
    getState(extra?: Omit<PivotTableState, 'version' | 'pivotModel'>): PivotTableState;
    restoreState(state: PivotTableState | string, source?: PivotEventSource): boolean;
    get isMounted(): boolean;
}
```

The store of one pivot report. Create it with `usePivot()`; pass it to the
pivot parts as `pivot`.

Members (75):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `handlers` | `handlers: Handlers<Row>;` |  | Latest event handlers (replaced on every `usePivot()` render, read when an event fires). |
| `options` | `private options;` |  |  |
| `state` | `private state;` |  |  |
| `listeners` | `private readonly listeners;` |  |  |
| `engine` | `private engine;` |  |  |
| `unsubscribeEngine` | `private unsubscribeEngine;` |  |  |
| `windowed` | `windowed: WindowedPivot \| null;` |  | Window adapter of an asynchronous (Worker) engine; null for the local engine. |
| `memberCache` | `private memberCache;` |  |  |
| `data` | `private data;` |  |  |
| `initial` | `private initial;` |  |  |
| `mounted` | `private mounted;` |  |  |
| `appliedPropKey` | `private appliedPropKey;` |  |  |
| `pending` | `private pending;` |  |  |
| `subscribe` | `readonly subscribe: (listener: Listener) => (() => void);` |  |  |
| `getSnapshot` | `readonly getSnapshot: () => PivotState;` |  |  |
| `result` | `get result(): PivotResult \| null;` |  | Current result (null before the first compute). |
| `status` | `get status(): PivotState['status'];` |  |  |
| `model` | `get model(): PivotModel;` |  |  |
| `getData` | `getData(): readonly Row[];` |  | Raw rows the engine aggregates (after drill-through edits). |
| `set` | `private set;` |  |  |
| `engineOptions` | `private engineOptions;` |  |  |
| `createEngine` | `private createEngine;` |  |  |
| `syncFromEngine` | `private readonly syncFromEngine;` |  | Reads the engine snapshot into the store (also the engine listener). |
| `mount` | `mount(): () => void;` |  | Called from an effect: subscribes to the engine, starts a deferred compute, reports the initial compute. |
| `isLarge` | `private isLarge;` |  |  |
| `whenReady` | `private whenReady;` |  |  |
| `updateOptions` | `updateOptions(options: UsePivotOptions<Row>): void;` |  | Latest options (from `usePivot()` renders): handlers and creation-only fields. |
| `applyModelProp` | `applyModelProp(input: PivotModelInput \| undefined): void;` |  | Applies the reactive `pivotModel` prop when it changed structurally. |
| `applyDataProp` | `applyDataProp(data: readonly Row[] \| undefined): void;` |  | Applies a new `data` prop (identity change). |
| `event` | `private event;` |  |  |
| `allowed` | `private allowed;` |  | Fires a before-event; true when it was not cancelled. |
| `emitCompute` | `private emitCompute;` |  |  |
| `emitError` | `private emitError;` |  |  |
| `run` | `private run;` |  | Runs an engine command with the compute events, the status, and error reporting. |
| `setModel` | `setModel(input: PivotModelInput \| ((model: PivotModel) => PivotModelInput), options?: PivotCommandOptions & {     readonly action?: PivotAction;     readonly field?: string \| null; }): boolean;` |  | Applies a model (cancellable through `onBeforePivotModelChange`). Returns false when the change was cancelled or changed nothing. |
| `commit` | `private commit;` |  | Shared commit path: model before-event, the engine command, the after-event. `apply` runs a specialized engine command (expand, collapse) instead of `setModel`. |
| `applyDraft` | `applyDraft(source?: PivotEventSource): boolean;` |  | Commits the draft model of a deferred field list (Apply). |
| `cancelDraft` | `cancelDraft(): void;` |  | Drops the draft model (Cancel). |
| `beginDraft` | `beginDraft(): void;` |  | Starts a draft from the applied model (a deferred field list opening). |
| `moveField` | `moveField(field: string, to: PivotAxis \| null, index?: number, options?: PivotCommandOptions): boolean;` |  | Moves a field between axes or inside one; `to: null` removes it (cancellable through `onBeforeFieldMove`). |
| `stepField` | `stepField(field: string, axis: PivotAxis, step: -1 \| 1, options?: PivotCommandOptions): boolean;` |  | Moves a field one step inside its axis (Alt+ArrowUp / ArrowDown). |
| `setFilter` | `setFilter(field: string, filter: PivotFilter \| null, options?: PivotCommandOptions): boolean;` |  | Member, label or value filter of a field; null clears it (cancellable through `onBeforeFilterChange`). |
| `setSort` | `setSort(field: string, sort: PivotMemberSort, options?: PivotCommandOptions): boolean;` |  | Member sort of a field (cancellable through `onBeforeSortChange`). |
| `setValueSort` | `setValueSort(valueSort: PivotValueSort \| null, options?: PivotCommandOptions): boolean;` |  | Value sort; null clears it. |
| `setAggregate` | `setAggregate(index: number, aggregate: PivotAggregate, options?: PivotCommandOptions): boolean;` |  | Aggregate of the value field at `index`. |
| `aggregateMenuItems` | `aggregateMenuItems(field: string, index: number, items: PivotAggregate[], source?: PivotEventSource): PivotAggregate[] \| null;` |  | Aggregates the menu offers; `onBeforeAggregateMenuOpen` may cancel or edit `items`. Null when cancelled. |
| `setCalculatedField` | `setCalculatedField(name: string, calculatedField: PivotCalculatedField \| null, options?: PivotCommandOptions & {     readonly addToValues?: boolean; }): boolean;` |  | Adds or replaces a calculated field (by `name`), or removes it (`calculatedField: null`). |
| `setFormat` | `setFormat(field: string, format: PivotFormat \| null, options?: PivotCommandOptions): boolean;` |  | Number or date format of a value field or a member field (null clears it). |
| `setConditionalFormats` | `setConditionalFormats(conditionalFormats: readonly PivotConditionalFormat[], options?: PivotCommandOptions): boolean;` |  |  |
| `setGrouping` | `setGrouping(field: string, grouping: PivotGrouping \| null, options?: PivotCommandOptions): boolean;` |  | Number range, date or custom grouping of a field; null ungroups it. |
| `setTotals` | `setTotals(totals: Partial<PivotTotals>, options?: PivotCommandOptions): boolean;` |  |  |
| `isExpanded` | `private isExpanded;` |  |  |
| `expand` | `expand(path: PivotMemberPath, options?: PivotCommandOptions): boolean;` |  | Expands a member (incremental in the engine). |
| `collapse` | `collapse(path: PivotMemberPath, options?: PivotCommandOptions): boolean;` |  |  |
| `toggle` | `toggle(node: PivotHeaderNode, options?: PivotCommandOptions): boolean;` |  | Expands or collapses a header node. |
| `drill` | `private drill;` |  |  |
| `expandedPathsFromResult` | `private expandedPathsFromResult;` |  | Paths of every expanded node of the current result (to turn `expanded: 'all'` into a list). |
| `expandAll` | `expandAll(axis?: 'rows' \| 'columns', options?: PivotCommandOptions): boolean;` |  | Expands every member of one axis or both (Ctrl+ArrowDown). |
| `collapseAll` | `collapseAll(axis?: 'rows' \| 'columns', options?: PivotCommandOptions): boolean;` |  |  |
| `drillAll` | `private drillAll;` |  |  |
| `setSelection` | `setSelection(cells: readonly PivotCellKey[], options?: PivotCommandOptions & {     readonly confirmed?: boolean; }): boolean;` |  | Replaces the selected cells (cancellable through `onBeforeSelectionChange`). |
| `getMembers` | `getMembers(field: string, options?: {     search?: string;     limit?: number; }): readonly PivotMember[];` |  | Members of a field for the member editor: every member, searchable, no node limit. |
| `getMembersAsync` | `getMembersAsync(field: string, options?: {     search?: string;     limit?: number; }): Promise<readonly PivotMember[]>;` |  | Members, waiting for an asynchronous engine. |
| `getLoadedMembers` | `getLoadedMembers(field: string): readonly PivotMember[] \| null;` |  | Members already loaded by `getMembersAsync()` (null when not loaded yet). |
| `getCellRows` | `getCellRows(rowIndex: number, columnIndex: number): readonly Row[];` |  | Raw rows behind a value cell. |
| `getCellRowsAsync` | `getCellRowsAsync(rowIndex: number, columnIndex: number): Promise<readonly Row[]>;` |  | Raw rows behind a value cell, waiting for an asynchronous engine. |
| `getCellRowIndexes` | `getCellRowIndexes(rowIndex: number, columnIndex: number): readonly number[];` |  | Raw row indexes behind a value cell. |
| `drillThrough` | `drillThrough(rowIndex: number, columnIndex: number, options?: PivotCommandOptions & {     readonly openDialog?: boolean; }): boolean;` |  | Opens drill through for a value cell (cancellable through `onBeforeDrillThrough`). `openDialog: false` only fires the events (an app with its own UI). |
| `updateRows` | `updateRows(changes: readonly {     readonly index: number;     readonly row: Row \| null; }[], action?: PivotDataChangeEvent<Row>['action']): void;` |  | Writes edited raw rows (drill-through editing): replaces the rows at `index`, appends `index: -1` rows, removes `row: null` rows, then re-aggregates incrementally and fires `onDataChange`. |
| `refresh` | `refresh(): void;` |  | Re-reads the data and recomputes. |
| `openDialog` | `openDialog(dialog: PivotDialogState, source?: PivotEventSource): boolean;` |  |  |
| `closeDialog` | `closeDialog(): void;` |  |  |
| `getState` | `getState(extra?: Omit<PivotTableState, 'version' \| 'pivotModel'>): PivotTableState;` |  |  |
| `restoreState` | `restoreState(state: PivotTableState \| string, source?: PivotEventSource): boolean;` |  | Applies a saved state; false (with `onError`) when it is not a pivot state of a known version. |
| `isMounted` | `get isMounted(): boolean;` |  | True while mounted (effects ran). |

## Interfaces

### PivotAggregateMenuOpenEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotAggregateMenuOpenEvent

```ts
interface PivotAggregateMenuOpenEvent extends PivotEvent {
    readonly field: string;
    readonly index: number;
    readonly items: PivotAggregate[];
}
```

`onBeforeAggregateMenuOpen`.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `index` | `readonly index: number;` |  | Position in `pivotModel.values`. |
| `items` | `readonly items: PivotAggregate[];` |  | Aggregates offered; edit with `items` (mutable copy). |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotAxisBarOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotAxisBarOptions

```ts
interface PivotAxisBarOptions {
    readonly showFieldsPanel?: boolean | undefined;
    readonly showAggregate?: boolean | undefined;
    readonly showFilter?: boolean | undefined;
    readonly showSort?: boolean | undefined;
    readonly showRemove?: boolean | undefined;
    readonly draggable?: boolean | undefined;
    readonly axes?: readonly PivotAxis[] | undefined;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `showFieldsPanel` | `readonly showFieldsPanel?: boolean \| undefined;` | optional | The fields panel (fields not on the report). Default false. |
| `showAggregate` | `readonly showAggregate?: boolean \| undefined;` | optional | Aggregate menu on value field buttons. Default true. |
| `showFilter` | `readonly showFilter?: boolean \| undefined;` | optional |  |
| `showSort` | `readonly showSort?: boolean \| undefined;` | optional |  |
| `showRemove` | `readonly showRemove?: boolean \| undefined;` | optional |  |
| `draggable` | `readonly draggable?: boolean \| undefined;` | optional |  |
| `axes` | `readonly axes?: readonly PivotAxis[] \| undefined;` | optional | Axes shown. Default every axis. |

### PivotAxisBarProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotAxisBarProps

```ts
interface PivotAxisBarProps<Row = unknown> extends PivotAxisBarOptions {
    readonly pivot: PivotController<Row>;
    readonly aggregateOptions?: readonly PivotAggregate[] | undefined;
    readonly localeText?: PivotLocaleText | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `readonly pivot: PivotController<Row>;` |  |  |
| `aggregateOptions` | `readonly aggregateOptions?: readonly PivotAggregate[] \| undefined;` | optional |  |
| `localeText` | `readonly localeText?: PivotLocaleText \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `showFieldsPanel` | `showFieldsPanel?: boolean;` | optional, inherited | The fields panel (fields not on the report). Default false. |
| `showAggregate` | `showAggregate?: boolean;` | optional, inherited | Aggregate menu on value field buttons. Default true. |
| `showFilter` | `showFilter?: boolean;` | optional, inherited |  |
| `showSort` | `showSort?: boolean;` | optional, inherited |  |
| `showRemove` | `showRemove?: boolean;` | optional, inherited |  |
| `draggable` | `draggable?: boolean;` | optional, inherited |  |
| `axes` | `axes?: readonly PivotAxis[];` | optional, inherited | Axes shown. Default every axis. |

### PivotCalculatedFieldChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotCalculatedFieldChangeEvent

```ts
interface PivotCalculatedFieldChangeEvent extends PivotEvent {
    readonly name: string;
    readonly calculatedField: PivotCalculatedField | null;
    readonly previous: PivotCalculatedField | null;
}
```

`onBeforeCalculatedFieldChange` / `onCalculatedFieldChange`.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `calculatedField` | `readonly calculatedField: PivotCalculatedField \| null;` |  | The new definition, or null when removed. |
| `previous` | `readonly previous: PivotCalculatedField \| null;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotCellClickEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotCellClickEvent

```ts
interface PivotCellClickEvent extends PivotEvent {
    readonly cell: PivotCell | null;
    readonly rowHeader: PivotHeaderNode;
    readonly rowKey: string;
    readonly columnKey: string | null;
    readonly element: HTMLElement;
    readonly nativeEvent: MouseEvent;
}
```

`onCellClick`.

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `cell` | `readonly cell: PivotCell \| null;` |  | Value cell, or null for a row header cell. |
| `rowHeader` | `readonly rowHeader: PivotHeaderNode;` |  | Row header of the clicked row. |
| `rowKey` | `readonly rowKey: string;` |  |  |
| `columnKey` | `readonly columnKey: string \| null;` |  |  |
| `element` | `readonly element: HTMLElement;` |  |  |
| `nativeEvent` | `readonly nativeEvent: MouseEvent;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotCellContext

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotCellContext

```ts
interface PivotCellContext {
    readonly cell: PivotCell;
    readonly rowHeader: PivotHeaderNode;
    readonly columnHeader: PivotHeaderNode;
    readonly selected: boolean;
    readonly defaultContent: ReactNode;
}
```

Context of `renderCell` / `getCellClassName`.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `cell` | `readonly cell: PivotCell;` |  |  |
| `rowHeader` | `readonly rowHeader: PivotHeaderNode;` |  |  |
| `columnHeader` | `readonly columnHeader: PivotHeaderNode;` |  |  |
| `selected` | `readonly selected: boolean;` |  |  |
| `defaultContent` | `readonly defaultContent: ReactNode;` |  | The default content (the formatted value, or `emptyCellText`). |

### PivotCellKey

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotCellKey

```ts
interface PivotCellKey {
    readonly rowKey: string;
    readonly columnKey: string;
}
```

A selected cell (`rowKey|columnKey`).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowKey` | `readonly rowKey: string;` |  |  |
| `columnKey` | `readonly columnKey: string;` |  |  |

### PivotChartData

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartData

```ts
interface PivotChartData {
    readonly data: readonly Readonly<Record<string, string | number | null>>[];
    readonly series: readonly PivotChartSeries[];
    readonly categories: readonly string[];
    readonly measure: string | null;
    pointAt(seriesId: string, index: number): PivotChartPoint | null;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly Readonly<Record<string, string \| number \| null>>[];` |  | One record per category: `{ category, [seriesId]: value }`. |
| `series` | `readonly series: readonly PivotChartSeries[];` |  |  |
| `categories` | `readonly categories: readonly string[];` |  |  |
| `measure` | `readonly measure: string \| null;` |  |  |
| `pointAt` | `pointAt(seriesId: string, index: number): PivotChartPoint \| null;` |  | The pivot cell behind point `index` of `seriesId`, or null. |

### PivotChartPoint

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartPoint

```ts
interface PivotChartPoint {
    readonly rowIndex: number;
    readonly columnIndex: number;
    readonly rowKey: string;
    readonly columnKey: string;
    readonly categoryPath: PivotMemberPath;
    readonly categoryExpandable: boolean;
    readonly parentPath: PivotMemberPath | null;
}
```

Where a chart point comes from (drill down, drill through).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowIndex` | `readonly rowIndex: number;` |  |  |
| `columnIndex` | `readonly columnIndex: number;` |  |  |
| `rowKey` | `readonly rowKey: string;` |  |  |
| `columnKey` | `readonly columnKey: string;` |  |  |
| `categoryPath` | `readonly categoryPath: PivotMemberPath;` |  | Member path of the category (`['rows', ...]` or `['columns', ...]`), for `pivot.expand(path)`. |
| `categoryExpandable` | `readonly categoryExpandable: boolean;` |  |  |
| `parentPath` | `readonly parentPath: PivotMemberPath \| null;` |  | Member path of the category's parent (drill up, `pivot.collapse(path)`), or null for a top-level member. |

### PivotChartProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartProps-interface

```ts
interface PivotChartProps {
    readonly data: NonNullable<ChartProps['data']>;
    readonly series: readonly PivotChartSeries[];
    readonly xAxis: ChartAxisOptions;
    readonly yAxis: ChartAxisOptions;
    readonly coordinate?: 'polar' | 'radar';
    readonly onPointClick: NonNullable<ChartProps['onPointClick']>;
}
```

The `Chart` props of a pivot (spread them on `<Chart>` from `@salmonui/charts/chart`).

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: NonNullable<ChartProps['data']>;` |  |  |
| `series` | `readonly series: readonly PivotChartSeries[];` |  |  |
| `xAxis` | `readonly xAxis: ChartAxisOptions;` |  |  |
| `yAxis` | `readonly yAxis: ChartAxisOptions;` |  |  |
| `coordinate` | `readonly coordinate?: 'polar' \| 'radar';` | optional | `'polar'` or `'radar'` for those pivot chart types (`Chart` needs `features={[polar]}`). |
| `onPointClick` | `readonly onPointClick: NonNullable<ChartProps['onPointClick']>;` |  |  |

### PivotChartPropsOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartPropsOptions

```ts
interface PivotChartPropsOptions extends PivotToSeriesOptions {
    readonly drill?: PivotChartDrillMode | false | undefined;
    readonly onPointClick?: ((ctx: ChartPointContext, point: PivotChartPoint | null, event: ChartClickEvent) => void) | undefined;
    readonly xAxis?: ChartAxisOptions | undefined;
    readonly yAxis?: ChartAxisOptions | undefined;
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `drill` | `readonly drill?: PivotChartDrillMode \| false \| undefined;` | optional | Point click action (`drillChartPoint` mode). Default `'auto'`; `false` leaves clicks to `onPointClick`. |
| `onPointClick` | `readonly onPointClick?: ((ctx: ChartPointContext, point: PivotChartPoint \| null, event: ChartClickEvent) => void) \| undefined;` | optional | Called after the drill with the clicked point and its pivot cell (null when the point has none). |
| `xAxis` | `readonly xAxis?: ChartAxisOptions \| undefined;` | optional | Category axis options, merged over `{ scale: 'category' }`. |
| `yAxis` | `readonly yAxis?: ChartAxisOptions \| undefined;` | optional | Value axis options; the default title is the measure caption. |
| `measure` | `measure?: string;` | optional, inherited | Measure (value field name) to chart. Default: the first value field. |
| `seriesBy` | `seriesBy?: "columns" \| "rows";` | optional, inherited | Members on the series: `'columns'` (default: one series per column member, categories are row members) or `'rows'`. |
| `type` | `type?: PivotChartSeriesType;` | optional, inherited | Series type. Default `'column'`. |
| `includeTotals` | `includeTotals?: boolean;` | optional, inherited | Include subtotal and grand total members. Default false. |
| `labelSeparator` | `labelSeparator?: string;` | optional, inherited | Category member labels joined with this text for nested members. Default `' / '`. |

### PivotChartSeries

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartSeries

```ts
interface PivotChartSeries extends ChartSeriesOptions {
    readonly id: string;
    readonly name: string;
    readonly type: ChartSeriesType;
    readonly xField: 'category';
    readonly yField: string;
    readonly pivotType: PivotChartSeriesType;
}
```

One `Chart` series (`ChartSeriesOptions`) of a pivot measure.

Members (64):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  | Stable id (default: `name`, then `yField`, then the index). |
| `name` | `readonly name: string;` |  |  |
| `type` | `readonly type: ChartSeriesType;` |  |  |
| `xField` | `readonly xField: 'category';` |  | The category field of `data` records. |
| `yField` | `readonly yField: string;` |  | The field of this series in `data` records (the series id). |
| `pivotType` | `readonly pivotType: PivotChartSeriesType;` |  | The requested pivot chart type (`type` is the `Chart` series type it draws as). |
| `data` | `data?: readonly Readonly<Record<string, unknown>>[];` | optional, inherited | Per-series data (default: the chart `data`). |
| `lowField` | `lowField?: string;` | optional, inherited |  |
| `highField` | `highField?: string;` | optional, inherited |  |
| `openField` | `openField?: string;` | optional, inherited |  |
| `closeField` | `closeField?: string;` | optional, inherited |  |
| `volumeField` | `volumeField?: string;` | optional, inherited |  |
| `sizeField` | `sizeField?: string;` | optional, inherited |  |
| `colorField` | `colorField?: string;` | optional, inherited |  |
| `tooltipField` | `tooltipField?: string;` | optional, inherited |  |
| `targetField` | `targetField?: string \| readonly string[];` | optional, inherited | Bullet target field(s). |
| `targetShapes` | `targetShapes?: readonly ("circle" \| "cross" \| "line")[];` | optional, inherited | Bullet target glyphs per target field. |
| `targetColor` | `targetColor?: string;` | optional, inherited | Bullet target data color. |
| `valueShape` | `valueShape?: "bar" \| "dot";` | optional, inherited | Bullet feature glyph: a bar from zero (default) or a dot at the value. |
| `xAxis` | `xAxis?: string;` | optional, inherited |  |
| `yAxis` | `yAxis?: string;` | optional, inherited |  |
| `curve` | `curve?: ChartCurve;` | optional, inherited |  |
| `tension` | `tension?: number;` | optional, inherited |  |
| `stepPosition` | `stepPosition?: "center" \| "end" \| "start";` | optional, inherited |  |
| `risers` | `risers?: boolean;` | optional, inherited |  |
| `stack` | `stack?: "percent" \| boolean;` | optional, inherited |  |
| `stackGroup` | `stackGroup?: string;` | optional, inherited |  |
| `bandWidth` | `bandWidth?: number;` | optional, inherited | Band width as a fraction (0..1) of the category or as px (> 1). |
| `gap` | `gap?: number;` | optional, inherited |  |
| `group` | `group?: string;` | optional, inherited | Columns with the same group share a slot (overlap). |
| `radius` | `radius?: readonly [number, number];` | optional, inherited |  |
| `closed` | `closed?: boolean;` | optional, inherited |  |
| `upColor` | `upColor?: string;` | optional, inherited |  |
| `downColor` | `downColor?: string;` | optional, inherited |  |
| `hollow` | `hollow?: boolean;` | optional, inherited |  |
| `totals` | `totals?: readonly number[] \| ((index: number) => boolean);` | optional, inherited |  |
| `subtotals` | `subtotals?: readonly number[] \| ((index: number) => boolean);` | optional, inherited |  |
| `connectors` | `connectors?: boolean;` | optional, inherited |  |
| `binWidth` | `binWidth?: number;` | optional, inherited |  |
| `normalCurve` | `normalCurve?: boolean;` | optional, inherited |  |
| `quartileMethod` | `quartileMethod?: "exclusive" \| "inclusive" \| "normal";` | optional, inherited |  |
| `mean` | `mean?: boolean;` | optional, inherited |  |
| `outliers` | `outliers?: boolean;` | optional, inherited |  |
| `errorBars` | `errorBars?: ChartErrorBars;` | optional, inherited |  |
| `pareto` | `pareto?: { readonly line?: boolean \| undefined; readonly markers?: boolean \| undefined; readonly color?: string \| undefined; };` | optional, inherited | Pareto cumulative line options (`type: 'pareto'`). |
| `segments` | `segments?: readonly ChartSegment[];` | optional, inherited |  |
| `segmentAxis` | `segmentAxis?: "x" \| "y";` | optional, inherited |  |
| `trendlines` | `trendlines?: readonly ChartTrendline[];` | optional, inherited |  |
| `hidden` | `hidden?: boolean;` | optional, inherited |  |
| `order` | `order?: number;` | optional, inherited |  |
| `opacity` | `opacity?: number;` | optional, inherited |  |
| `color` | `color?: string;` | optional, inherited | Data color (not a theme token); default: the palette slot. |
| `lineStyle` | `lineStyle?: ChartLineStyle;` | optional, inherited |  |
| `markers` | `markers?: boolean \| ChartMarkers;` | optional, inherited |  |
| `renderMarker` | `renderMarker?: ((ctx: ChartPointContext) => ReactNode);` | optional, inherited | SVG content in place of each marker, centered on the point (`<image>`, any shape). |
| `labels` | `labels?: boolean \| ChartDataLabels;` | optional, inherited |  |
| `legendShape` | `legendShape?: ChartLegendShape;` | optional, inherited |  |
| `tooltip` | `tooltip?: boolean;` | optional, inherited |  |
| `editable` | `editable?: boolean \| { readonly min?: number \| undefined; readonly max?: number \| undefined; readonly step?: number \| undefined; };` | optional, inherited | Point drag and keyboard editing of y values; the change is reported, the application updates `data`. |
| `description` | `description?: string;` | optional, inherited |  |
| `emptyPoints` | `emptyPoints?: "average" \| "drop" \| "gap" \| "zero";` | optional, inherited |  |
| `lastValue` | `lastValue?: boolean \| { readonly format?: ChartFormat \| undefined; };` | optional, inherited |  |
| `inlineLabel` | `inlineLabel?: boolean;` | optional, inherited |  |
| `getPointStyle` | `getPointStyle?: ((ctx: ChartPointContext) => { readonly color?: string; readonly hidden?: boolean; } \| undefined);` | optional, inherited | Per-point style: data color or hidden. Called only for drawn points. |

### PivotCommandOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotCommandOptions

```ts
interface PivotCommandOptions {
    readonly source?: PivotEventSource | undefined;
    readonly draft?: boolean | undefined;
}
```

Options of a model command.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `source` | `readonly source?: PivotEventSource \| undefined;` | optional | Input that caused the command. Default `'api'`. |
| `draft` | `readonly draft?: boolean \| undefined;` | optional | Edit the draft model (a field list with `deferUpdate`) instead of the applied one. |

### PivotComputeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotComputeEvent

```ts
interface PivotComputeEvent extends PivotEvent {
    readonly phase: 'initial' | 'update';
    readonly status: PivotComputeStatus;
    readonly duration: number;
    readonly result: PivotResult | null;
}
```

`onComputeStart` / `onComputeEnd`.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `phase` | `readonly phase: 'initial' \| 'update';` |  |  |
| `status` | `readonly status: PivotComputeStatus;` |  |  |
| `duration` | `readonly duration: number;` |  | Milliseconds from start to end (end event only; 0 on start). |
| `result` | `readonly result: PivotResult \| null;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotDataChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotDataChangeEvent

```ts
interface PivotDataChangeEvent<Row = unknown> {
    readonly data: readonly Row[];
    readonly changes: readonly {
        readonly index: number;
        readonly row: Row;
        readonly previous: Row | undefined;
    }[];
    readonly action: 'update' | 'add' | 'delete';
}
```

`onDataChange`: drill-through edits wrote these rows.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly Row[];` |  |  |
| `changes` | `readonly changes: readonly {     readonly index: number;     readonly row: Row;     readonly previous: Row \| undefined; }[];` |  |  |
| `action` | `readonly action: 'update' \| 'add' \| 'delete';` |  |  |

### PivotDisplayProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotDisplayProps

```ts
interface PivotDisplayProps {
    rowHeight?: number | undefined;
    columnWidth?: number | undefined;
    rowHeaderWidth?: number | undefined;
    height?: number | string | undefined;
    resizable?: boolean | undefined;
    reorderable?: boolean | undefined;
    textWrap?: boolean | 'header' | 'content' | 'both' | undefined;
    overflow?: 'clip' | 'ellipsis' | 'ellipsisWithTooltip' | undefined;
    gridLines?: 'default' | 'both' | 'none' | 'horizontal' | 'vertical' | undefined;
    striped?: boolean | undefined;
    highlightOnHover?: boolean | undefined;
}
```

Display props forwarded to the Data Grid renderer by whitelist.

Members (11):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowHeight` | `rowHeight?: number \| undefined;` | optional |  |
| `columnWidth` | `columnWidth?: number \| undefined;` | optional | Value column width in px. Default 120. |
| `rowHeaderWidth` | `rowHeaderWidth?: number \| undefined;` | optional | Row header column width in px (compact) or per row field (tabular). Default 220 / 150. |
| `height` | `height?: number \| string \| undefined;` | optional |  |
| `resizable` | `resizable?: boolean \| undefined;` | optional |  |
| `reorderable` | `reorderable?: boolean \| undefined;` | optional |  |
| `textWrap` | `textWrap?: boolean \| 'header' \| 'content' \| 'both' \| undefined;` | optional |  |
| `overflow` | `overflow?: 'clip' \| 'ellipsis' \| 'ellipsisWithTooltip' \| undefined;` | optional |  |
| `gridLines` | `gridLines?: 'default' \| 'both' \| 'none' \| 'horizontal' \| 'vertical' \| undefined;` | optional |  |
| `striped` | `striped?: boolean \| undefined;` | optional |  |
| `highlightOnHover` | `highlightOnHover?: boolean \| undefined;` | optional |  |

### PivotDrillThroughEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotDrillThroughEvent

```ts
interface PivotDrillThroughEvent<Row = unknown> extends PivotEvent {
    readonly rowKey: string;
    readonly columnKey: string;
    readonly measure: string | null;
    readonly rowIndex: number;
    readonly columnIndex: number;
    readonly cell: PivotCell;
    rows(): readonly Row[];
}
```

`onBeforeDrillThrough` / `onDrillThrough`.

Members (11):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `rowKey` | `readonly rowKey: string;` |  |  |
| `columnKey` | `readonly columnKey: string;` |  |  |
| `measure` | `readonly measure: string \| null;` |  |  |
| `rowIndex` | `readonly rowIndex: number;` |  |  |
| `columnIndex` | `readonly columnIndex: number;` |  |  |
| `cell` | `readonly cell: PivotCell;` |  |  |
| `rows` | `rows(): readonly Row[];` |  | The raw rows behind the cell (computed on call). |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotErrorEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotErrorEvent

```ts
interface PivotErrorEvent extends PivotEvent {
    readonly error: Error;
    readonly action: PivotAction | 'compute' | 'drillThrough' | 'export' | 'restore';
}
```

`onError`.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `error` | `readonly error: Error;` |  |  |
| `action` | `readonly action: PivotAction \| 'compute' \| 'drillThrough' \| 'export' \| 'restore';` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotEventHandlers

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotEventHandlers

```ts
interface PivotEventHandlers<Row = unknown> {
    onBeforePivotModelChange?: ((event: PivotModelChangeEvent) => void) | undefined;
    onPivotModelChange?: ((event: PivotModelChangeEvent) => void) | undefined;
    onBeforeExpandedChange?: ((event: PivotExpandedChangeEvent) => void) | undefined;
    onExpandedChange?: ((event: PivotExpandedChangeEvent) => void) | undefined;
    onBeforeFilterChange?: ((event: PivotFilterChangeEvent) => void) | undefined;
    onFilterChange?: ((event: PivotFilterChangeEvent) => void) | undefined;
    onBeforeSortChange?: ((event: PivotSortChangeEvent) => void) | undefined;
    onSortChange?: ((event: PivotSortChangeEvent) => void) | undefined;
    onBeforeFieldMove?: ((event: PivotFieldMoveEvent) => void) | undefined;
    onFieldMove?: ((event: PivotFieldMoveEvent) => void) | undefined;
    onBeforeMemberEditorOpen?: ((event: PivotMemberEditorOpenEvent) => void) | undefined;
    onBeforeAggregateMenuOpen?: ((event: PivotAggregateMenuOpenEvent) => void) | undefined;
    onBeforeCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void) | undefined;
    onCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void) | undefined;
    onBeforeDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void) | undefined;
    onDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void) | undefined;
    onBeforeSelectionChange?: ((event: PivotSelectionChangeEvent) => void) | undefined;
    onSelectionChange?: ((event: PivotSelectionChangeEvent) => void) | undefined;
    onDataChange?: ((event: PivotDataChangeEvent<Row>) => void) | undefined;
    onComputeStart?: ((event: PivotComputeEvent) => void) | undefined;
    onComputeEnd?: ((event: PivotComputeEvent) => void) | undefined;
    onBeforeExport?: ((event: PivotExportEvent) => void) | undefined;
    onExport?: ((event: PivotExportEvent) => void) | undefined;
    onError?: ((event: PivotErrorEvent) => void) | undefined;
}
```

Event handlers shared by `usePivot()` and `PivotTable` (the controller reads the latest ones).

Members (24):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `onBeforePivotModelChange` | `onBeforePivotModelChange?: ((event: PivotModelChangeEvent) => void) \| undefined;` | optional |  |
| `onPivotModelChange` | `onPivotModelChange?: ((event: PivotModelChangeEvent) => void) \| undefined;` | optional |  |
| `onBeforeExpandedChange` | `onBeforeExpandedChange?: ((event: PivotExpandedChangeEvent) => void) \| undefined;` | optional |  |
| `onExpandedChange` | `onExpandedChange?: ((event: PivotExpandedChangeEvent) => void) \| undefined;` | optional |  |
| `onBeforeFilterChange` | `onBeforeFilterChange?: ((event: PivotFilterChangeEvent) => void) \| undefined;` | optional |  |
| `onFilterChange` | `onFilterChange?: ((event: PivotFilterChangeEvent) => void) \| undefined;` | optional |  |
| `onBeforeSortChange` | `onBeforeSortChange?: ((event: PivotSortChangeEvent) => void) \| undefined;` | optional |  |
| `onSortChange` | `onSortChange?: ((event: PivotSortChangeEvent) => void) \| undefined;` | optional |  |
| `onBeforeFieldMove` | `onBeforeFieldMove?: ((event: PivotFieldMoveEvent) => void) \| undefined;` | optional |  |
| `onFieldMove` | `onFieldMove?: ((event: PivotFieldMoveEvent) => void) \| undefined;` | optional |  |
| `onBeforeMemberEditorOpen` | `onBeforeMemberEditorOpen?: ((event: PivotMemberEditorOpenEvent) => void) \| undefined;` | optional |  |
| `onBeforeAggregateMenuOpen` | `onBeforeAggregateMenuOpen?: ((event: PivotAggregateMenuOpenEvent) => void) \| undefined;` | optional |  |
| `onBeforeCalculatedFieldChange` | `onBeforeCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void) \| undefined;` | optional |  |
| `onCalculatedFieldChange` | `onCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void) \| undefined;` | optional |  |
| `onBeforeDrillThrough` | `onBeforeDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void) \| undefined;` | optional |  |
| `onDrillThrough` | `onDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void) \| undefined;` | optional |  |
| `onBeforeSelectionChange` | `onBeforeSelectionChange?: ((event: PivotSelectionChangeEvent) => void) \| undefined;` | optional |  |
| `onSelectionChange` | `onSelectionChange?: ((event: PivotSelectionChangeEvent) => void) \| undefined;` | optional |  |
| `onDataChange` | `onDataChange?: ((event: PivotDataChangeEvent<Row>) => void) \| undefined;` | optional |  |
| `onComputeStart` | `onComputeStart?: ((event: PivotComputeEvent) => void) \| undefined;` | optional |  |
| `onComputeEnd` | `onComputeEnd?: ((event: PivotComputeEvent) => void) \| undefined;` | optional |  |
| `onBeforeExport` | `onBeforeExport?: ((event: PivotExportEvent) => void) \| undefined;` | optional |  |
| `onExport` | `onExport?: ((event: PivotExportEvent) => void) \| undefined;` | optional |  |
| `onError` | `onError?: ((event: PivotErrorEvent) => void) \| undefined;` | optional |  |

### PivotExpandedChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotExpandedChangeEvent

```ts
interface PivotExpandedChangeEvent extends PivotEvent {
    readonly action: 'expand' | 'collapse' | 'expandAll' | 'collapseAll';
    readonly path: PivotMemberPath | null;
    readonly axis: 'rows' | 'columns' | null;
    readonly expanded: boolean;
}
```

`onBeforeExpandedChange` / `onExpandedChange`.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `action` | `readonly action: 'expand' \| 'collapse' \| 'expandAll' \| 'collapseAll';` |  |  |
| `path` | `readonly path: PivotMemberPath \| null;` |  | The member drilled, or null for expand / collapse all. |
| `axis` | `readonly axis: 'rows' \| 'columns' \| null;` |  |  |
| `expanded` | `readonly expanded: boolean;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotExportEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotExportEvent

```ts
interface PivotExportEvent extends PivotEvent {
    readonly format: 'xlsx' | 'csv' | 'pdf' | 'print';
    readonly fileName: string;
}
```

`onBeforeExport` / `onExport`.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `format` | `readonly format: 'xlsx' \| 'csv' \| 'pdf' \| 'print';` |  |  |
| `fileName` | `readonly fileName: string;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotExportFile

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotExportFile

```ts
interface PivotExportFile {
    readonly fileName: string;
    readonly mimeType: string;
    readonly data: Uint8Array | string | Blob;
}
```

A written export file (`api.exportToExcel()` and friends resolve with it; null when cancelled).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `fileName` | `readonly fileName: string;` |  |  |
| `mimeType` | `readonly mimeType: string;` |  |  |
| `data` | `readonly data: Uint8Array \| string \| Blob;` |  |  |

### PivotExportOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotExportOptions

```ts
interface PivotExportOptions {
    readonly fileName?: string | undefined;
    readonly download?: boolean | undefined;
    readonly chart?: ExportImage | readonly ExportImage[] | undefined;
    readonly escapeFormulas?: boolean | undefined;
    readonly [option: string]: unknown;
}
```

Options of `api.exportToExcel()` / `exportToCsv()` / `exportToPdf()`, passed through to `exportPivot()` (file name, row layout, styles, `cell` hook, ...).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `fileName` | `readonly fileName?: string \| undefined;` | optional | File name without extension. Default `pivot`. |
| `download` | `readonly download?: boolean \| undefined;` | optional | Return the file instead of downloading it (the promise still resolves after the write). |
| `chart` | `readonly chart?: ExportImage \| readonly ExportImage[] \| undefined;` | optional | PDF only: chart image(s) on their own pages after the table (`pivotChartImage(chartApi)`). |
| `escapeFormulas` | `readonly escapeFormulas?: boolean \| undefined;` | optional | CSV only: neutralize spreadsheet formulas in text cells. Default true; `false` writes raw text. |

### PivotExportWriters

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotExportWriters

```ts
interface PivotExportWriters {
    readonly pivot?: (() => Promise<PivotWriterModule>) | undefined;
}
```

Loader of the pivot writers: a dynamic import of the `pivot` subpath of the

- `@salmonui`

/export package (a dynamic
import, so the writers stay out of the app's initial JS). Excel and PDF need it; CSV and print work
without it.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `readonly pivot?: (() => Promise<PivotWriterModule>) \| undefined;` | optional |  |

### PivotFieldListProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotFieldListProps

```ts
interface PivotFieldListProps<Row = unknown> {
    readonly pivot: PivotController<Row>;
    readonly deferUpdate?: boolean | undefined;
    readonly searchable?: boolean | undefined;
    readonly fieldOrder?: 'none' | 'asc' | 'desc' | readonly string[] | undefined;
    readonly aggregateOptions?: readonly PivotAggregate[] | undefined;
    readonly localeText?: PivotLocaleText | undefined;
    readonly onDone?: (() => void) | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly 'aria-label'?: string | undefined;
}
```

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `readonly pivot: PivotController<Row>;` |  |  |
| `deferUpdate` | `readonly deferUpdate?: boolean \| undefined;` | optional | Edit a draft model and commit it with Apply. |
| `searchable` | `readonly searchable?: boolean \| undefined;` | optional | Field search box. Default true. |
| `fieldOrder` | `readonly fieldOrder?: 'none' \| 'asc' \| 'desc' \| readonly string[] \| undefined;` | optional | Order of the field list: `'none'` (definition order, default), `'asc'`, `'desc'`, or field names in order. |
| `aggregateOptions` | `readonly aggregateOptions?: readonly PivotAggregate[] \| undefined;` | optional |  |
| `localeText` | `readonly localeText?: PivotLocaleText \| undefined;` | optional |  |
| `onDone` | `readonly onDone?: (() => void) \| undefined;` | optional | Called after Apply or Cancel (a popup closes itself). |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string \| undefined;` | optional |  |

### PivotFieldMoveEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotFieldMoveEvent

```ts
interface PivotFieldMoveEvent extends PivotEvent {
    readonly field: string;
    readonly from: PivotAxis | null;
    readonly to: PivotAxis | null;
    readonly index: number;
}
```

`onBeforeFieldMove` / `onFieldMove`.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `from` | `readonly from: PivotAxis \| null;` |  |  |
| `to` | `readonly to: PivotAxis \| null;` |  | Null removes the field from the report. |
| `index` | `readonly index: number;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotFilterChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotFilterChangeEvent

```ts
interface PivotFilterChangeEvent extends PivotEvent {
    readonly field: string;
    readonly filter: PivotFilter | null;
    readonly previousFilter: PivotFilter | null;
}
```

`onBeforeFilterChange` / `onFilterChange`.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `filter` | `readonly filter: PivotFilter \| null;` |  |  |
| `previousFilter` | `readonly previousFilter: PivotFilter \| null;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotHeaderContext

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotHeaderContext

```ts
interface PivotHeaderContext {
    readonly header: PivotHeaderNode;
    readonly axis: 'rows' | 'columns';
    readonly defaultContent: ReactNode;
}
```

Context of `renderHeader`: row and column headers.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `header` | `readonly header: PivotHeaderNode;` |  |  |
| `axis` | `readonly axis: 'rows' \| 'columns';` |  |  |
| `defaultContent` | `readonly defaultContent: ReactNode;` |  |  |

### PivotLoadingContext

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotLoadingContext

```ts
interface PivotLoadingContext {
    readonly status: PivotComputeStatus;
}
```

Context of `renderLoading`.

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `status` | `readonly status: PivotComputeStatus;` |  |  |

### PivotMemberEditorOpenEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotMemberEditorOpenEvent

```ts
interface PivotMemberEditorOpenEvent extends PivotEvent {
    readonly field: string;
}
```

`onBeforeMemberEditorOpen`.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotModelChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotModelChangeEvent

```ts
interface PivotModelChangeEvent extends PivotEvent {
    readonly action: PivotAction;
    readonly model: PivotModel;
    readonly previousModel: PivotModel;
    readonly field: string | null;
}
```

`onBeforePivotModelChange` / `onPivotModelChange`.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `action` | `readonly action: PivotAction;` |  |  |
| `model` | `readonly model: PivotModel;` |  | The model proposed (before) or applied (after). |
| `previousModel` | `readonly previousModel: PivotModel;` |  |  |
| `field` | `readonly field: string \| null;` |  | Field the action is about, or null. |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotPersistState

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotPersistState

```ts
interface PivotPersistState {
    readonly id: string;
    readonly storage?: {
        getItem(key: string): string | null;
        setItem(key: string, value: string): void;
        removeItem?(key: string): void;
    } | undefined;
    readonly version?: string | undefined;
}
```

Persistence.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  | Storage key suffix: `salmon-pivot-table:<id>`. |
| `storage` | `readonly storage?: {     getItem(key: string): string \| null;     setItem(key: string, value: string): void;     removeItem?(key: string): void; } \| undefined;` | optional | Default `localStorage`. |
| `version` | `readonly version?: string \| undefined;` | optional | Saved states of another application version are ignored. |

### PivotSelectionChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotSelectionChangeEvent

```ts
interface PivotSelectionChangeEvent extends PivotEvent {
    readonly cells: readonly PivotCellKey[];
    readonly keys: readonly string[];
}
```

`onBeforeSelectionChange` / `onSelectionChange`.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `cells` | `readonly cells: readonly PivotCellKey[];` |  |  |
| `keys` | `readonly keys: readonly string[];` |  | `rowKey\|columnKey` strings. |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotSortChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotSortChangeEvent

```ts
interface PivotSortChangeEvent extends PivotEvent {
    readonly field: string | null;
    readonly sort: PivotMemberSort | null;
    readonly valueSort: PivotValueSort | null;
}
```

`onBeforeSortChange` / `onSortChange` (member sort and value sort).

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string \| null;` |  |  |
| `sort` | `readonly sort: PivotMemberSort \| null;` |  |  |
| `valueSort` | `readonly valueSort: PivotValueSort \| null;` |  |  |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotState

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotState

```ts
interface PivotState {
    readonly result: PivotResult | null;
    readonly model: PivotModel;
    readonly draft: PivotModel | null;
    readonly status: PivotComputeStatus;
    readonly error: Error | null;
    readonly fields: readonly PivotFieldInfo[];
    readonly selection: readonly string[];
    readonly dialog: PivotDialogState | null;
}
```

Snapshot of the controller store; every field keeps its identity until it changes.

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `result` | `readonly result: PivotResult \| null;` |  |  |
| `model` | `readonly model: PivotModel;` |  |  |
| `draft` | `readonly draft: PivotModel \| null;` |  | Draft model of a field list with `deferUpdate`; null when nothing is pending. |
| `status` | `readonly status: PivotComputeStatus;` |  |  |
| `error` | `readonly error: Error \| null;` |  |  |
| `fields` | `readonly fields: readonly PivotFieldInfo[];` |  |  |
| `selection` | `readonly selection: readonly string[];` |  | Selected cells as `rowKey\|columnKey`. |
| `dialog` | `readonly dialog: PivotDialogState \| null;` |  | Open dialog of the pivot parts (field list popup, editors, drill through), or null. |

### PivotTableApi

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotTableApi

```ts
interface PivotTableApi<Row = unknown> {
    readonly pivot: PivotController<Row>;
    readonly element: HTMLDivElement | null;
    readonly grid: DataGridApi<PivotRowStub> | null;
    getResult(): PivotResult | null;
    getState(): PivotTableState;
    restoreState(state: PivotTableState | string): boolean;
    exportToExcel(options?: PivotExportOptions): Promise<PivotExportFile | null>;
    exportToCsv(options?: PivotExportOptions): Promise<PivotExportFile | null>;
    exportToPdf(options?: PivotExportOptions): Promise<PivotExportFile | null>;
    print(): Promise<null>;
    openFieldList(): void;
    openCalculatedFieldEditor(name?: string): void;
    openConditionalFormatEditor(): void;
    openNumberFormatEditor(measure?: string): void;
    refresh(): void;
}
```

Instance API of `PivotTable` (`ref`).

Members (15):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `readonly pivot: PivotController<Row>;` |  |  |
| `element` | `readonly element: HTMLDivElement \| null;` |  | The root element; null before mount. |
| `grid` | `readonly grid: DataGridApi<PivotRowStub> \| null;` |  | The inner Data Grid instance (renderer); null before mount. |
| `getResult` | `getResult(): PivotResult \| null;` |  |  |
| `getState` | `getState(): PivotTableState;` |  |  |
| `restoreState` | `restoreState(state: PivotTableState \| string): boolean;` |  |  |
| `exportToExcel` | `exportToExcel(options?: PivotExportOptions): Promise<PivotExportFile \| null>;` |  |  |
| `exportToCsv` | `exportToCsv(options?: PivotExportOptions): Promise<PivotExportFile \| null>;` |  |  |
| `exportToPdf` | `exportToPdf(options?: PivotExportOptions): Promise<PivotExportFile \| null>;` |  |  |
| `print` | `print(): Promise<null>;` |  |  |
| `openFieldList` | `openFieldList(): void;` |  |  |
| `openCalculatedFieldEditor` | `openCalculatedFieldEditor(name?: string): void;` |  |  |
| `openConditionalFormatEditor` | `openConditionalFormatEditor(): void;` |  |  |
| `openNumberFormatEditor` | `openNumberFormatEditor(measure?: string): void;` |  |  |
| `refresh` | `refresh(): void;` |  |  |

### PivotTableProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotTableProps

```ts
interface PivotTableProps<Row = unknown> extends UsePivotOptions<Row>, PivotDisplayProps {
    pivot?: PivotController<Row> | undefined;
    layout?: PivotTableLayout | undefined;
    fieldList?: boolean | 'popup' | undefined;
    axisBar?: boolean | PivotAxisBarOptions | undefined;
    toolbar?: readonly (PivotToolbarItemId | PivotToolbarItem)[] | undefined;
    drillThrough?: boolean | {
        readonly maxRows?: number;
    } | undefined;
    valueSorting?: boolean | {
        readonly multipleAxis?: boolean;
    } | undefined;
    editing?: boolean | DataGridEditing<Row> | undefined;
    paging?: boolean | {
        readonly rows?: number;
        readonly columns?: number;
    } | undefined;
    aggregateOptions?: readonly PivotAggregate[] | undefined;
    selection?: boolean | {
        readonly multiple?: boolean;
    } | undefined;
    emptyCellText?: string | undefined;
    renderCell?: ((ctx: PivotCellContext) => ReactNode) | undefined;
    renderHeader?: ((ctx: PivotHeaderContext) => ReactNode) | undefined;
    renderTooltip?: ((ctx: PivotTooltipContext) => ReactNode) | undefined;
    renderLoading?: ((ctx: PivotLoadingContext) => ReactNode) | undefined;
    getCellClassName?: ((ctx: PivotCellContext) => string | undefined) | undefined;
    onCellClick?: ((event: PivotCellClickEvent) => void) | undefined;
    persistState?: PivotPersistState | undefined;
    exportWriters?: PivotExportWriters | undefined;
    localeText?: PivotLocaleText | undefined;
    id?: string | undefined;
    className?: string | undefined;
    style?: CSSProperties | undefined;
    'aria-label'?: string | undefined;
    ref?: Ref<PivotTableApi<Row>> | undefined;
}
```

Members (71):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `pivot?: PivotController<Row> \| undefined;` | optional | A shared store from `usePivot()`; without it the table creates its own from `data`, `fields`, `pivotModel`. |
| `layout` | `layout?: PivotTableLayout \| undefined;` | optional | `compact` (default): row members as a tree in one column (`treegrid`); `tabular`: one pinned column per row field. |
| `fieldList` | `fieldList?: boolean \| 'popup' \| undefined;` | optional | Built-in field list: `'popup'` (or `true`) opens it from the toolbar and `api.openFieldList()`. |
| `axisBar` | `axisBar?: boolean \| PivotAxisBarOptions \| undefined;` | optional | Built-in axis bar above the table. |
| `toolbar` | `toolbar?: readonly (PivotToolbarItemId \| PivotToolbarItem)[] \| undefined;` | optional | Built-in toolbar items above the table. |
| `drillThrough` | `drillThrough?: boolean \| {     readonly maxRows?: number; } \| undefined;` | optional | Double-click or Enter on a value cell opens its raw rows. |
| `valueSorting` | `valueSorting?: boolean \| {     readonly multipleAxis?: boolean; } \| undefined;` | optional | Value sort buttons on the leaf column headers: a click or Enter / Space on the header cycles ascending, descending, none (Shift+Enter on a header that also drills). `multipleAxis` (default true) sorts every row level. |
| `editing` | `editing?: boolean \| DataGridEditing<Row> \| undefined;` | optional | Editing of the drill-through grid; edits write through and re-aggregate. |
| `paging` | `paging?: boolean \| {     readonly rows?: number;     readonly columns?: number; } \| undefined;` | optional | Paging instead of virtualization (opt-in): page sizes for rows and columns. `true` (or `{}`) uses the defaults, 10 rows and 5 column members per page; an object pages only the axes it names. |
| `aggregateOptions` | `aggregateOptions?: readonly PivotAggregate[] \| undefined;` | optional | Aggregates offered by the value field menus. |
| `selection` | `selection?: boolean \| {     readonly multiple?: boolean; } \| undefined;` | optional | Cell selection. Default off. |
| `emptyCellText` | `emptyCellText?: string \| undefined;` | optional | Text of empty value cells. Default ''. |
| `renderCell` | `renderCell?: ((ctx: PivotCellContext) => ReactNode) \| undefined;` | optional |  |
| `renderHeader` | `renderHeader?: ((ctx: PivotHeaderContext) => ReactNode) \| undefined;` | optional |  |
| `renderTooltip` | `renderTooltip?: ((ctx: PivotTooltipContext) => ReactNode) \| undefined;` | optional |  |
| `renderLoading` | `renderLoading?: ((ctx: PivotLoadingContext) => ReactNode) \| undefined;` | optional |  |
| `getCellClassName` | `getCellClassName?: ((ctx: PivotCellContext) => string \| undefined) \| undefined;` | optional |  |
| `onCellClick` | `onCellClick?: ((event: PivotCellClickEvent) => void) \| undefined;` | optional |  |
| `persistState` | `persistState?: PivotPersistState \| undefined;` | optional | Saves the model in storage and restores it on mount. |
| `exportWriters` | `exportWriters?: PivotExportWriters \| undefined;` | optional | Export writer loader: a dynamic import of the `pivot` subpath of the |
| `localeText` | `localeText?: PivotLocaleText \| undefined;` | optional |  |
| `id` | `id?: string \| undefined;` | optional |  |
| `className` | `className?: string \| undefined;` | optional |  |
| `style` | `style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `'aria-label'?: string \| undefined;` | optional |  |
| `ref` | `ref?: Ref<PivotTableApi<Row>> \| undefined;` | optional |  |
| `onBeforePivotModelChange` | `onBeforePivotModelChange?: ((event: PivotModelChangeEvent) => void);` | optional, inherited |  |
| `onPivotModelChange` | `onPivotModelChange?: ((event: PivotModelChangeEvent) => void);` | optional, inherited |  |
| `onBeforeExpandedChange` | `onBeforeExpandedChange?: ((event: PivotExpandedChangeEvent) => void);` | optional, inherited |  |
| `onExpandedChange` | `onExpandedChange?: ((event: PivotExpandedChangeEvent) => void);` | optional, inherited |  |
| `onBeforeFilterChange` | `onBeforeFilterChange?: ((event: PivotFilterChangeEvent) => void);` | optional, inherited |  |
| `onFilterChange` | `onFilterChange?: ((event: PivotFilterChangeEvent) => void);` | optional, inherited |  |
| `onBeforeSortChange` | `onBeforeSortChange?: ((event: PivotSortChangeEvent) => void);` | optional, inherited |  |
| `onSortChange` | `onSortChange?: ((event: PivotSortChangeEvent) => void);` | optional, inherited |  |
| `onBeforeFieldMove` | `onBeforeFieldMove?: ((event: PivotFieldMoveEvent) => void);` | optional, inherited |  |
| `onFieldMove` | `onFieldMove?: ((event: PivotFieldMoveEvent) => void);` | optional, inherited |  |
| `onBeforeMemberEditorOpen` | `onBeforeMemberEditorOpen?: ((event: PivotMemberEditorOpenEvent) => void);` | optional, inherited |  |
| `onBeforeAggregateMenuOpen` | `onBeforeAggregateMenuOpen?: ((event: PivotAggregateMenuOpenEvent) => void);` | optional, inherited |  |
| `onBeforeCalculatedFieldChange` | `onBeforeCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void);` | optional, inherited |  |
| `onCalculatedFieldChange` | `onCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void);` | optional, inherited |  |
| `onBeforeDrillThrough` | `onBeforeDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void);` | optional, inherited |  |
| `onDrillThrough` | `onDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void);` | optional, inherited |  |
| `onBeforeSelectionChange` | `onBeforeSelectionChange?: ((event: PivotSelectionChangeEvent) => void);` | optional, inherited |  |
| `onSelectionChange` | `onSelectionChange?: ((event: PivotSelectionChangeEvent) => void);` | optional, inherited |  |
| `onDataChange` | `onDataChange?: ((event: PivotDataChangeEvent<Row>) => void);` | optional, inherited |  |
| `onComputeStart` | `onComputeStart?: ((event: PivotComputeEvent) => void);` | optional, inherited |  |
| `onComputeEnd` | `onComputeEnd?: ((event: PivotComputeEvent) => void);` | optional, inherited |  |
| `onBeforeExport` | `onBeforeExport?: ((event: PivotExportEvent) => void);` | optional, inherited |  |
| `onExport` | `onExport?: ((event: PivotExportEvent) => void);` | optional, inherited |  |
| `onError` | `onError?: ((event: PivotErrorEvent) => void);` | optional, inherited |  |
| `data` | `data?: readonly Row[];` | optional, inherited | Raw rows by reference. Reactive: a new array re-aggregates (incrementally for small deltas). |
| `fields` | `fields?: readonly PivotFieldDefinition<Row>[];` | optional, inherited | Field definitions; inferred from the first rows when omitted. Read on creation. |
| `pivotModel` | `pivotModel?: PivotModelInput;` | optional, inherited | Reactive report model: re-applied when it changes structurally, never reset by an equal fresh literal. |
| `defaultPivotModel` | `defaultPivotModel?: PivotModelInput;` | optional, inherited | Initial report model (uncontrolled). |
| `locale` | `locale?: string;` | optional, inherited |  |
| `customAggregates` | `customAggregates?: Readonly<Record<string, PivotCustomAggregator<unknown>>>;` | optional, inherited |  |
| `getCellValue` | `getCellValue?: ((cell: PivotCell) => number \| null);` | optional, inherited | Pure value override per cell. |
| `worker` | `worker?: PivotWorkerLike;` | optional, inherited | Runs the engine in this Worker (`new Worker(new URL('@salmonui/pivot-table/engine/worker', import.meta.url), { type: 'module' })`). Read on creation. The server renders the loading state. |
| `deferComputeAbove` | `deferComputeAbove?: number;` | optional, inherited | Rows above which the first compute is deferred to the client after the first paint (the server renders the header and a loading state, `aria-busy`). Default 50,000. |
| `createEngine` | `createEngine?: ((options: { readonly model: unknown; readonly locale?: string \| undefined; }) => unknown);` | optional, inherited | Creates the engine instead of the local one (a remote pivot source: `(o) => source.createEngine(o)` from `createJsonPivotSource()` of `@salmonui/data/json`). Its commands may answer asynchronously. Read on creation; the server renders the loading state. |
| `rowHeight` | `rowHeight?: number;` | optional, inherited |  |
| `columnWidth` | `columnWidth?: number;` | optional, inherited | Value column width in px. Default 120. |
| `rowHeaderWidth` | `rowHeaderWidth?: number;` | optional, inherited | Row header column width in px (compact) or per row field (tabular). Default 220 / 150. |
| `height` | `height?: string \| number;` | optional, inherited |  |
| `resizable` | `resizable?: boolean;` | optional, inherited |  |
| `reorderable` | `reorderable?: boolean;` | optional, inherited |  |
| `textWrap` | `textWrap?: "both" \| "content" \| "header" \| boolean;` | optional, inherited |  |
| `overflow` | `overflow?: "clip" \| "ellipsis" \| "ellipsisWithTooltip";` | optional, inherited |  |
| `gridLines` | `gridLines?: "both" \| "default" \| "horizontal" \| "none" \| "vertical";` | optional, inherited |  |
| `striped` | `striped?: boolean;` | optional, inherited |  |
| `highlightOnHover` | `highlightOnHover?: boolean;` | optional, inherited |  |

### PivotTableState

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotTableState

```ts
interface PivotTableState {
    readonly version: 1;
    readonly pivotModel: PivotModel;
    readonly layout?: 'compact' | 'tabular' | undefined;
    readonly columnWidths?: Readonly<Record<string, number>> | undefined;
}
```

Serializable state (`api.getState()`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `version` | `readonly version: 1;` |  | Schema version; `restoreState()` rejects newer versions. |
| `pivotModel` | `readonly pivotModel: PivotModel;` |  |  |
| `layout` | `readonly layout?: 'compact' \| 'tabular' \| undefined;` | optional |  |
| `columnWidths` | `readonly columnWidths?: Readonly<Record<string, number>> \| undefined;` | optional | User column widths by column key. |

### PivotToSeriesOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotToSeriesOptions

```ts
interface PivotToSeriesOptions {
    readonly measure?: string | undefined;
    readonly seriesBy?: 'columns' | 'rows' | undefined;
    readonly type?: PivotChartSeriesType | undefined;
    readonly includeTotals?: boolean | undefined;
    readonly labelSeparator?: string | undefined;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `measure` | `readonly measure?: string \| undefined;` | optional | Measure (value field name) to chart. Default: the first value field. |
| `seriesBy` | `readonly seriesBy?: 'columns' \| 'rows' \| undefined;` | optional | Members on the series: `'columns'` (default: one series per column member, categories are row members) or `'rows'`. |
| `type` | `readonly type?: PivotChartSeriesType \| undefined;` | optional | Series type. Default `'column'`. |
| `includeTotals` | `readonly includeTotals?: boolean \| undefined;` | optional | Include subtotal and grand total members. Default false. |
| `labelSeparator` | `readonly labelSeparator?: string \| undefined;` | optional | Category member labels joined with this text for nested members. Default `' / '`. |

### PivotToolbarItem

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotToolbarItem

```ts
interface PivotToolbarItem {
    readonly id: string;
    readonly label?: ReactNode | undefined;
    readonly render?: (() => ReactNode) | undefined;
    readonly onClick?: (() => void) | undefined;
    readonly disabled?: boolean | undefined;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `label` | `readonly label?: ReactNode \| undefined;` | optional |  |
| `render` | `readonly render?: (() => ReactNode) \| undefined;` | optional | Custom content; the item is then rendered as is. |
| `onClick` | `readonly onClick?: (() => void) \| undefined;` | optional |  |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |

### PivotToolbarProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotToolbarProps

```ts
interface PivotToolbarProps<Row = unknown> {
    readonly pivot: PivotController<Row>;
    readonly items?: readonly (PivotToolbarItemId | PivotToolbarItem)[] | undefined;
    readonly exportWriters?: PivotExportWriters | undefined;
    readonly layout?: 'compact' | 'tabular' | undefined;
    readonly localeText?: PivotLocaleText | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly 'aria-label'?: string | undefined;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `pivot` | `readonly pivot: PivotController<Row>;` |  |  |
| `items` | `readonly items?: readonly (PivotToolbarItemId \| PivotToolbarItem)[] \| undefined;` | optional | Built-in item ids and custom items, in order. Default `['fieldList', 'totals', 'formatting', 'export']`. |
| `exportWriters` | `readonly exportWriters?: PivotExportWriters \| undefined;` | optional | Writer loaders for the export menu (Excel and PDF items are disabled without them). |
| `layout` | `readonly layout?: 'compact' \| 'tabular' \| undefined;` | optional | Row layout passed to the export writers. |
| `localeText` | `readonly localeText?: PivotLocaleText \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string \| undefined;` | optional |  |

### PivotTooltipContext

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotTooltipContext

```ts
interface PivotTooltipContext {
    readonly cell: PivotCell;
    readonly rowHeader: PivotHeaderNode;
    readonly columnHeader: PivotHeaderNode;
}
```

Context of `renderTooltip`.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `cell` | `readonly cell: PivotCell;` |  |  |
| `rowHeader` | `readonly rowHeader: PivotHeaderNode;` |  |  |
| `columnHeader` | `readonly columnHeader: PivotHeaderNode;` |  |  |

### PivotWorkerLike

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotWorkerLike

```ts
interface PivotWorkerLike {
    postMessage(message: unknown, transfer?: Transferable[]): void;
    addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
    removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
    terminate?(): void;
}
```

A Worker (or a `MessagePort`-like object) running `@salmonui/pivot-table/engine/worker`.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `postMessage` | `postMessage(message: unknown, transfer?: Transferable[]): void;` |  |  |
| `addEventListener` | `addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;` |  |  |
| `removeEventListener` | `removeEventListener(type: 'message', listener: (event: MessageEvent) => void): void;` |  |  |
| `terminate` | `terminate?(): void;` | optional |  |

### PivotWriterModule

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/PivotWriterModule

```ts
interface PivotWriterModule {
    exportPivot(source: unknown, options?: Record<string, unknown>, handlers?: Record<string, unknown>): Promise<{
        readonly fileName: string;
        readonly mimeType: string;
        readonly data: Uint8Array | string | Blob;
    } | null>;
}
```

The loaded pivot writer module (the `pivot` subpath of the

- `@salmonui` /export package).

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `exportPivot` | `exportPivot(source: unknown, options?: Record<string, unknown>, handlers?: Record<string, unknown>): Promise<{     readonly fileName: string;     readonly mimeType: string;     readonly data: Uint8Array \| string \| Blob; } \| null>;` |  |  |

### UsePivotOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/UsePivotOptions

```ts
interface UsePivotOptions<Row = unknown> extends PivotEventHandlers<Row> {
    data?: readonly Row[] | undefined;
    fields?: readonly PivotFieldDefinition<Row>[] | undefined;
    pivotModel?: PivotModelInput | undefined;
    defaultPivotModel?: PivotModelInput | undefined;
    locale?: string | undefined;
    customAggregates?: Readonly<Record<string, PivotCustomAggregator>> | undefined;
    getCellValue?: ((cell: PivotCell) => number | null) | undefined;
    worker?: PivotWorkerLike | undefined;
    deferComputeAbove?: number | undefined;
    createEngine?: ((options: {
        readonly model: unknown;
        readonly locale?: string | undefined;
    }) => unknown) | undefined;
}
```

Options of `usePivot()` (and the matching `PivotTable` props).

Members (34):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `data?: readonly Row[] \| undefined;` | optional | Raw rows by reference. Reactive: a new array re-aggregates (incrementally for small deltas). |
| `fields` | `fields?: readonly PivotFieldDefinition<Row>[] \| undefined;` | optional | Field definitions; inferred from the first rows when omitted. Read on creation. |
| `pivotModel` | `pivotModel?: PivotModelInput \| undefined;` | optional | Reactive report model: re-applied when it changes structurally, never reset by an equal fresh literal. |
| `defaultPivotModel` | `defaultPivotModel?: PivotModelInput \| undefined;` | optional | Initial report model (uncontrolled). |
| `locale` | `locale?: string \| undefined;` | optional |  |
| `customAggregates` | `customAggregates?: Readonly<Record<string, PivotCustomAggregator>> \| undefined;` | optional |  |
| `getCellValue` | `getCellValue?: ((cell: PivotCell) => number \| null) \| undefined;` | optional | Pure value override per cell. |
| `worker` | `worker?: PivotWorkerLike \| undefined;` | optional | Runs the engine in this Worker (`new Worker(new URL('@salmonui/pivot-table/engine/worker', import.meta.url), { type: 'module' })`). Read on creation. The server renders the loading state. |
| `deferComputeAbove` | `deferComputeAbove?: number \| undefined;` | optional | Rows above which the first compute is deferred to the client after the first paint (the server renders the header and a loading state, `aria-busy`). Default 50,000. |
| `createEngine` | `createEngine?: ((options: {     readonly model: unknown;     readonly locale?: string \| undefined; }) => unknown) \| undefined;` | optional | Creates the engine instead of the local one (a remote pivot source: `(o) => source.createEngine(o)` from `createJsonPivotSource()` of `@salmonui/data/json`). Its commands may answer asynchronously. Read on creation; the server renders the loading state. |
| `onBeforePivotModelChange` | `onBeforePivotModelChange?: ((event: PivotModelChangeEvent) => void);` | optional, inherited |  |
| `onPivotModelChange` | `onPivotModelChange?: ((event: PivotModelChangeEvent) => void);` | optional, inherited |  |
| `onBeforeExpandedChange` | `onBeforeExpandedChange?: ((event: PivotExpandedChangeEvent) => void);` | optional, inherited |  |
| `onExpandedChange` | `onExpandedChange?: ((event: PivotExpandedChangeEvent) => void);` | optional, inherited |  |
| `onBeforeFilterChange` | `onBeforeFilterChange?: ((event: PivotFilterChangeEvent) => void);` | optional, inherited |  |
| `onFilterChange` | `onFilterChange?: ((event: PivotFilterChangeEvent) => void);` | optional, inherited |  |
| `onBeforeSortChange` | `onBeforeSortChange?: ((event: PivotSortChangeEvent) => void);` | optional, inherited |  |
| `onSortChange` | `onSortChange?: ((event: PivotSortChangeEvent) => void);` | optional, inherited |  |
| `onBeforeFieldMove` | `onBeforeFieldMove?: ((event: PivotFieldMoveEvent) => void);` | optional, inherited |  |
| `onFieldMove` | `onFieldMove?: ((event: PivotFieldMoveEvent) => void);` | optional, inherited |  |
| `onBeforeMemberEditorOpen` | `onBeforeMemberEditorOpen?: ((event: PivotMemberEditorOpenEvent) => void);` | optional, inherited |  |
| `onBeforeAggregateMenuOpen` | `onBeforeAggregateMenuOpen?: ((event: PivotAggregateMenuOpenEvent) => void);` | optional, inherited |  |
| `onBeforeCalculatedFieldChange` | `onBeforeCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void);` | optional, inherited |  |
| `onCalculatedFieldChange` | `onCalculatedFieldChange?: ((event: PivotCalculatedFieldChangeEvent) => void);` | optional, inherited |  |
| `onBeforeDrillThrough` | `onBeforeDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void);` | optional, inherited |  |
| `onDrillThrough` | `onDrillThrough?: ((event: PivotDrillThroughEvent<Row>) => void);` | optional, inherited |  |
| `onBeforeSelectionChange` | `onBeforeSelectionChange?: ((event: PivotSelectionChangeEvent) => void);` | optional, inherited |  |
| `onSelectionChange` | `onSelectionChange?: ((event: PivotSelectionChangeEvent) => void);` | optional, inherited |  |
| `onDataChange` | `onDataChange?: ((event: PivotDataChangeEvent<Row>) => void);` | optional, inherited |  |
| `onComputeStart` | `onComputeStart?: ((event: PivotComputeEvent) => void);` | optional, inherited |  |
| `onComputeEnd` | `onComputeEnd?: ((event: PivotComputeEvent) => void);` | optional, inherited |  |
| `onBeforeExport` | `onBeforeExport?: ((event: PivotExportEvent) => void);` | optional, inherited |  |
| `onExport` | `onExport?: ((event: PivotExportEvent) => void);` | optional, inherited |  |
| `onError` | `onError?: ((event: PivotErrorEvent) => void);` | optional, inherited |  |

## Types

### PivotAction

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotAction

```ts
type PivotAction = 'set' | 'prop' | 'moveField' | 'removeField' | 'filter' | 'sort' | 'valueSort' | 'aggregate' | 'expand' | 'collapse' | 'expandAll' | 'collapseAll' | 'calculatedField' | 'format' | 'conditionalFormat' | 'group' | 'totals' | 'apply' | 'restore';
```

What a model change does.

### PivotAxis

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotAxis

```ts
type PivotAxis = 'rows' | 'columns' | 'values' | 'filters';
```

The four report axes plus `null` (not on the report).

### PivotChartDrillMode

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartDrillMode

```ts
type PivotChartDrillMode = 'auto' | 'expand' | 'drillThrough' | 'collapse';
```

What a chart point click does: drill down when possible, else drill through (`'auto'`); one of them only; or drill up (`'collapse'`).

### PivotChartSeriesShape

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartSeriesShape

```ts
type PivotChartSeriesShape = Pick<ChartSeriesOptions, 'curve' | 'stack' | 'closed'> & {
    readonly type: ChartSeriesType;
};
```

The `Chart` series options of one pivot chart type.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `curve` | `curve?: ChartCurve;` | optional, inherited |  |
| `stack` | `stack?: "percent" \| boolean;` | optional, inherited |  |
| `closed` | `closed?: boolean;` | optional, inherited |  |
| `type` | `type: ChartSeriesType;` | inherited |  |

### PivotChartSeriesType

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotChartSeriesType

```ts
type PivotChartSeriesType = 'line' | 'column' | 'area' | 'bar' | 'spline' | 'stepLine' | 'stackingColumn' | 'stackingColumn100' | 'stackingBar' | 'stackingBar100' | 'stackingArea' | 'stackingArea100' | 'scatter' | 'bubble' | 'polar' | 'radar' | 'pareto' | 'pie' | 'doughnut' | 'funnel' | 'pyramid';
```

Pivot chart types. Each maps
to `Chart` series options (`pivotChartSeriesOptions()`): `spline` is a
`line` with `curve: 'natural'`, `stepLine` a `line` with `curve: 'step'`,
the stacked kinds set `stack` (`'percent'` for 100 %). `polar` and `radar`
are closed lines in `coordinate="polar"` / `"radar"` (`pivotChartProps()`
sets it; `Chart` needs `features={[polar]}`). `pie`, `doughnut`, `funnel`
and `pyramid` are not `Chart` series: `PivotChart` from
`@salmonui/pivot-table/chart` draws them with `PieChart` and
`FunnelChart`, and their shape here is only a `column` data fallback.
`pivotType` keeps the requested type.

### PivotDialogState

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotDialogState

```ts
type PivotDialogState = {
    readonly kind: 'fieldList';
} | {
    readonly kind: 'memberEditor';
    readonly field: string;
} | {
    readonly kind: 'calculatedField';
    readonly name: string | null;
} | {
    readonly kind: 'numberFormat';
    readonly measure: string | null;
} | {
    readonly kind: 'conditionalFormat';
} | {
    readonly kind: 'grouping';
    readonly field: string;
} | {
    readonly kind: 'drillThrough';
    readonly rowIndex: number;
    readonly columnIndex: number;
    readonly rowKey: string;
    readonly columnKey: string;
};
```

### PivotEvent

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotEvent

```ts
type PivotEvent = DataGridEvent;
```

Base of every pivot event (the Data Grid event model: before-events cancel with `preventDefault()`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: string;` | inherited | `'sortChange'`, `'beforeSortChange'`, ... |
| `source` | `source: DataGridEventSource;` | inherited |  |
| `defaultPrevented` | `defaultPrevented: boolean;` | inherited | True after `preventDefault()` (before-events and click events). |
| `preventDefault` | `preventDefault: () => void;` | inherited | Before-events and click events: cancels the action (or the built-in behavior). |

### PivotEventSource

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotEventSource

```ts
type PivotEventSource = DataGridEventSource;
```

### PivotLocaleText

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotLocaleText

```ts
type PivotLocaleText = Partial<Record<PivotLocaleTextKey, string>>;
```

Members (97):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `addCalculatedField` | `addCalculatedField?: string;` | optional, inherited |  |
| `addRule` | `addRule?: string;` | optional, inherited |  |
| `aggregate` | `aggregate?: string;` | optional, inherited |  |
| `aggregateOf` | `aggregateOf?: string;` | optional, inherited |  |
| `allMeasures` | `allMeasures?: string;` | optional, inherited |  |
| `apply` | `apply?: string;` | optional, inherited |  |
| `calculatedField` | `calculatedField?: string;` | optional, inherited |  |
| `calculatedFieldName` | `calculatedFieldName?: string;` | optional, inherited |  |
| `cancel` | `cancel?: string;` | optional, inherited |  |
| `clearFilter` | `clearFilter?: string;` | optional, inherited |  |
| `close` | `close?: string;` | optional, inherited |  |
| `collapse` | `collapse?: string;` | optional, inherited |  |
| `collapseAll` | `collapseAll?: string;` | optional, inherited |  |
| `columnPage` | `columnPage?: string;` | optional, inherited |  |
| `columns` | `columns?: string;` | optional, inherited |  |
| `compact` | `compact?: string;` | optional, inherited |  |
| `conditionalFormat` | `conditionalFormat?: string;` | optional, inherited |  |
| `currency` | `currency?: string;` | optional, inherited |  |
| `decimals` | `decimals?: string;` | optional, inherited |  |
| `deferUpdate` | `deferUpdate?: string;` | optional, inherited |  |
| `drillRows` | `drillRows?: string;` | optional, inherited |  |
| `drillThrough` | `drillThrough?: string;` | optional, inherited |  |
| `drillTruncated` | `drillTruncated?: string;` | optional, inherited |  |
| `dropHere` | `dropHere?: string;` | optional, inherited |  |
| `empty` | `empty?: string;` | optional, inherited |  |
| `exclude` | `exclude?: string;` | optional, inherited |  |
| `expand` | `expand?: string;` | optional, inherited |  |
| `expandAll` | `expandAll?: string;` | optional, inherited |  |
| `export` | `export?: string;` | optional, inherited |  |
| `exportCsv` | `exportCsv?: string;` | optional, inherited |  |
| `exportExcel` | `exportExcel?: string;` | optional, inherited |  |
| `exportPdf` | `exportPdf?: string;` | optional, inherited |  |
| `fieldList` | `fieldList?: string;` | optional, inherited |  |
| `fieldMenu` | `fieldMenu?: string;` | optional, inherited |  |
| `fields` | `fields?: string;` | optional, inherited |  |
| `filter` | `filter?: string;` | optional, inherited |  |
| `filters` | `filters?: string;` | optional, inherited |  |
| `formatStyle` | `formatStyle?: string;` | optional, inherited |  |
| `formatting` | `formatting?: string;` | optional, inherited |  |
| `formula` | `formula?: string;` | optional, inherited |  |
| `formulaHelp` | `formulaHelp?: string;` | optional, inherited |  |
| `grandTotal` | `grandTotal?: string;` | optional, inherited |  |
| `grandTotals` | `grandTotals?: string;` | optional, inherited |  |
| `group` | `group?: string;` | optional, inherited |  |
| `groupDateParts` | `groupDateParts?: string;` | optional, inherited |  |
| `groupEnd` | `groupEnd?: string;` | optional, inherited |  |
| `groupInterval` | `groupInterval?: string;` | optional, inherited |  |
| `groupStart` | `groupStart?: string;` | optional, inherited |  |
| `grouping` | `grouping?: string;` | optional, inherited |  |
| `include` | `include?: string;` | optional, inherited |  |
| `labelFilter` | `labelFilter?: string;` | optional, inherited |  |
| `layout` | `layout?: string;` | optional, inherited |  |
| `loading` | `loading?: string;` | optional, inherited |  |
| `measure` | `measure?: string;` | optional, inherited |  |
| `memberEditor` | `memberEditor?: string;` | optional, inherited |  |
| `members` | `members?: string;` | optional, inherited |  |
| `more` | `more?: string;` | optional, inherited |  |
| `moveDown` | `moveDown?: string;` | optional, inherited |  |
| `moveTo` | `moveTo?: string;` | optional, inherited |  |
| `moveUp` | `moveUp?: string;` | optional, inherited |  |
| `nextColumns` | `nextColumns?: string;` | optional, inherited |  |
| `noMembers` | `noMembers?: string;` | optional, inherited |  |
| `numberFormat` | `numberFormat?: string;` | optional, inherited |  |
| `ok` | `ok?: string;` | optional, inherited |  |
| `operator` | `operator?: string;` | optional, inherited |  |
| `pivotTable` | `pivotTable?: string;` | optional, inherited |  |
| `previousColumns` | `previousColumns?: string;` | optional, inherited |  |
| `print` | `print?: string;` | optional, inherited |  |
| `removeCalculatedField` | `removeCalculatedField?: string;` | optional, inherited |  |
| `removeField` | `removeField?: string;` | optional, inherited |  |
| `removeRule` | `removeRule?: string;` | optional, inherited |  |
| `rowLabels` | `rowLabels?: string;` | optional, inherited |  |
| `rows` | `rows?: string;` | optional, inherited |  |
| `searchFields` | `searchFields?: string;` | optional, inherited |  |
| `searchMembers` | `searchMembers?: string;` | optional, inherited |  |
| `selectAll` | `selectAll?: string;` | optional, inherited |  |
| `showBoth` | `showBoth?: string;` | optional, inherited |  |
| `showColumns` | `showColumns?: string;` | optional, inherited |  |
| `showNone` | `showNone?: string;` | optional, inherited |  |
| `showRows` | `showRows?: string;` | optional, inherited |  |
| `sortAsc` | `sortAsc?: string;` | optional, inherited |  |
| `sortByValue` | `sortByValue?: string;` | optional, inherited |  |
| `sortDesc` | `sortDesc?: string;` | optional, inherited |  |
| `sortNone` | `sortNone?: string;` | optional, inherited |  |
| `subtotal` | `subtotal?: string;` | optional, inherited |  |
| `subtotals` | `subtotals?: string;` | optional, inherited |  |
| `tabular` | `tabular?: string;` | optional, inherited |  |
| `tone` | `tone?: string;` | optional, inherited |  |
| `toolbar` | `toolbar?: string;` | optional, inherited |  |
| `totals` | `totals?: string;` | optional, inherited |  |
| `ungroup` | `ungroup?: string;` | optional, inherited |  |
| `useGrouping` | `useGrouping?: string;` | optional, inherited |  |
| `value` | `value?: string;` | optional, inherited |  |
| `value2` | `value2?: string;` | optional, inherited |  |
| `valueFilter` | `valueFilter?: string;` | optional, inherited |  |
| `values` | `values?: string;` | optional, inherited |  |
| `valuesItem` | `valuesItem?: string;` | optional, inherited |  |

### PivotLocaleTextKey

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotLocaleTextKey

```ts
type PivotLocaleTextKey = keyof typeof PIVOT_DEFAULT_LOCALE_TEXT;
```

### PivotTableLayout

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotTableLayout

```ts
type PivotTableLayout = 'compact' | 'tabular';
```

### PivotToolbarItemId

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/PivotToolbarItemId

```ts
type PivotToolbarItemId = 'fieldList' | 'totals' | 'subtotals' | 'grandTotals' | 'formatting' | 'numberFormat' | 'conditionalFormat' | 'calculatedField' | 'export' | 'expandAll' | 'collapseAll';
```

## Constants

### PIVOT_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/pivot-table/PIVOT_DEFAULT_LOCALE_TEXT

```ts
const PIVOT_DEFAULT_LOCALE_TEXT: {
    readonly rowLabels: 'Row labels';
    readonly grandTotal: 'Grand total';
    readonly subtotal: '{label} total';
    readonly expand: 'Expand {label}';
    readonly collapse: 'Collapse {label}';
    readonly loading: 'Computing the pivot table';
    readonly empty: 'No data';
    readonly pivotTable: 'Pivot table';
    readonly fieldList: 'Field list';
    readonly fields: 'Fields';
    readonly searchFields: 'Search fields';
    readonly rows: 'Rows';
    readonly columns: 'Columns';
    readonly values: 'Values';
    readonly filters: 'Filters';
    readonly valuesItem: 'Values';
    readonly dropHere: 'Drop a field here';
    readonly apply: 'Apply';
    readonly cancel: 'Cancel';
    readonly close: 'Close';
    readonly ok: 'OK';
    readonly deferUpdate: 'Defer layout update';
    readonly moveTo: 'Move to {axis}';
    readonly removeField: 'Remove from report';
    readonly moveUp: 'Move up';
    readonly moveDown: 'Move down';
    readonly sortAsc: 'Sort ascending';
    readonly sortDesc: 'Sort descending';
    readonly sortByValue: 'Sort rows by {label}';
    readonly sortNone: 'Original order';
    readonly filter: 'Filter';
    readonly clearFilter: 'Clear filter';
    readonly aggregate: 'Summarize values by';
    readonly aggregateOf: '{aggregate} of {field}';
    readonly fieldMenu: '{field} options';
    readonly memberEditor: 'Filter {field}';
    readonly searchMembers: 'Search members';
    readonly selectAll: 'Select all';
    readonly members: '{count} members';
    readonly noMembers: 'No matching members';
    readonly include: 'Include';
    readonly exclude: 'Exclude';
    readonly labelFilter: 'Label filter';
    readonly valueFilter: 'Value filter';
    readonly calculatedField: 'Calculated field';
    readonly calculatedFieldName: 'Name';
    readonly formula: 'Formula';
    readonly formulaHelp: 'Reference measures as "Sum(Amount)"; operators + - * / and IF, AND, OR, NOT, ABS, MIN, MAX, ROUND.';
    readonly addCalculatedField: 'Add calculated field';
    readonly removeCalculatedField: 'Remove calculated field';
    readonly numberFormat: 'Number formatting';
    readonly formatStyle: 'Style';
    readonly decimals: 'Decimal places';
    readonly useGrouping: 'Use 1000 separator';
    readonly currency: 'Currency';
    readonly conditionalFormat: 'Conditional formatting';
    readonly addRule: 'Add condition';
    readonly removeRule: 'Remove condition';
    readonly measure: 'Measure';
    readonly allMeasures: 'All values';
    readonly operator: 'Condition';
    readonly value: 'Value';
    readonly value2: 'and';
    readonly tone: 'Style';
    readonly grouping: 'Grouping';
    readonly group: 'Group';
    readonly ungroup: 'Ungroup';
    readonly groupStart: 'Starting at';
    readonly groupEnd: 'Ending at';
    readonly groupInterval: 'Interval';
    readonly groupDateParts: 'Group by';
    readonly drillThrough: 'Details: {row}, {column}';
    readonly drillRows: '{count} rows';
    readonly drillTruncated: 'Showing the first {count} rows';
    readonly toolbar: 'Pivot table toolbar';
    readonly totals: 'Totals';
    readonly subtotals: 'Subtotals';
    readonly grandTotals: 'Grand totals';
    readonly showBoth: 'Show rows and columns';
    readonly showRows: 'Rows only';
    readonly showColumns: 'Columns only';
    readonly showNone: 'Do not show';
    readonly formatting: 'Formatting';
    readonly export: 'Export';
    readonly exportExcel: 'Excel';
    readonly exportCsv: 'CSV';
    readonly exportPdf: 'PDF';
    readonly print: 'Print';
    readonly expandAll: 'Expand all';
    readonly collapseAll: 'Collapse all';
    readonly layout: 'Layout';
    readonly compact: 'Compact';
    readonly tabular: 'Tabular';
    readonly more: 'More';
    readonly columnPage: 'Column page {page} of {count}';
    readonly previousColumns: 'Previous columns';
    readonly nextColumns: 'Next columns';
};
```

## Re-exported entry points

- [@salmonui/pivot-table/engine](https://salmonui.dev/docs/reference/pivot-table/engine.md): 21 symbols: 2 functions, 13 interfaces and 6 types
  `PivotAggregate`, `PivotAxisField`, `PivotCalculatedField`, `PivotCell`, `PivotConditionalFormat`, `PivotFieldDefinition`, `PivotFieldInfo`, `PivotFilter`, `PivotFormat`, `PivotGrouping`, `PivotHeaderNode`, `PivotMember`, `PivotMemberPath`, `PivotMemberSort`, `PivotModel`, `PivotModelInput`, `PivotResult`, `PivotValueField`, `PivotValueSort`, `normalizePivotModel`, `parseCsv`
