@toclocoinc/lattice-grid 1.32.0 → 1.34.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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/docs/API.html +420 -2
  3. package/docs/api-detail.html +5 -2
  4. package/lattice-grid.d.ts +730 -1
  5. package/lattice-grid.esm.min.js +4 -4
  6. package/lattice-grid.min.cjs +4 -4
  7. package/lattice-grid.min.js +4 -4
  8. package/modules/angular.esm.min.js +2 -2
  9. package/modules/angular.min.cjs +2 -2
  10. package/modules/angular.min.js +2 -2
  11. package/modules/chart-alluvial.esm.min.js +143 -0
  12. package/modules/chart-arc.esm.min.js +102 -0
  13. package/modules/chart-bubblemap.esm.min.js +86 -0
  14. package/modules/chart-bump.esm.min.js +105 -0
  15. package/modules/chart-calendar.esm.min.js +124 -0
  16. package/modules/chart-decomposition.esm.min.js +127 -0
  17. package/modules/chart-diverging.esm.min.js +99 -0
  18. package/modules/chart-dumbbell.esm.min.js +110 -0
  19. package/modules/chart-fan.esm.min.js +135 -0
  20. package/modules/chart-hexbin.esm.min.js +144 -0
  21. package/modules/chart-hexmap.esm.min.js +120 -0
  22. package/modules/chart-icicle.esm.min.js +92 -0
  23. package/modules/chart-parallel.esm.min.js +114 -0
  24. package/modules/chart-ridgeline.esm.min.js +114 -0
  25. package/modules/chart-roc.esm.min.js +177 -0
  26. package/modules/chart-slope.esm.min.js +95 -0
  27. package/modules/chart-splom.esm.min.js +120 -0
  28. package/modules/chart-waffle.esm.min.js +92 -0
  29. package/modules/charts.esm.min.js +107 -9
  30. package/modules/charts.min.cjs +105 -9
  31. package/modules/charts.min.js +105 -9
  32. package/modules/data-router.esm.min.js +1546 -8
  33. package/modules/data-router.min.cjs +1546 -8
  34. package/modules/data-router.min.js +1546 -8
  35. package/modules/devtools.esm.min.js +2 -2
  36. package/modules/devtools.min.cjs +2 -2
  37. package/modules/devtools.min.js +2 -2
  38. package/modules/dhtmlx-compat.esm.min.js +4 -4
  39. package/modules/dhtmlx-compat.min.cjs +4 -4
  40. package/modules/dhtmlx-compat.min.js +4 -4
  41. package/modules/gantt.esm.min.js +2004 -0
  42. package/modules/gantt.min.cjs +1996 -0
  43. package/modules/gantt.min.js +1996 -0
  44. package/modules/htmx.esm.min.js +4 -4
  45. package/modules/htmx.min.cjs +4 -4
  46. package/modules/htmx.min.js +4 -4
  47. package/modules/kanban.esm.min.js +2278 -0
  48. package/modules/kanban.min.cjs +2281 -0
  49. package/modules/kanban.min.js +2281 -0
  50. package/modules/mock-socket.esm.min.js +2 -2
  51. package/modules/mock-socket.min.cjs +242 -0
  52. package/modules/mock-socket.min.js +242 -0
  53. package/modules/react.esm.min.js +2 -2
  54. package/modules/react.min.cjs +2 -2
  55. package/modules/react.min.js +2 -2
  56. package/modules/svelte.esm.min.js +2 -2
  57. package/modules/svelte.min.cjs +2 -2
  58. package/modules/svelte.min.js +2 -2
  59. package/modules/vue.esm.min.js +2 -2
  60. package/modules/vue.min.cjs +2 -2
  61. package/modules/vue.min.js +2 -2
  62. package/modules/webcomponent.esm.min.js +4 -4
  63. package/modules/webcomponent.min.cjs +4 -4
  64. package/modules/webcomponent.min.js +4 -4
  65. package/package.json +1 -1
@@ -0,0 +1,143 @@
1
+ /*!
2
+ * Lattice Grid 1.34.0, chart-alluvial module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ import*as __ext_0 from"@toclocoinc/lattice-grid/modules/charts";
7
+ var __mods=Object.create(null);
8
+ var __cache=Object.create(null);
9
+ function __def(id,fn){__mods[id]=fn;}
10
+ function __req(id){
11
+ var hit=__cache[id];
12
+ if(hit)return hit;
13
+ var exports=Object.create(null);
14
+ __cache[id]=exports;
15
+ var fn=__mods[id];
16
+ if(!fn)throw new Error('[lattice] missing module: '+id);
17
+ fn(exports,__req);
18
+ return exports;
19
+ }
20
+ var __extmods=Object.create(null);
21
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=__ext_0;
22
+ function __ext(spec){
23
+ var mod=__extmods[spec];
24
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
25
+ if(mod)return mod;
26
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
27
+ throw new Error('[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: '+spec);
28
+ }
29
+ __def("packages/modules/chart-alluvial/index.js",function(__exports,__req){
30
+ 'use strict';
31
+ Object.defineProperty(__exports,"bindAlluvial",{enumerable:true,get:function(){return bindAlluvial;}});
32
+ Object.defineProperty(__exports,"drawAlluvial",{enumerable:true,get:function(){return drawAlluvial;}});
33
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
34
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
35
+ const registerChartType=__m0["registerChartType"];
36
+ function bindAlluvial(grid,spec){
37
+ const flows=new Map();
38
+ const sources=[];
39
+ const targets=[];
40
+ const n=grid.rows.count();
41
+ for(let i=0;i<n;i++){
42
+ const row=grid.rows.get(i);
43
+ if(!row||row.group)continue;
44
+ const s=String(grid.rows.text(row.key,spec.source));
45
+ const t=String(grid.rows.text(row.key,spec.target));
46
+ const v=spec.value?Number(grid.rows.value(row.key,spec.value)):1;
47
+ if(!Number.isFinite(v)||v<=0)continue;
48
+ if(!sources.includes(s))sources.push(s);
49
+ if(!targets.includes(t))targets.push(t);
50
+ const k=`${s}\u0001${t}`;
51
+ flows.set(k,(flows.get(k)||0)+v);
52
+ }
53
+ const list=[...flows.entries()].map(([k,value])=>{
54
+ const[source,target]=k.split('\u0001');
55
+ return{source,target,value};
56
+ });
57
+ return{flows:list,sources,targets,empty:list.length===0};
58
+ }
59
+ function drawAlluvial(ctx){
60
+ const{
61
+ plot,bound,scheme,fontSize,groups,helpers,
62
+ }=ctx;
63
+ const{
64
+ Pool,attrs,path,round,setText,resolveScheme,NS,
65
+ }=helpers;
66
+ const sch=scheme||resolveScheme();
67
+ const{flows,sources,targets}=bound;
68
+ const total=flows.reduce((t,f)=>t+f.value,0)||1;
69
+ const gap=Math.min(8,(plot.bottom-plot.top)*0.02);
70
+ const nodeW=Math.max(6,(plot.right-plot.left)*0.03);
71
+ const height=(plot.bottom-plot.top);
72
+ const stack=(names,weight)=>{
73
+ const totals=names.map(weight);
74
+ const sum=totals.reduce((t,v)=>t+v,0)||1;
75
+ const usable=height-gap*(names.length-1);
76
+ const bands=new Map();
77
+ let y=plot.top;
78
+ names.forEach((name,i)=>{
79
+ const h=(totals[i]/sum)*usable;
80
+ bands.set(name,{y0:y,y1:y+h,cursor:y});
81
+ y+=h+gap;
82
+ });
83
+ return bands;
84
+ };
85
+ const srcWeight=(s)=>flows.filter((f)=>f.source===s).reduce((t,f)=>t+f.value,0);
86
+ const tgtWeight=(t)=>flows.filter((f)=>f.target===t).reduce((a,f)=>a+f.value,0);
87
+ const left=stack(sources,srcWeight);
88
+ const right=stack(targets,tgtWeight);
89
+ const marks=new Pool(groups.marks);
90
+ const overlay=new Pool(groups.overlay);
91
+ sources.forEach((s,i)=>{
92
+ const b=left.get(s);
93
+ attrs(marks.next('rect',`${NS}__alluvial-node ${NS}__mark`),{
94
+ x:round(plot.left),y:round(b.y0),width:round(nodeW),height:round(Math.max(1,b.y1-b.y0)),
95
+ fill:sch.series(i),
96
+ });
97
+ const label=overlay.next('text',`${NS}__alluvial-label`);
98
+ setText(label,s);
99
+ attrs(label,{x:round(plot.left+nodeW+2),y:round((b.y0+b.y1)/2),'font-size':fontSize});
100
+ });
101
+ targets.forEach((t)=>{
102
+ const b=right.get(t);
103
+ attrs(marks.next('rect',`${NS}__alluvial-node ${NS}__mark`),{
104
+ x:round(plot.right-nodeW),y:round(b.y0),width:round(nodeW),height:round(Math.max(1,b.y1-b.y0)),
105
+ fill:'currentColor','fill-opacity':0.4,
106
+ });
107
+ const label=overlay.next('text',`${NS}__alluvial-label`);
108
+ setText(label,t);
109
+ attrs(label,{x:round(plot.right-nodeW-2),y:round((b.y0+b.y1)/2),'text-anchor':'end','font-size':fontSize});
110
+ });
111
+ const x0=plot.left+nodeW;
112
+ const x1=plot.right-nodeW;
113
+ const xm=(x0+x1)/2;
114
+ for(const f of flows){
115
+ const b0=left.get(f.source);
116
+ const b1=right.get(f.target);
117
+ const h=(f.value/total)*(height-gap*(Math.max(sources.length,targets.length)-1));
118
+ const sy=b0.cursor;b0.cursor+=h;
119
+ const ty=b1.cursor;b1.cursor+=h;
120
+ const si=sources.indexOf(f.source);
121
+ attrs(marks.next('path',`${NS}__alluvial-flow ${NS}__mark`),{
122
+ d:path([
123
+ 'M',round(x0),round(sy),
124
+ 'C',round(xm),round(sy),round(xm),round(ty),round(x1),round(ty),
125
+ 'L',round(x1),round(ty+h),
126
+ 'C',round(xm),round(ty+h),round(xm),round(sy+h),round(x0),round(sy+h),
127
+ 'Z',
128
+ ]),
129
+ fill:sch.series(si),'fill-opacity':0.35,stroke:'none','data-value':f.value,
130
+ });
131
+ }
132
+ marks.finish();
133
+ overlay.finish();
134
+ return{flows:flows.length,legend:[]};
135
+ }
136
+ registerChartType('alluvial',{draw:drawAlluvial,bind:bindAlluvial,freeform:true,labelled:false});
137
+ const __default=drawAlluvial;
138
+ });
139
+ const __entry=__req("packages/modules/chart-alluvial/index.js");
140
+ export const
141
+ bindAlluvial=__entry.bindAlluvial,
142
+ drawAlluvial=__entry.drawAlluvial;
143
+ export default __entry.default;
@@ -0,0 +1,102 @@
1
+ /*!
2
+ * Lattice Grid 1.34.0, chart-arc module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ import*as __ext_0 from"@toclocoinc/lattice-grid/modules/charts";
7
+ var __mods=Object.create(null);
8
+ var __cache=Object.create(null);
9
+ function __def(id,fn){__mods[id]=fn;}
10
+ function __req(id){
11
+ var hit=__cache[id];
12
+ if(hit)return hit;
13
+ var exports=Object.create(null);
14
+ __cache[id]=exports;
15
+ var fn=__mods[id];
16
+ if(!fn)throw new Error('[lattice] missing module: '+id);
17
+ fn(exports,__req);
18
+ return exports;
19
+ }
20
+ var __extmods=Object.create(null);
21
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=__ext_0;
22
+ function __ext(spec){
23
+ var mod=__extmods[spec];
24
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
25
+ if(mod)return mod;
26
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
27
+ throw new Error('[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: '+spec);
28
+ }
29
+ __def("packages/modules/chart-arc/index.js",function(__exports,__req){
30
+ 'use strict';
31
+ Object.defineProperty(__exports,"bindArc",{enumerable:true,get:function(){return bindArc;}});
32
+ Object.defineProperty(__exports,"drawArc",{enumerable:true,get:function(){return drawArc;}});
33
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
34
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
35
+ const registerChartType=__m0["registerChartType"];
36
+ function bindArc(grid,spec){
37
+ const nodes=[];
38
+ const links=[];
39
+ const n=grid.rows.count();
40
+ for(let i=0;i<n;i++){
41
+ const row=grid.rows.get(i);
42
+ if(!row||row.group)continue;
43
+ const s=String(grid.rows.text(row.key,spec.source));
44
+ const t=String(grid.rows.text(row.key,spec.target));
45
+ if(!s||!t||s==='undefined'||t==='undefined')continue;
46
+ const v=spec.value?Number(grid.rows.value(row.key,spec.value)):1;
47
+ if(!nodes.includes(s))nodes.push(s);
48
+ if(!nodes.includes(t))nodes.push(t);
49
+ links.push({source:s,target:t,value:Number.isFinite(v)&&v>0?v:1});
50
+ }
51
+ return{nodes,links,empty:links.length===0};
52
+ }
53
+ function drawArc(ctx){
54
+ const{
55
+ plot,bound,scheme,fontSize,groups,helpers,
56
+ }=ctx;
57
+ const{
58
+ linearScale,extent,Pool,attrs,path,round,setText,resolveScheme,NS,
59
+ }=helpers;
60
+ const sch=scheme||resolveScheme();
61
+ const{nodes,links}=bound;
62
+ if(nodes.length<2)return{empty:true,legend:[]};
63
+ const baseline=plot.bottom-fontSize-4;
64
+ const step=(plot.right-plot.left)/Math.max(1,nodes.length-1);
65
+ const posOf=(name)=>plot.left+nodes.indexOf(name)*step;
66
+ const widthDomain=extent(links.map((l)=>l.value))||{min:1,max:1};
67
+ const widthScale=linearScale({min:0,max:widthDomain.max},[0.5,6]);
68
+ const marks=new Pool(groups.marks);
69
+ for(const link of links){
70
+ const x1=posOf(link.source);
71
+ const x2=posOf(link.target);
72
+ const r=Math.abs(x2-x1)/2;
73
+ const cap=Math.min(baseline-plot.top,r);
74
+ const mid=(x1+x2)/2;
75
+ attrs(marks.next('path',`${NS}__arc-link ${NS}__mark`),{
76
+ d:path(['M',round(x1),round(baseline),'Q',round(mid),round(baseline-cap*2),round(x2),round(baseline)]),
77
+ fill:'none',stroke:'currentColor','stroke-opacity':0.35,
78
+ 'stroke-width':round(widthScale.of(link.value)),'data-value':link.value,
79
+ });
80
+ }
81
+ const overlay=new Pool(groups.overlay);
82
+ nodes.forEach((name,i)=>{
83
+ const x=posOf(name);
84
+ attrs(marks.next('circle',`${NS}__arc-node ${NS}__mark`),{
85
+ cx:round(x),cy:round(baseline),r:4,fill:sch.series(i),
86
+ });
87
+ const label=overlay.next('text',`${NS}__arc-label`);
88
+ setText(label,name);
89
+ attrs(label,{x:round(x),y:round(baseline+fontSize+2),'text-anchor':'middle','font-size':fontSize});
90
+ });
91
+ marks.finish();
92
+ overlay.finish();
93
+ return{nodes:nodes.length,links:links.length,legend:[]};
94
+ }
95
+ registerChartType('arc',{draw:drawArc,bind:bindArc,freeform:true,labelled:false});
96
+ const __default=drawArc;
97
+ });
98
+ const __entry=__req("packages/modules/chart-arc/index.js");
99
+ export const
100
+ bindArc=__entry.bindArc,
101
+ drawArc=__entry.drawArc;
102
+ export default __entry.default;
@@ -0,0 +1,86 @@
1
+ /*!
2
+ * Lattice Grid 1.34.0, chart-bubblemap module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ import*as __ext_0 from"@toclocoinc/lattice-grid/modules/charts";
7
+ var __mods=Object.create(null);
8
+ var __cache=Object.create(null);
9
+ function __def(id,fn){__mods[id]=fn;}
10
+ function __req(id){
11
+ var hit=__cache[id];
12
+ if(hit)return hit;
13
+ var exports=Object.create(null);
14
+ __cache[id]=exports;
15
+ var fn=__mods[id];
16
+ if(!fn)throw new Error('[lattice] missing module: '+id);
17
+ fn(exports,__req);
18
+ return exports;
19
+ }
20
+ var __extmods=Object.create(null);
21
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=__ext_0;
22
+ function __ext(spec){
23
+ var mod=__extmods[spec];
24
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
25
+ if(mod)return mod;
26
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
27
+ throw new Error('[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: '+spec);
28
+ }
29
+ __def("packages/modules/chart-bubblemap/index.js",function(__exports,__req){
30
+ 'use strict';
31
+ Object.defineProperty(__exports,"bindBubbleMap",{enumerable:true,get:function(){return bindBubbleMap;}});
32
+ Object.defineProperty(__exports,"drawBubbleMap",{enumerable:true,get:function(){return drawBubbleMap;}});
33
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
34
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
35
+ const registerChartType=__m0["registerChartType"];
36
+ function bindBubbleMap(grid,spec){
37
+ const points=[];
38
+ const n=grid.rows.count();
39
+ for(let i=0;i<n;i++){
40
+ const row=grid.rows.get(i);
41
+ if(!row||row.group)continue;
42
+ const lon=Number(grid.rows.value(row.key,spec.lon));
43
+ const lat=Number(grid.rows.value(row.key,spec.lat));
44
+ if(!Number.isFinite(lon)||!Number.isFinite(lat))continue;
45
+ const size=spec.size?Number(grid.rows.value(row.key,spec.size)):1;
46
+ points.push({lon,lat,size:Number.isFinite(size)?size:0,label:spec.label?grid.rows.text(row.key,spec.label):''});
47
+ }
48
+ return{points,empty:points.length===0};
49
+ }
50
+ function drawBubbleMap(ctx){
51
+ const{
52
+ plot,bound,scheme,groups,spec,helpers,
53
+ }=ctx;
54
+ const{
55
+ extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,
56
+ }=helpers;
57
+ const sch=scheme||resolveScheme();
58
+ const colour=sch.series(0);
59
+ const{points}=bound;
60
+ const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
61
+ const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
62
+ const pad=Math.max(8,spec&&spec.maxRadius>0?spec.maxRadius:20);
63
+ const xScale=linearScale(lonD,[plot.left+pad,plot.right-pad]);
64
+ const yScale=linearScale(latD,[plot.bottom-pad,plot.top+pad]);
65
+ const sizeD=extent(points.map((p)=>p.size))||{min:0,max:1};
66
+ const rScale=sqrtScale({min:0,max:Math.max(1e-9,sizeD.max)},[2,spec&&spec.maxRadius>0?spec.maxRadius:20]);
67
+ const marks=new Pool(groups.marks);
68
+ const ordered=[...points].sort((a,b)=>b.size-a.size);
69
+ for(const p of ordered){
70
+ attrs(marks.next('circle',`${NS}__bubblemap-dot ${NS}__mark`),{
71
+ cx:round(xScale.of(p.lon)),cy:round(yScale.of(p.lat)),
72
+ r:round(spec&&spec.size?rScale.of(p.size):4),
73
+ fill:colour,'fill-opacity':0.5,stroke:colour,'data-size':p.size,
74
+ });
75
+ }
76
+ marks.finish();
77
+ return{points:points.length,legend:[]};
78
+ }
79
+ registerChartType('bubblemap',{draw:drawBubbleMap,bind:bindBubbleMap,freeform:true,labelled:false});
80
+ const __default=drawBubbleMap;
81
+ });
82
+ const __entry=__req("packages/modules/chart-bubblemap/index.js");
83
+ export const
84
+ bindBubbleMap=__entry.bindBubbleMap,
85
+ drawBubbleMap=__entry.drawBubbleMap;
86
+ export default __entry.default;
@@ -0,0 +1,105 @@
1
+ /*!
2
+ * Lattice Grid 1.34.0, chart-bump module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ import*as __ext_0 from"@toclocoinc/lattice-grid/modules/charts";
7
+ var __mods=Object.create(null);
8
+ var __cache=Object.create(null);
9
+ function __def(id,fn){__mods[id]=fn;}
10
+ function __req(id){
11
+ var hit=__cache[id];
12
+ if(hit)return hit;
13
+ var exports=Object.create(null);
14
+ __cache[id]=exports;
15
+ var fn=__mods[id];
16
+ if(!fn)throw new Error('[lattice] missing module: '+id);
17
+ fn(exports,__req);
18
+ return exports;
19
+ }
20
+ var __extmods=Object.create(null);
21
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=__ext_0;
22
+ function __ext(spec){
23
+ var mod=__extmods[spec];
24
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
25
+ if(mod)return mod;
26
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
27
+ throw new Error('[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: '+spec);
28
+ }
29
+ __def("packages/modules/chart-bump/index.js",function(__exports,__req){
30
+ 'use strict';
31
+ Object.defineProperty(__exports,"drawBump",{enumerable:true,get:function(){return drawBump;}});
32
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
33
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
34
+ const registerChartType=__m0["registerChartType"];
35
+ function drawBump(ctx){
36
+ const{
37
+ plot,bound,scheme,fontSize,groups,helpers,
38
+ }=ctx;
39
+ const{
40
+ linearScale,bandScale,Pool,attrs,path,round,setText,resolveScheme,NS,
41
+ }=helpers;
42
+ const sch=scheme||resolveScheme();
43
+ const labels=bound.labels||[];
44
+ const series=bound.series||[];
45
+ if(labels.length<2||!series.length)return{empty:true,legend:[]};
46
+ const ranks=labels.map((_,col)=>{
47
+ const scored=series
48
+ .map((s,i)=>({i,y:s.points[col]?s.points[col].y:null}))
49
+ .filter((e)=>e.y!==null)
50
+ .sort((a,b)=>b.y-a.y);
51
+ const byIndex=new Map();
52
+ scored.forEach((e,r)=>byIndex.set(e.i,r+1));
53
+ return byIndex;
54
+ });
55
+ const maxRank=series.length;
56
+ const xScale=bandScale(labels,[plot.left,plot.right],0.5);
57
+ const colX=labels.map((l)=>xScale.of(l)+xScale.bandwidth/2);
58
+ const yScale=linearScale({min:1,max:maxRank},[plot.top,plot.bottom]);
59
+ const axisPool=new Pool(groups.axis);
60
+ labels.forEach((label,i)=>{
61
+ const t=axisPool.next('text',`${NS}__tick`);
62
+ setText(t,String(label));
63
+ attrs(t,{x:round(colX[i]),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
64
+ });
65
+ const marks=new Pool(groups.marks);
66
+ const overlay=new Pool(groups.overlay);
67
+ series.forEach((s,i)=>{
68
+ const colour=sch.series(i);
69
+ const parts=[];
70
+ labels.forEach((_,col)=>{
71
+ const rank=ranks[col].get(i);
72
+ if(rank===undefined){return;}
73
+ parts.push(parts.length?'L':'M',round(colX[col]),round(yScale.of(rank)));
74
+ });
75
+ if(parts.length>=3){
76
+ attrs(marks.next('path',`${NS}__bump-line ${NS}__mark`),{
77
+ d:path(parts),stroke:colour,'stroke-width':2.5,fill:'none','data-series':i,
78
+ });
79
+ }
80
+ labels.forEach((_,col)=>{
81
+ const rank=ranks[col].get(i);
82
+ if(rank===undefined)return;
83
+ attrs(marks.next('circle',`${NS}__bump-dot ${NS}__mark`),{
84
+ cx:round(colX[col]),cy:round(yScale.of(rank)),r:4,fill:colour,
85
+ });
86
+ });
87
+ const firstCol=labels.findIndex((_,col)=>ranks[col].get(i)!==undefined);
88
+ if(firstCol>=0){
89
+ const t=overlay.next('text',`${NS}__bump-label`);
90
+ setText(t,String(s.label||s.key));
91
+ attrs(t,{x:round(plot.left-4),y:round(yScale.of(ranks[firstCol].get(i))),'text-anchor':'end','font-size':fontSize});
92
+ }
93
+ });
94
+ axisPool.finish();
95
+ marks.finish();
96
+ overlay.finish();
97
+ return{series:series.length,periods:labels.length,legend:[]};
98
+ }
99
+ registerChartType('bump',{draw:drawBump,labelled:false});
100
+ const __default=drawBump;
101
+ });
102
+ const __entry=__req("packages/modules/chart-bump/index.js");
103
+ export const
104
+ drawBump=__entry.drawBump;
105
+ export default __entry.default;
@@ -0,0 +1,124 @@
1
+ /*!
2
+ * Lattice Grid 1.34.0, chart-calendar module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ import*as __ext_0 from"@toclocoinc/lattice-grid/modules/charts";
7
+ var __mods=Object.create(null);
8
+ var __cache=Object.create(null);
9
+ function __def(id,fn){__mods[id]=fn;}
10
+ function __req(id){
11
+ var hit=__cache[id];
12
+ if(hit)return hit;
13
+ var exports=Object.create(null);
14
+ __cache[id]=exports;
15
+ var fn=__mods[id];
16
+ if(!fn)throw new Error('[lattice] missing module: '+id);
17
+ fn(exports,__req);
18
+ return exports;
19
+ }
20
+ var __extmods=Object.create(null);
21
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=__ext_0;
22
+ function __ext(spec){
23
+ var mod=__extmods[spec];
24
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
25
+ if(mod)return mod;
26
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
27
+ throw new Error('[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: '+spec);
28
+ }
29
+ __def("packages/modules/chart-calendar/index.js",function(__exports,__req){
30
+ 'use strict';
31
+ Object.defineProperty(__exports,"drawCalendar",{enumerable:true,get:function(){return drawCalendar;}});
32
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
33
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
34
+ const registerChartType=__m0["registerChartType"];
35
+ const DAY=86_400_000;
36
+ const WEEKDAYS=['S','M','T','W','T','F','S'];
37
+ const MONTHS=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
38
+ function dayStart(ms){
39
+ return Math.floor(ms/DAY)*DAY;
40
+ }
41
+ function drawCalendar(ctx){
42
+ const{
43
+ plot,bound,scheme,fontSize,groups,spec,helpers,
44
+ }=ctx;
45
+ const{
46
+ toTime,measureDomain,colourRamp,Pool,attrs,round,setText,resolveScheme,NS,
47
+ }=helpers;
48
+ const sch=scheme||resolveScheme();
49
+ const series=bound.series&&bound.series[0];
50
+ const points=(series&&series.points)||[];
51
+ const byDay=new Map();
52
+ const values=[];
53
+ for(const p of points){
54
+ const ms=toTime(p.x);
55
+ if(ms===null||!Number.isFinite(p.y))continue;
56
+ const day=dayStart(ms);
57
+ byDay.set(day,(byDay.get(day)||0)+p.y);
58
+ }
59
+ for(const v of byDay.values())values.push(v);
60
+ if(!byDay.size)return{empty:true,legend:[]};
61
+ const days=[...byDay.keys()].sort((a,b)=>a-b);
62
+ const first=days[0];
63
+ const last=days[days.length-1];
64
+ const firstDow=new Date(first).getUTCDay();
65
+ const gridStart=first-firstDow*DAY;
66
+ const weeks=Math.floor((last-gridStart)/(7*DAY))+1;
67
+ const domain=measureDomain(values,{zero:true});
68
+ const ramp=colourRamp(domain,false,sch);
69
+ const gutterLeft=fontSize+4;
70
+ const gutterTop=fontSize+4;
71
+ const availW=plot.right-plot.left-gutterLeft;
72
+ const availH=plot.bottom-plot.top-gutterTop;
73
+ const cell=Math.max(2,Math.floor(Math.min(availW/weeks,availH/7))-1);
74
+ const gap=Math.max(1,Math.round(cell*0.12));
75
+ const originX=plot.left+gutterLeft;
76
+ const originY=plot.top+gutterTop;
77
+ const cellPool=new Pool(groups.marks);
78
+ let drawn=0;
79
+ let lastMonth=-1;
80
+ const overlay=new Pool(groups.overlay);
81
+ for(let d=gridStart;d<=last;d+=DAY){
82
+ const week=Math.floor((d-gridStart)/(7*DAY));
83
+ const dow=new Date(d).getUTCDay();
84
+ const x=originX+week*(cell+gap);
85
+ const y=originY+dow*(cell+gap);
86
+ const value=byDay.get(d);
87
+ const present=value!==undefined&&d>=first;
88
+ const rect=cellPool.next('rect',`${NS}__cal-cell ${NS}__mark`);
89
+ const cellAttrs={
90
+ x:round(x),y:round(y),width:cell,height:cell,rx:2,
91
+ fill:present?ramp(value):'currentColor',
92
+ 'fill-opacity':present?1:0.06,
93
+ };
94
+ if(present)cellAttrs['data-value']=value;
95
+ attrs(rect,cellAttrs);
96
+ if(present)drawn+=1;
97
+ const month=new Date(d).getUTCMonth();
98
+ if(dow===0&&month!==lastMonth){
99
+ lastMonth=month;
100
+ const label=overlay.next('text',`${NS}__cal-month`);
101
+ setText(label,MONTHS[month]);
102
+ attrs(label,{x:round(x),y:round(plot.top+fontSize),'font-size':fontSize});
103
+ }
104
+ }
105
+ const showDow=spec&&spec.weekdayLabels===false?[]:[1,3,5];
106
+ for(const dow of showDow){
107
+ const label=overlay.next('text',`${NS}__cal-dow`);
108
+ setText(label,WEEKDAYS[dow]);
109
+ attrs(label,{
110
+ x:round(plot.left),y:round(originY+dow*(cell+gap)+cell),
111
+ 'font-size':fontSize,
112
+ });
113
+ }
114
+ cellPool.finish();
115
+ overlay.finish();
116
+ return{cells:drawn,weeks,domain,legend:[]};
117
+ }
118
+ registerChartType('calendar',{draw:drawCalendar,freeform:true,labelled:false});
119
+ const __default=drawCalendar;
120
+ });
121
+ const __entry=__req("packages/modules/chart-calendar/index.js");
122
+ export const
123
+ drawCalendar=__entry.drawCalendar;
124
+ export default __entry.default;
@@ -0,0 +1,127 @@
1
+ /*!
2
+ * Lattice Grid 1.34.0, chart-decomposition module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ import*as __ext_0 from"@toclocoinc/lattice-grid/modules/charts";
7
+ var __mods=Object.create(null);
8
+ var __cache=Object.create(null);
9
+ function __def(id,fn){__mods[id]=fn;}
10
+ function __req(id){
11
+ var hit=__cache[id];
12
+ if(hit)return hit;
13
+ var exports=Object.create(null);
14
+ __cache[id]=exports;
15
+ var fn=__mods[id];
16
+ if(!fn)throw new Error('[lattice] missing module: '+id);
17
+ fn(exports,__req);
18
+ return exports;
19
+ }
20
+ var __extmods=Object.create(null);
21
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=__ext_0;
22
+ function __ext(spec){
23
+ var mod=__extmods[spec];
24
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
25
+ if(mod)return mod;
26
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
27
+ throw new Error('[lattice] this module shares the Lattice core with the page, but it was not found. Load lattice-grid (or its script build) before this module. Missing: '+spec);
28
+ }
29
+ __def("packages/modules/chart-decomposition/index.js",function(__exports,__req){
30
+ 'use strict';
31
+ Object.defineProperty(__exports,"bindDecomposition",{enumerable:true,get:function(){return bindDecomposition;}});
32
+ Object.defineProperty(__exports,"drawDecomposition",{enumerable:true,get:function(){return drawDecomposition;}});
33
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
34
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
35
+ const registerChartType=__m0["registerChartType"];
36
+ const COMPONENTS=[
37
+ {key:'observed',label:'Observed'},
38
+ {key:'trend',label:'Trend'},
39
+ {key:'seasonal',label:'Seasonal'},
40
+ {key:'residual',label:'Residual'},
41
+ ];
42
+ function bindDecomposition(grid,spec){
43
+ const chosen=COMPONENTS.filter((c)=>spec[c.key]);
44
+ const n=grid.rows.count();
45
+ const panels=chosen.map((c)=>({key:c.key,label:c.label,col:spec[c.key],values:[]}));
46
+ for(let i=0;i<n;i++){
47
+ const row=grid.rows.get(i);
48
+ if(!row||row.group)continue;
49
+ for(const panel of panels){
50
+ const v=Number(grid.rows.value(row.key,panel.col));
51
+ panel.values.push(Number.isFinite(v)?v:null);
52
+ }
53
+ }
54
+ const rows=panels.length?panels[0].values.length:0;
55
+ return{panels,n:rows,empty:panels.length===0||rows===0};
56
+ }
57
+ function drawDecomposition(ctx){
58
+ const{
59
+ plot,bound,scheme,fontSize,groups,grid,helpers,
60
+ }=ctx;
61
+ const{
62
+ measureDomain,linearScale,linearTicks,Pool,attrs,path,round,setText,
63
+ formatters,resolveScheme,NS,
64
+ }=helpers;
65
+ const sch=scheme||resolveScheme();
66
+ const{panels,n}=bound;
67
+ const xScale=linearScale({min:0,max:Math.max(1,n-1)},[plot.left,plot.right]);
68
+ const gap=Math.round(fontSize*1.2);
69
+ const panelH=(plot.bottom-plot.top-gap*(panels.length-1))/panels.length;
70
+ const gridPool=new Pool(groups.grid);
71
+ const axisPool=new Pool(groups.axis);
72
+ const marks=new Pool(groups.marks);
73
+ const overlay=new Pool(groups.overlay);
74
+ panels.forEach((panel,p)=>{
75
+ const top=plot.top+p*(panelH+gap);
76
+ const bottom=top+panelH;
77
+ const present=panel.values.filter((v)=>v!==null);
78
+ const domain=measureDomain(present.length?present:[0,1],{zero:panel.key==='residual'});
79
+ const yScale=linearScale(domain,[bottom,top]);
80
+ const colour=sch.series(p);
81
+ attrs(gridPool.next('rect',`${NS}__decomp-frame`),{
82
+ x:round(plot.left),y:round(top),width:round(plot.right-plot.left),height:round(panelH),
83
+ fill:'none',stroke:'currentColor','stroke-opacity':0.12,
84
+ });
85
+ const fmt=formatters(grid,{kind:'linear',step:(domain.max-domain.min)/2||1});
86
+ for(const t of linearTicks(domain,2)){
87
+ const label=axisPool.next('text',`${NS}__tick`);
88
+ setText(label,fmt.tick(t));
89
+ attrs(label,{x:round(plot.left-4),y:round(yScale.of(t)),'text-anchor':'end','font-size':fontSize});
90
+ }
91
+ if(domain.min<0&&domain.max>0){
92
+ attrs(gridPool.next('line',`${NS}__decomp-zero`),{
93
+ x1:round(plot.left),y1:round(yScale.of(0)),x2:round(plot.right),y2:round(yScale.of(0)),
94
+ stroke:'currentColor','stroke-opacity':0.25,
95
+ });
96
+ }
97
+ const label=overlay.next('text',`${NS}__decomp-label`);
98
+ setText(label,panel.label);
99
+ attrs(label,{x:round(plot.left+2),y:round(top+fontSize),'font-size':fontSize});
100
+ const parts=[];
101
+ let pen=false;
102
+ panel.values.forEach((v,i)=>{
103
+ if(v===null){pen=false;return;}
104
+ parts.push(pen?'L':'M',round(xScale.of(i)),round(yScale.of(v)));
105
+ pen=true;
106
+ });
107
+ if(parts.length){
108
+ attrs(marks.next('path',`${NS}__decomp-line ${NS}__mark`),{
109
+ d:path(parts),stroke:colour,'stroke-width':panel.key==='residual'?1:2,fill:'none',
110
+ 'data-panel':panel.key,
111
+ });
112
+ }
113
+ });
114
+ gridPool.finish();
115
+ axisPool.finish();
116
+ marks.finish();
117
+ overlay.finish();
118
+ return{panels:panels.length,n,legend:[]};
119
+ }
120
+ registerChartType('decomposition',{draw:drawDecomposition,bind:bindDecomposition,freeform:true,labelled:false});
121
+ const __default=drawDecomposition;
122
+ });
123
+ const __entry=__req("packages/modules/chart-decomposition/index.js");
124
+ export const
125
+ bindDecomposition=__entry.bindDecomposition,
126
+ drawDecomposition=__entry.drawDecomposition;
127
+ export default __entry.default;