api reference
Type reference
Every interface the library declares, with the type of each member, generated from the declarations so it always matches the release.
API reference › Type reference
Type reference
Every interface the library declares, with the type of each member. The sections above describe how the grid is used; this one is the complete surface, generated from the type declarations so that it always matches the release.
AiApi
| Member | Type | Description |
|---|---|---|
| schema | (opts?: { maxColumns?: number; maxRows?: number }): Record<string, unknown> | A machine-readable description of the grid, for a model's context. |
| tool | (opts?: { maxColumns?: number; maxRows?: number }): Record<string, unknown> | The same schema as a tool definition. |
| prompt | (opts?: Record<string, unknown>): string | The prompt describing this grid (its columns, types and operators) for sending to a model. It carries no row values. It does not take the user's question: compose that yourself alongside the text this returns, which is what `ask` receives as `schemaText`. |
| buildPrompt | (text: string, opts?: Record<string, unknown>): string | |
| plan | (reply: string | Record<string, unknown>, opts?: Record<string, unknown>): Record<string, unknown> | Parse what the model returned into a plan. |
| apply | (plan: Record<string, unknown>): Record<string, unknown> | Run a plan as one undoable step. |
AnnotationApi
The presenter's drawing layer. Pixels over the grid, it never reads or writes data, and it is inert until a tool is chosen, so scrolling and selection pass straight through. Marks are held in content coordinates, so they stay with the cells they annotate when the grid scrolls, and are cleared when a presentation ends.
| Member | Type | Description |
|---|---|---|
| tool | 'pen' | 'arrow' | 'rect' | 'highlight' | null | (read-only) |
| count | number | (read-only) |
| use | (tool: 'pen' | 'arrow' | 'rect' | 'highlight' | null, opts?: { colour?: string }): string | null | |
| undo | (): number | |
| clear | (): void | |
| redraw | (): void |
BooleanFormat
| Member | Type | Description |
|---|---|---|
| type | 'boolean' | |
| display | 'checkbox' | 'switch' | 'text' | 'icon' | (optional) |
| trueLabel | string | (optional) |
| falseLabel | string | (optional) |
| nullLabel | string | (optional) |
| trueIcon | string | (optional) |
| falseIcon | string | (optional) |
CapabilityInterval
An interval for a capability index, by Bissell's approximation.
| Member | Type | Description |
|---|---|---|
| index | number | |
| lower | number | |
| upper | number | |
| margin | number | |
| n | number | |
| confidence | number |
CaptureOptions
Rendering the grid to a still image. `scale` multiplies the pixel dimensions : 2 for a retina still, 3 or 4 for a slide. `background` fills behind the grid so a PNG dropped into a deck does not show it through.
| Member | Type | Description |
|---|---|---|
| scale | number | (optional) |
| background | string | (optional) |
| download | boolean | (optional) |
| fileName | string | (optional) |
CellMenuParams
What a cell-menu builder and a host item's `action` are handed.
| Member | Type | Description |
|---|---|---|
| key | string | |
| colId | string | |
| value | unknown | |
| row | Row | The row wrapper. |
| data | unknown | Your original row object. |
| column | ResolvedColumn | |
| index | number | |
| grid | Grid |
CellParams
| Member | Type | Description |
|---|---|---|
| text | string | |
| index | number | |
| props | Record<string, unknown> | (optional) |
CellRange
| Member | Type | Description |
|---|---|---|
| startRow | number | |
| endRow | number | |
| columns | string[] |
ChangeResult
| Member | Type | Description |
|---|---|---|
| added | Row[] | |
| updated | Row[] | |
| removed | string[] | |
| rejected | RejectedRow[] | Rows that could not be applied. A batch of a thousand containing three bad ones applies the other 997 and lists the three here. (optional) |
Chart
A live chart.
| Member | Type | Description |
|---|---|---|
| element | SVGElement | (read-only) |
| draw | (): void | Redraw now. |
| update | (spec: Partial<ChartSpec>): void | Change the spec and redraw; unnamed keys keep their values. |
| data | (): object | null | The data the chart last bound. |
| ascend | (levels?: number): void | Go up one level, on a drillable hierarchy. |
| on | (event: ChartEventName, handler: (payload: unknown) => void): () => void | |
| emit | (event: ChartEventName, payload?: unknown): void | |
| toSVG | (opts?: object): string | |
| toPNG | (opts?: { scale?: number; background?: string }): Promise<Blob> | |
| toCSV | (): string | |
| destroy | (): void |
ChartLabels
Data labels beside each mark.
| Member | Type | Description |
|---|---|---|
| position | 'outside' | 'inside' | 'auto' | (optional) |
| format | string | ((value: unknown, point?: unknown) => string) | A format mask, or a function of the value. (optional) |
| minGap | number | Pixels two labels must leave between them before both are kept. (optional) |
ChartMeasure
A measure a chart reduces, when the chart is not given a bare `y`.
| Member | Type | Description |
|---|---|---|
| col | string | |
| fn | TotalName | A reduction name, as the totals row uses. (optional) |
| type | 'bar' | 'line' | 'area' | The mark this measure draws with, on a combo chart. (optional) |
| axis | 'left' | 'right' | Which axis it belongs to, on a combo chart. (optional) |
| title | string | (optional) |
ChartSpec
What a chart draws and how. `grid` and `container` are required; everything else describes the chart. A chart reads the grid's *filtered* rows, so it follows the grid without being told to.
| Member | Type | Description |
|---|---|---|
| grid | Grid | |
| container | Element | string | |
| type | ChartType | |
| x | string | The category column. (optional) |
| y | string | The measure column, for the types that take one. (optional) |
| series | string | Splits the measure into one series per distinct value. (optional) |
| measures | ChartMeasure[] | Several measures at once, for combo and candlestick. (optional) |
| source | string | Endpoints, for sankey, chord and network. (optional) |
| target | string | (optional) |
| label | string | Row label and dates, for gantt. (optional) |
| start | string | (optional) |
| end | string | (optional) |
| title | string | (optional) |
| scheme | string | string[] | A named scheme, or an array of colours. (optional) |
| legend | boolean | { position?: 'top' | 'bottom' | 'left' | 'right'; isolate?: boolean } | (optional) |
| labels | boolean | ChartLabels | (optional) |
| axis | object | (optional) |
| font | object | (optional) |
| margin | number | { top?: number; right?: number; bottom?: number; left?: number } | (optional) |
| fit | boolean | 'line' | A least-squares line through a scatter or bubble chart, one per series. `true` draws the line and its R²; `'line'` draws the line alone. Only where the x axis is numeric: on a band scale the positions are categories in an arbitrary order, and a slope through them would be a slope through the order they happened to be listed in. (optional) |
| error | boolean | { of?: string; confidence?: number } | Whiskers showing the uncertainty in each mark. `true` computes a confidence interval from the readings behind the mark; `of` takes a symmetric margin from another column instead. (optional) |
| reference | { value: number; label?: string }[] | (optional) |
| buckets | number | Bins for a histogram; the default is twelve. (optional) |
| diverging | boolean | A diverging colour ramp, for heatmap and geomap. (optional) |
| shapes | unknown | Country outlines, for a geomap drawing countries rather than continents. (optional) |
| codeProperty | string | (optional) |
| multiples | string | One chart per distinct value of this column. (optional) |
| canvas | boolean | number | Draw to canvas past this many points. (optional) |
| downsample | number | (optional) |
| emptyText | string | (optional) |
| subtitle | string | A second line under the title. (optional) |
| footnote | string | A note under the plot, a source, a caveat, a unit. (optional) |
| tooltip | boolean | `false` turns the hover tooltip off. (optional) |
| selection | boolean | Draw the grid's selected rows emphasised, and follow the selection. (optional) |
| drill | boolean | Clicking a group drills into it. (optional) |
| filterOnClick | boolean | Clicking a mark filters the grid to it. (optional) |
| stack | boolean | Stack the series rather than drawing them side by side. (optional) |
| curve | boolean | Overlay a kernel density curve on a histogram. (optional) |
| measure | string | An alias for `y`, where "the measure" reads better than "the y axis". (optional) |
| size | string | Bubble charts: the column driving the radius, and the largest it may be. (optional) |
| maxRadius | number | (optional) |
| min | number | Fix the measure axis rather than taking it from the data. (optional) |
| max | number | (optional) |
| code | string | A geomap's ISO code column. An alias for `x`. (optional) |
| columns | string[] | Correlogram: which columns to correlate, how, and whether to print them. (optional) |
| method | 'pearson' | 'spearman' | 'kendall' | (optional) |
| values | boolean | (optional) |
| iterations | number | Network layouts: how many relaxation passes to run. (optional) |
| spec | { lower?: number; upper?: number; target?: number } | Control and capability charts: a tolerance overriding the column's own `spec`, how many leading readings fix the control limits, which rule set the violations are judged against, and the level for the capability interval. (optional) |
| baseline | number | (optional) |
| rules | 'westernElectric' | 'nelson' | (optional) |
| confidence | number | (optional) |
Chunk
| Member | Type | Description |
|---|---|---|
| rows | unknown[] | |
| progress | { loaded: number; estimated?: number } | (optional) |
| done | boolean | (optional) |
ClipboardOptions
| Member | Type | Description |
|---|---|---|
| headers | boolean | (optional) |
| rows | 'visible' | 'all' | 'selected' | 'range' | (optional) |
Column
| Member | Type | Description |
|---|---|---|
| tags | string | string[] | Free-form labels for grouping columns together. A bare string is accepted for a single tag. Used by the column tag bar to show and hide sets of columns: tag sixty monthly columns with their year, and a user can switch to one year. (optional) |
| id | string | The column's own identity. Defaults to `field`; needed explicitly when two columns read the same field, as a value and its running total do. (optional) |
| field | string | The property to read from each row. Dotted paths reach into nested data. (optional) |
| title | string | The heading. Defaults to a readable form of `field`. (optional) |
| type | TypeName | false | The data type, which decides parsing, formatting, sorting, the default editor and the default filter together. `false` turns inference off and treats the values as opaque. (optional) |
| preset | string | string[] | Named column presets to merge in first, so a house style is declared once. (optional) |
| format | FormatSpec | string | How a value is rendered as text. A string is a shorthand mask. (optional) |
| lookup | LookupSpec | Display a stored code as a label, and edit it as a list. (optional) |
| value | ColumnValueSpec | A computed value, with the columns it depends on, in place of a stored one. (optional) |
| cell | ColumnCellSpec | string | The renderer, and what it is given. A string names a registered renderer. (optional) |
| edit | ColumnEditSpec | boolean | string | Whether and how the cell can be edited. A string names an editor. (optional) |
| sort | ColumnSortSpec | boolean | Whether the column sorts, and by what comparison. `false` refuses it. (optional) |
| filter | ColumnFilterSpec | boolean | FilterName | Whether the column filters, and with which filter. A string names one. (optional) |
| group | { enabled?: boolean; index?: number; explode?: boolean } | boolean | Row grouping by this column. `index` fixes its place among several; `explode` gives a multi-value cell one group per value rather than one group for the combination. (optional) |
| pivot | { enabled?: boolean; index?: number } | boolean | Use this column as a pivot dimension, and where it sits among several. (optional) |
| total | TotalName | TotalFn | The reduction shown in the totals row and in group footers. (optional) |
| shadow | ShadowKind | { | A value the grid maintains about this column's own history, rather than a field in the data. `{of: 'price', kind: 'delta'}`, or the bare kind to shadow the column it sits beside. (optional) |
| running | 'total' | 'percent' | 'delta' | A running total down the grid **as it is currently ordered**. The one derived value that depends on the display order: sort differently and every value changes. That is why it is not a shadow kind: every shadow reads the same however the rows are arranged. (optional) |
| spec | { lower?: number; upper?: number; target?: number } | The customer's tolerance, for process capability and control charts. Declared here rather than passed to each call so the capability figures, a control chart and any rule marking an out-of-tolerance cell cannot disagree about what the tolerance is. (optional) |
| layout | ColumnLayoutSpec | number | Width, pinning and flex. A bare number is the width in pixels. (optional) |
| header | ColumnHeaderSpec | string | The header cell: its text, tooltip, menu and any header chart. (optional) |
| export | ColumnExportSpec | How the column leaves the grid, where that differs from how it is shown. (optional) |
| allowGroup | boolean | Whether the user may group by this column from the interface. (optional) |
| allowPivot | boolean | Whether the user may pivot on it. (optional) |
| allowTotal | boolean | Whether the user may put a total on it. (optional) |
| nullable | boolean | Whether an empty value is a legitimate value rather than a gap. (optional) |
ColumnCellSpec
| Member | Type | Description |
|---|---|---|
| decoration | DecorationName | DecorationSpec | (optional) |
| variant | VariantSpec | (optional) |
| template | string | (optional) |
| render | string | RenderFn | RendererCtor | (optional) |
| props | Record<string, unknown> | (optional) |
| css | (p: CellParams) => CellStyle | (optional) |
| class | string | string[] | ((p: CellParams) => string | string[]) | (optional) |
| classWhen | Record<string, string | ((p: CellParams) => boolean)> | (optional) |
| style | CellStyle | ((p: CellParams) => CellStyle) | (optional) |
| tooltip | string | ((p: CellParams) => string) | (optional) |
| align | Align | (optional) |
| wrap | boolean | (optional) |
| autoHeight | boolean | (optional) |
| flash | boolean | (optional) |
| spanColumns | (p: SpanParams) => number | (optional) |
| spanRows | (p: SpanParams) => number | (optional) |
ColumnDistribution
| Member | Type | Description |
|---|---|---|
| n | number | |
| min | number | |
| max | number | |
| mean | number | |
| stddev | number | |
| median | number | |
| q1 | number | |
| q3 | number | |
| iqr | number | |
| sorted | number[] |
ColumnEditSpec
| Member | Type | Description |
|---|---|---|
| enabled | boolean | ((p: CellParams) => boolean) | (optional) |
| editor | string | EditorCtor | (optional) |
| props | Record<string, unknown> | (optional) |
| popup | boolean | (optional) |
| validate | (p: ValidateParams) => true | string | (optional) |
ColumnExportSpec
| Member | Type | Description |
|---|---|---|
| lookup | 'label' | 'value' | 'columns' | (optional) |
| csv | boolean | (optional) |
| excel | boolean | (optional) |
ColumnFacetConfig
Per-column histogram settings, layered over the grid's.
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (optional) |
| buckets | number | (optional) |
| strategy | 'equal' | 'quantile' | 'log' | (optional) |
| granularity | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year' | (optional) |
| order | 'count' | 'alpha' | (optional) |
| cardinalityLimit | number | (optional) |
| aboveLimit | 'suppress' | 'topN' | (optional) |
| bucketFn | (handle: unknown, indices: Uint32Array | null, count: number) => FacetBounds | Replace the built-in bucketing entirely. (optional) |
| format | (bucket: FacetBucket, count: number, unfiltered: number) => string | Label a bucket for its tooltip and accessible name. (optional) |
ColumnFilterSpec
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (optional) |
| type | FilterName | FilterCtor | (optional) |
| props | Record<string, unknown> | (optional) |
ColumnGroup
| Member | Type | Description |
|---|---|---|
| id | string | (optional) |
| title | string | |
| columns | (Column | ColumnGroup)[] | |
| collapsible | boolean | (optional) |
| openByDefault | boolean | (optional) |
| showWhen | 'open' | 'closed' | 'always' | (optional) |
| marryChildren | boolean | (optional) |
| header | { render?: string | RendererCtor; props?: Record<string, unknown>; class?: string | string[] } | (optional) |
| facet | ColumnFacetConfig | boolean | This column's histogram. `true` turns it on with the grid's settings. (optional) |
ColumnHeaderSpec
| Member | Type | Description |
|---|---|---|
| template | string | (optional) |
| render | string | RendererCtor | (optional) |
| props | Record<string, unknown> | (optional) |
| class | string | string[] | (optional) |
| tooltip | string | (optional) |
| align | Align | (optional) |
ColumnLayoutSpec
| Member | Type | Description |
|---|---|---|
| width | number | string | A pixel width, or a percentage of the grid's inner width as a string, `'25%'`. A percentage is a share of the *whole* grid. `flex` divides only the space left over after fixed columns, so the two are not interchangeable: `flex: 25` on four columns is a quarter of the remainder, which is a quarter of the grid only when nothing else is fixed. (optional) |
| min | number | (optional) |
| max | number | (optional) |
| flex | number | (optional) |
| pin | 'start' | 'end' | null | (optional) |
| hidden | boolean | (optional) |
| resizable | boolean | (optional) |
| movable | boolean | (optional) |
| lockVisible | boolean | (optional) |
| lockPosition | boolean | 'start' | 'end' | (optional) |
ColumnMenuParams
What a column menu's item builder and its actions are handed.
| Member | Type | Description |
|---|---|---|
| colId | string | |
| column | ResolvedColumn | The resolved column, including any properties you defined on it. |
| grid | Grid |
ColumnProfile
| Member | Type | Description |
|---|---|---|
| column | string | |
| rows | number | |
| present | number | |
| missing | number | |
| distinct | number | |
| min | number | null | |
| max | number | null | |
| mean | number | null | |
| median | number | null | |
| q1 | number | null | |
| q3 | number | null | |
| iqr | number | null | |
| stddev | number | null | |
| outliers | number | |
| histogram | HistogramBin[] |
ColumnsApi
| Member | Type | Description |
|---|---|---|
| setTotal | (id: string, fn: TotalName | TotalFn | null): void | Set or clear a column's totals-row reduction. |
| distinct | (id: string): unknown[] | Every distinct value in a column, from the dictionary where there is one. |
| get | (id: string): ResolvedColumn | undefined | |
| all | (): ResolvedColumn[] | |
| visible | (): ResolvedColumn[] | |
| state | (): ColumnState[] | |
| apply | (state: ColumnState[]): void | |
| tags | (): string[] | Every distinct column tag, in the order first declared. |
| showTagged | (tags?: string | string[] | null): string[] | Show only the columns carrying one of these tags. **Columns with no tags are never hidden.** Pass nothing to show every tagged column again. Returns the ids that were hidden. |
| activeTags | (): string[] | The tags currently being shown, empty when all are. |
| show | (ids: string | string[]): void | |
| hide | (ids: string | string[]): void | |
| move | (id: string, to: number): void | |
| pin | (id: string, side: 'start' | 'end' | null): void | |
| resize | (id: string, px: number): void | |
| autoSize | (ids?: string | string[]): void | |
| fit | (): void | |
| group | (ids: string | string[]): void | |
| pivot | (ids: string | string[]): void | |
| totals | (ids: string | string[]): void |
ColumnSortSpec
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (optional) |
| direction | 'asc' | 'desc' | null | (optional) |
| order | number | (optional) |
| nullsFirst | boolean | (optional) |
ColumnState
| Member | Type | Description |
|---|---|---|
| id | string | |
| width | number | (optional) |
| flex | number | (optional) |
| hidden | boolean | (optional) |
| pin | 'start' | 'end' | null | (optional) |
| sort | 'asc' | 'desc' | null | (optional) |
| sortIndex | number | null | (optional) |
| groupIndex | number | null | (optional) |
| pivotIndex | number | null | (optional) |
| total | TotalName | null | (optional) |
ColumnValueSpec
| Member | Type | Description |
|---|---|---|
| compute | (deps: DepValues, ctx: ValueContext) => unknown | (optional) |
| deps | string[] | '*' | (optional) |
| pure | boolean | (optional) |
| format | (p: FormatParams) => string | (optional) |
| apply | (p: ApplyParams) => boolean | (optional) |
| parse | (p: ParseParams) => unknown | (optional) |
| key | (p: KeyParams) => string | (optional) |
| compare | Comparator | (optional) |
| quickFilterText | (p: ValueParams) => string | (optional) |
Comment
One comment in a thread, as the provider returns it.
| Member | Type | Description |
|---|---|---|
| id | string | |
| body | string | |
| author | { name?: string; avatarUrl?: string; initials?: string } | Rendered as supplied. The grid does not know who the user is. (optional) |
| at | number | (optional) |
| edited | boolean | (optional) |
| resolved | boolean | (optional) |
| parentId | string | null | (optional) |
| value | unknown | The cell's value when this was written, so a later reader is told it moved. (optional) |
| can | { edit?: boolean; delete?: boolean; resolve?: boolean } | What the current user may do. Absent means the grid shows every affordance and relies on the provider to refuse. Hiding a button is a convenience, never a security control. (optional) |
CommentConfig
| Member | Type | Description |
|---|---|---|
| provider | CommentProvider | Without one the feature is inert and no error is raised. (optional) |
| debounce | number | Milliseconds a viewport change waits before the index is fetched. (optional) |
| indexLimit | number | Cell descriptors held before the oldest are dropped. (optional) |
| mode | 'anchored' | 'docked' | `'anchored'` floats beside the cell; `'docked'` uses a side panel. (optional) |
| markdown | boolean | Restricted markdown in bodies: emphasis, code and links only. (optional) |
| rowLabel | (row: Row) => string | Label for the row, so the panel says what is being commented on. (optional) |
CommentDescriptor
Counts for one cell. Never bodies: this is consulted on every repaint.
| Member | Type | Description |
|---|---|---|
| count | number | |
| unresolved | number | |
| updated | number |
CommentIndexEntry
What `loadIndex` returns per commented cell.
| Member | Type | Description |
|---|---|---|
| cellKey | string | (optional) |
| rowId | string | (optional) |
| field | string | (optional) |
CommentProvider
Storage for comments. Every method returns a promise; a rejection surfaces in the panel without disturbing grid state.
| Member | Type | Description |
|---|---|---|
| loadIndex | (rowIds: string[], fields: string[]): Promise<CommentIndexEntry[]> | |
| loadThread | (cellKey: string): Promise<Comment[]> | |
| addComment | (cellKey: string, body: string, parentId: string | null, | |
| editComment | (commentId: string, body: string): Promise<Comment> | |
| deleteComment | (commentId: string): Promise<void> | |
| resolveThread | (cellKey: string): Promise<void> | |
| unresolveThread | (cellKey: string): Promise<void> |
CommentsApi
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (read-only) |
| openKey | string | null | (read-only) |
| thread | Comment[] | null | (read-only) |
| loading | boolean | (read-only) |
| complete | boolean | (read-only) |
| unavailable | (): string | null | `'no-provider'`, `'no-row-identity'`, or null when available. |
| at | (rowId: string, colId: string): CommentDescriptor | null | |
| request | (rowIds: string[], fields?: string[]): void | |
| open | (rowId: string, colId: string): Promise<Comment[] | null> | |
| close | (opts?: { reason?: string }): void | |
| add | (body: string, opts?: { parentId?: string; author?: object }): Promise<Comment | null> | |
| edit | (commentId: string, body: string): Promise<Comment | null> | |
| remove | (commentId: string): Promise<boolean> | |
| resolve | (): Promise<boolean> | |
| unresolve | (): Promise<boolean> | |
| refresh | (): void | |
| loadAll | (): Promise<boolean> | |
| hiddenUnresolved | (): number | |
| filterToCommented | (opts?: { unresolvedOnly?: boolean }): boolean |
Condition
| Member | Type | Description |
|---|---|---|
| col | string | |
| type | TypeName | (optional) |
| op | Operator | |
| value | unknown | (optional) |
| bounds | '[]' | '[)' | '(]' | '()' | (optional) |
| caseSensitive | boolean | (optional) |
| meta | Record<string, unknown> | (optional) |
ConfidenceInterval
An interval for an estimated figure, at a stated level.
| Member | Type | Description |
|---|---|---|
| mean | number | |
| lower | number | |
| upper | number | |
| margin | number | |
| n | number | |
| confidence | number | The level the bounds were computed at, 0 to 1. |
CrossFilter
| Member | Type | Description |
|---|---|---|
| enabled | (): boolean | Whether this grid can cross-filter a source. |
| column | (): string | null | The source column the filter is pushed onto. |
| get | (): string[] | The keys currently filtering the source. |
| set | (keys: string | string[] | null): void | Filter the source to these derived rows. |
| toggle | (key: string): void | Add or remove one key, for click-to-filter. |
| clear | (): void | Take this grid's filter off its source. |
CsvExportOptions
| Member | Type | Description |
|---|---|---|
| delimiter | string | (optional) |
| quote | string | (optional) |
| lineEnding | string | (optional) |
| headers | boolean | (optional) |
| columns | string[] | (optional) |
| rows | 'visible' | 'all' | 'selected' | (optional) |
| fileName | string | (optional) |
| processCell | (p: CellParams) => string | (optional) |
| download | boolean | (optional) |
DataType
| Member | Type | Description |
|---|---|---|
| base | 'text' | 'number' | 'boolean' | 'date' | 'dateString' | 'object' | |
| extends | TypeName | (optional) |
| matches | (value: unknown) => boolean | (optional) |
| format | (p: FormatParams) => string | (optional) |
| parse | (p: ParseParams) => unknown | (optional) |
| compare | Comparator | (optional) |
| defaults | { | (optional) |
| storage | 'float64' | 'int32' | 'bitset' | 'dictionary' | 'object' | (optional) |
| totals | { | Which aggregates are meaningful for this type, and how. Omit it and every aggregate is allowed, which is what every type that shipped before this does. (optional) |
| excel | string | (optional) |
| toClipboard | (v: unknown) => string | (optional) |
| fromClipboard | (s: string) => unknown | (optional) |
DateFormat
| Member | Type | Description |
|---|---|---|
| type | 'date' | |
| pattern | string | (optional) |
| dateStyle | 'short' | 'medium' | 'long' | 'full' | (optional) |
| timeStyle | 'short' | 'medium' | 'long' | (optional) |
| timeZone | string | (optional) |
| relative | boolean | { threshold?: number } | (optional) |
| nullDisplay | string | (optional) |
| locale | string | (optional) |
DecorationSpec
| Member | Type | Description |
|---|---|---|
| type | DecorationName | |
| size | 'sm' | 'md' | 'lg' | (optional) |
| shape | 'pill' | 'rounded' | 'square' | (optional) |
| outline | boolean | (optional) |
| edge | boolean | (optional) |
| position | 'start' | 'end' | (optional) |
| name | string | Record<string, string> | (optional) |
| min | number | (optional) |
| max | number | (optional) |
| origin | number | (optional) |
| showValue | boolean | (optional) |
| track | boolean | (optional) |
| ramp | string | (optional) |
| midpoint | number | (optional) |
DerivedJoin
| Member | Type | Description |
|---|---|---|
| with | Grid | The grid holding the other side. |
| on | string | { left?: string; right?: string } | The shared key: one field name when both sides use it, or one each. |
| type | 'inner' | 'left' | `inner` keeps only rows that matched; `left` keeps them all. (optional) |
| select | string[] | Which of the partner's fields to bring across. All of them by default. (optional) |
| prefix | string | Rename the brought-across fields, when both sides have one worth keeping. (optional) |
| follow | 'all' | 'filtered' | Which of the partner's rows to read. `all` by default. (optional) |
DerivedSelect
One reduced column of a derived grid.
| Member | Type | Description |
|---|---|---|
| of | string | The column to reduce, as a field name or a dotted path. Omit for `count`. (optional) |
| fn | TotalName | A key of `TOTAL_FNS`: `sum`, `avg`, `median`, `p95`, `distinct` and the rest. (optional) |
DerivedSourceConfig
A grid whose rows are derived from another grid: aggregated, unnested, filtered, ranked or profiled. Read-only: write to the source instead.
| Member | Type | Description |
|---|---|---|
| mode | 'derived' | |
| from | Grid | The grid to read. |
| follow | 'filtered' | 'all' | 'selected' | 'grouped' | Which of its rows to read. `filtered` by default. (optional) |
| unnest | string | An array property to expand, one row per element, before anything else. (optional) |
| join | DerivedJoin | Match each row against a second grid on a shared key, and bring some of its fields across. Runs after `unnest` and before `where`, so a condition: and a grouping, and a total: can read a field the join produced. (optional) |
| where | (row: unknown) => boolean | A row predicate, applied before grouping. (optional) |
| bucket | { of: string; by: 'day' | 'week' | 'month' | 'quarter' | 'year' } | Round a date column down to a period, and group on that. (optional) |
| groupBy | string | string[] | The dimension, or dimensions, to group by. Omit to pass rows through. (optional) |
| select | Record<string, DerivedSelect> | The reduced columns, by output id. (optional) |
| sort | { col: string; dir?: 'asc' | 'desc' }[] | How to order the derived rows before limiting them. (optional) |
| limit | number | Keep at most this many rows. (optional) |
| limitPer | string | Apply `limit` within each distinct value of this column, not overall. (optional) |
| cumulative | { of: string; upTo: number } | Keep rows until their running share of the total reaches `upTo`, 0 to 1. (optional) |
| profile | string | string[] | One row per column, with the statistics as columns. Replaces the pipeline. (optional) |
| orient | 'columns' | 'metrics' | With `profile`, emit one row per statistic instead of one per column. (optional) |
| refresh | 'live' | 'idle' | 'manual' | number | When to re-derive. `idle` by default: coalesced to a frame. (optional) |
| crossFilter | boolean | string | { col?: string } | Let this grid filter the grid it derives from. `true` cross-filters through whatever it groups by; a string names a different source column. (optional) |
DetailApi
| Member | Type | Description |
|---|---|---|
| enabled | (): boolean | |
| isMaster | (target: string | Row): boolean | |
| isOpen | (key: string): boolean | |
| open | (key: string): void | |
| close | (key: string): void | |
| toggle | (key: string): boolean | |
| closeAll | (): void | |
| keys | (): string[] | |
| active | (): string | null | |
| placement | (): 'inline' | 'target' | null | |
| config | (): DetailConfig | null |
DetailConfig
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (optional) |
| render | string | RendererCtor | (optional) |
| config | GridConfig | (optional) |
| rows | (row: Row) => unknown[] | Promise<unknown[]> | (optional) |
| height | number | 'auto' | ((row: Row) => number) | (optional) |
| cacheLimit | number | (optional) |
| isMaster | (data: unknown, row: Row) => boolean | (optional) |
| target | string | HTMLElement | Render the detail into this element instead of into a row beneath its master. A selector or an element. Exactly one detail is open at a time in this placement. (optional) |
| onCreate | (grid: Grid, masterRow: Row) => void | Handed the nested grid as it is created, for whatever the forwarded events do not cover. (optional) |
| path | string | The property of the master's record the detail rows live on, so an edit in the detail is reported as a path on the master: `ports.1.vlan`. Inferred by identity when `rows(row)` returns an array already on the record, which is the usual shape; set this when it does not. (optional) |
DiagnosticsApi
| Member | Type | Description |
|---|---|---|
| snapshot | (): Record<string, unknown> | |
| renders | (): Record<string, unknown> | `dom.cellWrites` is the figure a DOM-write assertion reads. |
| store | (): Record<string, unknown> | |
| operations | (): Record<string, unknown> | |
| providers | (): Record<string, unknown> | |
| events | (): Record<string, number> | |
| config | (): { effective: Record<string, unknown>; supplied: string[]; defaulted: string[] } | |
| warnings | (): DiagnosticWarning[] | |
| dismiss | (id: string): void | |
| bundle | (): Record<string, unknown> | Contains no row data, cell values or column values. |
| checkOptions | (options: unknown): boolean | |
| record | (kind: string, detail: { rows?: number; ms?: number; worker?: boolean }): void | |
| render | (cause: string, phases?: Record<string, number>): void | |
| recordEvents | (on: boolean, limit?: number): void | Off by default; recording times every emit. |
| eventLog | (): Array<{ type: string; origin: string; listeners: number | |
| clearEventLog | (): void | |
| mark | (): Record<string, unknown> | Keep current store statistics so growth can be measured against them. |
| since | (): Record<string, unknown> | null | |
| reset | (): void |
DiagnosticWarning
One thing the grid has flagged as probably a mistake.
| Member | Type | Description |
|---|---|---|
| id | string | Stable identifier, nameable in a support conversation. |
| message | string | |
| values | Record<string, unknown> | The specific values involved, so the warning is actionable. |
| count | number | |
| first | number | |
| last | number | |
| source | 'check' | 'reported' | 'info' | `'check'` raised by a diagnostic check, `'reported'` from `warnOnce`. |
DiffApi
| Member | Type | Description |
|---|---|---|
| swap | (): boolean | Exchange the baseline and the current rows. Returns false with nothing to swap. |
| enabled | boolean | (read-only) |
| setSnapshot | (rows: unknown[] | null): void | Set the baseline every row is compared against. |
| clear | (): void | |
| summary | (): { added: number; removed: number; changed: number; unchanged: number } | |
| statusOf | (key: string): 'added' | 'removed' | 'changed' | 'unchanged' | |
| cellStatus | (key: string, colId: string): 'changed' | 'unchanged' | |
| isChanged | (key: string, colId?: string): boolean | |
| changedColumns | (key: string): string[] | |
| before | (key: string, colId: string): unknown | The value a cell held in the baseline. |
| beforeRow | (key: string): unknown | |
| removedKeys | (): string[] | |
| removedRows | (): unknown[] | |
| report | (): Record<string, unknown> |
EditApi
| Member | Type | Description |
|---|---|---|
| start | (key: string, colId: string): boolean | |
| stop | (cancel?: boolean): void | |
| undo | (): void | |
| redo | (): void | |
| setCells | (writes: { key: string; colId: string; value: unknown }[], type?: 'cell' | 'fill' | 'paste'): number | |
| pasteInto | (anchor: { key: string; colId: string }, text: string, extent?: { rows?: number; columns?: number }): number | |
| settle | (id: string, ok: boolean, reason?: string): boolean | |
| pending | (): OpenWrite[] | |
| status | (key: string, colId: string): 'pending' | null |
EditConfig
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (optional) |
| mode | 'cell' | 'row' | (optional) |
| start | 'single' | 'double' | 'key' | (optional) |
| enterMovesDown | boolean | (optional) |
| undoDepth | number | (optional) |
| commit | (write: PendingWrite) => unknown | (optional) |
| confirm | 'auto' | 'manual' | (optional) |
| pendingTimeout | number | (optional) |
Editor
| Member | Type | Description |
|---|---|---|
| init | (p: EditorParams): void | |
| element | (): HTMLElement | |
| value | (): unknown | |
| attached | (): void | (optional) |
| cancelBeforeStart | (): boolean | (optional) |
| cancelOnClose | (): boolean | (optional) |
| popup | boolean | (optional) |
| destroy | (): void | (optional) |
EditorParams
| Member | Type | Description |
|---|---|---|
| stop | (cancel?: boolean): void | |
| key | string | (optional) |
| charPress | string | (optional) |
ExcelExportOptions
| Member | Type | Description |
|---|---|---|
| sheetName | string | (optional) |
| freezePanes | boolean | (optional) |
| variantFills | boolean | (optional) |
| onProgress | (p: { written: number; total: number }) => void | (optional) |
ExportApi
| Member | Type | Description |
|---|---|---|
| rangeText | (opts?: object): string | The selected range as tab-separated text, the shape a spreadsheet pastes. |
| csv | (opts?: CsvExportOptions): string | Promise<Blob> | |
| excel | (opts?: ExcelExportOptions): Promise<Blob> | |
| clipboard | (opts?: ClipboardOptions): Promise<void> | |
| (): void |
FacetBounds
Where a column's buckets are, and how they were chosen.
| Member | Type | Description |
|---|---|---|
| kind | 'numeric' | 'date' | 'category' | 'boolean' | 'none' | |
| buckets | FacetBucket[] | |
| suppressed | 'type' | 'cardinality' | 'rows' | 'streaming' | 'no-provider' | 'disabled' | Set when no histogram was drawn, naming why. (optional) |
| cardinality | number | Distinct values, on categorical columns. (optional) |
| granularity | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year' | The time unit chosen, on date columns. (optional) |
| strategy | 'equal' | 'quantile' | 'log' | The numeric strategy actually applied, which may differ from the request. (optional) |
| min | number | (optional) |
| max | number | (optional) |
FacetBucket
One bucket of a column's distribution.
| Member | Type | Description |
|---|---|---|
| from | number | Lower edge, for ordered columns. Half-open `[from, to)` except the last. (optional) |
| to | number | Upper edge, for ordered columns. Inclusive on the last bucket only. (optional) |
| value | unknown | The value, for categorical and boolean columns. (optional) |
| null | boolean | True on the terminal bucket holding nulls, NaN and empty values. (optional) |
| remainder | boolean | True on the aggregated tail bucket under `aboveLimit: 'topN'`. (optional) |
| label | string | A ready-made label, where one is more useful than the raw value. (optional) |
FacetConfig
Grid-level histogram settings.
| Member | Type | Description |
|---|---|---|
| enabled | boolean | Off unless asked for: header space is tight and this doubles its height. (optional) |
| collapsed | boolean | Start as a one-line density strip that opens on hover or click. (optional) |
| height | number | Band height in pixels. (optional) |
| rowCeiling | number | Rows above which histograms are suppressed. (optional) |
| debounce | number | Milliseconds a filter change waits before charts recount. (optional) |
| whilePaused | boolean | Whether a paused stream re-enables histograms. Defaults to true. (optional) |
| provider | (request: { | Bucket counts for a source the client cannot compute over. (optional) |
FacetsApi
| Member | Type | Description |
|---|---|---|
| get | (colId: string): FacetState | null | |
| suppression | (colId: string): string | null | |
| config | (colId?: string): FacetConfig | |
| refresh | (opts?: { immediate?: boolean }): void | |
| isExpanded | (colId: string): boolean | |
| toggle | (colId: string, open?: boolean): boolean | |
| select | (colId: string, from: number, to?: number, | |
| clear | (colId: string): boolean | |
| selected | (colId: string): number[] | |
| expanded | (): string[] |
FacetState
A column's computed distribution.
| Member | Type | Description |
|---|---|---|
| bounds | FacetBounds | null | |
| counts | Uint32Array | null | Counts under every filter except this column's own. Aligned to `buckets`. |
| unfiltered | Uint32Array | null | Counts with no filter applied, for the "40 of 200" reading. |
| stale | boolean | True while a recount is outstanding; draw the previous counts faded. |
| suppressed | string | null |
Filter
| Member | Type | Description |
|---|---|---|
| init | (p: FilterParams): void | |
| active | (): boolean | |
| passes | (p: { row: Row; data: unknown }): boolean | |
| get | (): unknown | |
| set | (state: unknown): void | |
| element | (): HTMLElement | |
| onRowsChanged | (): void | (optional) |
FilterGroup
| Member | Type | Description |
|---|---|---|
| op | 'and' | 'or' | 'not' | |
| conditions | FilterSet[] |
FilterParams
| Member | Type | Description |
|---|---|---|
| column | Column | |
| colId | string | |
| grid | Grid | |
| context | unknown | |
| props | Record<string, unknown> | (optional) |
| changed | (): void |
FiltersApi
| Member | Type | Description |
|---|---|---|
| quickState | (): { text: string; mode: string } | The quick filter's text and match mode, for restoring a control. |
| get | (): FilterSet | |
| set | (filters: FilterSet): void | |
| clear | (): void | |
| quick | (text: string): void |
FormattingApi
| Member | Type | Description |
|---|---|---|
| list | (scope?: FormattingScope): FormattingRule[] | |
| all | (): Record<FormattingScope, FormattingRule[]> | |
| scopes | (): FormattingScope[] | |
| add | (scope: FormattingScope, rule: FormattingRule, opts?: { at?: number }): FormattingRule | null | |
| remove | (scope: FormattingScope, which: string | number): boolean | |
| update | (scope: FormattingScope, which: string | number, patch: FormattingRule): FormattingRule | null | |
| move | (scope: FormattingScope, which: string | number, to: number): boolean | |
| set | (scope: FormattingScope, rules: FormattingRule[]): FormattingRule[] | |
| replaceAll | (rules: Record<FormattingScope, FormattingRule[]>): void | |
| clear | (scope?: FormattingScope): void | |
| styleFor | (colId: string, value: unknown): CellStyle | null | |
| restat | (): void | Re-derive the thresholds of distribution rules from the data as it stands. |
| distribution | (colId: string): ColumnDistribution | null | The five numbers a distribution rule resolves against for one column. |
FormattingCondition
| Member | Type | Description |
|---|---|---|
| op | Operator | DistributionOp | A filter operator compared against `value`, or a distribution operator whose threshold comes from the column itself: `{op: 'topPercent', value: 10}`, `{op: 'outlier'}`. Distribution thresholds are pinned when the rules compile; `grid.formatting.restat()` moves them. |
| value | unknown | (optional) |
| value2 | unknown | (optional) |
FormattingRule
One rule. Either a condition and the styling it produces, or a colour scale. A rule held as runtime state must be JSON, so `style` may not be a function there: config-time `cell.style` still accepts one.
| Member | Type | Description |
|---|---|---|
| id | string | (optional) |
| when | FormattingCondition | (optional) |
| style | CellStyle | ((p: CellParams) => CellStyle | null) | (optional) |
| scale | FormattingScale | (optional) |
| stopIfTrue | boolean | (optional) |
| enabled | boolean | (optional) |
| icon | string | (optional) |
| bar | boolean | (optional) |
| label | string | (optional) |
FormattingScale
| Member | Type | Description |
|---|---|---|
| from | 'minmax' | 'quantile' | 'stddev' | Where the bounds come from when `min` and `max` are not given. `'minmax'` spans the data, `'quantile'` spans `low` to `high` (5th to 95th percentile by default), `'stddev'` spans `deviations` either side of the mean. (optional) |
| min | number | (optional) |
| max | number | (optional) |
| mid | number | (optional) |
| low | number | (optional) |
| high | number | (optional) |
| deviations | number | (optional) |
| colours | string[] | (optional) |
FullWidthParams
What `fullWidth.render` is handed.
| Member | Type | Description |
|---|---|---|
| row | Row | |
| data | unknown | Your original row object. |
| index | number | Display index of the row. |
| grid | Grid | |
| element | HTMLElement | The element to fill. Write into it directly, or return content instead. |
Grid
| Member | Type | Description |
|---|---|---|
| rows | RowsApi | The data: reading it, changing it, walking it. (read-only) |
| columns | ColumnsApi | The columns: order, width, visibility, grouping and pivoting. (read-only) |
| selection | SelectionApi | What is selected, and the range the user has marked. (read-only) |
| filters | FiltersApi | The filter tree, however it was set. (read-only) |
| sort | SortApi | The sort, in priority order. (read-only) |
| edit | EditApi | Editing sessions: starting, committing and cancelling them. (read-only) |
| scroll | ScrollApi | Where the viewport is, and moving it. (read-only) |
| export | ExportApi | CSV, Excel and clipboard. (read-only) |
| state | StateApi | Everything the user arranged, as a serialisable object. (read-only) |
| overlay | OverlayApi | The loading, empty and error surfaces drawn over the grid. (read-only) |
| history | HistoryApi | Undo and redo over edits and structural changes. (read-only) |
| views | ViewsApi | Saved arrangements the user can switch between. (read-only) |
| diff | DiffApi | What changed against a baseline, cell by cell. (read-only) |
| permissions | PermissionsApi | Who may see, edit and export what. (read-only) |
| ai | AiApi | A machine-readable description of the grid, for a model to read. (read-only) |
| messages | MessagesApi | Translation: the catalogue and the active locale. (read-only) |
| licence | LicenceApi | Licence state, and setting a key after construction. (read-only) |
| pagination | PaginationApi | Pages, where the grid is paged rather than scrolled. (read-only) |
| highlight | HighlightApi | Transient emphasis on a row, column or cell. (read-only) |
| redaction | RedactionApi | Values hidden from view and from export. (read-only) |
| capture | (opts?: CaptureOptions): Promise<Blob> | An image of the grid as drawn, where the module is installed. (optional) |
| annotate | AnnotationApi | Drawing over the grid, where the module is installed. (optional) |
| presentation | PresentationApi | Full screen, scaling and chrome suppression. (read-only) |
| updates | UpdatesApi | The live feed: pausing it, flushing it, and what it has done. (read-only) |
| timeline | TimelineApi | Replaying the changes the grid has seen. (read-only) |
| crossFilter | CrossFilter | Cross-filtering, a derived grid filtering the grid it derives from. (read-only) |
| facets | FacetsApi | Header distributions, and the filters clicking one creates. (read-only) |
| detail | DetailApi | The expandable panel beneath a row. (read-only) |
| comments | CommentsApi | Threads attached to rows and cells. (read-only) |
| presence | PresenceApi | Who else is looking, and where. (read-only) |
| diagnostics | DiagnosticsApi | What the grid is doing, for when it is doing it slowly. (read-only) |
| statistics | StatisticsApi | Reductions, profiles, correlations, capability and intervals. (read-only) |
| formatting | FormattingApi | Formatting a value as the grid would, outside a cell. (read-only) |
| maximise | MaximiseApi | Full-screen control, where it is enabled. (read-only, optional) |
| element | HTMLElement | null | The element you passed to `createGrid`, not the grid's own root. The grid builds its `.lattice` root *inside* that element, so `el.closest('.lattice')` never matches this, and a theme attribute set on it has no effect, the theme is read from the root within. Use `element.querySelector('.lattice')` for the grid's own root. (read-only) |
| destroyed | boolean | Whether `destroy` has run. Every other member is inert afterwards. (read-only) |
| ready | boolean | False until the first render has been laid out. (read-only) |
| config | (): GridConfig | The resolved configuration, as one object. |
| setAll | (values: Partial<GridConfig>): void | Apply several configuration changes as one update rather than several. |
| on | (event: EventName, handler: EventHandler): Unsubscribe | Listen. Returns the function that stops listening. |
| once | (event: EventName, handler: EventHandler): Unsubscribe | Listen until it fires once. |
| off | (event: EventName, handler: EventHandler): void | Stop listening. |
| emit | (event: string, payload?: Record<string, unknown>): void | Raise an event of your own on the grid's bus. |
| setPinnedRows | (rows: unknown[], opts?: { edge?: 'top' | 'bottom' }): void | Pin rows above or below the scrolling body. The rows render through the ordinary column pipeline but are not part of the data: not counted, sorted, filtered, grouped, selectable or exported. Pass a new array rather than mutating the one you passed before: array identity is how the grid knows the pinned rows have changed. |
| getPinnedRows | (opts?: { edge?: 'top' | 'bottom' }): unknown[] | The objects currently pinned at one edge, as a copy. |
| form | RowFormApi | The row form. Declines when `rowForm` is not configured. (read-only) |
| getVersion | (): string | The library version. |
| destroy | (): void | Release everything: listeners, timers, workers and the DOM the grid made. |
GridConfig
| Member | Type | Description |
|---|---|---|
| columns | (Column | ColumnGroup)[] | The columns, in order. A group nests columns under one heading. (optional) |
| columnGroups | ColumnGroup[] | Header groups declared separately from the columns they contain. (optional) |
| rows | unknown[] | The data, for a memory grid. Use `source` for anything fetched. (optional) |
| rowKey | string | ((row: unknown) => string) | What identifies a row. Everything that survives a refresh (selection, expansion, and edits in flight) is keyed on it, so it must be stable and unique. A derived grid defaults to its own derived key. (optional) |
| source | SourceConfig | Where rows come from: memory, paged, remote, stream or derived. (optional) |
| columnDefaults | Column | Applied to every column before its own settings. (optional) |
| columnPresets | Record<string, Column> | Named bundles of column settings, referenced by a column's `preset`. (optional) |
| dataTypes | Record<string, DataType> | Your own data types, alongside the built-in catalogue. (optional) |
| sampleSize | number | Values sampled per undeclared column when inferring its type. Default 100. (optional) |
| targetSize | 'default' | 'large' | Raise every interactive target to a comfortable size for touch, without changing the type. `'large'` asks for it; `'default'` opts out of the coarse-pointer rule that would otherwise apply it. (optional) |
| components | Record<string, RendererCtor | EditorCtor | FilterCtor> | Your own renderers, editors and filters, registered by name. (optional) |
| pipes | Record<string, (value: unknown, ...args: string[]) => string> | Named text transforms usable from a format mask or a template. (optional) |
| totalFns | Record<string, TotalFn> | Your own reductions, alongside the built-in ones. (optional) |
| variants | Record<string, VariantDefinition> | Named appearance variants a row or cell can be switched into by a rule. (optional) |
| tree | TreeConfig | Hierarchical rows: where the parent link or the path lives. (optional) |
| detail | DetailConfig | The expandable panel beneath a row. (optional) |
| selection | SelectionConfig | 'single' | 'multiple' | 'none' | What the user may select, and how selection behaves across groups. (optional) |
| edit | EditConfig | boolean | Editing, and how a change is committed and validated. (optional) |
| pagination | PaginationConfig | boolean | Page the rows rather than scrolling them. (optional) |
| locale | string | (optional) |
| timeZone | string | IANA zone every date column formats in, e.g. 'Europe/London' or 'UTC'. Omit to use each viewer's own zone. A column's own `format.timeZone` wins. (optional) |
| theme | Theme | The visual theme. (optional) |
| density | Density | Row height and padding as a named step, rather than pixel by pixel. (optional) |
| gridLines | boolean | 'both' | 'horizontal' | 'vertical' | 'none' | 'rows' | 'columns' | Which rules are drawn between cells. `'both'` by default. The two axes are separate decisions: horizontal rules help the eye track along a row, vertical ones stop adjacent values running together. `false` or `'none'` draws neither. Only the rules *between data* are affected, the header's underline, the pinned seams and the totals separator are structure, not grid lines. (optional) |
| cornerRadius | boolean | number | string | Round the grid's outer corners. Square by default. `true` adopts the theme's own radius; a number is pixels; a string is used as written, so a host can pass its own token or a relative unit. (optional) |
| columnTagFilter | boolean | { multiple?: boolean; label?: string } | Show a bar above the column headings for filtering columns by tag. Off by default, and it draws nothing unless some column carries a `tags` entry. `multiple: true` lets more than one tag be chosen at once. Only tagged columns are ever hidden, so an untagged account or total column stays visible whatever is selected. (optional) |
| typeOptions | Record<string, { | Per-column options a data type reads. `ratio` and `percentRate` use `{ weight }` to name the column their average is weighted by. A unit type reads `{ significantFigures }` to render to a fixed precision rather than a fixed number of decimals. (optional) |
| rowTemplate | string | { | (optional) |
| responsive | { | Present rows as cards when the grid's container is too narrow to be a table honestly, a phone, or a narrow panel on a wide screen. Measured on the container, not the viewport, so a grid in a sidebar collapses and a grid filling a small tablet does not. Sorting, filtering and export continue to work; the tool panel is where they live when there are no column headings to click. Emits `presentation:changed`. (optional) |
| rowForm | boolean | { | (optional) |
| showColumnFunctions | boolean | Draw the sort, filter and menu controls in the column headings. `true` by default. `false` leaves each heading as its label alone, which is what a dense grid wants: three affordances take roughly fifty pixels, and on an eighty-pixel column that leaves the heading nothing and the label disappears entirely. Only the furniture goes. Sorting, filtering and the column menu are still reachable through the API, the keyboard and the tool panel. (optional) |
| rowHeight | number | ((row: Row) => number) | Row height in pixels, or a function of the row. A function makes the grid measure rather than assume, which costs a pass over what is on screen: worth it for wrapped text, wasteful for a uniform grid. (optional) |
| title | string | A caption for the grid, drawn above the column headings. Inside the grid rather than an element the host places above it: a title outside does not scroll with the grid, is not in the region a screen reader announces, and is left behind by image capture and print. (optional) |
| showHeader | boolean | Draw the column headings at all. `true` by default. `false` removes the row, and removes it from the accessibility tree rather than only from view, a heading a screen reader still announces is invisible, not hidden. What a small dashboard tile wants when its `title` already says what the panel is. Distinct from `showColumnFunctions`, which keeps the headings and drops only the sort, filter and menu controls inside them. (optional) |
| headerHeight | number | Header height in pixels. (optional) |
| overscan | number | How many rows to render beyond the viewport. More costs memory and smooths fast scrolling; fewer is lighter and can show a gap. (optional) |
| autoHeight | boolean | 'visible' | Size rows to their content rather than to the density token. Only rows that are actually rendered are ever measured, in both settings: the grid does not lay out rows you cannot see. The difference is what happens on a large grid: `true` gives up above ten thousand rows and falls back to fixed heights, because a cumulative offset array being patched as you scroll a million rows is not worth the result. `'visible'` keeps measuring at any size, accepting that the scrollbar shifts as rows are measured on the way past. The name is historical and reads as though it were about which rows are measured; it is about whether the ceiling applies. (optional) |
| state | GridState | Sort, filters, grouping, widths and the rest, restored at construction. (optional) |
| licence | string | Your licence key. Without one the grid renders in full and watermarks off localhost. (optional) |
| maximise | boolean | Offer a full-screen control. (optional) |
| formulaFunctions | Record<string, (args: unknown[]) => unknown> | Extra functions a formula may call, on top of the built-in library. (optional) |
| allowUnsafeTemplates | boolean | Permit raw HTML from a template without sanitising it. Off, and worth leaving off: a template usually interpolates data, and data is where injected markup arrives from. (optional) |
| updates | { | Caps on the change log behind `grid.updates` and `grid.timeline`. Two caps, because an entry is not a fixed size: `logLimit` bounds how many changes are kept (default 2000) and `logRows` bounds the rows they account for between them (default 100,000). A feed delivering large batches reaches the second long before the first, and without it the log is unbounded in bytes while looking bounded in entries. (optional) |
| comments | CommentConfig | Threaded comments on individual cells. Requires a stable `rowKey`: comments outlive the values they annotate, and index identity would reattach every thread on the next sort. (optional) |
| presence | PresenceConfig | Collaborative presence. A display feature over a transport the grid does not own; without a provider it is inert. (optional) |
| environment | () => Record<string, unknown> | Host environment for a support bundle. Supplied by the DOM layer; core cannot read `navigator` or `window` itself. (optional) |
| facets | FacetConfig | boolean | Column header histograms and the filters clicking them creates. Off by default: the band roughly doubles header height, which is a cost no grid should pay without asking. Per-column settings layer over these. (optional) |
| hostFilter | { active(): boolean; passes(row: Row): boolean } | A filter your application owns, applied alongside the grid's own and invisible to its filter UI. (optional) |
| context | unknown | Anything of yours, passed untouched to renderers, editors and sources. (optional) |
| workerThreshold | number | Row count above which a column distribution is computed in a Worker. (optional) |
| useWorker | boolean | Compute column distributions off the main thread. Sorting, filtering and grouping run on the main thread; see the reference for why. (optional) |
| workerUrl | string | Where to load the worker kernel from, when hosting it yourself. (optional) |
| sharedMemory | boolean | Use a shared buffer for the worker, where the page's headers allow it. (optional) |
| groupFooter | boolean | A totals line at the foot of each group as well as the grid. (optional) |
| grandTotalRow | boolean | 'bottom' | Where the grand total goes. `true` adds it as the last display row, counted by `rows.count()` like any other. `'bottom'` pins it beneath the viewport instead, so it stays in view while the rows scroll and is *not* part of `rows.count()`. Omitted or `false` means no grand total row. (optional) |
| pinnedTopRows | unknown[] | Rows pinned above the scrolling body. The objects are rendered through the ordinary column pipeline but are not part of the data: not counted by `rows.count()`, not sorted, filtered, grouped, selectable or exported. Use it for a totals line or a units row that must stay against the header. (optional) |
| pinnedBottomRows | unknown[] | Rows pinned below the scrolling body. As `pinnedTopRows`, at the other edge. (optional) |
| fullWidth | { | Rows drawn as a single band across every column instead of being divided into them, a section banner, a note, a "load more" affordance. `when` picks the rows; `render` fills them. A full-width row is still one of your data rows: counted by `rows.count()`, sorted, filtered and exported like any other. Only its presentation changes. For a row that should *not* be part of the data, use `pinnedTopRows`. (optional) |
| totalFilteredOnly | boolean | Total what the filters left rather than the whole set. (optional) |
| totalOnlyChangedColumns | boolean | On a change, recompute only the totals whose column moved. (optional) |
| showTotalInHeader | boolean | Put the total in the header rather than a footer row. (optional) |
| columnVirtualisationAbove | number | Render only the visible columns once there are more than this many. (optional) |
| statusBar | boolean | { panels?: string[] } | The bar beneath the grid, and which panels it carries. (optional) |
| contextMenu | boolean | ((p: CellMenuParams, defaults: MenuItem[]) => MenuItem[] | void) | The cell right-click menu. A function supplies custom items; `false` suppresses it entirely, which is what a read-only grid wants, the default menu offers Paste, Clear and Fill down. (optional) |
| columnMenu | boolean | ((p: ColumnMenuParams, defaults: MenuItem[]) => MenuItem[] | void) | The header's 3-dot menu, and the right-click menu on a column heading. `false` suppresses both. A function supplies custom items, receiving the grid's own so it can add to them rather than reproduce them. Default true. (optional) |
| shortcuts | boolean | The `?` keyboard shortcut overlay. `false` suppresses it, for a host that wants `?` for itself. Default true. (optional) |
| rowReorder | boolean | { column?: string } | Let a user reorder rows by dragging a handle, or with Alt+Shift+Up/Down. `true` puts the handle in the first visible column; `{ column }` names a different one. The move reorders your data and emits `row:moved`; persisting it is yours, and `rows.data()` afterwards is the new order. Refused, with a reason announced, while a sort, filter or grouping is active, the position a row is dropped at has no single meaning in the underlying order then. (optional) |
| rowTransfer | boolean | { | Let rows be dragged out of this grid, into it, or both. Off by default: rows leaving a grid is a data change a host has to want, and a mis-drag that silently removed one has no gesture a user would think to undo. `send` and `receive` are both on when the option is present, so one-way is expressed by turning off the direction you do not want, a source grid is `{ receive: false }` and a target is `{ send: false }`. `mode: 'copy'` leaves the row where it was. `group` restricts exchange to grids sharing the same name, so two unrelated grids on a page do not accept each other's rows. The source needs `rowReorder` as well, since that is what draws the handle a drag starts from. (optional) |
| alignedGrids | unknown[] | Other grids to stay column-aligned with. Column widths, order, visibility and pinning are shared, and horizontal scrolling moves them together. Sort, filters, selection, grouping and the rows themselves stay independent: sharing those would make one grid with extra steps rather than two aligned ones. Declared on the grid created last, since it is the only one that can name the others; the link is peer-based once made. (optional) |
| stickyGroupHeaders | boolean | number | { depth?: number } | Keep the enclosing group headings pinned above the viewport while scrolling inside a group. On by default, stacking at most two. `false` turns it off; a number, or `{ depth }`, sets how many may stack: each costs a row of viewport, so a deep grouping would otherwise spend the screen describing itself. (optional) |
| highlightOnChange | boolean | string | { | Flash a cell when its value changes. `true` takes the defaults; an object names a colour, a duration in milliseconds, or both. (optional) |
| formatting | Record<string, FormattingRule[]> | Conditional formatting rules the grid holds as runtime state, keyed by column id or `'*'` for every column (spec 8.12). Seeds `grid.formatting`, which an end user can then change; the rules travel in saved views and undo like any other change. Config-time `cell.style` is unaffected. (optional) |
| rowClass | string | string[] | ((p: RowStyleParams) => string | string[]) | A class, or classes, for every row. Re-evaluated on each repaint. (optional) |
| rowStyle | CellStyle | ((p: RowStyleParams) => CellStyle) | Inline styles for every row. Camel-case or hyphenated property names. (optional) |
| toolPanel | boolean | { | (optional) |
| quickFilterText | string | The quick filter's initial text. (optional) |
| permissions | PermissionPolicy | Per-column read/write/hidden policy. A usability control, not a security boundary: hidden data is still resident in the store. Enforce the same policy server-side with `permittedColumns` / `permittedExport`. (optional) |
| diff | { | Prior state for diff and audit mode. (optional) |
| views | { storage?: { read(): unknown[]; write(views: unknown[]): void }; saved?: unknown[] } | Saved views: a storage adapter and any pre-loaded views. (optional) |
| historyBar | boolean | { element?: HTMLElement; timeline?: boolean } | The undo toolbar. `element` mounts it into the host's own chrome. (optional) |
| ai | { | The AI skill layer. The grid makes no network call of its own: `ask` is the host's, and owns the model, the key and the privacy decision. (optional) |
| pivot | { | (optional) |
GridEvent
| Member | Type | Description |
|---|---|---|
| type | string | |
| origin | 'api' | 'user' | 'init' | |
| grid | Grid |
GridModule
| Member | Type | Description |
|---|---|---|
| name | string | |
| version | string | (optional) |
| install | (ctx: ModuleContext): void | |
| uninstall | (ctx: ModuleContext): void | (optional) |
GridState
| Member | Type | Description |
|---|---|---|
| version | number | |
| columns | ColumnState[] | (optional) |
| columnOrder | string[] | (optional) |
| filters | FilterSet | (optional) |
| quick | string | (optional) |
| sort | SortEntry[] | (optional) |
| group | string[] | (optional) |
| pivot | { enabled: boolean; columns: string[] } | (optional) |
| formatting | Record<string, FormattingRule[]> | (optional) |
| expanded | string[] | (optional) |
| selection | string[] | (optional) |
| scroll | { top: number; left: number } | (optional) |
| pagination | { page: number; pageSize: number } | (optional) |
HighlightApi
| Member | Type | Description |
|---|---|---|
| clear | (target?: { key?: string; colId?: string } | string): boolean | Clear one target, or every highlight when called with nothing. |
| list | (): { scope: string; key: string | null; colId: string | null; colour: string; duration: number }[] | |
| colourFor | (key: string, colId: string): string | null |
HistogramBin
| Member | Type | Description |
|---|---|---|
| from | number | |
| to | number | |
| count | number |
HistoryApi
| Member | Type | Description |
|---|---|---|
| undo | (): HistoryEntry | null | |
| redo | (): HistoryEntry | null | |
| canUndo | (): boolean | |
| canRedo | (): boolean | |
| peek | (direction?: 'undo' | 'redo'): HistoryEntry | null | What undo or redo would apply next, for labelling a button. |
| list | (): HistoryEntry[] | |
| transaction | (label: string, fn: () => void): HistoryEntry | null | Group everything `fn` does into one undoable step. |
| clear | (): void |
HistoryEntry
| Member | Type | Description |
|---|---|---|
| seq | number | Monotonic sequence number, in the order actions were recorded. |
| type | string | What kind of action it was, e.g. `'sort'`, `'column:pin'`, `'edit'`. |
| label | string | Human text for a button, e.g. `'sort by Region'`. |
| target | string | null | The column or row the action was aimed at, where there was one. |
| at | number | When it was recorded, on the high-resolution clock. |
| delegated | boolean | True when the edit model owns the undo rather than the history stack. |
| undone | boolean | Set once the entry has been undone. (optional) |
LicenceApi
| Member | Type | Description |
|---|---|---|
| set | (key: string): LicenceInfo | |
| info | (): LicenceInfo | |
| state | (): 'licensed' | 'localhost' | 'trial' | |
| watermark | (): boolean | |
| ready | Promise<LicenceInfo> | Settles when the licence check finishes. (read-only) |
LicenceInfo
| Member | Type | Description |
|---|---|---|
| valid | boolean | |
| product | string | (optional) |
| issuedTo | string | (optional) |
| expires | string | (optional) |
| reason | string | (optional) |
LookupSpec
| Member | Type | Description |
|---|---|---|
| options | Option[] | (() => Option[] | Promise<Option[]>) | (optional) |
| valueKey | string | (optional) |
| labelKey | string | (optional) |
| groupKey | string | (optional) |
| multiple | boolean | (optional) |
| allowCustom | boolean | (optional) |
| unknownLabel | string | ((v: unknown) => string) | (optional) |
| search | (query: string, signal: AbortSignal) => Promise<Option[]> | (optional) |
| sortBy | 'label' | 'value' | 'optionOrder' | 'count' | (optional) |
| separator | string | (optional) |
MaximiseApi
| Member | Type | Description |
|---|---|---|
| enter | (): boolean | |
| exit | (): boolean | |
| toggle | (): boolean | |
| active | (): boolean |
MenuItem
| Member | Type | Description |
|---|---|---|
| name | string | (optional) |
| icon | string | (optional) |
| shortcut | string | (optional) |
| action | () => void | (optional) |
| disabled | boolean | (optional) |
| separator | boolean | (optional) |
| children | MenuItem[] | (optional) |
MessagesApi
The resolved message set for a grid: every user-visible string, in the grid's locale.
| Member | Type | Description |
|---|---|---|
| t | (key: string, params?: Record<string, unknown>): string | Format a message. |
| list | (items: string[], type?: 'conjunction' | 'disjunction'): string | Join parts the way this locale joins lists. |
| number | (value: number, opts?: Intl.NumberFormatOptions): string | Format a number for this locale. |
| locale | string | The resolved BCP 47 tag. (read-only) |
| keys | ReadonlyArray<string> | Every key the catalogue defines. (read-only) |
ModuleContext
| Member | Type | Description |
|---|---|---|
| registry | Registry | |
| grid | Grid | (optional) |
NumberFormat
| Member | Type | Description |
|---|---|---|
| type | 'number' | (optional) |
| style | 'decimal' | 'currency' | 'percent' | (optional) |
| currency | string | (optional) |
| currencyDisplay | 'symbol' | 'code' | 'name' | 'narrowSymbol' | (optional) |
| decimals | number | (optional) |
| minDecimals | number | (optional) |
| maxDecimals | number | (optional) |
| thousandsSeparator | boolean | string | (optional) |
| decimalSeparator | string | (optional) |
| notation | 'standard' | 'compact' | 'scientific' | (optional) |
| negative | 'minus' | 'parentheses' | 'suffix' | (optional) |
| negativeClass | string | (optional) |
| prefix | string | (optional) |
| suffix | string | (optional) |
| zeroDisplay | string | (optional) |
| nullDisplay | string | (optional) |
| locale | string | The locale for number, date and text formatting. The page's by default. (optional) |
| messages | Record<string, string | Record<string, string>> | A partial message catalogue laid over the built-in British English one. Every valid key is listed in `MESSAGE_KEYS`; a key that is not is ignored with a warning. Import a bundled locale (`FR_FR`, `AR`, …) or supply your own object. Merged rather than replacing, so an incomplete translation leaves the remainder in English rather than showing raw keys. (optional) |
| direction | 'ltr' | 'rtl' | Writing direction. Omit to settle it from the element's own `dir` and then from `locale`: `ar`, `he`, `fa` and the rest resolve to `rtl`. (optional) |
| scale | number | (optional) |
OpenWrite
| Member | Type | Description |
|---|---|---|
| id | string | |
| key | string | |
| colId | string | |
| value | unknown | |
| before | unknown | |
| state | 'pending' | 'superseded' | |
| age | number |
Option
| Member | Type | Description |
|---|---|---|
| id | unknown | |
| label | string | |
| disabled | boolean | (optional) |
| variant | VariantName | (optional) |
| icon | string | (optional) |
| group | string | (optional) |
OverlayApi
| Member | Type | Description |
|---|---|---|
| show | (kind: 'loading' | 'empty' | (string & {}), message?: string): void | |
| hide | (): void |
PagedSourceConfig
| Member | Type | Description |
|---|---|---|
| mode | 'paged' | |
| pageSize | number | (optional) |
| maxCachedPages | number | (optional) |
| fetch | (req: { |
PaginationApi
| Member | Type | Description |
|---|---|---|
| get | (): { page: number; pageSize: number; total: number; pageCount: number } | |
| set | (next: { page?: number; pageSize?: number }): void | |
| applyPage | (next: { page?: number; pageSize?: number }): void |
PaginationConfig
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (optional) |
| pageSize | number | (optional) |
| pageSizes | number[] | (optional) |
Peer
One peer, as the grid holds them.
| Member | Type | Description |
|---|---|---|
| id | string | |
| name | string | |
| colour | string | Assigned deterministically from the id when the provider supplies none. |
| avatarUrl | string | null | (optional) |
| initials | string | null | (optional) |
| cursor | { rowId: string; colId: string } | null | Row key and column, never an index. |
| ranges | Array<{ rowIds: string[]; columns: string[] }> | |
| editing | { rowId: string; colId: string } | null | |
| at | number | Local receipt time, not the sender's clock. |
| sentAt | number | null | The sender's own timestamp, for inspection only. Nothing decides on it. (optional) |
| idle | boolean | (optional) |
| silentMs | number | (optional) |
| hidden | boolean | True when the peer's cursor is on a row this view is not showing. (optional) |
PendingWrite
| Member | Type | Description |
|---|---|---|
| id | string | |
| key | string | |
| colId | string | |
| value | unknown | |
| before | unknown | |
| row | Row | (optional) |
PermissionsApi
| Member | Type | Description |
|---|---|---|
| levelOf | (column: string | ResolvedColumn): PermissionLevel | |
| isHidden | (column: string | ResolvedColumn): boolean | |
| isReadable | (column: string | ResolvedColumn): boolean | |
| isEditable | (column: string | ResolvedColumn): boolean | |
| isSecret | (column: string | ResolvedColumn): boolean | True only at `writeOnly`: writable, never shown or exported. |
| isExportable | (column: string | ResolvedColumn): boolean | |
| levels | (): Record<string, PermissionLevel> | |
| setContext | (context: unknown): void | Change the context permissions are evaluated against, and re-evaluate. |
| invalidate | (): void |
PresenceApi
| Member | Type | Description |
|---|---|---|
| enabled | boolean | (read-only) |
| me | Record<string, unknown> | null | (read-only) |
| publishing | boolean | (read-only) |
| peers | (): Peer[] | |
| hiddenCount | (): number | |
| editorOf | (rowId: string, colId: string): Peer | null | |
| lockedBy | (rowId: string, colId: string): Peer | null | Advisory. Reduces collisions; does not eliminate them. |
| jumpTo | (peerId: string): boolean | |
| publish | (): void | |
| setPublishing | (on: boolean): void | |
| setPaused | (paused: boolean): void | |
| connect | (provider: PresenceProvider | null): void | |
| stats | (): Record<string, number> |
PresenceConfig
| Member | Type | Description |
|---|---|---|
| provider | PresenceProvider | Without one the feature is inert and raises nothing. (optional) |
| me | { id: string; name?: string; colour?: string; avatarUrl?: string; initials?: string } | The local identity, echoed in everything published. (optional) |
| throttleMs | number | Milliseconds between published updates. Throttled, not debounced. (optional) |
| idleMs | number | Silence after which a peer is shown idle. (optional) |
| removeMs | number | Silence after which a peer is dropped. (optional) |
| lockMs | number | Silence after which a peer's edit claim is disregarded. (optional) |
| lock | boolean | Refuse local editing of a cell a peer is editing. Advisory only: the authoritative resolution is the conditional write in `edit.commit`. (optional) |
| palette | string[] | Override the peer colour palette. (optional) |
| roster | boolean | { side?: 'start' | 'end' } | Suppress the roster, or place it. (optional) |
| announce | boolean | Suppress join and leave announcements to assistive technology. (optional) |
PresenceProvider
Transport for presence. The grid never opens a connection: it subscribes to what the provider delivers and hands it what changed locally.
| Member | Type | Description |
|---|---|---|
| subscribe | (onMessage: (message: Peer | Peer[]) => void): (() => void) | void | Returns an unsubscribe function, if it has one. |
| publish | (state: Record<string, unknown>): void |
PresentationApi
| Member | Type | Description |
|---|---|---|
| active | boolean | (read-only) |
| scale | number | (read-only) |
| options | { scale?: number; chrome?: string[]; views?: string[]; from?: number; autoAdvance?: number } | (read-only) |
| views | string[] | (read-only) |
| index | number | (read-only) |
| viewId | string | null | (read-only) |
| start | (options?: { | |
| stop | (): boolean | |
| setScale | (value: number): number | |
| nudge | (steps?: number): number | |
| step | (by?: number): number | |
| goTo | (index: number): number | |
| reset | (): boolean | |
| spotlight | { keys: string[]; colIds: string[] } | null | (read-only) |
| setSpotlight | (target?: { keys?: string[]; colIds?: string[] } | null): boolean |
ProcessCapability
| Member | Type | Description |
|---|---|---|
| n | number | |
| mean | number | |
| lower | number | null | |
| upper | number | null | |
| target | number | null | |
| sigmaWithin | number | null | Short-term variation, from the moving range: what Cp and Cpk use. |
| sigmaOverall | number | null | Overall variation: what Pp and Ppk use. |
| cp | number | null | Potential capability. Null for a one-sided specification. |
| cpk | number | null | Capability allowing for where the process is centred. |
| pp | number | null | Cp over the overall spread: what the process actually delivered. |
| ppk | number | null | Cpk over the overall spread. Well below Cpk means the process drifted. |
| outOfSpec | number | |
| defectRate | number | null | |
| limits | { centre: number; upper: number; lower: number; sigma: number } | null | Three sigma either side of the process mean, from the moving range. |
| baseline | number | How many leading readings set the limits. (optional) |
| ruleSet | 'westernElectric' | 'nelson' | Which rule set `violations` were judged against, they number differently. (optional) |
| violations | { index: number; rule: number; description: string }[] | |
| interval | CapabilityInterval | null | A confidence interval for `cpk`. A study that reports the point estimate alone overstates itself: 1.35 from thirty parts has a lower bound below 1. (optional) |
| intervalPp | CapabilityInterval | null | The same, for `ppk`. (optional) |
ProportionInterval
A Wilson score interval for a rate. Stays inside 0 to 1 at the extremes.
| Member | Type | Description |
|---|---|---|
| proportion | number | |
| lower | number | |
| upper | number | |
| n | number | |
| confidence | number |
PushdownAdapter
An engine the grid can query, and what it is able to answer.
| Member | Type | Description |
|---|---|---|
| name | string | Used in diagnostics and in the message when work cannot be pushed. (optional) |
| capabilities | PushdownCapabilities | (optional) |
| execute | (query: RemoteRequest, request?: RemoteRequest): | Run the part of the query the adapter declared it could handle. |
PushdownCapabilities
What a pushdown adapter can answer. Everything is off unless declared.
| Member | Type | Description |
|---|---|---|
| filter | false | 'term' | 'flat' | 'tree' | `false`, a single field and term, a flat conjunction, or a full tree. (optional) |
| operators | string[] | Which comparison operators the engine understands. (optional) |
| sort | false | 'single' | 'multi' | `false`, one column only, or many. (optional) |
| quick | boolean | Whether a free-text search across columns can be pushed. (optional) |
| range | boolean | Whether the engine can return a window rather than the whole result. (optional) |
| total | boolean | Whether it can report the count of matching rows. (optional) |
| group | boolean | Whether it can group and aggregate. (optional) |
PushdownPlan
How one request was divided between the engine and the grid.
| Member | Type | Description |
|---|---|---|
| pushed | RemoteRequest | The query the adapter was given. |
| residual | { filters: object | null; sort: SortEntry[] | null; quick: string } | What the grid applied afterwards. |
| needsAll | boolean | Whether the whole result had to be fetched rather than a window. |
| unpushed | string[] | Which parts could not be pushed: `filter`, `sort`, `quick`. |
PushdownSourceConfig
| Member | Type | Description |
|---|---|---|
| adapter | PushdownAdapter | |
| compute | object | The compute barrel, for applying whatever the engine could not. (optional) |
| pageSize | number | (optional) |
RailAction
| Member | Type | Description |
|---|---|---|
| name | string | |
| title | string | (() => string) | |
| icon | string | (() => string) | (optional) |
| run | (params: RailActionParams): void | |
| enabled | (): boolean | (optional) |
RailActionParams
What a host rail action's `run` is handed.
| Member | Type | Description |
|---|---|---|
| grid | Grid | |
| keys | string[] | |
| cells | { key: string; colId: string }[] |
RedactionApi
Redaction obscures a column's values on screen. It is presentational: the values stay in the model, the DOM, the clipboard and every export. Use `permissions` with `writeOnly` for a value that must not be readable.
| Member | Type | Description |
|---|---|---|
| has | (colId: string): boolean | |
| list | (): string[] | |
| toggle | (colId: string): boolean | |
| add | (colId: string): void | |
| remove | (colId: string): void | |
| set | (ids: string[]): void | |
| clear | (): void | |
| active | boolean | (read-only) |
Registry
| Member | Type | Description |
|---|---|---|
| modules | (): GridModule[] | |
| has | (name: string): boolean | |
| renderer | (name: string): RendererCtor | RenderFn | undefined | |
| editor | (name: string): EditorCtor | undefined | |
| filter | (name: string): FilterCtor | undefined | |
| dataType | (name: string): DataType | undefined | |
| totalFn | (name: string): TotalFn | undefined | |
| pipe | (name: string): ((v: unknown, ...a: string[]) => string) | undefined | |
| register | (kind: string, name: string, impl: unknown): void |
RegressionFit
| Member | Type | Description |
|---|---|---|
| slope | number | |
| intercept | number | |
| r2 | number | The square of Pearson's r: how much of the response the fit accounts for. |
| stdError | number | Standard error of the slope, which is what says it differs from zero. |
| n | number | Pairs that survived pairwise deletion, not rows scanned. |
RejectedRow
A row a change could not apply, and why. Reported, never thrown.
| Member | Type | Description |
|---|---|---|
| operation | 'add' | 'update' | 'remove' | |
| id | string | |
| reason | 'unknown-id' | 'duplicate-id' | `unknown-id`, no row with that key. `duplicate-id`, a row with that key already exists; admitting a second would corrupt every structure that resolves one key to one row. |
RemoteRequest
| Member | Type | Description |
|---|---|---|
| protocol | 1 | |
| range | { start: number; end: number } | |
| groupPath | string[] | |
| groupBy | ColumnRef[] | |
| totals | ColumnRef[] | |
| pivotBy | ColumnRef[] | |
| pivotMode | boolean | |
| filters | FilterSet | |
| quick | string | (optional) |
| sort | SortEntry[] | |
| context | unknown | |
| signal | AbortSignal |
RemoteResult
| Member | Type | Description |
|---|---|---|
| rows | unknown[] | |
| count | number | (optional) |
| pivotFields | string[] | (optional) |
RemoteSourceConfig
| Member | Type | Description |
|---|---|---|
| mode | 'remote' | |
| pageSize | number | (optional) |
| maxCachedPages | number | (optional) |
| fetch | (req: RemoteRequest): Promise<RemoteResult> |
Renderer
| Member | Type | Description |
|---|---|---|
| init | (p: CellParams): void | |
| element | (): HTMLElement | |
| refresh | (p: CellParams): boolean | (optional) |
| attached | (): void | (optional) |
| destroy | (): void | (optional) |
ResolvedColumn
A column after presets, type defaults and grid defaults are folded in.
| Member | Type | Description |
|---|---|---|
| id | string | |
| field | string | null | |
| title | string | |
| type | TypeName | |
| dataType | DataType | |
| nullable | boolean | |
| align | Align | |
| value | Required<Pick<ColumnValueSpec, 'pure'>> & ColumnValueSpec | |
| cell | ColumnCellSpec | |
| edit | ColumnEditSpec | |
| sort | ColumnSortSpec | |
| filter | ColumnFilterSpec | |
| group | { enabled: boolean; index: number; explode: boolean } | |
| pivot | { enabled: boolean; index: number } | |
| total | TotalName | TotalFn | null | |
| layout | ColumnLayoutSpec | |
| header | ColumnHeaderSpec | |
| export | ColumnExportSpec | |
| lookup | LookupSpec | null | |
| allowGroup | boolean | |
| allowPivot | boolean | |
| allowTotal | boolean | |
| formatValue | (value: unknown, row?: Row, data?: unknown): string | Compiled display-text producer. |
| getValue | (data: unknown, row?: Row): unknown | Resolve the value for a row, through the computed-value graph. |
| def | Column |
Row
| Member | Type | Description |
|---|---|---|
| key | string | What identifies the row. Selection, expansion and edits are all keyed on it. |
| data | unknown | null | The object you supplied. Null on a group heading, which is a product of the grouping rather than a record. |
| level | number | Depth in a tree or a grouping. Zero at the top. |
| parent | Row | null | The row above it in a tree or grouping, or null at the top. |
| children | Row[] | Every child, before filtering. (optional) |
| filteredChildren | Row[] | The children the filters left. (optional) |
| sortedChildren | Row[] | The children in display order. (optional) |
| group | boolean | Whether this is a group heading rather than a record. A heading carries no data and must be skipped when totalling. |
| expanded | boolean | Whether its children are showing. |
| leafCount | number | How many records sit beneath it, at any depth. |
| totals | Record<string, unknown> | The group's own reductions, by column id. (optional) |
| detail | boolean | Whether this row is the expanded detail panel of the one above. (optional) |
| master | boolean | Whether this row has a detail panel. (optional) |
| height | number | The row's height in pixels, as measured or configured. |
| index | number | null | Position in the display order, or null when off screen. |
| selected | boolean | 'partial' | Selection state. `partial` is a group some but not all of whose children are selected. |
| physical | number | null | Physical index into the ColumnStore. Null for synthetic rows. (optional) |
| groupColumn | string | Group rows only: the column id this level groups on, and the group value. (optional) |
| groupValue | unknown | The value this group heading stands for. (optional) |
| groupPath | string[] | Stable path of group keys from root to this row. (optional) |
| hasChildren | boolean | Whether children exist, which a lazily loaded tree knows before it has them. (optional) |
| pinned | 'top' | 'bottom' | Which sticky strip this row is pinned in, when it is one the host pinned through `setPinnedRows`. Absent on every row that is part of the data. (optional) |
RowChange
| Member | Type | Description |
|---|---|---|
| add | unknown[] | (optional) |
| at | number | (optional) |
| update | unknown[] | (optional) |
| remove | unknown[] | string[] | (optional) |
RowFormApi
| Member | Type | Description |
|---|---|---|
| open | (key: string): boolean | Open the form for a row. False when the form is not configured. |
| close | (): void | |
| save | (): boolean | |
| isOpen | (): boolean |
RowsApi
| Member | Type | Description |
|---|---|---|
| load | (rows: unknown[]): void | Replace the data. Sort, filters, grouping and column layout are kept. |
| apply | (change: RowChange): ChangeResult | |
| queue | (change: RowChange): Promise<ChangeResult> | |
| get | (index: number): Row | undefined | |
| byKey | (key: string): Row | undefined | |
| count | (): number | |
| totalCount | (): number | Rows in the source before filtering; under pagination, across every page. |
| matchCount | (): number | Data rows matching the filters, excluding group, footer and total rows. |
| data | (): unknown[] | |
| forEach | (fn: (row: Row, index: number) => void): void | |
| forEachAll | (fn: (row: Row, index: number) => void): void | Every row in the data, before any filter. Leaf rows, in physical order. |
| forEachExcept | (colId: string, fn: (row: Row, index: number) => void): void | Visit the rows surviving every filter except one column's own: the faceting question, asked of the rows. |
| value | (key: string, colId: string): unknown | |
| text | (key: string, colId: string): string | |
| values | (key: string): Record<string, unknown> | |
| refresh | (opts?: { rows?: string[]; columns?: string[]; force?: boolean }): void | |
| move | (key: string, to: number): { moved: boolean; from: number; to: number; reason?: string } | Move a row to another position in the data. Refuses, with a reason, while a sort, filter or grouping is active. |
| groupHeadings | (index: number): Row[] | The group headings enclosing a display row, outermost first. Empty when the grid is not grouped. |
| expand | (key: string, deep?: boolean): void | |
| collapse | (key: string): void | |
| expandAll | (): void | |
| collapseAll | (): void |
RowStyleParams
| Member | Type | Description |
|---|---|---|
| row | Row | |
| key | string | |
| index | number | |
| data | unknown | |
| grid | Grid | |
| context | unknown |
SavedView
| Member | Type | Description |
|---|---|---|
| id | string | |
| name | string | |
| description | string | |
| shared | boolean | |
| isDefault | boolean | |
| builtin | boolean | Supplied in `config.views.saved`: listed apart, and not renamable or deletable. |
| createdAt | number | |
| updatedAt | number | |
| state | GridState | A partial `GridState`; only the sections it names are applied. |
ScrollApi
| Member | Type | Description |
|---|---|---|
| toRow | (row: string | number, align?: 'start' | 'center' | 'end' | 'auto'): void | A row key, or a display index. A key survives a sort and is usually what a caller holds; resolving one scans the display order, so prefer an index when scrolling a very large grid repeatedly. |
| toColumn | (id: string): void | |
| toCell | (row: string | number, colId: string, align?: 'start' | 'center' | 'end' | 'auto'): void | Scroll a cell into view, both axes in one call. |
| position | (): { top: number; left: number } | |
| to | (at: { top?: number; left?: number }): void | `left` is the logical offset, zero at the content's start in either direction. |
SelectionApi
| Member | Type | Description |
|---|---|---|
| clearRange | (): void | Drop every range, leaving the row and cell selection alone. |
| statistics | (): object | null | Everything worth knowing about the selected cells: what `summary()` reports plus median, quartiles, deviation, distinct and outliers. Over the cells rather than a column, so a rectangle spanning three columns is one set of numbers. Null with nothing selected. |
| rows | (): Row[] | |
| keys | (): string[] | |
| set | (keys: string[]): void | |
| all | (): void | |
| clear | (): void | |
| headerState | (): boolean | 'partial' | |
| cells | (): { key: string; colId: string }[] | |
| ranges | (): CellRange[] | |
| setRange | (range: CellRange): void | |
| addRange | (range: CellRange): void | |
| startRange | (rowIndex: number, colId: string, opts?: { additive?: boolean }): void | |
| extendRange | (rowIndex: number, colId: string): void | |
| corner | (): { row: number; colId: string } | null | |
| inRange | (rowIndex: number, colId: string): boolean |
SelectionConfig
| Member | Type | Description |
|---|---|---|
| mode | 'none' | 'single' | 'multiple' | (optional) |
| checkbox | boolean | (optional) |
| headerCheckbox | boolean | (optional) |
| groupSelectsChildren | boolean | (optional) |
| groupSelectsFiltered | boolean | (optional) |
| ranges | boolean | (optional) |
| fillHandle | boolean | (optional) |
| fill | (p: { source: unknown[]; target: { row: Row; column: ResolvedColumn }[]; direction: string }) => unknown[] | (optional) |
SeriesStats
| Member | Type | Description |
|---|---|---|
| n | number | |
| first | number | |
| last | number | |
| change | number | |
| changePercent | number | null | |
| volatility | number | null | Standard deviation of period-on-period returns. |
| annualisedVolatility | number | null | The same, times the root of `periodsPerYear`; null unless one was given. |
| growth | number | null | Compound growth per period, annualised when `periodsPerYear` is given. |
| maxDrawdown | number | null | The largest peak-to-trough fall, as a fraction. |
| maxDrawdownFrom | number | |
| maxDrawdownTo | number | |
| autocorrelation | number | null | Lag-1: positive is momentum, negative is mean reversion. |
| upDays | number | |
| downDays | number |
SortApi
| Member | Type | Description |
|---|---|---|
| get | (): SortEntry[] | |
| set | (entries: SortEntry[]): void | |
| clear | (): void |
SortEntry
| Member | Type | Description |
|---|---|---|
| col | string | |
| dir | 'asc' | 'desc' | |
| nullsFirst | boolean | (optional) |
Source
| Member | Type | Description |
|---|---|---|
| mode | 'memory' | 'paged' | 'remote' | 'stream' | (read-only) |
| count | (): number | |
| at | (index: number): Row | undefined | |
| byKey | (key: string): Row | undefined | |
| loaded | (index: number): boolean | |
| hint | (start: number, end: number): void | |
| apply | (change: RowChange): ChangeResult | |
| reload | (opts?: ReloadOptions): void | |
| destroy | (): void | (optional) |
Stat
The handle `createStat` returns.
| Member | Type | Description |
|---|---|---|
| element | (): HTMLElement | null | |
| value | (): unknown | |
| refresh | (): void | |
| destroy | (): void |
StatConfig
A statistic block: a label, a value, its change, and what it is compared with. Reads the grid, so it cannot disagree with the table beneath it, and formats through the column's own type, so the tile and the table cannot drift.
| Member | Type | Description |
|---|---|---|
| grid | Grid | (optional) |
| container | HTMLElement | string | An element, or a CSS selector resolved against the grid's document. |
| title | string | (optional) |
| value | unknown | StatValueSpec | ((grid: Grid) => unknown) | A literal value, a spec to reduce, or a function of the grid. (optional) |
| footer | string | ((value: unknown, grid: Grid) => string) | Text under the value, or a function of it. (optional) |
| baseline | number | ((grid: Grid) => number) | What the value is compared against, for the change indicator. (optional) |
| goodWhen | 'up' | 'down' | 'neither' | Whether a rise is good news. `up` by default. (optional) |
| bands | { good?: number; warn?: number; direction?: 'up' | 'down' } | Thresholds the value itself is judged against, setting `data-tone` on the tile. Separate from `goodWhen`, which judges the *change*: a Cpk of 0.9 is bad news whether it rose or fell to get there. (optional) |
| interval | (value: unknown, grid: Grid) => | An interval to show under the value: how much to trust it. Return whichever of the grid's intervals belongs to this tile. (optional) |
| scope | 'filtered' | 'all' | 'selected' | Which rows feed the value. `filtered` by default. (optional) |
| live | boolean | `false` stops the tile following the grid; `refresh()` still works. (optional) |
| format | (value: unknown, grid: Grid) => string | Override the formatting the column's type would apply. (optional) |
| empty | string | Shown when there is no value. `, ` by default. (optional) |
| decimals | number | Fraction digits for a value whose reduction changed the unit. 2 by default. (optional) |
| class | string | Extra class names for the tile's root. (optional) |
StateApi
| Member | Type | Description |
|---|---|---|
| get | (): GridState | |
| apply | (state: GridState, opts?: { skip?: (keyof GridState)[] }): StateApplyReport | |
| baseline | (): GridState | null | The state the grid started in, captured once after `config.state`. |
| reset | (): StateApplyReport | null | Put the grid back the way it started, as one undoable step. |
| modified | (): boolean | Whether anything has changed since construction. |
StateApplyReport
| Member | Type | Description |
|---|---|---|
| applied | string[] | |
| skipped | { key: string; reason: string }[] |
StatisticsApi
| Member | Type | Description |
|---|---|---|
| shadow | (colId: string, kind: ShadowKind, rowKey: string, scope?: 'all' | 'filtered'): unknown | One shadow value for one row, by the column it shadows and the kind. |
| running | (colId: string, kind: 'total' | 'percent', rowKey: string): number | null | A running total at one row, down the grid as it is currently ordered. |
| rebase | (colId?: string): void | Make the current values the new baseline: "mark all". |
| tracking | (): { columns: string[]; rows: number; forgotten: number } | What the shadow histories are costing. |
| reduce | (colId: string, fn: string): unknown | Reduce a column by a named kernel over the filtered rows. |
| profile | (colId: string): ColumnProfile | null | Everything worth knowing about one column, in one pass each. |
| correlation | (a: string, b: string): number | null | Pearson's correlation between two columns. |
| covariance | (a: string, b: string, opts?: { population?: boolean }): number | null | Covariance, a correlation before the scales are divided out. |
| regression | (a: string, b: string): RegressionFit | null | Least-squares fit of `b` on `a`: in finance, beta and alpha. |
| spearman | (a: string, b: string): number | null | Spearman's rank correlation, which one outlier cannot drag. |
| kendall | (a: string, b: string): number | null | Kendall's tau-b. Null past 5,000 rows: it is quadratic. |
| weightedQuantile | (colId: string, weightId: string, p?: number): number | null | A quantile of one column weighted by another; the median by default. |
| capability | (colId: string, opts?: { | Process capability against the column's `spec`, with control limits and the Western Electric rule breaks. `baseline` fixes the limits over the first N readings, which is how a shift is found rather than hidden by the limits it widened. |
| interval | (colId: string, opts?: { | A confidence interval for what a column measures, the range the estimate pins the figure down to, not a verdict about it. Reads the rows the filters left, so an interval narrows as the grid does: it describes the filtered population, not the whole table. |
| series | (colId: string, opts: { by: string; periodsPerYear?: number }): SeriesStats | null | How a column varies along an ordering. `by` is required and never guessed: kernels see rows in the order they arrived, which is not the grid's sort. |
| weightedAverage | (colId: string, weightId: string): number | null | A weighted average of one column by another. |
| keyOf | (data: unknown): string | null | The key a row's data resolves to. |
| maintenance | Readonly<Record<string, 'maintained' | 'rescan'>> | Which reductions can be maintained against a change, and which rescan. (read-only) |
StatValueSpec
How a statistic block finds the number it reports.
| Member | Type | Description |
|---|---|---|
| of | string | The column to reduce, as a field name or a dotted path. Omit for `count`. (optional) |
| fn | TotalName | A key of `TOTAL_FNS`: `sum`, `avg`, `median`, `p95`, `gini` and the rest. (optional) |
| show | string | Report this column from the row holding the extreme, rather than the extreme itself: `{ of: 'sales', fn: 'max', show: 'rep' }` is the *name* of the best rep. Needs `min` or `max`, no single row holds an average. (optional) |
StreamSourceConfig
| Member | Type | Description |
|---|---|---|
| mode | 'stream' | |
| open | (req: { | |
| maxRows | number | The most rows to keep. A stream has no end, so an unbounded grid dies overnight; this makes it a sliding window and the oldest rows are dropped. Omit for no limit. Set on the source, not passed to `open`, it bounds what the grid retains rather than what the producer sends. (optional) |
| promoteToMemoryBelow | number | (optional) |
| coalesceMs | number | (optional) |
TextFormat
| Member | Type | Description |
|---|---|---|
| type | 'text' | |
| transform | 'none' | 'upper' | 'lower' | 'title' | (optional) |
| truncate | number | { chars: number; ellipsis?: string } | (optional) |
| nullDisplay | string | (optional) |
| emptyDisplay | string | (optional) |
TimelineApi
Moving the grid through recent data changes. Reads the change log rather than the undo history: history records what the *user* did, and the question on a live grid is what the *data* did. Nothing is scrubbable until `attach()`: what a value used to be is not recoverable after the fact.
| Member | Type | Description |
|---|---|---|
| attached | boolean | (read-only) |
| live | boolean | (read-only) |
| position | number | (read-only) |
| depth | number | (read-only) |
| attach | (): void | |
| detach | (): void | |
| seek | (steps: number): number | |
| step | (by: number): number | |
| toLive | (): number | |
| at | (): number | null | |
| span | (): { from: number; to: number } | null |
TreeConfig
| Member | Type | Description |
|---|---|---|
| path | (row: unknown) => string[] | (optional) |
| parentKey | string | ((row: unknown) => unknown) | (optional) |
| orphans | 'root' | string | (optional) |
| hasChildren | (row: unknown) => boolean | (optional) |
| loadChildren | (row: Row, signal: AbortSignal) => Promise<unknown[]> | (optional) |
| label | string | ((data: unknown, row: Row) => unknown) | Where the generated tree column takes its text from: a field or a function. (optional) |
| title | string | The tree column's heading. Defaults to the label column's own title. (optional) |
UnitConfig
How a column stores, parses and renders a quantity.
| Member | Type | Description |
|---|---|---|
| system | string | (optional) |
| unit | string | (optional) |
| binary | boolean | (optional) |
| decimals | number | (optional) |
| minDecimals | number | (optional) |
| maxDecimals | number | (optional) |
| display | string | (optional) |
| locale | string | (optional) |
| group | boolean | (optional) |
| space | string | (optional) |
| placement | 'suffix' | 'prefix' | (optional) |
UnitDescriptor
One unit descriptor: a symbol and how many base quantities it is worth.
| Member | Type | Description |
|---|---|---|
| symbol | string | |
| factor | number | |
| aliases | readonly string[] | |
| binary | boolean | |
| prefix | string | null | |
| auto | boolean |
UpdatesApi
| Member | Type | Description |
|---|---|---|
| paused | boolean | (read-only) |
| pause | (): boolean | |
| resume | (): ChangeResult | |
| flush | (): ChangeResult | |
| stats | (): { | |
| log | (opts?: { since?: number }): { at: number; change: RowChange; rows: number }[] |
ValueParams
| Member | Type | Description |
|---|---|---|
| value | unknown | |
| data | unknown | |
| row | Row | |
| column | Column | |
| colId | string | |
| grid | Grid | |
| context | unknown |
VariantDefinition
| Member | Type | Description |
|---|---|---|
| light | { fill: string; text: string; border: string } | |
| dark | { fill: string; text: string; border: string } |
ViewChange
| Member | Type | Description |
|---|---|---|
| reason | 'save' | 'update' | 'rename' | 'remove' | 'default' | 'import' | 'seed' | 'replace' | |
| view | SavedView | null | The view the change concerns; null for a bulk replace. |
ViewsApi
| Member | Type | Description |
|---|---|---|
| list | (): SavedView[] | |
| get | (id: string): SavedView | undefined | |
| activeId | string | null | (read-only) |
| save | (name: string, opts?: { id?: string; overwrite?: boolean }): SavedView | |
| apply | (id: string): SavedView | null | |
| rename | (id: string, name: string): SavedView | null | |
| duplicate | (id: string, name?: string): SavedView | null | |
| remove | (id: string): boolean | |
| setDefault | (id: string | null): SavedView | null | Mark the view applied on load; null clears it. |
| defaultView | (): SavedView | null | |
| diff | (id: string): Record<string, unknown> | null | What applying the view would change, without applying it. |
| export | (id: string): string | |
| import | (json: string): SavedView | |
| reload | (): void | Re-read from storage, after another tab or the server changed it. |
ViewStorage
| Member | Type | Description |
|---|---|---|
| read | (): SavedView[] | Load the user's views. Called at construction and by `views.reload()`. |
| write | (views: SavedView[], change: ViewChange): void | Mirror the views somewhere synchronous: `localStorage`, an in-memory cache. For a server, listen for `view:saved` / `view:removed` and do the write yourself: the grid does not make network calls and does not want to know whether yours succeeded. |