# @birchui/pivot-studio API reference

> Birch UI Pivot Studio: pivot-first report builder for BI embeds

```bash
npm install @birchui/pivot-studio
```

## @birchui/pivot-studio

### aggregateCube

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function aggregateCube(input: CubeKernelInput): CubeKernelOutput
```

| Parameter | Type | Description |
| --- | --- | --- |
| `input` | `CubeKernelInput` |  |

### buildPivotWorkbook

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function buildPivotWorkbook(view: PivotView, options: PivotWorkbookOptions = {}): XlsxWorkbook
```

| Parameter | Type | Description |
| --- | --- | --- |
| `view` | `PivotView` |  |
| `options?` | `PivotWorkbookOptions` |  |

### buildRecordsWorkbook

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function buildRecordsWorkbook<TRecord>(records: readonly TRecord[], fields: readonly PivotField[], options: { sheetName?: string; title?: string } = {}): XlsxWorkbook
```

| Parameter | Type | Description |
| --- | --- | --- |
| `records` | `readonly TRecord[]` |  |
| `fields` | `readonly PivotField[]` |  |
| `options?` | `{ sheetName?: string; title?: string }` |  |

### createPivotEngine

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function createPivotEngine<TRecord = PivotRecord>(options: PivotEngineOptions<TRecord> = {}): PivotEngine<TRecord>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `options?` | `PivotEngineOptions<TRecord>` |  |

### createPivotStudio

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function createPivotStudio<TRecord = PivotRecord>(container: HTMLElement, options: PivotStudioOptions<TRecord> = {}): PivotStudioApi<TRecord>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `container` | `HTMLElement` |  |
| `options?` | `PivotStudioOptions<TRecord>` |  |

### csvToRecords

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function csvToRecords(text: string, options: CsvRecordsOptions = {}): CsvRecordsResult
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `options?` | `CsvRecordsOptions` |  |

### detectFieldType

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function detectFieldType(values: readonly unknown[]): FieldType
```

| Parameter | Type | Description |
| --- | --- | --- |
| `values` | `readonly unknown[]` |  |

### excelNumberFormat

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function excelNumberFormat(resolved: ResolvedFormat): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `resolved` | `ResolvedFormat` |  |

### formatPivotValue

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function formatPivotValue(value: number | null, resolved: ResolvedFormat, locale?: string, emptyText = ''): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `number \| null` |  |
| `resolved` | `ResolvedFormat` |  |
| `locale?` | `string` |  |
| `emptyText?` | `unknown` |  |

### humanizeFieldName

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function humanizeFieldName(name: string): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `name` | `string` |  |

### inferFields

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function inferFields(records: readonly PivotRecord[], definitions: readonly FieldDefinition[] = [], partCaption: (part: DatePart) => string = datePartCaption): PivotField[]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `records` | `readonly PivotRecord[]` |  |
| `definitions?` | `readonly FieldDefinition[]` |  |
| `partCaption?` | `(part: DatePart) => string` |  |

### normalizeReport

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function normalizeReport(input: unknown, warn: Warn = () => {}): PivotReport
```

| Parameter | Type | Description |
| --- | --- | --- |
| `input` | `unknown` |  |
| `warn?` | `Warn` |  |

### parseCsv

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function parseCsv(text: string, options: CsvParseOptions = {}): string[][]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `options?` | `CsvParseOptions` |  |

### parseDateValue

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function parseDateValue(value: unknown): number
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` |  |

### parseJsonData

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function parseJsonData(input: string | unknown, options: JsonDataOptions = {}): PivotRecord[]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `input` | `string \| unknown` |  |
| `options?` | `JsonDataOptions` |  |

### pivotChartData

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function pivotChartData(view: PivotView, options: PivotChartDataOptions = {}): PivotChartData
```

| Parameter | Type | Description |
| --- | --- | --- |
| `view` | `PivotView` |  |
| `options?` | `PivotChartDataOptions` |  |

### pivotViewToMatrix

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function pivotViewToMatrix(view: PivotView, options: PivotMatrixOptions = {}): PivotMatrixCell[][]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `view` | `PivotView` |  |
| `options?` | `PivotMatrixOptions` |  |

### sniffDelimiter

Kind: function. Import from `@birchui/pivot-studio`.

```ts
function sniffDelimiter(text: string, candidates: readonly string[] = DELIMITER_CANDIDATES): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |
| `candidates?` | `readonly string[]` |  |

### InputLimitError

Kind: class. Import from `@birchui/pivot-studio`.

```ts
class InputLimitError extends Error
new InputLimitError(readonly code: InputLimitCode, readonly limit: number, readonly actual: number, message: string)
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly name` | `"InputLimitError"` |  |
| `readonly code` | `InputLimitCode` |  |
| `readonly limit` | `number` |  |
| `readonly actual` | `number` |  |

### AGGREGATION_NAMES

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const AGGREGATION_NAMES: readonly AggregationName[]
```

### DEFAULT_DATA_LIMITS

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const DEFAULT_DATA_LIMITS: Readonly<DataLimits>
```

### DEFAULT_REPORT_OPTIONS

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const DEFAULT_REPORT_OPTIONS: ResolvedReportOptions
```

### PIVOT_STUDIO_EVENTS

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const PIVOT_STUDIO_EVENTS: readonly ["ready", "reportChange", "cellClick", "drillThrough", "dataLoaded", "pivotUpdated", "error"]
```

### pivotStudioDefinition

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const pivotStudioDefinition: WidgetDefinition<PivotStudioOptions<PivotRecord>, PivotStudioEvents<PivotRecord>, PivotStudioApi<PivotRecord>>
```

### pivotStudioStyles

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const pivotStudioStyles: "\n.lq-pivot {\n --lq-pivot-panel-width: 272px;\n --lq-pivot-chip-bg: #eef3f9;\n --lq-pivot-chip-border: #c9d6e6;\n --lq-pivot-zone-bg: #f9fafb;\n --lq-pivot-zone-over: rgba(31, 111, 235, 0.12);\n --lq-pivot-subtotal-bg: #f3f5f8;\n --lq-pivot-grand-bg: #e8eef7;\n --lq-pivot-negative: #b42318;\n --lq-pivot-toggle-fg: #59636e;\n --lq-pivot-backdrop: rgba(15, 23, 42, 0.45);\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n min-height: 320px;\n font-family: var(--lq-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n font-size: var(--lq-font-size, 13px);\n line-height: 1.4;\n color: var(--lq-fg);\n background: var(--lq-bg);\n}\n.lq-pivot *, .lq-pivot *::before, .lq-pivot *::after { box-sizing: border-box; }\n.lq-pivot.lq-theme-dark {\n --lq-pivot-chip-bg: #1a2230;\n --lq-pivot-chip-border: #30405a;\n --lq-pivot-zone-bg: #11161d;\n --lq-pivot-zone-over: rgba(68, 147, 248, 0.2);\n --lq-pivot-subtotal-bg: #161c25;\n --lq-pivot-grand-bg: #1c2636;\n --lq-pivot-negative: #ff8b81;\n --lq-pivot-toggle-fg: #9198a1;\n --lq-pivot-backdrop: rgba(0, 0, 0, 0.6);\n}\n@media (prefers-color-scheme: dark) {\n .lq-pivot.lq-theme-auto {\n --lq-pivot-chip-bg: #1a2230;\n --lq-pivot-chip-border: #30405a;\n --lq-pivot-zone-bg: #11161d;\n --lq-pivot-zone-over: rgba(68, 147, 248, 0.2);\n --lq-pivot-subtotal-bg: #161c25;\n --lq-pivot-grand-bg: #1c2636;\n --lq-pivot-negative: #ff8b81;\n --lq-pivot-toggle-fg: #9198a1;\n --lq-pivot-backdrop: rgba(0, 0, 0, 0.6);\n }\n}\n.lq-pivot-fullscreen { position: fixed; inset: 0; z-index: 2147483000; height: 100vh !important; width: 100vw; }\n.lq-pivot:fullscreen { height: 100vh; }\n.lq-pivot button, .lq-pivot select, .lq-pivot input { font: inherit; color: inherit; }\n.lq-pivot :focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: 1px; }\n\n.lq-pivot-toolbar {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px 12px;\n padding: 6px 8px;\n border: 1px solid var(--lq-border);\n border-bottom: none;\n border-radius: var(--lq-radius, 6px) var(--lq-radius, 6px) 0 0;\n background: var(--lq-header-bg);\n}\n.lq-pivot-toolbar[hidden] { display: none; }\n.lq-pivot-tool-group { display: flex; flex-wrap: wrap; gap: 4px; }\n.lq-pivot-tool-plugins:empty { display: none; }\n.lq-pivot-tool {\n height: 28px;\n padding: 0 10px;\n border: 1px solid var(--lq-input-border, #818b98);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-bg);\n cursor: pointer;\n white-space: nowrap;\n}\n.lq-pivot-tool:hover { border-color: var(--lq-fg); }\n.lq-pivot-tool[aria-pressed=\"true\"] { background: var(--lq-selection-bg); border-color: var(--lq-accent); }\n.lq-pivot-file { display: none; }\n\n.lq-pivot-body {\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n border: 1px solid var(--lq-border);\n border-radius: 0 0 var(--lq-radius, 6px) var(--lq-radius, 6px);\n overflow: hidden;\n}\n.lq-pivot-toolbar[hidden] + .lq-pivot-body { border-radius: var(--lq-radius, 6px); }\n.lq-pivot-panel {\n display: flex;\n flex-direction: column;\n flex: 0 0 var(--lq-pivot-panel-width);\n width: var(--lq-pivot-panel-width);\n min-height: 0;\n padding: 8px;\n gap: 8px;\n border-inline-end: 1px solid var(--lq-border);\n background: var(--lq-header-bg);\n overflow: auto;\n}\n.lq-pivot-panel[hidden] { display: none; }\n.lq-pivot-search, .lq-pivot-input {\n width: 100%;\n height: 28px;\n padding: 0 8px;\n border: 1px solid var(--lq-input-border, #818b98);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-input-bg);\n}\n.lq-pivot-search::placeholder, .lq-pivot-input::placeholder { color: var(--lq-placeholder-fg, var(--lq-muted-fg)); opacity: 1; }\n.lq-pivot-fields {\n flex: 1 1 160px;\n min-height: 96px;\n margin: 0;\n padding: 2px;\n list-style: none;\n overflow: auto;\n border: 1px solid var(--lq-border-subtle);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-bg);\n}\n.lq-pivot-field {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 3px 6px;\n border-radius: 4px;\n cursor: grab;\n user-select: none;\n}\n.lq-pivot-field:hover { background: var(--lq-row-hover); }\n.lq-pivot-field-child { padding-inline-start: 26px; }\n.lq-pivot-field-used .lq-pivot-field-label { font-weight: 600; }\n.lq-pivot-field-used::after { content: \"●\"; margin-inline-start: auto; font-size: 8px; color: var(--lq-accent); }\n.lq-pivot-type {\n flex: 0 0 auto;\n min-width: 30px;\n padding: 0 4px;\n border-radius: 3px;\n font-size: 10px;\n font-weight: 600;\n text-align: center;\n color: var(--lq-muted-fg);\n background: var(--lq-border-subtle);\n}\n.lq-pivot-type-part { min-width: 14px; background: none; }\n.lq-pivot-field-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.lq-pivot-fields-empty, .lq-pivot-panel-hint { margin: 0; padding: 6px; color: var(--lq-muted-fg); font-size: 12px; }\n.lq-pivot-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }\n.lq-pivot-zone { display: flex; flex-direction: column; min-width: 0; }\n.lq-pivot-zone-title {\n margin: 0 0 3px;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n color: var(--lq-muted-fg);\n}\n.lq-pivot-zone-list {\n display: flex;\n flex-direction: column;\n gap: 3px;\n min-height: 64px;\n margin: 0;\n padding: 4px;\n list-style: none;\n border: 1px dashed var(--lq-border);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-pivot-zone-bg);\n}\n.lq-pivot-zone-over { background: var(--lq-pivot-zone-over); border-color: var(--lq-accent); }\n.lq-pivot-zone-empty { padding: 14px 4px; text-align: center; font-size: 11px; color: var(--lq-muted-fg); }\n.lq-pivot-chip {\n display: flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n padding-block: 2px;\n padding-inline: 8px 4px;\n border: 1px solid var(--lq-pivot-chip-border);\n border-radius: 4px;\n background: var(--lq-pivot-chip-bg);\n cursor: grab;\n user-select: none;\n}\n.lq-pivot-chip-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.lq-pivot-chip-sort { color: var(--lq-muted-fg); font-size: 11px; }\n.lq-pivot-chip-filtered { border-color: var(--lq-accent); }\n.lq-pivot-chip-filter, .lq-pivot-chip-remove {\n flex: 0 0 auto;\n width: 20px;\n height: 20px;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: none;\n color: var(--lq-muted-fg);\n cursor: pointer;\n line-height: 1;\n}\n.lq-pivot-chip-filter:hover, .lq-pivot-chip-remove:hover { background: var(--lq-row-hover); color: var(--lq-fg); }\n.lq-pivot-active { color: var(--lq-accent); }\n.lq-pivot-agg {\n flex: 0 0 auto;\n max-width: 84px;\n height: 22px;\n border: 1px solid var(--lq-input-border, #818b98);\n border-radius: 3px;\n background: var(--lq-input-bg);\n font-size: 11px;\n}\n.lq-pivot-chip-drop-before { box-shadow: 0 -2px 0 0 var(--lq-accent); }\n.lq-pivot-chip-drop-after { box-shadow: 0 2px 0 0 var(--lq-accent); }\n.lq-pivot-dragging .lq-pivot-zone-list { border-style: solid; }\n\n.lq-pivot-main { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; }\n.lq-pivot-panels:empty { display: none; }\n.lq-pivot-plugin-panel { border-bottom: 1px solid var(--lq-border); }\n.lq-pivot-panels-bottom .lq-pivot-plugin-panel { border-top: 1px solid var(--lq-border); border-bottom: none; }\n.lq-pivot-table { position: relative; flex: 1 1 auto; min-height: 0; }\n.lq-pivot-table > .lq-grid { border: none; border-radius: 0; min-height: 0; }\n.lq-pivot-busy {\n position: absolute;\n top: 8px;\n inset-inline-end: 12px;\n z-index: 5;\n padding: 2px 10px;\n border-radius: 999px;\n font-size: 12px;\n color: var(--lq-accent-fg);\n background: var(--lq-accent);\n}\n.lq-pivot-busy[hidden] { display: none; }\n.lq-pivot-live {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n white-space: nowrap;\n border: 0;\n}\n\n.lq-pivot-header { display: flex; flex-direction: column; }\n.lq-pivot-header-row {\n display: flex;\n height: var(--lq-header-height, 38px);\n border-bottom: 1px solid var(--lq-border-subtle);\n}\n.lq-pivot-header-corner {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n padding: 0 var(--lq-cell-padding, 10px);\n border-inline-end: 1px solid var(--lq-border);\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.02em;\n color: var(--lq-muted-fg);\n overflow: hidden;\n white-space: nowrap;\n}\n.lq-pivot-header-clip { position: relative; flex: 1 1 auto; overflow: hidden; }\n.lq-pivot-header-track { position: relative; height: 100%; will-change: transform; }\n.lq-pivot-header-span {\n position: absolute;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n padding: 0 6px;\n border-inline-end: 1px solid var(--lq-border-subtle);\n font-weight: 600;\n color: var(--lq-header-fg);\n overflow: hidden;\n white-space: nowrap;\n}\n.lq-pivot-header-blank { border-inline-end-color: transparent; }\n.lq-pivot-header-text { overflow: hidden; text-overflow: ellipsis; }\n\n.lq-pivot-row-leaf { font-weight: 400; }\n.lq-pivot-row-parent { font-weight: 600; }\n.lq-pivot-row-subtotal { font-weight: 600; background: var(--lq-pivot-subtotal-bg); }\n.lq-pivot-row-grand { font-weight: 700; background: var(--lq-pivot-grand-bg); }\n.lq-pivot-row-subtotal .lq-cell, .lq-pivot-row-grand .lq-cell { background: inherit; }\n.lq-pivot-label { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }\n.lq-pivot-label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.lq-pivot-toggle {\n flex: 0 0 auto;\n width: 18px;\n height: 18px;\n padding: 0;\n border: none;\n border-radius: 3px;\n background: none;\n color: var(--lq-pivot-toggle-fg);\n cursor: pointer;\n line-height: 1;\n}\n.lq-pivot-toggle:hover { background: var(--lq-row-hover); color: var(--lq-fg); }\n.lq-pivot-toggle-space { display: inline-block; flex: 0 0 auto; width: 20px; }\n.lq-pivot-total-cell { font-weight: 600; }\n.lq-pivot-negative { color: var(--lq-pivot-negative); }\n.lq-pivot-cf-bar {\n background-image: linear-gradient(90deg, var(--lq-pivot-bar-color, rgba(99, 142, 198, 0.45)) var(--lq-pivot-bar, 0%), transparent var(--lq-pivot-bar, 0%));\n background-repeat: no-repeat;\n background-size: calc(100% - 4px) 70%;\n background-position: 2px center;\n}\n.lq-pivot-cf-scale, .lq-pivot-cf-threshold { transition: none; }\n\n.lq-pivot-menu, .lq-pivot-filter {\n position: absolute;\n z-index: 40;\n min-width: 200px;\n max-width: min(360px, calc(100% - 8px));\n max-height: min(480px, calc(100% - 16px));\n overflow: auto;\n padding: 4px;\n border: 1px solid var(--lq-border);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-menu-bg);\n box-shadow: var(--lq-menu-shadow);\n}\n.lq-pivot-menu-item {\n display: flex;\n align-items: center;\n gap: 6px;\n width: 100%;\n padding-block: 5px;\n padding-inline: 4px 10px;\n border: none;\n border-radius: 4px;\n background: none;\n text-align: start;\n cursor: pointer;\n}\n.lq-pivot-menu-item:hover, .lq-pivot-menu-item:focus { background: var(--lq-row-hover); outline: none; }\n.lq-pivot-menu-item:focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: -2px; }\n.lq-pivot-menu-item[disabled] { opacity: 0.5; cursor: default; }\n.lq-pivot-menu-check { display: inline-block; width: 16px; text-align: center; color: var(--lq-accent); }\n.lq-pivot-menu-heading {\n padding: 6px 10px 2px;\n padding-inline-start: 26px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.02em;\n color: var(--lq-muted-fg);\n}\n.lq-pivot-menu-separator { height: 1px; margin: 4px 0; background: var(--lq-border-subtle); }\n\n.lq-pivot-filter { width: 300px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }\n.lq-pivot-filter-title { margin: 0; font-size: 14px; }\n.lq-pivot-filter-members {\n display: flex;\n flex-direction: column;\n max-height: 200px;\n overflow: auto;\n padding: 4px;\n border: 1px solid var(--lq-border-subtle);\n border-radius: var(--lq-radius, 6px);\n}\n.lq-pivot-check { display: flex; align-items: center; gap: 6px; padding: 2px 2px; cursor: pointer; }\n.lq-pivot-check-all { font-weight: 600; }\n.lq-pivot-filter-note { margin: 0; font-size: 12px; color: var(--lq-muted-fg); }\n.lq-pivot-filter-note:empty { display: none; }\n.lq-pivot-fieldset {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 6px;\n margin: 0;\n padding: 6px 8px 8px;\n border: 1px solid var(--lq-border-subtle);\n border-radius: var(--lq-radius, 6px);\n}\n.lq-pivot-fieldset legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--lq-muted-fg); }\n.lq-pivot-fieldset > select:first-of-type { grid-column: 1 / -1; }\n.lq-pivot-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }\n.lq-pivot-button {\n height: 28px;\n padding: 0 12px;\n border: 1px solid var(--lq-border);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-bg);\n cursor: pointer;\n}\n.lq-pivot-button:hover { border-color: var(--lq-muted-fg); }\n.lq-pivot-button-primary { border-color: var(--lq-accent); background: var(--lq-accent); color: var(--lq-accent-fg); }\n\n.lq-pivot-backdrop {\n position: absolute;\n inset: 0;\n z-index: 50;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n background: var(--lq-pivot-backdrop);\n}\n.lq-pivot-dialog {\n display: flex;\n flex-direction: column;\n width: min(960px, 100%);\n height: min(560px, 100%);\n border: 1px solid var(--lq-border);\n border-radius: var(--lq-radius, 6px);\n background: var(--lq-bg);\n box-shadow: var(--lq-menu-shadow);\n overflow: hidden;\n}\n.lq-pivot-dialog-head {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: 8px;\n padding: 10px 12px;\n border-bottom: 1px solid var(--lq-border);\n background: var(--lq-header-bg);\n}\n.lq-pivot-dialog-title { margin: 0; font-size: 15px; }\n.lq-pivot-dialog-subtitle { margin: 2px 0 0; font-size: 12px; color: var(--lq-muted-fg); }\n.lq-pivot-dialog-close { width: 28px; padding: 0; font-size: 16px; }\n.lq-pivot-drill-grid { flex: 1 1 auto; min-height: 0; }\n.lq-pivot-drill-grid > .lq-grid { border: none; border-radius: 0; }\n\n.lq-pivot-chart { padding: 8px; min-height: 240px; }\n.lq-pivot-chart[hidden] { display: none; }\n\n@media (max-width: 720px) {\n .lq-pivot-body { flex-direction: column; }\n .lq-pivot-panel { flex: 0 0 auto; width: 100%; max-height: 45%; border-inline-end: none; border-bottom: 1px solid var(--lq-border); }\n}\n@media (prefers-reduced-motion: reduce) {\n .lq-pivot *, .lq-pivot *::before, .lq-pivot *::after { transition: none !important; animation: none !important; }\n}\n@media (forced-colors: active) {\n .lq-pivot :focus-visible, .lq-pivot-menu :focus-visible, .lq-pivot-filter :focus-visible {\n outline: 2px solid Highlight !important;\n }\n .lq-pivot-tool[aria-pressed=\"true\"], .lq-pivot-chip-filtered { border: 2px solid Highlight; }\n .lq-pivot-zone-over { outline: 2px dashed Highlight; }\n .lq-pivot-chip-drop-before { border-top: 3px solid Highlight; }\n .lq-pivot-chip-drop-after { border-bottom: 3px solid Highlight; }\n}\n" = ` .lq-pivot { --lq-pivot-panel-width: 272px; --lq-pivot-chip-bg: #eef3f9; --lq-pivot-chip-border: #c9d6e6; --lq-pivot-zone-bg: #f9fafb; --lq-pivot-zone-over: rgba(31, 111, 235, 0.12); --lq-pivot-subtotal-bg: #f3f5f8; --lq-pivot-grand-bg: #e8eef7; --lq-pivot-negative: #b42318; --lq-pivot-toggle-fg: #59636e; --lq-pivot-backdrop: rgba(15, 23, 42, 0.45); position: relative; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; height: 100%; min-height: 320px; font-family: var(--lq-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); font-size: var(--lq-font-size, 13px); line-height: 1.4; color: var(--lq-fg); background: var(--lq-bg); } .lq-pivot *, .lq-pivot *::before, .lq-pivot *::after { box-sizing: border-box; } .lq-pivot.lq-theme-dark { --lq-pivot-chip-bg: #1a2230; --lq-pivot-chip-border: #30405a; --lq-pivot-zone-bg: #11161d; --lq-pivot-zone-over: rgba(68, 147, 248, 0.2); --lq-pivot-subtotal-bg: #161c25; --lq-pivot-grand-bg: #1c2636; --lq-pivot-negative: #ff8b81; --lq-pivot-toggle-fg: #9198a1; --lq-pivot-backdrop: rgba(0, 0, 0, 0.6); } @media (prefers-color-scheme: dark) { .lq-pivot.lq-theme-auto { --lq-pivot-chip-bg: #1a2230; --lq-pivot-chip-border: #30405a; --lq-pivot-zone-bg: #11161d; --lq-pivot-zone-over: rgba(68, 147, 248, 0.2); --lq-pivot-subtotal-bg: #161c25; --lq-pivot-grand-bg: #1c2636; --lq-pivot-negative: #ff8b81; --lq-pivot-toggle-fg: #9198a1; --lq-pivot-backdrop: rgba(0, 0, 0, 0.6); } } .lq-pivot-fullscreen { position: fixed; inset: 0; z-index: 2147483000; height: 100vh !important; width: 100vw; } .lq-pivot:fullscreen { height: 100vh; } .lq-pivot button, .lq-pivot select, .lq-pivot input { font: inherit; color: inherit; } .lq-pivot :focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: 1px; } .lq-pivot-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 8px; border: 1px solid var(--lq-border); border-bottom: none; border-radius: var(--lq-radius, 6px) var(--lq-radius, 6px) 0 0; background: var(--lq-header-bg); } .lq-pivot-toolbar[hidden] { display: none; } .lq-pivot-tool-group { display: flex; flex-wrap: wrap; gap: 4px; } .lq-pivot-tool-plugins:empty { display: none; } .lq-pivot-tool { height: 28px; padding: 0 10px; border: 1px solid var(--lq-input-border, #818b98); border-radius: var(--lq-radius, 6px); background: var(--lq-bg); cursor: pointer; white-space: nowrap; } .lq-pivot-tool:hover { border-color: var(--lq-fg); } .lq-pivot-tool[aria-pressed="true"] { background: var(--lq-selection-bg); border-color: var(--lq-accent); } .lq-pivot-file { display: none; } .lq-pivot-body { display: flex; flex: 1 1 auto; min-height: 0; border: 1px solid var(--lq-border); border-radius: 0 0 var(--lq-radius, 6px) var(--lq-radius, 6px); overflow: hidden; } .lq-pivot-toolbar[hidden] + .lq-pivot-body { border-radius: var(--lq-radius, 6px); } .lq-pivot-panel { display: flex; flex-direction: column; flex: 0 0 var(--lq-pivot-panel-width); width: var(--lq-pivot-panel-width); min-height: 0; padding: 8px; gap: 8px; border-inline-end: 1px solid var(--lq-border); background: var(--lq-header-bg); overflow: auto; } .lq-pivot-panel[hidden] { display: none; } .lq-pivot-search, .lq-pivot-input { width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--lq-input-border, #818b98); border-radius: var(--lq-radius, 6px); background: var(--lq-input-bg); } .lq-pivot-search::placeholder, .lq-pivot-input::placeholder { color: var(--lq-placeholder-fg, var(--lq-muted-fg)); opacity: 1; } .lq-pivot-fields { flex: 1 1 160px; min-height: 96px; margin: 0; padding: 2px; list-style: none; overflow: auto; border: 1px solid var(--lq-border-subtle); border-radius: var(--lq-radius, 6px); background: var(--lq-bg); } .lq-pivot-field { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 4px; cursor: grab; user-select: none; } .lq-pivot-field:hover { background: var(--lq-row-hover); } .lq-pivot-field-child { padding-inline-start: 26px; } .lq-pivot-field-used .lq-pivot-field-label { font-weight: 600; } .lq-pivot-field-used::after { content: "●"; margin-inline-start: auto; font-size: 8px; color: var(--lq-accent); } .lq-pivot-type { flex: 0 0 auto; min-width: 30px; padding: 0 4px; border-radius: 3px; font-size: 10px; font-weight: 600; text-align: center; color: var(--lq-muted-fg); background: var(--lq-border-subtle); } .lq-pivot-type-part { min-width: 14px; background: none; } .lq-pivot-field-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lq-pivot-fields-empty, .lq-pivot-panel-hint { margin: 0; padding: 6px; color: var(--lq-muted-fg); font-size: 12px; } .lq-pivot-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .lq-pivot-zone { display: flex; flex-direction: column; min-width: 0; } .lq-pivot-zone-title { margin: 0 0 3px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--lq-muted-fg); } .lq-pivot-zone-list { display: flex; flex-direction: column; gap: 3px; min-height: 64px; margin: 0; padding: 4px; list-style: none; border: 1px dashed var(--lq-border); border-radius: var(--lq-radius, 6px); background: var(--lq-pivot-zone-bg); } .lq-pivot-zone-over { background: var(--lq-pivot-zone-over); border-color: var(--lq-accent); } .lq-pivot-zone-empty { padding: 14px 4px; text-align: center; font-size: 11px; color: var(--lq-muted-fg); } .lq-pivot-chip { display: flex; align-items: center; gap: 4px; min-width: 0; padding-block: 2px; padding-inline: 8px 4px; border: 1px solid var(--lq-pivot-chip-border); border-radius: 4px; background: var(--lq-pivot-chip-bg); cursor: grab; user-select: none; } .lq-pivot-chip-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lq-pivot-chip-sort { color: var(--lq-muted-fg); font-size: 11px; } .lq-pivot-chip-filtered { border-color: var(--lq-accent); } .lq-pivot-chip-filter, .lq-pivot-chip-remove { flex: 0 0 auto; width: 20px; height: 20px; padding: 0; border: none; border-radius: 3px; background: none; color: var(--lq-muted-fg); cursor: pointer; line-height: 1; } .lq-pivot-chip-filter:hover, .lq-pivot-chip-remove:hover { background: var(--lq-row-hover); color: var(--lq-fg); } .lq-pivot-active { color: var(--lq-accent); } .lq-pivot-agg { flex: 0 0 auto; max-width: 84px; height: 22px; border: 1px solid var(--lq-input-border, #818b98); border-radius: 3px; background: var(--lq-input-bg); font-size: 11px; } .lq-pivot-chip-drop-before { box-shadow: 0 -2px 0 0 var(--lq-accent); } .lq-pivot-chip-drop-after { box-shadow: 0 2px 0 0 var(--lq-accent); } .lq-pivot-dragging .lq-pivot-zone-list { border-style: solid; } .lq-pivot-main { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; } .lq-pivot-panels:empty { display: none; } .lq-pivot-plugin-panel { border-bottom: 1px solid var(--lq-border); } .lq-pivot-panels-bottom .lq-pivot-plugin-panel { border-top: 1px solid var(--lq-border); border-bottom: none; } .lq-pivot-table { position: relative; flex: 1 1 auto; min-height: 0; } .lq-pivot-table > .lq-grid { border: none; border-radius: 0; min-height: 0; } .lq-pivot-busy { position: absolute; top: 8px; inset-inline-end: 12px; z-index: 5; padding: 2px 10px; border-radius: 999px; font-size: 12px; color: var(--lq-accent-fg); background: var(--lq-accent); } .lq-pivot-busy[hidden] { display: none; } .lq-pivot-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; } .lq-pivot-header { display: flex; flex-direction: column; } .lq-pivot-header-row { display: flex; height: var(--lq-header-height, 38px); border-bottom: 1px solid var(--lq-border-subtle); } .lq-pivot-header-corner { flex: 0 0 auto; display: flex; align-items: center; padding: 0 var(--lq-cell-padding, 10px); border-inline-end: 1px solid var(--lq-border); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--lq-muted-fg); overflow: hidden; white-space: nowrap; } .lq-pivot-header-clip { position: relative; flex: 1 1 auto; overflow: hidden; } .lq-pivot-header-track { position: relative; height: 100%; will-change: transform; } .lq-pivot-header-span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; border-inline-end: 1px solid var(--lq-border-subtle); font-weight: 600; color: var(--lq-header-fg); overflow: hidden; white-space: nowrap; } .lq-pivot-header-blank { border-inline-end-color: transparent; } .lq-pivot-header-text { overflow: hidden; text-overflow: ellipsis; } .lq-pivot-row-leaf { font-weight: 400; } .lq-pivot-row-parent { font-weight: 600; } .lq-pivot-row-subtotal { font-weight: 600; background: var(--lq-pivot-subtotal-bg); } .lq-pivot-row-grand { font-weight: 700; background: var(--lq-pivot-grand-bg); } .lq-pivot-row-subtotal .lq-cell, .lq-pivot-row-grand .lq-cell { background: inherit; } .lq-pivot-label { display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; } .lq-pivot-label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lq-pivot-toggle { flex: 0 0 auto; width: 18px; height: 18px; padding: 0; border: none; border-radius: 3px; background: none; color: var(--lq-pivot-toggle-fg); cursor: pointer; line-height: 1; } .lq-pivot-toggle:hover { background: var(--lq-row-hover); color: var(--lq-fg); } .lq-pivot-toggle-space { display: inline-block; flex: 0 0 auto; width: 20px; } .lq-pivot-total-cell { font-weight: 600; } .lq-pivot-negative { color: var(--lq-pivot-negative); } .lq-pivot-cf-bar { background-image: linear-gradient(90deg, var(--lq-pivot-bar-color, rgba(99, 142, 198, 0.45)) var(--lq-pivot-bar, 0%), transparent var(--lq-pivot-bar, 0%)); background-repeat: no-repeat; background-size: calc(100% - 4px) 70%; background-position: 2px center; } .lq-pivot-cf-scale, .lq-pivot-cf-threshold { transition: none; } .lq-pivot-menu, .lq-pivot-filter { position: absolute; z-index: 40; min-width: 200px; max-width: min(360px, calc(100% - 8px)); max-height: min(480px, calc(100% - 16px)); overflow: auto; padding: 4px; border: 1px solid var(--lq-border); border-radius: var(--lq-radius, 6px); background: var(--lq-menu-bg); box-shadow: var(--lq-menu-shadow); } .lq-pivot-menu-item { display: flex; align-items: center; gap: 6px; width: 100%; padding-block: 5px; padding-inline: 4px 10px; border: none; border-radius: 4px; background: none; text-align: start; cursor: pointer; } .lq-pivot-menu-item:hover, .lq-pivot-menu-item:focus { background: var(--lq-row-hover); outline: none; } .lq-pivot-menu-item:focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: -2px; } .lq-pivot-menu-item[disabled] { opacity: 0.5; cursor: default; } .lq-pivot-menu-check { display: inline-block; width: 16px; text-align: center; color: var(--lq-accent); } .lq-pivot-menu-heading { padding: 6px 10px 2px; padding-inline-start: 26px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; color: var(--lq-muted-fg); } .lq-pivot-menu-separator { height: 1px; margin: 4px 0; background: var(--lq-border-subtle); } .lq-pivot-filter { width: 300px; padding: 10px; display: flex; flex-direction: column; gap: 8px; } .lq-pivot-filter-title { margin: 0; font-size: 14px; } .lq-pivot-filter-members { display: flex; flex-direction: column; max-height: 200px; overflow: auto; padding: 4px; border: 1px solid var(--lq-border-subtle); border-radius: var(--lq-radius, 6px); } .lq-pivot-check { display: flex; align-items: center; gap: 6px; padding: 2px 2px; cursor: pointer; } .lq-pivot-check-all { font-weight: 600; } .lq-pivot-filter-note { margin: 0; font-size: 12px; color: var(--lq-muted-fg); } .lq-pivot-filter-note:empty { display: none; } .lq-pivot-fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; padding: 6px 8px 8px; border: 1px solid var(--lq-border-subtle); border-radius: var(--lq-radius, 6px); } .lq-pivot-fieldset legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--lq-muted-fg); } .lq-pivot-fieldset > select:first-of-type { grid-column: 1 / -1; } .lq-pivot-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; } .lq-pivot-button { height: 28px; padding: 0 12px; border: 1px solid var(--lq-border); border-radius: var(--lq-radius, 6px); background: var(--lq-bg); cursor: pointer; } .lq-pivot-button:hover { border-color: var(--lq-muted-fg); } .lq-pivot-button-primary { border-color: var(--lq-accent); background: var(--lq-accent); color: var(--lq-accent-fg); } .lq-pivot-backdrop { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--lq-pivot-backdrop); } .lq-pivot-dialog { display: flex; flex-direction: column; width: min(960px, 100%); height: min(560px, 100%); border: 1px solid var(--lq-border); border-radius: var(--lq-radius, 6px); background: var(--lq-bg); box-shadow: var(--lq-menu-shadow); overflow: hidden; } .lq-pivot-dialog-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--lq-border); background: var(--lq-header-bg); } .lq-pivot-dialog-title { margin: 0; font-size: 15px; } .lq-pivot-dialog-subtitle { margin: 2px 0 0; font-size: 12px; color: var(--lq-muted-fg); } .lq-pivot-dialog-close { width: 28px; padding: 0; font-size: 16px; } .lq-pivot-drill-grid { flex: 1 1 auto; min-height: 0; } .lq-pivot-drill-grid > .lq-grid { border: none; border-radius: 0; } .lq-pivot-chart { padding: 8px; min-height: 240px; } .lq-pivot-chart[hidden] { display: none; } @media (max-width: 720px) { .lq-pivot-body { flex-direction: column; } .lq-pivot-panel { flex: 0 0 auto; width: 100%; max-height: 45%; border-inline-end: none; border-bottom: 1px solid var(--lq-border); } } @media (prefers-reduced-motion: reduce) { .lq-pivot *, .lq-pivot *::before, .lq-pivot *::after { transition: none !important; animation: none !important; } } @media (forced-colors: active) { .lq-pivot :focus-visible, .lq-pivot-menu :focus-visible, .lq-pivot-filter :focus-visible { outline: 2px solid Highlight !important; } .lq-pivot-tool[aria-pressed="true"], .lq-pivot-chip-filtered { border: 2px solid Highlight; } .lq-pivot-zone-over { outline: 2px dashed Highlight; } .lq-pivot-chip-drop-before { border-top: 3px solid Highlight; } .lq-pivot-chip-drop-after { border-bottom: 3px solid Highlight; } } `
```

### SHOW_VALUES_AS

Kind: const. Import from `@birchui/pivot-studio`.

```ts
const SHOW_VALUES_AS: readonly ShowValuesAs[]
```

### CellClickEvent

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CellClickEvent
```

| Property | Type | Description |
| --- | --- | --- |
| `rowPath` | `string[]` |  |
| `colPath` | `string[]` |  |
| `measure` | `string \| null` |  |
| `value` | `number \| null` |  |
| `rowKind` | `PivotRowKind` |  |
| `columnKind` | `PivotRowKind \| null` |  |

### CellStyle

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CellStyle
```

| Property | Type | Description |
| --- | --- | --- |
| `background?` | `string` |  |
| `color?` | `string` |  |
| `bold?` | `boolean` |  |
| `bar?` | `{ ratio: number; negative: boolean; color: string }` |  |
| `classNames` | `string[]` |  |

### ColorScaleRule

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface ColorScaleRule extends ConditionalFormatBase
```

| Property | Type | Description |
| --- | --- | --- |
| `type` | `'colorScale'` |  |
| `minColor?` | `string` |  |
| `midColor?` | `string` |  |
| `maxColor?` | `string` |  |
| `id?` | `string \| undefined` | Inherited from ConditionalFormatBase. |
| `measure?` | `string \| undefined` | Inherited from ConditionalFormatBase. |
| `includeTotals?` | `boolean \| undefined` | Inherited from ConditionalFormatBase. |

### CsvExportOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CsvExportOptions extends PivotMatrixOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `separator?` | `string` |  |
| `download?` | `boolean` |  |
| `fileName?` | `string` |  |
| `formatted?` | `boolean \| undefined` | Inherited from PivotMatrixOptions. |
| `headers?` | `"stacked" \| "flat" \| undefined` | Inherited from PivotMatrixOptions. |

### CsvParseOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CsvParseOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `delimiter?` | `string` |  |
| `quote?` | `string` |  |
| `skipEmptyLines?` | `boolean` |  |
| `limits?` | `Partial<DataLimits>` |  |

### CsvRecordsOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CsvRecordsOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `delimiter?` | `string` |  |
| `header?` | `boolean` |  |
| `types?` | `Record<string, FieldType>` |  |
| `limits?` | `Partial<DataLimits>` |  |

### CsvRecordsResult

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CsvRecordsResult
```

| Property | Type | Description |
| --- | --- | --- |
| `records` | `PivotRecord[]` |  |
| `columns` | `string[]` |  |
| `delimiter` | `string` |  |

### CubeKernelInput

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CubeKernelInput
```

| Property | Type | Description |
| --- | --- | --- |
| `recordCount` | `number` |  |
| `indices` | `Int32Array \| null` |  |
| `rows` | `KernelDimension[]` |  |
| `columns` | `KernelDimension[]` |  |
| `measures` | `KernelMeasure[]` |  |
| `denseLimit?` | `number` |  |
| `keepRowLeaf?` | `boolean` |  |

### CubeKernelOutput

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface CubeKernelOutput
```

| Property | Type | Description |
| --- | --- | --- |
| `rowTree` | `AxisTree` |  |
| `colTree` | `AxisTree` |  |
| `dense` | `boolean` |  |
| `slots` | `Float64Array \| null` |  |
| `hits` | `Float64Array` |  |
| `values` | `Float64Array[]` |  |
| `rowLeafOf` | `Int32Array \| null` |  |
| `selected` | `number` |  |

### DataBarRule

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface DataBarRule extends ConditionalFormatBase
```

| Property | Type | Description |
| --- | --- | --- |
| `type` | `'dataBar'` |  |
| `color?` | `string` |  |
| `negativeColor?` | `string` |  |
| `id?` | `string \| undefined` | Inherited from ConditionalFormatBase. |
| `measure?` | `string \| undefined` | Inherited from ConditionalFormatBase. |
| `includeTotals?` | `boolean \| undefined` | Inherited from ConditionalFormatBase. |

### DataLimits

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface DataLimits
```

| Property | Type | Description |
| --- | --- | --- |
| `maxLength` | `number` |  |
| `maxRows` | `number` |  |
| `maxColumns` | `number` |  |

### DrillThroughEvent

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface DrillThroughEvent<TRecord = PivotRecord>
```

| Property | Type | Description |
| --- | --- | --- |
| `records` | `TRecord[]` |  |
| `rowPath` | `string[]` |  |
| `colPath` | `string[]` |  |
| `measure` | `string \| null` |  |

### ExcelExportOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface ExcelExportOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `download?` | `boolean` |  |
| `fileName?` | `string` |  |
| `sheetName?` | `string` |  |
| `title?` | `string` |  |

### ExpansionSpec

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface ExpansionSpec
```

| Property | Type | Description |
| --- | --- | --- |
| `all` | `boolean` |  |
| `except?` | `string[][]` |  |

### FieldDefinition

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface FieldDefinition
```

| Property | Type | Description |
| --- | --- | --- |
| `name` | `string` |  |
| `caption?` | `string` |  |
| `type?` | `FieldType` |  |
| `format?` | `PivotNumberFormat` |  |
| `dateParts?` | `boolean \| DatePart[]` |  |
| `hidden?` | `boolean` |  |

### FieldFilter

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface FieldFilter
```

| Property | Type | Description |
| --- | --- | --- |
| `include?` | `string[]` |  |
| `exclude?` | `string[]` |  |
| `label?` | `LabelFilter` |  |
| `value?` | `ValueFilter` |  |
| `top?` | `TopFilter` |  |

### JsonDataOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface JsonDataOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `limits?` | `Partial<DataLimits>` |  |

### LabelFilter

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface LabelFilter
```

| Property | Type | Description |
| --- | --- | --- |
| `op` | `LabelFilterOp` |  |
| `value` | `string` |  |
| `caseSensitive?` | `boolean` |  |

### MeasureSort

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface MeasureSort
```

| Property | Type | Description |
| --- | --- | --- |
| `measure` | `string` |  |
| `dir` | `SortDirection` |  |
| `path?` | `string[]` |  |

### PivotChartData

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotChartData
```

| Property | Type | Description |
| --- | --- | --- |
| `categories` | `string[]` |  |
| `series` | `PivotChartSeries[]` |  |

### PivotChartDataOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotChartDataOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `measure?` | `string` |  |
| `maxCategories?` | `number` |  |
| `maxSeries?` | `number` |  |

### PivotChartSeries

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotChartSeries
```

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` |  |
| `name` | `string` |  |
| `measure` | `string` |  |
| `values` | `(number \| null)[]` |  |

### PivotDataSourceRef

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotDataSourceRef
```

| Property | Type | Description |
| --- | --- | --- |
| `type?` | `DataFormat` |  |
| `ref?` | `string` |  |
| `delimiter?` | `string` |  |
| `fields?` | `FieldDefinition[]` |  |

### PivotEngine

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotEngine<TRecord = PivotRecord>
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly dataFormat` | `Exclude<DataFormat, 'auto'>` |  |
| `readonly delimiter` | `string \| undefined` |  |
| `setData` | `(data: readonly TRecord[] \| string, options?: SetDataOptions) => void` |  |
| `setFieldDefinitions` | `(fields: FieldDefinition[] \| undefined) => void` |  |
| `setLocale` | `(locale: string \| undefined) => void` |  |
| `setTranslator` | `(translate: Translate) => void` |  |
| `invalidate` | `() => void` |  |
| `getRecords` | `() => readonly TRecord[]` |  |
| `getFields` | `() => PivotField[]` |  |
| `getField` | `(name: string) => PivotField \| undefined` |  |
| `getMembers` | `(field: string) => PivotMember[]` |  |
| `setReport` | `(report: PivotReport) => void` |  |
| `getReport` | `() => PivotReport` |  |
| `current` | `() => PivotReport` |  |
| `setExpanded` | `(axis: PivotAxis, path: readonly string[], expanded: boolean) => void` |  |
| `setAllExpanded` | `(axis: PivotAxis, expanded: boolean) => void` |  |
| `isCollapsed` | `(axis: PivotAxis, path: readonly string[]) => boolean` |  |
| `needsCompute` | `() => boolean` |  |
| `compute` | `() => PivotViewModel` |  |
| `computeAsync` | `(runner: KernelRunner) => Promise<PivotViewModel>` |  |
| `rebuildView` | `() => PivotViewModel` |  |
| `getView` | `() => PivotViewModel \| null` |  |
| `drillThrough` | `(rowPath: readonly string[], colPath?: readonly string[]) => TRecord[]` |  |
| `getMatrix` | `(options?: PivotMatrixOptions) => PivotMatrixCell[][]` |  |
| `buildWorkbook` | `(options?: PivotWorkbookOptions) => XlsxWorkbook` |  |

### PivotEngineOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotEngineOptions<TRecord = PivotRecord>
```

| Property | Type | Description |
| --- | --- | --- |
| `data?` | `readonly TRecord[] \| string` |  |
| `dataFormat?` | `DataFormat` |  |
| `csvDelimiter?` | `string` |  |
| `dataLimits?` | `Partial<DataLimits>` |  |
| `fields?` | `FieldDefinition[]` |  |
| `report?` | `PivotReport` |  |
| `locale?` | `string` |  |
| `translate?` | `Translate` |  |
| `onWarning?` | `(message: string) => void` |  |

### PivotField

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotField
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly name` | `string` |  |
| `readonly caption` | `string` |  |
| `readonly type` | `FieldType` |  |
| `readonly source` | `string` |  |
| `readonly format?` | `PivotNumberFormat` |  |
| `readonly datePart?` | `DatePart` |  |
| `readonly parent?` | `string` |  |
| `readonly integer` | `boolean` |  |
| `readonly hidden` | `boolean` |  |

### PivotHeaderSpan

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotHeaderSpan
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly start` | `number` |  |
| `readonly span` | `number` |  |
| `readonly label` | `string` |  |
| `readonly node` | `number` |  |
| `readonly expandable` | `boolean` |  |
| `readonly expanded` | `boolean` |  |

### PivotMatrixOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotMatrixOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `formatted?` | `boolean` |  |
| `headers?` | `'stacked' \| 'flat'` |  |

### PivotMeasureInfo

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotMeasureInfo
```

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` |  |
| `field` | `string` |  |
| `caption` | `string` |  |
| `aggregation` | `AggregationName` |  |
| `showAs` | `ShowValuesAs` |  |
| `along` | `PivotAxis` |  |

### PivotMember

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotMember
```

| Property | Type | Description |
| --- | --- | --- |
| `key` | `string` |  |
| `label` | `string` |  |
| `isBlank` | `boolean` |  |

### PivotNumberFormat

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotNumberFormat
```

| Property | Type | Description |
| --- | --- | --- |
| `style?` | `'number' \| 'currency' \| 'percent'` |  |
| `currency?` | `string` |  |
| `decimals?` | `number` |  |
| `thousands?` | `boolean` |  |
| `prefix?` | `string` |  |
| `suffix?` | `string` |  |
| `nullText?` | `string` |  |
| `excel?` | `string` |  |

### PivotReport

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotReport
```

| Property | Type | Description |
| --- | --- | --- |
| `version?` | `1` |  |
| `dataSource?` | `PivotDataSourceRef` |  |
| `slice` | `PivotSlice` |  |
| `filters?` | `Record<string, FieldFilter>` |  |
| `formats?` | `Record<string, PivotNumberFormat>` |  |
| `conditionalFormats?` | `ConditionalFormatRule[]` |  |
| `options?` | `PivotReportOptions` |  |
| `expansion?` | `{ rows?: ExpansionSpec; columns?: ExpansionSpec }` |  |

### PivotReportOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotReportOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `layout?` | `PivotLayoutName` |  |
| `grandTotalRow?` | `boolean` |  |
| `grandTotalColumn?` | `boolean` |  |
| `rowSubtotals?` | `boolean` |  |
| `columnSubtotals?` | `boolean` |  |
| `grandTotalPosition?` | `'top' \| 'bottom'` |  |
| `subtotalPosition?` | `'top' \| 'bottom'` |  |
| `stackedHeaders?` | `boolean` |  |
| `repeatRowLabels?` | `boolean` |  |
| `emptyCellText?` | `string` |  |

### PivotSlice

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotSlice
```

| Property | Type | Description |
| --- | --- | --- |
| `rows?` | `SliceField[]` |  |
| `columns?` | `SliceField[]` |  |
| `values?` | `ValueField[]` |  |
| `filters?` | `SliceField[]` |  |

### PivotStudioApi

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotStudioApi<TRecord = PivotRecord> extends Widget< PivotStudioOptions<TRecord>, PivotStudioEvents<TRecord> >
```

| Property | Type | Description |
| --- | --- | --- |
| `setData` | `(data: readonly TRecord[] \| string, options?: SetDataOptions) => void` |  |
| `getRecords` | `() => readonly TRecord[]` |  |
| `getFields` | `() => PivotField[]` |  |
| `getMembers` | `(field: string) => PivotMember[]` |  |
| `setReport` | `(report: PivotReport) => void` |  |
| `getReport` | `() => PivotReport` |  |
| `addField` | `(zone: PivotZone, field: string, index?: number) => void` |  |
| `removeField` | `(field: string, zone?: PivotZone) => void` |  |
| `moveField` | `(field: string, zone: Exclude<PivotZone, 'values'>, index?: number) => void` |  |
| `setAggregation` | `(measure: string, aggregation: AggregationName) => void` |  |
| `setShowValuesAs` | `(measure: string, showAs: ShowValuesAs, along?: PivotAxis) => void` |  |
| `setFilter` | `(field: string, filter: FieldFilter \| null) => void` |  |
| `setSort` | `(field: string, sort: SortDirection \| MeasureSort) => void` |  |
| `swapAxes` | `() => void` |  |
| `expandAll` | `(axis?: PivotAxis) => void` |  |
| `collapseAll` | `(axis?: PivotAxis) => void` |  |
| `setExpanded` | `(axis: PivotAxis, path: readonly string[], expanded: boolean) => void` |  |
| `drillThrough` | `(rowPath: readonly string[], colPath?: readonly string[]) => TRecord[]` |  |
| `getView` | `() => PivotView \| null` |  |
| `getPivotMatrix` | `(options?: PivotMatrixOptions) => PivotMatrixCell[][]` |  |
| `exportCsv` | `(options?: CsvExportOptions) => string` |  |
| `exportExcel` | `(options?: ExcelExportOptions) => Promise<Uint8Array>` |  |
| `refresh` | `() => Promise<void>` |  |
| `readonly element` | `HTMLElement` | Inherited from Widget. |
| `update` | `(options: Partial<PivotStudioOptions<TRecord>>) => void` | Inherited from Widget. |
| `on` | `<K extends keyof TEvents & string>(event: K, listener: Listener<TEvents[K]>) => () => void` | Inherited from Widget. |
| `destroy` | `() => void` | Inherited from Widget. |

### PivotStudioEvents

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotStudioEvents<TRecord = PivotRecord>
```

| Property | Type | Description |
| --- | --- | --- |
| `ready` | `{ api: PivotStudioApi<TRecord> }` |  |
| `reportChange` | `{ report: PivotReport }` |  |
| `cellClick` | `CellClickEvent` |  |
| `drillThrough` | `DrillThroughEvent<TRecord>` |  |
| `dataLoaded` | `{ rowCount: number; fields: PivotField[] }` |  |
| `pivotUpdated` | `{ rowCount: number; columnCount: number; recordCount: number; durationMs: number }` |  |
| `error` | `{ message: string; error?: unknown }` |  |

### PivotStudioOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotStudioOptions<TRecord = PivotRecord>
```

| Property | Type | Description |
| --- | --- | --- |
| `data?` | `readonly TRecord[] \| string` |  |
| `dataFormat?` | `DataFormat` |  |
| `csvDelimiter?` | `string` |  |
| `dataLimits?` | `Partial<DataLimits>` |  |
| `fields?` | `FieldDefinition[]` |  |
| `report?` | `PivotReport` |  |
| `licenseKey?` | `string` |  |
| `theme?` | `'light' \| 'dark' \| 'auto'` |  |
| `density?` | `'compact' \| 'normal' \| 'comfortable'` |  |
| `locale?` | `string` |  |
| `height?` | `number \| string` |  |
| `fieldList?` | `boolean` |  |
| `toolbar?` | `boolean` |  |
| `worker?` | `boolean` |  |
| `drillThrough?` | `boolean` |  |
| `injectStyles?` | `boolean` |  |
| `ariaLabel?` | `string` |  |
| `fileName?` | `string` |  |
| `plugins?` | `PivotStudioPlugin[]` |  |
| `localeText?` | `LocaleTextInput` |  |
| `rtl?` | `boolean` |  |

### PivotStudioPlugin

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotStudioPlugin
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly name` | `string` |  |
| `install` | `(context: PivotStudioPluginContext<unknown>) => void \| (() => void)` |  |

### PivotStudioPluginContext

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotStudioPluginContext<TRecord = PivotRecord>
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly studio` | `PivotStudioApi<TRecord>` |  |
| `readonly root` | `HTMLElement` |  |
| `readonly licenseKey` | `string \| undefined` |  |
| `readonly theme` | `'light' \| 'dark' \| 'auto'` |  |
| `addToolbarButton` | `(button: PivotToolbarButton) => PivotToolbarHandle` |  |
| `addPanel` | `(position: 'top' \| 'bottom') => HTMLElement` |  |
| `announce` | `(message: string) => void` |  |
| `translate` | `Translate` |  |

### PivotToolbarButton

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotToolbarButton
```

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` |  |
| `label` | `string` |  |
| `title?` | `string` |  |
| `toggle?` | `boolean` |  |
| `onClick` | `() => void` |  |

### PivotToolbarHandle

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotToolbarHandle
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly element` | `HTMLButtonElement` |  |
| `setPressed` | `(pressed: boolean) => void` |  |
| `remove` | `() => void` |  |

### PivotView

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotView
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly layout` | `PivotLayoutName` |  |
| `readonly rowFields` | `readonly PivotField[]` |  |
| `readonly columnFields` | `readonly PivotField[]` |  |
| `readonly measures` | `readonly PivotMeasureInfo[]` |  |
| `readonly rows` | `readonly PivotViewRow[]` |  |
| `readonly columns` | `readonly PivotViewColumn[]` |  |
| `readonly rowHeaderColumns` | `readonly string[]` |  |
| `readonly headerLevels` | `number` |  |
| `readonly headerSpans` | `readonly (readonly PivotHeaderSpan[])[]` |  |
| `readonly recordCount` | `number` |  |
| `readonly totalRecordCount` | `number` |  |
| `value` | `(rowIndex: number, columnIndex: number) => number \| null` |  |
| `rawValue` | `(rowIndex: number, columnIndex: number) => number \| null` |  |
| `formatted` | `(rowIndex: number, columnIndex: number) => string` |  |
| `cellStyle` | `(rowIndex: number, columnIndex: number) => CellStyle \| null` |  |
| `excelFormat` | `(columnIndex: number) => string` |  |
| `columnKind` | `(columnIndex: number) => 'number' \| 'integer' \| 'percent' \| 'date'` |  |

### PivotViewColumn

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotViewColumn
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly id` | `string` |  |
| `readonly kind` | `PivotRowKind` |  |
| `readonly node` | `number` |  |
| `readonly depth` | `number` |  |
| `readonly path` | `readonly string[]` |  |
| `readonly labels` | `readonly string[]` |  |
| `readonly headerPath` | `readonly string[]` |  |
| `readonly header` | `string` |  |
| `readonly measureIndex` | `number` |  |
| `readonly expandable` | `boolean` |  |
| `readonly expanded` | `boolean` |  |

### PivotViewRow

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotViewRow
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly id` | `string` |  |
| `readonly kind` | `PivotRowKind` |  |
| `readonly node` | `number` |  |
| `readonly depth` | `number` |  |
| `readonly path` | `readonly string[]` |  |
| `readonly labels` | `readonly string[]` |  |
| `readonly label` | `string` |  |
| `readonly expandable` | `boolean` |  |
| `readonly expanded` | `boolean` |  |
| `readonly hasValues` | `boolean` |  |
| `readonly cells` | `readonly string[]` |  |
| `readonly owners` | `readonly number[]` |  |

### PivotWorkbookOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface PivotWorkbookOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `sheetName?` | `string` |  |
| `title?` | `string` |  |
| `creator?` | `string` |  |
| `isCollapsed?` | `(path: readonly string[]) => boolean` |  |
| `summaryBelow?` | `boolean` |  |

### SetDataOptions

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface SetDataOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `format?` | `DataFormat` |  |
| `delimiter?` | `string` |  |
| `limits?` | `Partial<DataLimits>` |  |
| `fields?` | `FieldDefinition[]` |  |

### SliceField

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface SliceField
```

| Property | Type | Description |
| --- | --- | --- |
| `field` | `string` |  |
| `sort?` | `SortDirection` |  |
| `sortBy?` | `MeasureSort` |  |

### ThresholdRule

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface ThresholdRule extends ConditionalFormatBase
```

| Property | Type | Description |
| --- | --- | --- |
| `type` | `'threshold'` |  |
| `op` | `ValueFilterOp` |  |
| `value` | `number` |  |
| `valueTo?` | `number` |  |
| `background?` | `string` |  |
| `color?` | `string` |  |
| `bold?` | `boolean` |  |
| `className?` | `string` |  |
| `id?` | `string \| undefined` | Inherited from ConditionalFormatBase. |
| `measure?` | `string \| undefined` | Inherited from ConditionalFormatBase. |
| `includeTotals?` | `boolean \| undefined` | Inherited from ConditionalFormatBase. |

### TopFilter

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface TopFilter
```

| Property | Type | Description |
| --- | --- | --- |
| `type` | `'top' \| 'bottom'` |  |
| `count` | `number` |  |
| `measure` | `MeasureRef` |  |

### ValueField

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface ValueField
```

| Property | Type | Description |
| --- | --- | --- |
| `field` | `string` |  |
| `aggregation?` | `AggregationName` |  |
| `showAs?` | `ShowValuesAs` |  |
| `along?` | `PivotAxis` |  |
| `caption?` | `string` |  |
| `format?` | `PivotNumberFormat` |  |
| `id?` | `string` |  |

### ValueFilter

Kind: interface. Import from `@birchui/pivot-studio`.

```ts
interface ValueFilter
```

| Property | Type | Description |
| --- | --- | --- |
| `op` | `ValueFilterOp` |  |
| `measure` | `MeasureRef` |  |
| `value` | `number` |  |
| `valueTo?` | `number` |  |

### AggregationName

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type AggregationName = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'distinctCount' | 'median';
```

### ConditionalFormatRule

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type ConditionalFormatRule = ColorScaleRule | DataBarRule | ThresholdRule;
```

### DataFormat

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type DataFormat = 'auto' | 'array' | 'csv' | 'json';
```

### DatePart

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type DatePart = 'year' | 'quarter' | 'month' | 'day';
```

### FieldType

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type FieldType = 'string' | 'number' | 'date' | 'boolean';
```

### InputLimitCode

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type InputLimitCode =
  'input-too-long' | 'too-many-rows' | 'too-many-columns' | 'too-many-events' | 'too-many-tasks' | 'too-many-links';
```

### LabelFilterOp

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type LabelFilterOp = 'contains' | 'notContains' | 'beginsWith' | 'endsWith' | 'equals' | 'notEquals';
```

### MeasureRef

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type MeasureRef = string | { field: string; aggregation?: AggregationName };
```

### PivotAxis

Kind: type. Import from `@birchui/pivot-studio`.

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

### PivotLayoutName

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type PivotLayoutName = 'compact' | 'outline' | 'tabular';
```

### PivotMatrixCell

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type PivotMatrixCell = string | number | null;
```

### PivotRecord

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type PivotRecord = Record<string, unknown>;
```

### PivotRowKind

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type PivotRowKind = 'member' | 'subtotal' | 'grandTotal';
```

### PivotZone

Kind: type. Import from `@birchui/pivot-studio`.

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

### ShowValuesAs

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type ShowValuesAs =
  | 'none'
  | 'percentOfGrandTotal'
  | 'percentOfRowTotal'
  | 'percentOfColumnTotal'
  | 'percentOfParentRowTotal'
  | 'percentOfParentColumnTotal'
  | 'runningTotal'
  | 'differenceFromPrevious'
  | 'percentDifferenceFromPrevious';
```

### SortDirection

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type SortDirection = 'asc' | 'desc';
```

### ValueFilterOp

Kind: type. Import from `@birchui/pivot-studio`.

```ts
type ValueFilterOp = 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'ne' | 'between' | 'notBetween';
```

## @birchui/pivot-studio/charts

### createPivotChart

Kind: function. Import from `@birchui/pivot-studio/charts`.

```ts
function createPivotChart<TRecord>(container: HTMLElement, studio: PivotStudioApi<TRecord>, options: PivotChartOptions = {}): PivotChartHandle
```

| Parameter | Type | Description |
| --- | --- | --- |
| `container` | `HTMLElement` |  |
| `studio` | `PivotStudioApi<TRecord>` |  |
| `options?` | `PivotChartOptions` |  |

### pivotChartData

Kind: function. Import from `@birchui/pivot-studio/charts`.

```ts
function pivotChartData(view: PivotView, options: PivotChartDataOptions = {}): PivotChartData
```

| Parameter | Type | Description |
| --- | --- | --- |
| `view` | `PivotView` |  |
| `options?` | `PivotChartDataOptions` |  |

### pivotChartOptions

Kind: function. Import from `@birchui/pivot-studio/charts`.

```ts
function pivotChartOptions(view: PivotView | null, options: PivotChartOptions = {}): ChartOptions<ChartDatum>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `view` | `PivotView \| null` |  |
| `options?` | `PivotChartOptions` |  |

### pivotChartPlugin

Kind: function. Import from `@birchui/pivot-studio/charts`.

```ts
function pivotChartPlugin(options: PivotChartPluginOptions = {}): PivotStudioPlugin
```

| Parameter | Type | Description |
| --- | --- | --- |
| `options?` | `PivotChartPluginOptions` |  |

### PivotChartData

Kind: interface. Import from `@birchui/pivot-studio/charts`.

```ts
interface PivotChartData
```

| Property | Type | Description |
| --- | --- | --- |
| `categories` | `string[]` |  |
| `series` | `PivotChartSeries[]` |  |

### PivotChartHandle

Kind: interface. Import from `@birchui/pivot-studio/charts`.

```ts
interface PivotChartHandle
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly chart` | `ChartApi<ChartDatum>` |  |
| `update` | `(options: Partial<PivotChartOptions>) => void` |  |
| `refresh` | `() => void` |  |
| `destroy` | `() => void` |  |

### PivotChartOptions

Kind: interface. Import from `@birchui/pivot-studio/charts`.

```ts
interface PivotChartOptions extends PivotChartDataOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `type?` | `PivotChartType` |  |
| `stacked?` | `boolean` |  |
| `title?` | `string` |  |
| `height?` | `number \| string` |  |
| `theme?` | `'light' \| 'dark' \| 'auto'` |  |
| `licenseKey?` | `string` |  |
| `locale?` | `string` |  |
| `chart?` | `Partial<Omit<ChartOptions<ChartDatum>, 'data' \| 'series'>>` |  |
| `measure?` | `string \| undefined` | Inherited from PivotChartDataOptions. |
| `maxCategories?` | `number \| undefined` | Inherited from PivotChartDataOptions. |
| `maxSeries?` | `number \| undefined` | Inherited from PivotChartDataOptions. |

### PivotChartPluginOptions

Kind: interface. Import from `@birchui/pivot-studio/charts`.

```ts
interface PivotChartPluginOptions extends PivotChartOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `position?` | `'top' \| 'bottom'` |  |
| `visible?` | `boolean` |  |
| `type?` | `PivotChartType \| undefined` | Inherited from PivotChartOptions. |
| `stacked?` | `boolean \| undefined` | Inherited from PivotChartOptions. |
| `title?` | `string \| undefined` | Inherited from PivotChartOptions. |
| `height?` | `string \| number \| undefined` | Inherited from PivotChartOptions. |
| `theme?` | `"auto" \| "light" \| "dark" \| undefined` | Inherited from PivotChartOptions. |
| `licenseKey?` | `string \| undefined` | Inherited from PivotChartOptions. |
| `locale?` | `string \| undefined` | Inherited from PivotChartOptions. |
| `chart?` | `Partial<Omit<ChartOptions<ChartDatum>, "data" \| "series">> \| undefined` | Inherited from PivotChartOptions. |
| `measure?` | `string \| undefined` | Inherited from PivotChartDataOptions. |
| `maxCategories?` | `number \| undefined` | Inherited from PivotChartDataOptions. |
| `maxSeries?` | `number \| undefined` | Inherited from PivotChartDataOptions. |

### PivotChartSeries

Kind: interface. Import from `@birchui/pivot-studio/charts`.

```ts
interface PivotChartSeries
```

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` |  |
| `name` | `string` |  |
| `measure` | `string` |  |
| `values` | `(number \| null)[]` |  |

### PivotChartType

Kind: type. Import from `@birchui/pivot-studio/charts`.

```ts
type PivotChartType = 'column' | 'bar' | 'line' | 'area' | 'pie' | 'donut';
```
