@toclocoinc/lattice-grid 1.12.0 → 1.12.2
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 +11 -2
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +1 -1
- package/lattice-grid.min.cjs +1 -1
- package/lattice-grid.min.js +1 -1
- package/modules/charts.esm.min.js +28 -4
- package/modules/devtools.esm.min.js +1 -1
- package/modules/dhtmlx-compat.esm.min.js +1 -1
- package/modules/htmx.esm.min.js +1 -1
- package/modules/htmx.min.cjs +1 -1
- package/modules/htmx.min.js +1 -1
- package/modules/react.esm.min.js +1 -1
- package/modules/svelte.esm.min.js +1 -1
- package/modules/vue.esm.min.js +1 -1
- package/modules/webcomponent.esm.min.js +1 -1
- 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.12.
|
|
7
|
+
Version 1.12.2 · [latticegrid.dev](https://www.latticegrid.dev) · TOCLOCO Inc
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
package/docs/API.html
CHANGED
|
@@ -2334,6 +2334,15 @@ grid.licence.state(); <span class="cmt">// 'licensed' | 'localhost' | 'tria
|
|
|
2334
2334
|
spread pulls that chart's own limits wider with it: it rescales to accommodate the very thing
|
|
2335
2335
|
that has gone wrong. Drawn one above the other, they are the standard I-MR pair.
|
|
2336
2336
|
</p>
|
|
2337
|
+
<p class="section-note">
|
|
2338
|
+
<strong>Bind it to the readings, not to a summary of them.</strong> A whisker is computed from
|
|
2339
|
+
the values the chart can see behind each mark. Bound to a grid whose rows are already one per
|
|
2340
|
+
mark, a summary or a derived panel, the chart sees a single value per category and there is no
|
|
2341
|
+
spread to draw: the readings that produced each average are upstream and no longer reachable.
|
|
2342
|
+
Bind the chart to the rows the summary was computed from, or carry a margin yourself and use
|
|
2343
|
+
<code>error: { of: 'margin' }</code>. A chart asked for whiskers it cannot compute says so once
|
|
2344
|
+
rather than drawing nothing in silence.
|
|
2345
|
+
</p>
|
|
2337
2346
|
<p class="section-note">
|
|
2338
2347
|
<strong>Uncertainty on a chart.</strong> <code>error: true</code> draws a whisker on each mark,
|
|
2339
2348
|
computed from the readings behind it. Four bars side by side invite a comparison the numbers
|
|
@@ -2805,7 +2814,7 @@ const chart = createChart({
|
|
|
2805
2814
|
<tr><td class="name">footnote</td><td class="type">string</td><td class="desc">A note under the plot, a source, a caveat, a unit.</td></tr>
|
|
2806
2815
|
<tr><td class="name">emptyText</td><td class="type">string</td><td class="desc">What to show when the binding produces nothing. Said rather than left blank, because an empty plot and a broken one look identical.</td></tr>
|
|
2807
2816
|
<tr><td class="name">fit</td><td class="type">boolean | 'line'</td><td class="desc">A least-squares line through a scatter or bubble chart, one per series. <code>true</code> draws it with its R²; <code>'line'</code> draws the line alone. Only where the x axis is numeric: on a band scale a slope would be a slope through the order the categories happened to be listed in.</td></tr>
|
|
2808
|
-
<tr><td class="name">error</td><td class="type">boolean | object</td><td class="desc">Whiskers showing the uncertainty in each mark, computed from the readings behind it. <code>{ of }</code> takes a symmetric margin from a column instead; <code>{ confidence }</code> sets the level. A mark
|
|
2817
|
+
<tr><td class="name">error</td><td class="type">boolean | object</td><td class="desc">Whiskers showing the uncertainty in each mark, computed from the readings the chart can see behind it. <code>{ of }</code> takes a symmetric margin from a column instead; <code>{ confidence }</code> sets the level. A mark the chart sees only one value for gets none, and the chart says so.</td></tr>
|
|
2809
2818
|
<tr><td class="name">stack</td><td class="type">boolean</td><td class="desc">Stack the series rather than drawing them side by side.</td></tr>
|
|
2810
2819
|
<tr><td class="name">curve</td><td class="type">boolean</td><td class="desc">Overlay a kernel density curve on a histogram, which shows which features are in the data and which are in the binning.</td></tr>
|
|
2811
2820
|
<tr><td class="name">diverging</td><td class="type">boolean</td><td class="desc">Colour a heatmap outward from zero rather than along a single ramp.</td></tr>
|
|
@@ -5651,7 +5660,7 @@ createGrid(el, {
|
|
|
5651
5660
|
<!-- END GENERATED TYPE REFERENCE -->
|
|
5652
5661
|
|
|
5653
5662
|
<footer>
|
|
5654
|
-
Lattice Grid 1.12.
|
|
5663
|
+
Lattice Grid 1.12.2 · Copyright © 2026 TOCLOCO Inc. All rights reserved.
|
|
5655
5664
|
This document describes the behaviour of the shipped library. Where this guide and the code
|
|
5656
5665
|
disagree, the code wins: please <a href="https://www.latticegrid.dev">tell us</a>.
|
|
5657
5666
|
</footer>
|
package/lattice-grid.d.ts
CHANGED
package/lattice-grid.esm.min.js
CHANGED
package/lattice-grid.min.cjs
CHANGED
package/lattice-grid.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.12.
|
|
2
|
+
* Lattice Grid 1.12.2, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
@@ -394,6 +394,7 @@ return`
|
|
|
394
394
|
.${NS}__qq-line{stroke:var(--lattice-foreground-muted,#5b6570);stroke-width:1;stroke-dasharray:4 3;fill:none}
|
|
395
395
|
.${NS}__ecdf{stroke-width:1.5;fill:none}
|
|
396
396
|
.${NS}__control-line{stroke-width:1.25;fill:none}
|
|
397
|
+
.${NS}__error-bar{stroke:var(--lattice-foreground,#1a1a1a);stroke-width:1.5;fill:none;stroke-linecap:round}
|
|
397
398
|
.${NS}__control-centre{stroke:var(--lattice-foreground-muted,#5b6570);stroke-width:1;fill:none}
|
|
398
399
|
.${NS}__control-limit{stroke:var(--lattice-foreground-muted,#5b6570);stroke-width:1;stroke-dasharray:6 3;fill:none}
|
|
399
400
|
.${NS}__spec-limit{stroke:var(--lattice-danger,#a4262c);stroke-width:1;stroke-dasharray:2 3;fill:none}
|
|
@@ -1727,9 +1728,13 @@ const pool=new Pool(group);
|
|
|
1727
1728
|
const conf=Number.isFinite(Number(options.confidence))?Number(options.confidence):0.95;
|
|
1728
1729
|
const cap=4;
|
|
1729
1730
|
let drawn=0;
|
|
1731
|
+
let marks=0;
|
|
1732
|
+
let single=0;
|
|
1730
1733
|
for(const sery of series){
|
|
1731
1734
|
for(const point of sery.points){
|
|
1732
1735
|
if(point.y===null||point.y===undefined)continue;
|
|
1736
|
+
marks++;
|
|
1737
|
+
if(Array.isArray(point.values)&&point.values.length===1)single++;
|
|
1733
1738
|
let lower=null;
|
|
1734
1739
|
let upper=null;
|
|
1735
1740
|
if(options.of!==undefined&&Number.isFinite(Number(point[options.of]))){
|
|
@@ -1752,6 +1757,7 @@ d:path([
|
|
|
1752
1757
|
'M',x-cap,bottom,'L',x+cap,bottom,
|
|
1753
1758
|
]),
|
|
1754
1759
|
fill:'none',
|
|
1760
|
+
stroke:'currentColor',
|
|
1755
1761
|
'data-lower':lower,
|
|
1756
1762
|
'data-upper':upper,
|
|
1757
1763
|
});
|
|
@@ -1759,7 +1765,7 @@ drawn++;
|
|
|
1759
1765
|
}
|
|
1760
1766
|
}
|
|
1761
1767
|
pool.finish();
|
|
1762
|
-
return
|
|
1768
|
+
return{drawn,marks,single};
|
|
1763
1769
|
}
|
|
1764
1770
|
function drawCartesian(ctx){
|
|
1765
1771
|
const scheme=ctx.scheme||resolveScheme();
|
|
@@ -1939,8 +1945,9 @@ size:type_.small,
|
|
|
1939
1945
|
showR2:ctx.fit!=='line',
|
|
1940
1946
|
});
|
|
1941
1947
|
}
|
|
1948
|
+
let errorBars=null;
|
|
1942
1949
|
if(ctx.error){
|
|
1943
|
-
drawErrorBars({
|
|
1950
|
+
errorBars=drawErrorBars({
|
|
1944
1951
|
group:ctx.groups.overlay,
|
|
1945
1952
|
series:visible,
|
|
1946
1953
|
xScale,
|
|
@@ -1965,7 +1972,7 @@ drawReferenceLines({
|
|
|
1965
1972
|
group:ctx.groups.overlay,plot,scale:yScale,lines:ctx.reference,
|
|
1966
1973
|
});
|
|
1967
1974
|
}
|
|
1968
|
-
return{xScale,yScale,series:visible,horizontal,percent,plot};
|
|
1975
|
+
return{xScale,yScale,series:visible,horizontal,percent,plot,errorBars};
|
|
1969
1976
|
}
|
|
1970
1977
|
function nearestCategory(opts){
|
|
1971
1978
|
const{bound,xScale,at}=opts;
|
|
@@ -5781,6 +5788,7 @@ class Chart{
|
|
|
5781
5788
|
#hidden=new Set();
|
|
5782
5789
|
#drawn=null;
|
|
5783
5790
|
#warnedLabels=false;
|
|
5791
|
+
#warnedError=false;
|
|
5784
5792
|
#bound=null;
|
|
5785
5793
|
#frame=0;
|
|
5786
5794
|
#observer=null;
|
|
@@ -6376,6 +6384,22 @@ this.#drawLegend(bound.series.length>1
|
|
|
6376
6384
|
:[]);
|
|
6377
6385
|
}
|
|
6378
6386
|
}
|
|
6387
|
+
const bars=this.#drawn&&this.#drawn.errorBars;
|
|
6388
|
+
if(this.#spec.error&&bars&&!bars.drawn&&bars.marks&&!this.#warnedError){
|
|
6389
|
+
this.#warnedError=true;
|
|
6390
|
+
const view=this.#doc&&this.#doc.defaultView;
|
|
6391
|
+
const out=(view&&view.console)
|
|
6392
|
+
||(typeof globalThis!=='undefined'?globalThis.console:null);
|
|
6393
|
+
if(out&&typeof out.warn==='function'){
|
|
6394
|
+
out.warn(bars.single===bars.marks
|
|
6395
|
+
?'[lattice] error bars were requested but every mark has a single reading behind it, so '
|
|
6396
|
+
+'there is no spread to compute. A chart bound to a summary or derived grid sees one '
|
|
6397
|
+
+'row per mark: bind it to the rows the summary was computed from, or supply a margin '
|
|
6398
|
+
+'column with `error: { of: "column" }`.'
|
|
6399
|
+
:'[lattice] error bars were requested but no mark had enough readings to compute an '
|
|
6400
|
+
+'interval.');
|
|
6401
|
+
}
|
|
6402
|
+
}
|
|
6379
6403
|
if(this.#drawn)this.#drawn.plot=this.#drawn.plot||plotOf(this.#drawn,width,height);
|
|
6380
6404
|
if(this.#spec.selection)this.#emphasise();
|
|
6381
6405
|
this.#watermark();
|
package/modules/htmx.esm.min.js
CHANGED
package/modules/htmx.min.cjs
CHANGED
package/modules/htmx.min.js
CHANGED
package/modules/react.esm.min.js
CHANGED
package/modules/vue.esm.min.js
CHANGED