@toclocoinc/lattice-grid 1.18.1 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/API.html +153 -2
- package/docs/api-detail.html +48 -4
- package/lattice-grid.d.ts +237 -4
- package/lattice-grid.esm.min.js +1659 -204
- package/lattice-grid.min.cjs +1659 -204
- package/lattice-grid.min.css +1 -1
- package/lattice-grid.min.js +1659 -204
- package/modules/charts.esm.min.js +14 -3
- package/modules/devtools.esm.min.js +2 -2
- package/modules/dhtmlx-compat.esm.min.js +142 -7
- package/modules/htmx.esm.min.js +1659 -204
- package/modules/htmx.min.cjs +1659 -204
- package/modules/htmx.min.js +1659 -204
- package/modules/react.esm.min.js +2 -2
- package/modules/svelte.esm.min.js +2 -2
- package/modules/vue.esm.min.js +2 -2
- package/modules/webcomponent.esm.min.js +1659 -204
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
dependencies, no build step required. Optional adapters for React, Vue, Svelte
|
|
5
5
|
and Web Components ship alongside it.
|
|
6
6
|
|
|
7
|
-
Version 1.
|
|
7
|
+
Version 1.20.0 · [latticegrid.dev](https://www.latticegrid.dev) · TOCLOCO Inc
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
package/docs/API.html
CHANGED
|
@@ -871,6 +871,9 @@ autoInit(document); <span class="cmt">// builds every [data-lattice-grid] under
|
|
|
871
871
|
<tr><td class="name">stripedRows</td><td class="type">boolean</td><td class="dflt">false</td><td class="desc">Shade alternate data rows (zebra striping). Strictly opt-in, so an existing grid is unchanged on upgrade. Parity follows each row's logical index, so a stripe survives a scroll; group headings, footers and the grand total are never striped; selection and hover still win. Uses the theme's <code>--lattice-surface-alt</code>, so dark, high-contrast and terminal come for free.</td></tr>
|
|
872
872
|
<tr><td class="name">columnTagFilter</td><td class="type">boolean | { multiple, label }</td><td class="dflt">, </td><td class="desc">A bar above the headings for showing only the columns carrying a chosen tag. Draws nothing unless some column has <code>tags</code>. See <a href="api-detail.html#column-tags">Column tags</a>.</td></tr>
|
|
873
873
|
<tr><td class="name">rowTemplate</td><td class="type">string | { template, cardsPerRow, maxCardWidth, gap, className, role, itemRole }</td><td class="dflt">, </td><td class="desc">Draw each row with a template instead of dividing it into columns, a card list, a feed, a search-result list. Compiles once; binds with <code>{{data.field}}</code>. <code>cardsPerRow</code> or <code>maxCardWidth</code> puts several on a line. The pipeline underneath is unchanged. See <a href="api-detail.html#cards">Cards, lists and feeds</a>.</td></tr>
|
|
874
|
+
<tr><td class="name">gallery</td><td class="type">boolean | { template, tileWidth, tileHeight, cardsPerRow, gap, className, role, itemRole }</td><td class="dflt">, </td><td class="desc">Present rows as a gallery of tiles, laid out by the same 2-D virtualisation the grid runs. <code>true</code> generates a tile per row from the columns; <code>tileWidth</code> sizes them and the count across follows the container, or <code>cardsPerRow</code> fixes it. Presentation only — sort, filter, group and export are unchanged. See <a href="api-detail.html#cards">Cards, lists and feeds</a>.</td></tr>
|
|
875
|
+
<tr><td class="name">recordCard</td><td class="type">boolean | { template, cardHeight, className, role, itemRole }</td><td class="dflt">, </td><td class="desc">Present each row as a record card — a form of label/value pairs, one line per column in display order, showing the same text the table shows. <code>true</code> generates the form from the columns. A card list underneath, so it inherits the virtualisation and every card interaction. Presentation only. See <a href="api-detail.html#cards">Cards, lists and feeds</a>.</td></tr>
|
|
876
|
+
<tr><td class="name">board</td><td class="type">boolean | { template, laneWidth, cardHeight, laneGap, gap, className, role, itemRole }</td><td class="dflt">, </td><td class="desc">Present rows as a board — a kanban of grouped lanes of cards. The top-level group becomes a lane and every leaf under it becomes a card stacked in it; group the grid to give the board its lanes. <code>true</code> generates a card per row from the columns. Both axes are virtualised, the lanes across and the cards down each, so a board of many long lanes draws only what is on screen. A board card is still a row: it clicks, selects and drags through the grid's own handlers. Presentation only — sort, filter, group and export are unchanged. See <a href="api-detail.html#cards">Cards, lists and feeds</a>.</td></tr>
|
|
874
877
|
<tr><td class="name">responsive</td><td class="type">{ maxWidth, template, rowHeight }</td><td class="dflt">, </td><td class="desc">Collapse to cards when the <em>container</em> is at or below <code>maxWidth</code> (640 by default), and return to a table above it. Sorting, filtering and export keep working. Emits <code>presentation:changed</code>. See <a href="api-detail.html#cards">Cards, lists and feeds</a>.</td></tr>
|
|
875
878
|
<tr><td class="name">rowForm</td><td class="type">boolean | { mode, load, fields, title, width, trigger, timeout, container }</td><td class="dflt">, </td><td class="desc">Open a row for editing on a form. <code>mode: 'drawer'</code> (default) or <code>'dialog'</code>; without <code>load</code> the fields are the grid's own columns. A field entry is <code>{ field, label, editor, type, props, lookup }</code>: any editor, including your own. Takes double-click on the row unless <code>trigger: false</code>. A load that has not answered within <code>timeout</code> milliseconds (2000; <code>false</code> waits indefinitely) is reported as a failure with a retry. <code>container</code> builds the form in an element of your own instead of over the grid. See <a href="api-detail.html#row-form">Editing a row on a form</a>.</td></tr>
|
|
876
879
|
<tr><td class="name">showColumnFunctions</td><td class="type">boolean</td><td class="dflt">true</td><td class="desc"><code>false</code> leaves each heading as its label, with no sort, filter or menu control. Those remain reachable through the API, the keyboard and the tool panel.</td></tr>
|
|
@@ -4123,6 +4126,36 @@ grid.destroy();
|
|
|
4123
4126
|
translated.total,
|
|
4124
4127
|
].join('|');</code></pre>
|
|
4125
4128
|
|
|
4129
|
+
<h3 id="dhtmlx-spans-example">Cell spans, executed</h3>
|
|
4130
|
+
<p class="section-note">dhtmlx's imperative <code>addSpan</code> maintains a span table, and that table drives
|
|
4131
|
+
Lattice's own per-cell span functions — installed on each column's <code>cell</code> definition. A span
|
|
4132
|
+
declared through the shim is read back through the very functions the renderer calls.</p>
|
|
4133
|
+
<pre data-run="js" data-expect="3|2|1|1" data-covers="adapterKey:cell"><code><span class="cmt">// Aliased on import: the shim's span factory, bound to a local name.</span>
|
|
4134
|
+
<span class="kw">const</span> { createSpans: installSpans } = <span class="kw">await</span> import('../packages/modules/dhtmlx-compat/spans.js');
|
|
4135
|
+
|
|
4136
|
+
<span class="cmt">// A minimal stand-in for a grid: it just holds its columns, which is all the</span>
|
|
4137
|
+
<span class="cmt">// span shim touches. `createSpans` installs `cell.spanRows`/`cell.spanColumns`</span>
|
|
4138
|
+
<span class="cmt">// on each column by re-setting them through its own wrapper.</span>
|
|
4139
|
+
<span class="kw">let</span> columns = [{ id: 'name', cell: {} }];
|
|
4140
|
+
<span class="kw">const</span> grid = {
|
|
4141
|
+
get: () => columns,
|
|
4142
|
+
set: (_, next) => { columns = next; },
|
|
4143
|
+
};
|
|
4144
|
+
|
|
4145
|
+
<span class="kw">const</span> spans = installSpans(grid);
|
|
4146
|
+
spans.addSpan('R0', 'name', 3, 2); <span class="cmt">// rowspan 3, colspan 2</span>
|
|
4147
|
+
|
|
4148
|
+
<span class="cmt">// The column's own cell functions now read the maintained table.</span>
|
|
4149
|
+
<span class="kw">const</span> { cell } = columns[0];
|
|
4150
|
+
<span class="kw">const</span> spanned = { row: { key: 'R0' }, colId: 'name' };
|
|
4151
|
+
<span class="kw">const</span> plain = { row: { key: 'R1' }, colId: 'name' };
|
|
4152
|
+
<span class="kw">return</span> [
|
|
4153
|
+
cell.spanRows(spanned),
|
|
4154
|
+
cell.spanColumns(spanned),
|
|
4155
|
+
cell.spanRows(plain),
|
|
4156
|
+
cell.spanColumns(plain),
|
|
4157
|
+
].join('|');</code></pre>
|
|
4158
|
+
|
|
4126
4159
|
<h3 id="module-exports-example">Every module export, executed</h3>
|
|
4127
4160
|
<p class="section-note">Nine shipped modules, each export resolved against its own barrel on every build.</p>
|
|
4128
4161
|
<pre data-run="js" data-expect="60" data-covers="export:ContextMenu export:Messages export:Registry export:autoInit export:createGrid export:createLocalViewStorage export:createMessages export:createStat export:deltaOf export:gridElementsWithin export:hydrateTable export:mountPanel export:readTable export:toneOf export:Chart export:PALETTE export:SCHEMES export:TYPES export:createChart export:chartRange export:canChartRange export:deriveRangeSpec export:registerScheme export:resolveScheme export:schemeNames export:setDefaultScheme export:HTML_ROW_WARNING_THRESHOLD export:QUERY_CHANGED_EVENT export:SCROLL_NEAR_END_EVENT export:attach export:destroyWithin export:driveInfiniteScroll export:driveOobUpdates export:driveServerMode export:ingestResponse export:initWithin export:queryParams export:restoreStateWithin export:rowsFromFragment export:rowsFromJson export:saveStateWithin export:ATTRIBUTE_CONFIG export:EVENT_PREFIX export:GridElementController export:LatticeGrid export:TAG_NAME export:createLatticeGridElement export:defineLatticeGrid export:domEventName export:observedAttributeNames export:CONSOLE_ACTIVATION export:createDevtools export:expose export:EVENT_NAMES export:handlerName export:createLatticeGrid export:dashedName export:createLatticeAction export:Grid export:warnIfLargeHtmlPayload"><code><span class="cmt">// Every declared export of every shipped module, resolved against its own</span>
|
|
@@ -4547,6 +4580,17 @@ grid.destroy();
|
|
|
4547
4580
|
</tbody>
|
|
4548
4581
|
</table>
|
|
4549
4582
|
</div>
|
|
4583
|
+
<h3 id="type-ApproximateEntry">ApproximateEntry</h3>
|
|
4584
|
+
<p class="section-note">One entry of the approximate maintenance tier.</p>
|
|
4585
|
+
<div class="table-wrap">
|
|
4586
|
+
<table>
|
|
4587
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
4588
|
+
<tbody>
|
|
4589
|
+
<tr><td class="name">sketch</td><td class="type">string</td><td class="desc">The sketch that backs this kernel: `HyperLogLog`, `KLL`, `SpaceSaving`.</td></tr>
|
|
4590
|
+
<tr><td class="name">bound</td><td class="type">ErrorBound</td><td class="desc">The error bound the sketch is verified to meet.</td></tr>
|
|
4591
|
+
</tbody>
|
|
4592
|
+
</table>
|
|
4593
|
+
</div>
|
|
4550
4594
|
<h3 id="type-BooleanFormat">BooleanFormat</h3>
|
|
4551
4595
|
<div class="table-wrap">
|
|
4552
4596
|
<table>
|
|
@@ -4830,6 +4874,24 @@ grid.destroy();
|
|
|
4830
4874
|
</tbody>
|
|
4831
4875
|
</table>
|
|
4832
4876
|
</div>
|
|
4877
|
+
<h3 id="type-ColumnDifference">ColumnDifference</h3>
|
|
4878
|
+
<p class="section-note">How one column differs between the filtered subset and its population.</p>
|
|
4879
|
+
<div class="table-wrap">
|
|
4880
|
+
<table>
|
|
4881
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
4882
|
+
<tbody>
|
|
4883
|
+
<tr><td class="name">column</td><td class="type">string</td><td class="desc">The column id.</td></tr>
|
|
4884
|
+
<tr><td class="name">name</td><td class="type">string</td><td class="desc">The column's display name, or its id.</td></tr>
|
|
4885
|
+
<tr><td class="name">measure</td><td class="type">'standardizedMeanDifference' | 'categoricalTotalVariation'</td><td class="desc">The effect size reported for this column's family: the standardized mean difference for a numeric column, the total variation of the category mix for a categorical one. Never a p-value.</td></tr>
|
|
4886
|
+
<tr><td class="name">magnitude</td><td class="type">number | null</td><td class="desc">The effect size in its own terms, or null when it has no scale here.</td></tr>
|
|
4887
|
+
<tr><td class="name">distance</td><td class="type">number</td><td class="desc">The total variation distance between subset and population, 0 to 1 — the common scale both families reduce to, and what the ranking sorts by.</td></tr>
|
|
4888
|
+
<tr><td class="name">direction</td><td class="type">number</td><td class="desc">+1 when the subset sits above the population, −1 below, 0 for a mix.</td></tr>
|
|
4889
|
+
<tr><td class="name">subsetN</td><td class="type">number</td><td class="desc">How many rows the subset comparison stood on.</td></tr>
|
|
4890
|
+
<tr><td class="name">populationN</td><td class="type">number</td><td class="desc">How many rows the population comparison stood on.</td></tr>
|
|
4891
|
+
<tr><td class="name">reliable</td><td class="type">boolean</td><td class="desc">False when the subset is too small to read the difference from.</td></tr>
|
|
4892
|
+
</tbody>
|
|
4893
|
+
</table>
|
|
4894
|
+
</div>
|
|
4833
4895
|
<h3 id="type-ColumnDistribution">ColumnDistribution</h3>
|
|
4834
4896
|
<div class="table-wrap">
|
|
4835
4897
|
<table>
|
|
@@ -5044,6 +5106,8 @@ grid.destroy();
|
|
|
5044
5106
|
<tr><td class="name">total</td><td class="type">TotalName | null</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5045
5107
|
<tr><td class="name">groupTotal</td><td class="type">TotalName | null</td><td class="desc">The group-subtotal override, when one differs from `total`. <small>(optional)</small></td></tr>
|
|
5046
5108
|
<tr><td class="name">grandTotal</td><td class="type">TotalName | null</td><td class="desc">The grand-total override, when one differs from `total`. <small>(optional)</small></td></tr>
|
|
5109
|
+
<tr><td class="name">decoration</td><td class="type">DecorationName | DecorationSpec | null</td><td class="desc">The column's runtime decoration (BACKLOG-0000723), present only when the column carries one, so a `columns.decorate()` survives a saved view and participates in undo/redo. Absent means "not recorded"; an explicit `null` on an undo patch clears a decoration back to plain text. <small>(optional)</small></td></tr>
|
|
5110
|
+
<tr><td class="name">variant</td><td class="type">VariantSpec | null</td><td class="desc">The variant set alongside the decoration, when one is present. <small>(optional)</small></td></tr>
|
|
5047
5111
|
</tbody>
|
|
5048
5112
|
</table>
|
|
5049
5113
|
</div>
|
|
@@ -5500,6 +5564,46 @@ grid.destroy();
|
|
|
5500
5564
|
</tbody>
|
|
5501
5565
|
</table>
|
|
5502
5566
|
</div>
|
|
5567
|
+
<h3 id="type-ErrorBound">ErrorBound</h3>
|
|
5568
|
+
<p class="section-note">How an approximate reduction's error bound holds, and what it measures.</p>
|
|
5569
|
+
<div class="table-wrap">
|
|
5570
|
+
<table>
|
|
5571
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
5572
|
+
<tbody>
|
|
5573
|
+
<tr><td class="name">kind</td><td class="type">'deterministic' | 'probabilistic' | 'exact'</td><td class="desc">`deterministic` every run, `probabilistic` in expectation, `exact` to float rounding.</td></tr>
|
|
5574
|
+
<tr><td class="name">metric</td><td class="type">'absolute' | 'relative' | 'rank' | 'none'</td><td class="desc">What the number measures. `rank` is a fraction of the rank, for quantiles.</td></tr>
|
|
5575
|
+
<tr><td class="name">value</td><td class="type">number</td><td class="desc">The bound itself, in the unit `metric` names.</td></tr>
|
|
5576
|
+
<tr><td class="name">statement</td><td class="type">string</td><td class="desc">A one-line human reading of the guarantee.</td></tr>
|
|
5577
|
+
</tbody>
|
|
5578
|
+
</table>
|
|
5579
|
+
</div>
|
|
5580
|
+
<h3 id="type-ExcelBorderSpec">ExcelBorderSpec</h3>
|
|
5581
|
+
<p class="section-note">A cell border, per edge. `true` means a thin line; a string names the style.</p>
|
|
5582
|
+
<div class="table-wrap">
|
|
5583
|
+
<table>
|
|
5584
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
5585
|
+
<tbody>
|
|
5586
|
+
<tr><td class="name">left</td><td class="type">boolean | string</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5587
|
+
<tr><td class="name">right</td><td class="type">boolean | string</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5588
|
+
<tr><td class="name">top</td><td class="type">boolean | string</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5589
|
+
<tr><td class="name">bottom</td><td class="type">boolean | string</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5590
|
+
</tbody>
|
|
5591
|
+
</table>
|
|
5592
|
+
</div>
|
|
5593
|
+
<h3 id="type-ExcelCellStyle">ExcelCellStyle</h3>
|
|
5594
|
+
<p class="section-note">A conditional-formatting rule's rendering, returned by `cellStyle`.</p>
|
|
5595
|
+
<div class="table-wrap">
|
|
5596
|
+
<table>
|
|
5597
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
5598
|
+
<tbody>
|
|
5599
|
+
<tr><td class="name">bold</td><td class="type">boolean</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5600
|
+
<tr><td class="name">italic</td><td class="type">boolean</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5601
|
+
<tr><td class="name">colour</td><td class="type">string</td><td class="desc">Font colour as 6- or 8-digit hex/ARGB, e.g. 'FFFF0000'. `color` is an alias. <small>(optional)</small></td></tr>
|
|
5602
|
+
<tr><td class="name">color</td><td class="type">string</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5603
|
+
<tr><td class="name">fill</td><td class="type">string</td><td class="desc">Solid fill colour as 6- or 8-digit hex/ARGB. <small>(optional)</small></td></tr>
|
|
5604
|
+
</tbody>
|
|
5605
|
+
</table>
|
|
5606
|
+
</div>
|
|
5503
5607
|
<h3 id="type-ExcelExportOptions">ExcelExportOptions</h3>
|
|
5504
5608
|
<div class="table-wrap">
|
|
5505
5609
|
<table>
|
|
@@ -5508,6 +5612,9 @@ grid.destroy();
|
|
|
5508
5612
|
<tr><td class="name">sheetName</td><td class="type">string</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5509
5613
|
<tr><td class="name">freezePanes</td><td class="type">boolean</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5510
5614
|
<tr><td class="name">variantFills</td><td class="type">boolean</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5615
|
+
<tr><td class="name">borders</td><td class="type">boolean | string | ExcelBorderSpec</td><td class="desc">Draw cell borders on the data grid. `false` (default) is borderless; `true` draws a thin box; a string names the line style; an object picks edges. <small>(optional)</small></td></tr>
|
|
5616
|
+
<tr><td class="name">hiddenColumns</td><td class="type">'omit' | 'hidden'</td><td class="desc">What to do with grid-hidden columns. `'omit'` (default) drops them; `'hidden'` keeps them as Excel-hidden columns for round-trip fidelity. <small>(optional)</small></td></tr>
|
|
5617
|
+
<tr><td class="name">merges</td><td class="type">string[]</td><td class="desc">Explicit merged body ranges in A1 form, e.g. ['A3:A4']. <small>(optional)</small></td></tr>
|
|
5511
5618
|
<tr><td class="name">onProgress</td><td class="type">(p: { written: number; total: number }) => void</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5512
5619
|
</tbody>
|
|
5513
5620
|
</table>
|
|
@@ -5828,6 +5935,9 @@ grid.destroy();
|
|
|
5828
5935
|
<tr><td class="name">columnTagFilter</td><td class="type">boolean | { multiple?: boolean; label?: string }</td><td class="desc">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. <small>(optional)</small></td></tr>
|
|
5829
5936
|
<tr><td class="name">typeOptions</td><td class="type">Record<string, {</td><td class="desc">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. <small>(optional)</small></td></tr>
|
|
5830
5937
|
<tr><td class="name">rowTemplate</td><td class="type">string | {</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5938
|
+
<tr><td class="name">gallery</td><td class="type">boolean | {</td><td class="desc">Present rows as a gallery of tiles (§7.12). The tiled card layout with a size-driven column count: tiles as wide as `tileWidth` allows, as many across as the container holds, laid out by the same 2-D virtualisation the grid already runs. `true` draws a tile per row generated from the columns; an object sizes them or supplies a template. Presentation only — sort, filter, group and the data pipeline are unchanged. <small>(optional)</small></td></tr>
|
|
5939
|
+
<tr><td class="name">recordCard</td><td class="type">boolean | {</td><td class="desc">Present each row as a record card — a form of label/value pairs (§7.11). For a screen where reading one record matters more than comparing many. `true` draws a card per row generated from the columns, each column a labelled line in display order, showing the same text the table shows. An object supplies a template or sizes the card. A card list underneath, so it inherits the virtualisation and every interaction a card carries. Presentation only — sort, filter, group and the data pipeline are unchanged. <small>(optional)</small></td></tr>
|
|
5940
|
+
<tr><td class="name">board</td><td class="type">boolean | {</td><td class="desc">Present rows as a board — a kanban of grouped lanes of cards (§7.14). The top-level group becomes a lane and every leaf under it becomes a card stacked in that lane: a pipeline by stage, a task list by status, a backlog by owner. `true` draws a card per row generated from the columns; an object sizes the lanes and cards or supplies a template. Group the grid to give the board its lanes; an ungrouped board is a single lane of every card. A card is drawn through the same code the other card presentations use, so a board card is still a row: it clicks, selects and drags through the grid's own handlers, masks protected columns, and shows the same text the table shows. Both axes are virtualised — the lanes across and the cards down each — so a board of many long lanes renders only what is on screen. Presentation only: sort, filter, group and the data pipeline are unchanged. <small>(optional)</small></td></tr>
|
|
5831
5941
|
<tr><td class="name">responsive</td><td class="type">{</td><td class="desc">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`. <small>(optional)</small></td></tr>
|
|
5832
5942
|
<tr><td class="name">rowForm</td><td class="type">boolean | {</td><td class="desc"><small>(optional)</small></td></tr>
|
|
5833
5943
|
<tr><td class="name">showColumnFunctions</td><td class="type">boolean</td><td class="desc">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. <small>(optional)</small></td></tr>
|
|
@@ -5849,8 +5959,8 @@ grid.destroy();
|
|
|
5849
5959
|
<tr><td class="name">facets</td><td class="type">FacetConfig | boolean</td><td class="desc">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. <small>(optional)</small></td></tr>
|
|
5850
5960
|
<tr><td class="name">hostFilter</td><td class="type">{ active(): boolean; passes(row: Row): boolean }</td><td class="desc">A filter your application owns, applied alongside the grid's own and invisible to its filter UI. <small>(optional)</small></td></tr>
|
|
5851
5961
|
<tr><td class="name">context</td><td class="type">unknown</td><td class="desc">Anything of yours, passed untouched to renderers, editors and sources. <small>(optional)</small></td></tr>
|
|
5852
|
-
<tr><td class="name">workerThreshold</td><td class="type">number</td><td class="desc">Row count above which
|
|
5853
|
-
<tr><td class="name">useWorker</td><td class="type">boolean</td><td class="desc">Compute
|
|
5962
|
+
<tr><td class="name">workerThreshold</td><td class="type">number</td><td class="desc">Row count above which eligible work is computed in a Worker: column distributions, and a portable sort (a built-in collation with no custom comparator). Below it, everything runs on the main thread. <small>(optional)</small></td></tr>
|
|
5963
|
+
<tr><td class="name">useWorker</td><td class="type">boolean</td><td class="desc">Compute eligible work off the main thread: column distributions, and a portable sort above {@link GridConfig.workerThreshold} (a re-sort recomputes off-thread while the grid keeps showing the prior order, then swaps to the new one when it lands). Filtering and grouping still run on the main thread. <small>(optional)</small></td></tr>
|
|
5854
5964
|
<tr><td class="name">workerUrl</td><td class="type">string</td><td class="desc">Where to load the worker kernel from, when hosting it yourself. <small>(optional)</small></td></tr>
|
|
5855
5965
|
<tr><td class="name">sharedMemory</td><td class="type">boolean</td><td class="desc">Use a shared buffer for the worker, where the page's headers allow it. <small>(optional)</small></td></tr>
|
|
5856
5966
|
<tr><td class="name">groupFooter</td><td class="type">boolean</td><td class="desc">A totals line at the foot of each group as well as the grid. <small>(optional)</small></td></tr>
|
|
@@ -6055,6 +6165,18 @@ grid.destroy();
|
|
|
6055
6165
|
</tbody>
|
|
6056
6166
|
</table>
|
|
6057
6167
|
</div>
|
|
6168
|
+
<h3 id="type-MaintenanceTier">MaintenanceTier</h3>
|
|
6169
|
+
<p class="section-note">The maintenance label for one kernel across both tiers.</p>
|
|
6170
|
+
<div class="table-wrap">
|
|
6171
|
+
<table>
|
|
6172
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
6173
|
+
<tbody>
|
|
6174
|
+
<tr><td class="name">stat</td><td class="type">string</td><td class="desc">The kernel name.</td></tr>
|
|
6175
|
+
<tr><td class="name">exact</td><td class="type">'maintained' | 'rescan' | null</td><td class="desc">Its exact tier, or null when it is not an exact kernel.</td></tr>
|
|
6176
|
+
<tr><td class="name">approximate</td><td class="type">ApproximateEntry | null</td><td class="desc">The approximate alternative and bound, or null when none exists.</td></tr>
|
|
6177
|
+
</tbody>
|
|
6178
|
+
</table>
|
|
6179
|
+
</div>
|
|
6058
6180
|
<h3 id="type-MaximiseApi">MaximiseApi</h3>
|
|
6059
6181
|
<div class="table-wrap">
|
|
6060
6182
|
<table>
|
|
@@ -6931,6 +7053,7 @@ grid.destroy();
|
|
|
6931
7053
|
<tr><td class="name">tracking</td><td class="type">(): { columns: string[]; rows: number; forgotten: number }</td><td class="desc">What the shadow histories are costing.</td></tr>
|
|
6932
7054
|
<tr><td class="name">reduce</td><td class="type">(colId: string, fn: string): unknown</td><td class="desc">Reduce a column by a named kernel over the filtered rows.</td></tr>
|
|
6933
7055
|
<tr><td class="name">profile</td><td class="type">(colId: string): ColumnProfile | null</td><td class="desc">Everything worth knowing about one column, in one pass each.</td></tr>
|
|
7056
|
+
<tr><td class="name">subsetVsPopulation</td><td class="type">(opts?: { columns?: string[] }): SubsetComparison</td><td class="desc">Which columns differ most between the filtered subset and the whole population it was drawn from, ranked by effect size — never by a p-value. The measure is stated per column; a numeric and a categorical column are put on one bounded scale so they rank against each other.</td></tr>
|
|
6934
7057
|
<tr><td class="name">correlation</td><td class="type">(a: string, b: string): number | null</td><td class="desc">Pearson's correlation between two columns.</td></tr>
|
|
6935
7058
|
<tr><td class="name">covariance</td><td class="type">(a: string, b: string, opts?: { population?: boolean }): number | null</td><td class="desc">Covariance, a correlation before the scales are divided out.</td></tr>
|
|
6936
7059
|
<tr><td class="name">regression</td><td class="type">(a: string, b: string): RegressionFit | null</td><td class="desc">Least-squares fit of `b` on `a`: in finance, beta and alpha.</td></tr>
|
|
@@ -6943,6 +7066,8 @@ grid.destroy();
|
|
|
6943
7066
|
<tr><td class="name">weightedAverage</td><td class="type">(colId: string, weightId: string): number | null</td><td class="desc">A weighted average of one column by another.</td></tr>
|
|
6944
7067
|
<tr><td class="name">keyOf</td><td class="type">(data: unknown): string | null</td><td class="desc">The key a row's data resolves to.</td></tr>
|
|
6945
7068
|
<tr><td class="name">maintenance</td><td class="type">Readonly<Record<string, 'maintained' | 'rescan'>></td><td class="desc">Which reductions can be maintained against a change, and which rescan. <small>(read-only)</small></td></tr>
|
|
7069
|
+
<tr><td class="name">approximate</td><td class="type">Readonly<Record<string, ApproximateEntry>></td><td class="desc">The approximate tier: kernels a sketch maintains in constant time per tick, keyed by kernel name, each carrying the sketch that backs it and the error bound that sketch is verified to meet. <small>(read-only)</small></td></tr>
|
|
7070
|
+
<tr><td class="name">maintenanceTier</td><td class="type">(fn: string): MaintenanceTier</td><td class="desc">The honest tier for one kernel across both the exact and approximate maps: its exact tier and, when one exists, the approximate alternative and bound.</td></tr>
|
|
6946
7071
|
</tbody>
|
|
6947
7072
|
</table>
|
|
6948
7073
|
</div>
|
|
@@ -6971,6 +7096,20 @@ grid.destroy();
|
|
|
6971
7096
|
</tbody>
|
|
6972
7097
|
</table>
|
|
6973
7098
|
</div>
|
|
7099
|
+
<h3 id="type-SubsetComparison">SubsetComparison</h3>
|
|
7100
|
+
<p class="section-note">The subset-vs-population ranking (BACKLOG-0000653).</p>
|
|
7101
|
+
<div class="table-wrap">
|
|
7102
|
+
<table>
|
|
7103
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
7104
|
+
<tbody>
|
|
7105
|
+
<tr><td class="name">ranked</td><td class="type">ColumnDifference[]</td><td class="desc">Every compared column, largest difference first.</td></tr>
|
|
7106
|
+
<tr><td class="name">subsetN</td><td class="type">number</td><td class="desc">How many rows the filtered subset holds.</td></tr>
|
|
7107
|
+
<tr><td class="name">populationN</td><td class="type">number</td><td class="desc">How many rows the whole population holds.</td></tr>
|
|
7108
|
+
<tr><td class="name">filtered</td><td class="type">boolean</td><td class="desc">Whether a filter is actually narrowing the set.</td></tr>
|
|
7109
|
+
<tr><td class="name">measures</td><td class="type">{ numeric: string; categorical: string; common: string }</td><td class="desc">The measure each family reports, and the common scale, named for a legend.</td></tr>
|
|
7110
|
+
</tbody>
|
|
7111
|
+
</table>
|
|
7112
|
+
</div>
|
|
6974
7113
|
<h3 id="type-TextFormat">TextFormat</h3>
|
|
6975
7114
|
<div class="table-wrap">
|
|
6976
7115
|
<table>
|
|
@@ -7136,6 +7275,18 @@ grid.destroy();
|
|
|
7136
7275
|
</tbody>
|
|
7137
7276
|
</table>
|
|
7138
7277
|
</div>
|
|
7278
|
+
<h3 id="type-WindowSpec">WindowSpec</h3>
|
|
7279
|
+
<p class="section-note">The window a windowed aggregate was computed over.</p>
|
|
7280
|
+
<div class="table-wrap">
|
|
7281
|
+
<table>
|
|
7282
|
+
<thead><tr><th>Member</th><th>Type</th><th>Description</th></tr></thead>
|
|
7283
|
+
<tbody>
|
|
7284
|
+
<tr><td class="name">kind</td><td class="type">'count' | 'time' | 'session'</td><td class="desc">Which window: last N ticks, last N ms, or the session.</td></tr>
|
|
7285
|
+
<tr><td class="name">span</td><td class="type">number</td><td class="desc">The size: N ticks, N ms, or the session duration in ms.</td></tr>
|
|
7286
|
+
<tr><td class="name">size</td><td class="type">number</td><td class="desc">How many values actually fell inside the window.</td></tr>
|
|
7287
|
+
</tbody>
|
|
7288
|
+
</table>
|
|
7289
|
+
</div>
|
|
7139
7290
|
<!-- END GENERATED TYPE REFERENCE -->
|
|
7140
7291
|
|
|
7141
7292
|
<footer>
|
package/docs/api-detail.html
CHANGED
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
<div class="shell">
|
|
438
438
|
<aside class="rail">
|
|
439
439
|
<p class="rail__brand">Lattice Grid</p>
|
|
440
|
-
<p class="rail__sub">Developer guide · v1.
|
|
440
|
+
<p class="rail__sub">Developer guide · v1.20.0</p>
|
|
441
441
|
<nav>
|
|
442
442
|
<div class="rail__group">
|
|
443
443
|
<span class="rail__label">Start here</span>
|
|
@@ -3172,6 +3172,48 @@ columns: [
|
|
|
3172
3172
|
record is a small piece of layout rather than a line of cells.
|
|
3173
3173
|
</p>
|
|
3174
3174
|
|
|
3175
|
+
<p class="lead-in">
|
|
3176
|
+
Two shorthands sit on top of it for the shapes that recur. <code>recordCard</code> presents each
|
|
3177
|
+
row as a record card — a form of label/value pairs, one line per column in display order,
|
|
3178
|
+
showing the same text the table shows — for a screen where reading one record matters more
|
|
3179
|
+
than comparing many. <code>gallery</code> presents the rows as a grid of tiles laid out by the
|
|
3180
|
+
same 2-D virtualisation the grid already runs. Both take <code>true</code> to generate the layout
|
|
3181
|
+
from the columns, or an object to size it or supply a template, and both are presentation only:
|
|
3182
|
+
sort, filter, group and the data pipeline are unchanged.
|
|
3183
|
+
</p>
|
|
3184
|
+
|
|
3185
|
+
<p class="lead-in">
|
|
3186
|
+
<code>board</code> is the third shape: a kanban of grouped lanes of cards. Group the grid and the
|
|
3187
|
+
top-level group becomes a lane, with every leaf under it a card stacked in that lane — a
|
|
3188
|
+
pipeline by stage, a task list by status, a backlog by owner. Both axes are virtualised, the lanes
|
|
3189
|
+
across and the cards down each, so a board of many long lanes draws only what is on screen. A board
|
|
3190
|
+
card is still a row: it clicks, selects and drags through the grid's own handlers, and masks
|
|
3191
|
+
protected columns exactly as every other card does. Like the others it is presentation only.
|
|
3192
|
+
</p>
|
|
3193
|
+
|
|
3194
|
+
<div class="example">
|
|
3195
|
+
<p class="example__label">The shorthands, and the config a grid reports back</p>
|
|
3196
|
+
<pre data-run="js" data-expect="recordCard true, gallery 240px, board 300px" data-covers="config:recordCard config:gallery config:board"><code><span class="kw">const</span> { createHeadlessGrid } = <span class="kw">await</span> import('../packages/core/src/index.js');
|
|
3197
|
+
|
|
3198
|
+
<span class="kw">const</span> grid = createHeadlessGrid({
|
|
3199
|
+
columns: [{ field: 'name' }, { field: 'owner' }],
|
|
3200
|
+
rows: [
|
|
3201
|
+
{ id: '1', name: 'Alpha', owner: 'Ada' },
|
|
3202
|
+
{ id: '2', name: 'Beta', owner: 'Ben' },
|
|
3203
|
+
],
|
|
3204
|
+
rowKey: 'id',
|
|
3205
|
+
<span class="cmt">// Each row as a labelled record card…</span>
|
|
3206
|
+
recordCard: <span class="kw">true</span>,
|
|
3207
|
+
<span class="cmt">// …or a gallery of size-driven tiles…</span>
|
|
3208
|
+
gallery: { tileWidth: 240 },
|
|
3209
|
+
<span class="cmt">// …or a kanban of grouped lanes. Presentation only.</span>
|
|
3210
|
+
board: { laneWidth: 300 },
|
|
3211
|
+
});
|
|
3212
|
+
|
|
3213
|
+
<span class="kw">const</span> c = grid.config();
|
|
3214
|
+
<span class="kw">return</span> `recordCard ${c.recordCard === <span class="kw">true</span>}, gallery ${c.gallery.tileWidth}px, board ${c.board.laneWidth}px`;</code></pre>
|
|
3215
|
+
</div>
|
|
3216
|
+
|
|
3175
3217
|
<div class="example">
|
|
3176
3218
|
<p class="example__label">A card list</p>
|
|
3177
3219
|
<pre><code>createGrid(element, {
|
|
@@ -4265,9 +4307,11 @@ const providerFor = (id) => ({
|
|
|
4265
4307
|
ordinary filters. Pausing the stream brings the charts back, a paused stream is a still
|
|
4266
4308
|
one: unless you set <code>whilePaused: false</code>.</p>
|
|
4267
4309
|
<p><strong>Counting runs off the main thread above <code>workerThreshold</code>.</strong>
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4310
|
+
A distribution was the first work the grid moved to a Worker: nothing waits on a histogram,
|
|
4311
|
+
which is what made it offloadable without an async pipeline. A portable sort — a built-in
|
|
4312
|
+
collation with no custom comparator — now also recomputes off-thread above the threshold,
|
|
4313
|
+
serving the prior order until the new one lands. Filtering and grouping still run on the main
|
|
4314
|
+
thread. The column is copied, or shared where cross-origin isolation makes
|
|
4271
4315
|
<code>SharedArrayBuffer</code> available; it is never transferred, because transferring would
|
|
4272
4316
|
detach the buffer the grid is still rendering from.</p>
|
|
4273
4317
|
<p><strong>The Worker settings.</strong> <code>useWorker</code> and
|