@toclocoinc/lattice-grid 1.32.0 → 1.33.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 +90 -0
- package/docs/api-detail.html +3 -2
- package/lattice-grid.d.ts +236 -1
- package/lattice-grid.esm.min.js +4 -4
- package/lattice-grid.min.cjs +4 -4
- package/lattice-grid.min.js +4 -4
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.esm.min.js +143 -0
- package/modules/chart-arc.esm.min.js +102 -0
- package/modules/chart-bubblemap.esm.min.js +86 -0
- package/modules/chart-bump.esm.min.js +105 -0
- package/modules/chart-calendar.esm.min.js +124 -0
- package/modules/chart-decomposition.esm.min.js +127 -0
- package/modules/chart-diverging.esm.min.js +99 -0
- package/modules/chart-dumbbell.esm.min.js +110 -0
- package/modules/chart-fan.esm.min.js +135 -0
- package/modules/chart-hexbin.esm.min.js +144 -0
- package/modules/chart-hexmap.esm.min.js +120 -0
- package/modules/chart-icicle.esm.min.js +92 -0
- package/modules/chart-parallel.esm.min.js +114 -0
- package/modules/chart-ridgeline.esm.min.js +114 -0
- package/modules/chart-roc.esm.min.js +177 -0
- package/modules/chart-slope.esm.min.js +95 -0
- package/modules/chart-splom.esm.min.js +120 -0
- package/modules/chart-waffle.esm.min.js +92 -0
- package/modules/charts.esm.min.js +107 -9
- package/modules/charts.min.cjs +105 -9
- package/modules/charts.min.js +105 -9
- package/modules/data-router.esm.min.js +1180 -6
- package/modules/data-router.min.cjs +1180 -6
- package/modules/data-router.min.js +1180 -6
- package/modules/devtools.esm.min.js +2 -2
- package/modules/devtools.min.cjs +2 -2
- package/modules/devtools.min.js +2 -2
- package/modules/dhtmlx-compat.esm.min.js +4 -4
- package/modules/dhtmlx-compat.min.cjs +4 -4
- package/modules/dhtmlx-compat.min.js +4 -4
- package/modules/htmx.esm.min.js +4 -4
- package/modules/htmx.min.cjs +4 -4
- package/modules/htmx.min.js +4 -4
- package/modules/mock-socket.esm.min.js +2 -2
- package/modules/mock-socket.min.cjs +242 -0
- package/modules/mock-socket.min.js +242 -0
- package/modules/react.esm.min.js +2 -2
- package/modules/react.min.cjs +2 -2
- package/modules/react.min.js +2 -2
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.esm.min.js +4 -4
- package/modules/webcomponent.min.cjs +4 -4
- package/modules/webcomponent.min.js +4 -4
- 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.33.0 · [latticegrid.dev](https://www.latticegrid.dev) · TOCLOCO Inc
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
package/docs/API.html
CHANGED
|
@@ -4094,6 +4094,93 @@ createGrid(el, {
|
|
|
4094
4094
|
|
|
4095
4095
|
<div class="note"><p>The module imports nothing from the grid: <code>createChart</code> is handed a grid rather than importing one. That is what keeps the charts bundle to the drawing, and it is why the grid must be created first, and why a chart cannot outlive it.</p></div>
|
|
4096
4096
|
|
|
4097
|
+
<h3 id="chart-extension-types">Extension chart types — pay only for what you draw</h3>
|
|
4098
|
+
<p>The base charts bundle draws the built-in <code>TYPES</code> and nothing else. A new chart type is a <strong>separate, opt-in module</strong> a caller imports only if they use it (BACKLOG-0000886, on the slim-core seam BACKLOG-0000884). Importing it self-registers the type with the base module through <code>registerChartType</code>; the base <code>Chart</code> consults that registry for any type it does not draw natively. Because the base never imports the extension, the base bundle <strong>does not grow</strong> for a type a caller never uses.</p>
|
|
4099
|
+
<pre><code><span class="kw">import</span> '@toclocoinc/lattice-grid/modules/charts'; <span class="cmt">// the base</span>
|
|
4100
|
+
<span class="kw">import</span> '@toclocoinc/lattice-grid/modules/chart-ridgeline'; <span class="cmt">// opt in to one type</span>
|
|
4101
|
+
|
|
4102
|
+
createChart({ grid, container: '#dist', type: 'ridgeline', x: 'segment', y: 'value' });</code></pre>
|
|
4103
|
+
<p>An extension declares <code>{ draw, bind?, freeform?, labelled? }</code>. Its <code>draw(ctx)</code> receives the same context a built-in drawer gets — <code>plot</code>, <code>bound</code>, <code>groups</code>, <code>scheme</code>, <code>typography</code>, <code>labels</code>, <code>grid</code>, <code>spec</code> — plus <code>ctx.helpers</code>, the base's own toolkit (element factory, scales, axis drawers, mark pool, distribution kernels). So an extension imports nothing heavy from the base: it receives the toolkit and ships only its own geometry. <code>registeredChartTypes()</code> lists what is registered. <strong>Ridgeline</strong> (<code>drawRidgeline</code>) is the first: one kernel-density ridge per category, stacked and overlapping, over the distribution of a measure — the reading for "how did this distribution change across segments".</p>
|
|
4104
|
+
<pre data-run="js" data-expect="true | true | function" data-covers="export:registerChartType export:registeredChartTypes export:drawRidgeline"><code><span class="kw">const</span> charts = <span class="kw">await</span> import('../packages/modules/charts/index.js');
|
|
4105
|
+
<span class="kw">const</span> ridge = <span class="kw">await</span> import('../packages/modules/chart-ridgeline/index.js');
|
|
4106
|
+
|
|
4107
|
+
<span class="cmt">// Importing the module self-registered the type against the base registry.</span>
|
|
4108
|
+
<span class="kw">const</span> registered = charts.registeredChartTypes().includes('ridgeline');
|
|
4109
|
+
<span class="cmt">// registerChartType is idempotent by name, so re-registering is safe.</span>
|
|
4110
|
+
charts.registerChartType('ridgeline', { draw: ridge.drawRidgeline });
|
|
4111
|
+
|
|
4112
|
+
<span class="kw">return</span> [
|
|
4113
|
+
registered,
|
|
4114
|
+
charts.registeredChartTypes().includes('ridgeline'),
|
|
4115
|
+
typeof ridge.drawRidgeline,
|
|
4116
|
+
].join(' | ');</code></pre>
|
|
4117
|
+
|
|
4118
|
+
<p>More lead-pick types ship the same way, each in its own opt-in module — the base bundle stays flat as they are added. <strong>Calendar heatmap</strong> (<code>drawCalendar</code>, <code>type: 'calendar'</code>) lays a measure out value-by-day, GitHub-style, from a date column. <strong>Scatter-plot matrix</strong> (<code>drawSplom</code>/<code>bindSplom</code>, <code>type: 'splom'</code>) crosses every pair of numeric <code>columns</code>. <strong>Hexbin</strong> (<code>drawHexbin</code>/<code>bindHexbin</code>, <code>type: 'hexbin'</code>) bins a scatter into count-shaded hexagons so a million rows read as a density field. Each reads the grid through the public row API, so it follows the grid's filters and sort.</p>
|
|
4119
|
+
<pre data-run="js" data-expect="true | function | function | function | function | function" data-covers="export:drawCalendar export:drawSplom export:bindSplom export:drawHexbin export:bindHexbin"><code><span class="kw">const</span> charts = <span class="kw">await</span> import('../packages/modules/charts/index.js');
|
|
4120
|
+
<span class="kw">const</span> cal = <span class="kw">await</span> import('../packages/modules/chart-calendar/index.js');
|
|
4121
|
+
<span class="kw">const</span> splom = <span class="kw">await</span> import('../packages/modules/chart-splom/index.js');
|
|
4122
|
+
<span class="kw">const</span> hex = <span class="kw">await</span> import('../packages/modules/chart-hexbin/index.js');
|
|
4123
|
+
|
|
4124
|
+
<span class="cmt">// Each import self-registered its type; the base bundle carries none of them.</span>
|
|
4125
|
+
<span class="kw">const</span> types = charts.registeredChartTypes();
|
|
4126
|
+
<span class="kw">return</span> [
|
|
4127
|
+
['calendar', 'splom', 'hexbin'].every((t) => types.includes(t)),
|
|
4128
|
+
typeof cal.drawCalendar,
|
|
4129
|
+
typeof splom.drawSplom, typeof splom.bindSplom,
|
|
4130
|
+
typeof hex.drawHexbin, typeof hex.bindHexbin,
|
|
4131
|
+
].join(' | ');</code></pre>
|
|
4132
|
+
|
|
4133
|
+
<p>The model-evaluation and time-series lead picks ship the same way. <strong>ROC / PR / calibration</strong> (<code>drawRoc</code>/<code>bindRoc</code>, <code>type: 'roc'</code>, <code>curve: 'roc' | 'pr' | 'calibration'</code>) evaluates a classifier from a <code>label</code> and a <code>score</code> column, with the AUC. <strong>Fan / forecast</strong> (<code>drawFan</code>/<code>bindFan</code>, <code>type: 'fan'</code>) draws history, a point forecast, and a widening prediction interval from <code>y</code>/<code>forecast</code>/<code>lower</code>/<code>upper</code>. <strong>Decomposition panel</strong> (<code>drawDecomposition</code>/<code>bindDecomposition</code>, <code>type: 'decomposition'</code>) stacks the <code>observed</code>/<code>trend</code>/<code>seasonal</code>/<code>residual</code> components on one x axis — the companion to the grid's own time-series shadow columns.</p>
|
|
4134
|
+
<pre data-run="js" data-expect="true | function | function | function | function | function | function" data-covers="export:drawRoc export:bindRoc export:drawFan export:bindFan export:drawDecomposition export:bindDecomposition"><code><span class="kw">const</span> charts = <span class="kw">await</span> import('../packages/modules/charts/index.js');
|
|
4135
|
+
<span class="kw">const</span> roc = <span class="kw">await</span> import('../packages/modules/chart-roc/index.js');
|
|
4136
|
+
<span class="kw">const</span> fan = <span class="kw">await</span> import('../packages/modules/chart-fan/index.js');
|
|
4137
|
+
<span class="kw">const</span> decomp = <span class="kw">await</span> import('../packages/modules/chart-decomposition/index.js');
|
|
4138
|
+
|
|
4139
|
+
<span class="kw">const</span> types = charts.registeredChartTypes();
|
|
4140
|
+
<span class="kw">return</span> [
|
|
4141
|
+
['roc', 'fan', 'decomposition'].every((t) => types.includes(t)),
|
|
4142
|
+
typeof roc.drawRoc, typeof roc.bindRoc,
|
|
4143
|
+
typeof fan.drawFan, typeof fan.bindFan,
|
|
4144
|
+
typeof decomp.drawDecomposition, typeof decomp.bindDecomposition,
|
|
4145
|
+
].join(' | ');</code></pre>
|
|
4146
|
+
|
|
4147
|
+
<p>The comparison and ranking family ships the same way. <strong>Slope</strong> (<code>drawSlope</code>, <code>type: 'slope'</code>) connects each series across two periods; <strong>dumbbell</strong> (<code>drawDumbbell</code>/<code>bindDumbbell</code>, <code>type: 'dumbbell'</code>) shows a <code>start</code>/<code>end</code> gap per category; <strong>bump</strong> (<code>drawBump</code>, <code>type: 'bump'</code>) plots rank-over-time; <strong>diverging</strong> (<code>drawDiverging</code>, <code>type: 'diverging'</code>) grows bars from a central zero; <strong>parallel coordinates</strong> (<code>drawParallel</code>/<code>bindParallel</code>, <code>type: 'parallel'</code>) draws one polyline per row across several numeric axes.</p>
|
|
4148
|
+
<pre data-run="js" data-expect="true | function | function | function | function | function | function | function" data-covers="export:drawSlope export:drawDumbbell export:bindDumbbell export:drawBump export:drawDiverging export:drawParallel export:bindParallel"><code><span class="kw">const</span> charts = <span class="kw">await</span> import('../packages/modules/charts/index.js');
|
|
4149
|
+
<span class="kw">const</span> slope = <span class="kw">await</span> import('../packages/modules/chart-slope/index.js');
|
|
4150
|
+
<span class="kw">const</span> dumbbell = <span class="kw">await</span> import('../packages/modules/chart-dumbbell/index.js');
|
|
4151
|
+
<span class="kw">const</span> bump = <span class="kw">await</span> import('../packages/modules/chart-bump/index.js');
|
|
4152
|
+
<span class="kw">const</span> diverging = <span class="kw">await</span> import('../packages/modules/chart-diverging/index.js');
|
|
4153
|
+
<span class="kw">const</span> parallel = <span class="kw">await</span> import('../packages/modules/chart-parallel/index.js');
|
|
4154
|
+
|
|
4155
|
+
<span class="kw">const</span> types = charts.registeredChartTypes();
|
|
4156
|
+
<span class="kw">return</span> [
|
|
4157
|
+
['slope', 'dumbbell', 'bump', 'diverging', 'parallel'].every((t) => types.includes(t)),
|
|
4158
|
+
typeof slope.drawSlope,
|
|
4159
|
+
typeof dumbbell.drawDumbbell, typeof dumbbell.bindDumbbell,
|
|
4160
|
+
typeof bump.drawBump,
|
|
4161
|
+
typeof diverging.drawDiverging,
|
|
4162
|
+
typeof parallel.drawParallel, typeof parallel.bindParallel,
|
|
4163
|
+
].join(' | ');</code></pre>
|
|
4164
|
+
|
|
4165
|
+
<p>The hierarchy, flow and geographic remainder ships the same way — treemap, sunburst, funnel, radar, sankey, chord and network are already built in, so the new opt-in modules are: <strong>icicle</strong> (<code>drawIcicle</code>, <code>type: 'icicle'</code>, drawn from the grid's group tree), <strong>waffle</strong> (<code>drawWaffle</code>, <code>type: 'waffle'</code>), <strong>alluvial</strong> (<code>drawAlluvial</code>/<code>bindAlluvial</code>, <code>type: 'alluvial'</code>), <strong>arc diagram</strong> (<code>drawArc</code>/<code>bindArc</code>, <code>type: 'arc'</code>), <strong>bubble map</strong> (<code>drawBubbleMap</code>/<code>bindBubbleMap</code>, <code>type: 'bubblemap'</code>) and <strong>hexbin map</strong> (<code>drawHexMap</code>/<code>bindHexMap</code>, <code>type: 'hexmap'</code>). The two maps place <code>lon</code>/<code>lat</code> directly, so they need no outline data and fetch nothing.</p>
|
|
4166
|
+
<pre data-run="js" data-expect="true | function | function | function | function | function | function | function | function | function | function" data-covers="export:drawIcicle export:drawWaffle export:drawAlluvial export:bindAlluvial export:drawArc export:bindArc export:drawBubbleMap export:bindBubbleMap export:drawHexMap export:bindHexMap"><code><span class="kw">const</span> charts = <span class="kw">await</span> import('../packages/modules/charts/index.js');
|
|
4167
|
+
<span class="kw">const</span> icicle = <span class="kw">await</span> import('../packages/modules/chart-icicle/index.js');
|
|
4168
|
+
<span class="kw">const</span> waffle = <span class="kw">await</span> import('../packages/modules/chart-waffle/index.js');
|
|
4169
|
+
<span class="kw">const</span> alluvial = <span class="kw">await</span> import('../packages/modules/chart-alluvial/index.js');
|
|
4170
|
+
<span class="kw">const</span> arc = <span class="kw">await</span> import('../packages/modules/chart-arc/index.js');
|
|
4171
|
+
<span class="kw">const</span> bubblemap = <span class="kw">await</span> import('../packages/modules/chart-bubblemap/index.js');
|
|
4172
|
+
<span class="kw">const</span> hexmap = <span class="kw">await</span> import('../packages/modules/chart-hexmap/index.js');
|
|
4173
|
+
|
|
4174
|
+
<span class="kw">const</span> types = charts.registeredChartTypes();
|
|
4175
|
+
<span class="kw">return</span> [
|
|
4176
|
+
['icicle', 'waffle', 'alluvial', 'arc', 'bubblemap', 'hexmap'].every((t) => types.includes(t)),
|
|
4177
|
+
typeof icicle.drawIcicle, typeof waffle.drawWaffle,
|
|
4178
|
+
typeof alluvial.drawAlluvial, typeof alluvial.bindAlluvial,
|
|
4179
|
+
typeof arc.drawArc, typeof arc.bindArc,
|
|
4180
|
+
typeof bubblemap.drawBubbleMap, typeof bubblemap.bindBubbleMap,
|
|
4181
|
+
typeof hexmap.drawHexMap, typeof hexmap.bindHexMap,
|
|
4182
|
+
].join(' | ');</code></pre>
|
|
4183
|
+
|
|
4097
4184
|
<h2 id="datarouter">The data router</h2>
|
|
4098
4185
|
<p><code>modules/data-router</code> is a host-layer demultiplexer: it takes <strong>one</strong> arriving stream or dataset, splits it by what each record <em>is</em>, and routes each partition to its own grid — or to a headless grid driving a chart. One round-trip, or one live feed, hydrates a whole screen of grids that each see only their slice. It is optional, imports nothing from the grid, and adds no core hook: every grid is driven through the <strong>public</strong> incremental path, <code>grid.rows.apply({ add, update, remove })</code>.</p>
|
|
4099
4186
|
<pre><code>import { createDataRouter } from '@toclocoinc/lattice-grid/modules/data-router';
|
|
@@ -4131,6 +4218,9 @@ router.apply([{ op: 'upsert', row }, { op: 'delete', row }]); <span class="cmt">
|
|
|
4131
4218
|
<tr><td class="sig">flushStream()</td><td class="desc"><strong>v3:</strong> apply the buffered deltas now, coalesced into a single apply (a deterministic point, and for tests).</td></tr>
|
|
4132
4219
|
<tr><td class="sig">dropped</td><td class="desc"><strong>v3:</strong> how many stale/duplicate deltas the <code>seq</code> dedupe gate has dropped.</td></tr>
|
|
4133
4220
|
<tr><td class="sig">lastSeq() / checkpoint() / seenThrough(mark)</td><td class="desc"><strong>v3:</strong> the resume point — the highest applied <code>seq</code>, a per-record checkpoint to persist, and a way to prime it after a reconnect so an early replay is dropped.</td></tr>
|
|
4221
|
+
<tr><td class="sig">subscribe(predicate, handler, opts?)</td><td class="desc"><strong>v5:</strong> route a slice to any non-grid view. <code>handler(change)</code> receives the same keyed diff <code>{ add, update, remove }</code> a grid does — drive a KPI tile, detail pane, map or form. A peer to <code>attach</code>: same partitioning and the same <code>transform</code>/<code>filter</code>/<code>sort</code>/<code>rollup</code> options; grids and charts are unchanged.</td></tr>
|
|
4222
|
+
<tr><td class="sig">alert(predicate, condition, handler, { filter?, debounce?, rowKey? })</td><td class="desc"><strong>v5:</strong> watch a slice and emit rather than render. <code>condition(rows)</code> is evaluated over the slice on every load and delta; when it first becomes truthy, <code>handler(signal, rows)</code> fires. Edge-triggered (once per crossing, re-arms on release), <code>debounce</code> coalesces a burst, and it never competes for a partition or touches a grid.</td></tr>
|
|
4223
|
+
<tr><td class="sig">configure(spec)</td><td class="desc"><strong>v5:</strong> the whole routing graph as one data spec — <code>routes</code> (grid/<code>default</code>/<code>subscribe</code>/<code>alert</code> entries), <code>links</code>, <code>relate</code>, <code>buffer</code> — desugared to the imperative API. Composes with imperative calls and round-trips to identical behaviour. Also accepted as <code>createDataRouter({ config })</code>.</td></tr>
|
|
4134
4224
|
<tr><td class="sig">detach(grid)</td><td class="desc">Stop routing to a grid and forget its slice; drop any link/edge it is part of (restoring a filtered sibling). The host still owns and destroys the grid.</td></tr>
|
|
4135
4225
|
<tr><td class="sig">destroy()</td><td class="desc">Detach every grid, drop every link, edge and subscription. <strong>Detaches only</strong> — the host owns and destroys its grids.</td></tr>
|
|
4136
4226
|
</tbody>
|
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.33.0</p>
|
|
441
441
|
<nav>
|
|
442
442
|
<div class="rail__group">
|
|
443
443
|
<span class="rail__label">Start here</span>
|
|
@@ -6238,12 +6238,13 @@ grid.state.apply(savedView.state);
|
|
|
6238
6238
|
<tr><td class="name">canChartRange</td><td class="desc">Whether <code>chartRange</code> would draw something for the grid’s current selection — the question a menu asks before offering the item.</td></tr>
|
|
6239
6239
|
<tr><td class="name">deriveRangeSpec</td><td class="desc">Decide what a chart of a range should be without drawing it: the type, the category column, the measures, and a spec ready for <code>createChart</code>.</td></tr>
|
|
6240
6240
|
<tr><td class="name">regressionPlots</td><td class="desc">Turn a fitted regression model into diagnostic chart specs ready for <code>createChart</code>: the fit line with its confidence band, residuals-vs-fitted, a QQ plot of the residuals, and a multicollinearity correlogram with the model’s VIF. The plots that need a per-row or per-coefficient quantity the grid has no column for (scale-location, residuals-vs-leverage, the coefficient forest) are returned as a null spec carrying the reason rather than dropped.</td></tr>
|
|
6241
|
-
<tr><td class="name">createDataRouter</td><td class="desc">Split one arriving stream or dataset across many grids by what each record is — a property or a predicate — driving each grid through the public keyed <code>rows.apply</code> path so a snapshot is a diff, a delta is applied in place, a moved partition moves the row rather than duplicating it, and an unmatched record is counted, sunk and never dropped. v2 adds cross-grid selection filtering: <code>link(source, target, relation)</code> makes a selection in one grid filter what another receives — by a key map or a predicate function, multi-select as an IN set, debounced — re-pushed through the same keyed-diff path so the target stays dumb. Detaches its grids on <code>destroy</code>; the host owns them.</td></tr>
|
|
6241
|
+
<tr><td class="name">createDataRouter</td><td class="desc">Split one arriving stream or dataset across many grids by what each record is — a property or a predicate — driving each grid through the public keyed <code>rows.apply</code> path so a snapshot is a diff, a delta is applied in place, a moved partition moves the row rather than duplicating it, and an unmatched record is counted, sunk and never dropped. v2 adds cross-grid selection filtering: <code>link(source, target, relation)</code> makes a selection in one grid filter what another receives — by a key map or a predicate function, multi-select as an IN set, debounced — re-pushed through the same keyed-diff path so the target stays dumb. v5 adds wedge-conversion primitives: <code>subscribe(value, handler)</code> routes a slice to any non-grid view (KPI tile, detail pane, map, form) as the same keyed diff a grid gets; <code>alert(value, condition, handler)</code> evaluates a condition over a slice and emits (edge-triggered, debounced) rather than rendering; and <code>configure(spec)</code> (or <code>createDataRouter({ config })</code>) takes the whole routing graph as one declarative data spec that desugars to the imperative API and composes with it. Detaches its grids on <code>destroy</code>; the host owns them.</td></tr>
|
|
6242
6242
|
<tr><td class="name">createDevtools</td><td class="desc">Mount the devtools panel against a grid, including its accessibility checks.</td></tr>
|
|
6243
6243
|
<tr><td class="name">createLatticeGridElement</td><td class="desc">Build the element class without registering it, for a custom registry.</td></tr>
|
|
6244
6244
|
<tr><td class="name">createMessages</td><td class="desc">Build a message catalogue. A partial set lays over the built-in British English one.</td></tr>
|
|
6245
6245
|
<tr><td class="name">defineLatticeGrid</td><td class="desc">Register &lt;lattice-grid&gt;, or your own tag name.</td></tr>
|
|
6246
6246
|
<tr><td class="name">defineUnit</td><td class="desc">Add one unit to a system, or override one of ours under the same name.</td></tr>
|
|
6247
|
+
<tr><td class="name">registerChartType</td><td class="desc">Register an extension chart type so <code>createChart({ type })</code> can draw it (BACKLOG-0000886). Extension types ship as their own opt-in modules (e.g. <code>modules/chart-ridgeline</code>), so the base charts bundle does not grow for a type a caller never imports — you pay only for the charts you use. <code>registeredChartTypes()</code> lists what is registered.</td></tr>
|
|
6247
6248
|
<tr><td class="name">registerModules</td><td class="desc">Install optional modules once, for every grid on the page.</td></tr>
|
|
6248
6249
|
<tr><td class="name">registerScheme</td><td class="desc">Add a colour scheme, or replace one of ours under the same name.</td></tr>
|
|
6249
6250
|
<tr><td class="name">restoreStateWithin</td><td class="desc">Put it back afterwards.</td></tr>
|
package/lattice-grid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.33.0, type declarations
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -5863,9 +5863,244 @@ declare module 'lattice-grid/modules/charts' {
|
|
|
5863
5863
|
export function resolveScheme(spec?: object): object;
|
|
5864
5864
|
export function schemeNames(): string[];
|
|
5865
5865
|
export function setDefaultScheme(name: string): void;
|
|
5866
|
+
/**
|
|
5867
|
+
* The definition an extension chart type registers (BACKLOG-0000886). `draw`
|
|
5868
|
+
* receives the base drawing context — `plot`, `bound`, `groups`, `scheme`,
|
|
5869
|
+
* `typography`, `fontSize`, `labels`, `grid`, `spec`, `doc` — plus
|
|
5870
|
+
* `ctx.helpers`, the base's own toolkit of primitives (element factory, scales,
|
|
5871
|
+
* axes, mark pool, distribution kernels), and appends its marks to the layer
|
|
5872
|
+
* groups. `bind` optionally supplies the bound data (default: the by-series
|
|
5873
|
+
* binder); `freeform` lays the chart out without axis gutters; `labelled`
|
|
5874
|
+
* declares that `labels` applies.
|
|
5875
|
+
*/
|
|
5876
|
+
interface ChartTypeDefinition {
|
|
5877
|
+
draw: (ctx: object) => object;
|
|
5878
|
+
bind?: (grid: Grid, spec: ChartSpec) => object;
|
|
5879
|
+
freeform?: boolean;
|
|
5880
|
+
labelled?: boolean;
|
|
5881
|
+
}
|
|
5882
|
+
/**
|
|
5883
|
+
* Register an extension chart type so `createChart({ type })` can draw it
|
|
5884
|
+
* (BACKLOG-0000886). Extension types ship as their own opt-in modules, so the
|
|
5885
|
+
* base charts bundle does not grow for a type a caller never imports — you pay
|
|
5886
|
+
* only for the charts you use.
|
|
5887
|
+
*/
|
|
5888
|
+
export function registerChartType(name: string, def: ChartTypeDefinition): void;
|
|
5889
|
+
/** Every registered extension chart-type name, in registration order. */
|
|
5890
|
+
export function registeredChartTypes(): string[];
|
|
5866
5891
|
export { Chart };
|
|
5867
5892
|
}
|
|
5868
5893
|
|
|
5894
|
+
declare module 'lattice-grid/modules/chart-ridgeline' {
|
|
5895
|
+
/**
|
|
5896
|
+
* The ridgeline (joy plot) extension chart type (BACKLOG-0000886). Importing
|
|
5897
|
+
* this module registers `ridgeline` with the base charts module; the base
|
|
5898
|
+
* bundle does not include it unless a caller imports it. Draws one
|
|
5899
|
+
* kernel-density ridge per category (`x`), stacked and overlapping, over the
|
|
5900
|
+
* distribution of a measure (`y`); `spec.overlap` sets the vertical overlap.
|
|
5901
|
+
*/
|
|
5902
|
+
export function drawRidgeline(ctx: object): object;
|
|
5903
|
+
export default drawRidgeline;
|
|
5904
|
+
}
|
|
5905
|
+
|
|
5906
|
+
declare module 'lattice-grid/modules/chart-calendar' {
|
|
5907
|
+
/**
|
|
5908
|
+
* The calendar-heatmap extension chart type (BACKLOG-0000886). Importing this
|
|
5909
|
+
* module registers `calendar`. Draws value-by-day as a GitHub-style grid: `x`
|
|
5910
|
+
* is a date column, `y` the measure summed per day.
|
|
5911
|
+
*/
|
|
5912
|
+
export function drawCalendar(ctx: object): object;
|
|
5913
|
+
export default drawCalendar;
|
|
5914
|
+
}
|
|
5915
|
+
|
|
5916
|
+
declare module 'lattice-grid/modules/chart-splom' {
|
|
5917
|
+
/**
|
|
5918
|
+
* The scatter-plot-matrix (SPLOM) extension chart type (BACKLOG-0000886).
|
|
5919
|
+
* Importing this module registers `splom`. Crosses every pair of the numeric
|
|
5920
|
+
* `columns` (2–6) as a matrix of scatters, naming each variable on the
|
|
5921
|
+
* diagonal.
|
|
5922
|
+
*/
|
|
5923
|
+
export function drawSplom(ctx: object): object;
|
|
5924
|
+
/** The SPLOM binding: reads the numeric `columns` off the grid's visible rows. */
|
|
5925
|
+
export function bindSplom(grid: Grid, spec: object): object;
|
|
5926
|
+
export default drawSplom;
|
|
5927
|
+
}
|
|
5928
|
+
|
|
5929
|
+
declare module 'lattice-grid/modules/chart-hexbin' {
|
|
5930
|
+
/**
|
|
5931
|
+
* The hexbin / 2D-density extension chart type (BACKLOG-0000886). Importing
|
|
5932
|
+
* this module registers `hexbin`. Bins `x`/`y` points into hexagons shaded by
|
|
5933
|
+
* count, so a large scatter reads as a density field rather than overplotting.
|
|
5934
|
+
*/
|
|
5935
|
+
export function drawHexbin(ctx: object): object;
|
|
5936
|
+
/** The hexbin binding: reads the numeric `x` and `y` columns off the grid's rows. */
|
|
5937
|
+
export function bindHexbin(grid: Grid, spec: object): object;
|
|
5938
|
+
export default drawHexbin;
|
|
5939
|
+
}
|
|
5940
|
+
|
|
5941
|
+
declare module 'lattice-grid/modules/chart-roc' {
|
|
5942
|
+
/**
|
|
5943
|
+
* The ROC / PR / calibration extension chart type (BACKLOG-0000886). Importing
|
|
5944
|
+
* this module registers `roc`. `spec.curve` chooses `'roc'` (default, with the
|
|
5945
|
+
* chance diagonal and AUC), `'pr'`, or `'calibration'`; `label` is the outcome
|
|
5946
|
+
* column (positive when truthy or equal to `spec.positive`), `score` the model
|
|
5947
|
+
* score.
|
|
5948
|
+
*/
|
|
5949
|
+
export function drawRoc(ctx: object): object;
|
|
5950
|
+
/** The ROC binding: reads the outcome and score off the grid's rows. */
|
|
5951
|
+
export function bindRoc(grid: Grid, spec: object): object;
|
|
5952
|
+
export default drawRoc;
|
|
5953
|
+
}
|
|
5954
|
+
|
|
5955
|
+
declare module 'lattice-grid/modules/chart-fan' {
|
|
5956
|
+
/**
|
|
5957
|
+
* The fan / forecast extension chart type (BACKLOG-0000886). Importing this
|
|
5958
|
+
* module registers `fan`. Draws `y` (history) as a solid line, `forecast` as a
|
|
5959
|
+
* dashed continuation, and the `lower`/`upper` interval as a widening band.
|
|
5960
|
+
*/
|
|
5961
|
+
export function drawFan(ctx: object): object;
|
|
5962
|
+
/** The fan binding: reads the history, forecast and interval columns in row order. */
|
|
5963
|
+
export function bindFan(grid: Grid, spec: object): object;
|
|
5964
|
+
export default drawFan;
|
|
5965
|
+
}
|
|
5966
|
+
|
|
5967
|
+
declare module 'lattice-grid/modules/chart-decomposition' {
|
|
5968
|
+
/**
|
|
5969
|
+
* The seasonal-decomposition panel extension chart type (BACKLOG-0000886),
|
|
5970
|
+
* companion to the `tsTrend`/`tsSeasonal`/`tsResidual` shadow columns.
|
|
5971
|
+
* Importing this module registers `decomposition`. Draws a stacked panel per
|
|
5972
|
+
* named component column (`observed`/`trend`/`seasonal`/`residual`) sharing one
|
|
5973
|
+
* x axis.
|
|
5974
|
+
*/
|
|
5975
|
+
export function drawDecomposition(ctx: object): object;
|
|
5976
|
+
/** The decomposition binding: reads the named component columns in row order. */
|
|
5977
|
+
export function bindDecomposition(grid: Grid, spec: object): object;
|
|
5978
|
+
export default drawDecomposition;
|
|
5979
|
+
}
|
|
5980
|
+
|
|
5981
|
+
declare module 'lattice-grid/modules/chart-slope' {
|
|
5982
|
+
/**
|
|
5983
|
+
* The slope-chart extension type (BACKLOG-0000886). Importing this module
|
|
5984
|
+
* registers `slope`. One line per `series` connecting its `y` across the `x`
|
|
5985
|
+
* periods — before/after comparison read from the slopes.
|
|
5986
|
+
*/
|
|
5987
|
+
export function drawSlope(ctx: object): object;
|
|
5988
|
+
export default drawSlope;
|
|
5989
|
+
}
|
|
5990
|
+
|
|
5991
|
+
declare module 'lattice-grid/modules/chart-dumbbell' {
|
|
5992
|
+
/**
|
|
5993
|
+
* The dumbbell / connected-dot extension type (BACKLOG-0000886). Importing
|
|
5994
|
+
* this module registers `dumbbell`. Two dots (`start`, `end`) joined by a bar
|
|
5995
|
+
* per `x` category — the gap is the bar's length.
|
|
5996
|
+
*/
|
|
5997
|
+
export function drawDumbbell(ctx: object): object;
|
|
5998
|
+
/** The dumbbell binding: reads the category and its two numeric columns. */
|
|
5999
|
+
export function bindDumbbell(grid: Grid, spec: object): object;
|
|
6000
|
+
export default drawDumbbell;
|
|
6001
|
+
}
|
|
6002
|
+
|
|
6003
|
+
declare module 'lattice-grid/modules/chart-bump' {
|
|
6004
|
+
/**
|
|
6005
|
+
* The bump-chart extension type (BACKLOG-0000886). Importing this module
|
|
6006
|
+
* registers `bump`. One line per `series` plotted by its rank of `y` within
|
|
6007
|
+
* each `x` period — rank-over-time, where crossings are the story.
|
|
6008
|
+
*/
|
|
6009
|
+
export function drawBump(ctx: object): object;
|
|
6010
|
+
export default drawBump;
|
|
6011
|
+
}
|
|
6012
|
+
|
|
6013
|
+
declare module 'lattice-grid/modules/chart-diverging' {
|
|
6014
|
+
/**
|
|
6015
|
+
* The diverging-bar extension type (BACKLOG-0000886). Importing this module
|
|
6016
|
+
* registers `diverging`. Horizontal bars growing left/right from a central
|
|
6017
|
+
* zero over a signed `y`, on a symmetric scale.
|
|
6018
|
+
*/
|
|
6019
|
+
export function drawDiverging(ctx: object): object;
|
|
6020
|
+
export default drawDiverging;
|
|
6021
|
+
}
|
|
6022
|
+
|
|
6023
|
+
declare module 'lattice-grid/modules/chart-parallel' {
|
|
6024
|
+
/**
|
|
6025
|
+
* The parallel-coordinates extension type (BACKLOG-0000886). Importing this
|
|
6026
|
+
* module registers `parallel`. One polyline per row across the numeric
|
|
6027
|
+
* `columns`, each a vertical axis with its own scale; `spec.colourBy` colours
|
|
6028
|
+
* by a category.
|
|
6029
|
+
*/
|
|
6030
|
+
export function drawParallel(ctx: object): object;
|
|
6031
|
+
/** The parallel-coordinates binding: reads the dimension columns off the rows. */
|
|
6032
|
+
export function bindParallel(grid: Grid, spec: object): object;
|
|
6033
|
+
export default drawParallel;
|
|
6034
|
+
}
|
|
6035
|
+
|
|
6036
|
+
declare module 'lattice-grid/modules/chart-icicle' {
|
|
6037
|
+
/**
|
|
6038
|
+
* The icicle extension type (BACKLOG-0000886). Importing this module registers
|
|
6039
|
+
* `icicle`. A hierarchy (the grid's group tree) as nested rectangles in rows,
|
|
6040
|
+
* sized by `y`; drills like the built-in hierarchical types.
|
|
6041
|
+
*/
|
|
6042
|
+
export function drawIcicle(ctx: object): object;
|
|
6043
|
+
export default drawIcicle;
|
|
6044
|
+
}
|
|
6045
|
+
|
|
6046
|
+
declare module 'lattice-grid/modules/chart-waffle' {
|
|
6047
|
+
/**
|
|
6048
|
+
* The waffle / dot-matrix extension type (BACKLOG-0000886). Importing this
|
|
6049
|
+
* module registers `waffle`. Proportion as counted squares (default 100), one
|
|
6050
|
+
* colour per `x` category sized by `y`.
|
|
6051
|
+
*/
|
|
6052
|
+
export function drawWaffle(ctx: object): object;
|
|
6053
|
+
export default drawWaffle;
|
|
6054
|
+
}
|
|
6055
|
+
|
|
6056
|
+
declare module 'lattice-grid/modules/chart-alluvial' {
|
|
6057
|
+
/**
|
|
6058
|
+
* The alluvial extension type (BACKLOG-0000886). Importing this module
|
|
6059
|
+
* registers `alluvial`. Ribbons from `source` categories to `target`
|
|
6060
|
+
* categories sized by `value` — categorical flow between two dimensions.
|
|
6061
|
+
*/
|
|
6062
|
+
export function drawAlluvial(ctx: object): object;
|
|
6063
|
+
/** The alluvial binding: aggregates source→target flows off the grid's rows. */
|
|
6064
|
+
export function bindAlluvial(grid: Grid, spec: object): object;
|
|
6065
|
+
export default drawAlluvial;
|
|
6066
|
+
}
|
|
6067
|
+
|
|
6068
|
+
declare module 'lattice-grid/modules/chart-arc' {
|
|
6069
|
+
/**
|
|
6070
|
+
* The arc-diagram extension type (BACKLOG-0000886). Importing this module
|
|
6071
|
+
* registers `arc`. Nodes on a baseline with `source`→`target` relationships as
|
|
6072
|
+
* semicircular arcs, thickness by `value`.
|
|
6073
|
+
*/
|
|
6074
|
+
export function drawArc(ctx: object): object;
|
|
6075
|
+
/** The arc-diagram binding: collects nodes and edges off the grid's rows. */
|
|
6076
|
+
export function bindArc(grid: Grid, spec: object): object;
|
|
6077
|
+
export default drawArc;
|
|
6078
|
+
}
|
|
6079
|
+
|
|
6080
|
+
declare module 'lattice-grid/modules/chart-bubblemap' {
|
|
6081
|
+
/**
|
|
6082
|
+
* The symbol / bubble-map extension type (BACKLOG-0000886). Importing this
|
|
6083
|
+
* module registers `bubblemap`. Points placed by `lon`/`lat`, each a bubble
|
|
6084
|
+
* with a square-root radius from `size`; needs no outlines and fetches nothing.
|
|
6085
|
+
*/
|
|
6086
|
+
export function drawBubbleMap(ctx: object): object;
|
|
6087
|
+
/** The bubble-map binding: reads the coordinate and size columns off the rows. */
|
|
6088
|
+
export function bindBubbleMap(grid: Grid, spec: object): object;
|
|
6089
|
+
export default drawBubbleMap;
|
|
6090
|
+
}
|
|
6091
|
+
|
|
6092
|
+
declare module 'lattice-grid/modules/chart-hexmap' {
|
|
6093
|
+
/**
|
|
6094
|
+
* The hexbin-map extension type (BACKLOG-0000886). Importing this module
|
|
6095
|
+
* registers `hexmap`. `lon`/`lat` points binned into hexagons shaded by count,
|
|
6096
|
+
* so a geographic density reads without overplotting or outlines.
|
|
6097
|
+
*/
|
|
6098
|
+
export function drawHexMap(ctx: object): object;
|
|
6099
|
+
/** The hexbin-map binding: reads the coordinate columns off the grid's rows. */
|
|
6100
|
+
export function bindHexMap(grid: Grid, spec: object): object;
|
|
6101
|
+
export default drawHexMap;
|
|
6102
|
+
}
|
|
6103
|
+
|
|
5869
6104
|
declare module 'lattice-grid/modules/react' {
|
|
5870
6105
|
/**
|
|
5871
6106
|
* Build the React component.
|