@toclocoinc/lattice-grid 1.62.0 → 1.63.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 (159) hide show
  1. package/README.md +23 -8
  2. package/docs/API.html +526 -16
  3. package/docs/CHART-CODES.md +141 -2
  4. package/docs/api-detail.html +194 -5
  5. package/lattice-grid.d.ts +235 -5
  6. package/lattice-grid.esm.min.js +856 -78
  7. package/lattice-grid.min.cjs +856 -78
  8. package/lattice-grid.min.js +856 -78
  9. package/modules/ai.d.ts +1 -1
  10. package/modules/ai.esm.min.js +13 -16
  11. package/modules/ai.min.cjs +13 -16
  12. package/modules/ai.min.js +13 -16
  13. package/modules/angular.d.ts +1 -1
  14. package/modules/angular.esm.min.js +2 -2
  15. package/modules/angular.min.cjs +2 -2
  16. package/modules/angular.min.js +2 -2
  17. package/modules/chart-alluvial.d.ts +1 -1
  18. package/modules/chart-alluvial.esm.min.js +1 -1
  19. package/modules/chart-alluvial.min.cjs +147 -0
  20. package/modules/chart-alluvial.min.js +147 -0
  21. package/modules/chart-arc.d.ts +1 -1
  22. package/modules/chart-arc.esm.min.js +1 -1
  23. package/modules/chart-arc.min.cjs +106 -0
  24. package/modules/chart-arc.min.js +106 -0
  25. package/modules/chart-bubblemap.d.ts +1 -1
  26. package/modules/chart-bubblemap.esm.min.js +42 -6
  27. package/modules/chart-bubblemap.min.cjs +126 -0
  28. package/modules/chart-bubblemap.min.js +126 -0
  29. package/modules/chart-bump.d.ts +1 -1
  30. package/modules/chart-bump.esm.min.js +1 -1
  31. package/modules/chart-bump.min.cjs +110 -0
  32. package/modules/chart-bump.min.js +110 -0
  33. package/modules/chart-calendar.d.ts +1 -1
  34. package/modules/chart-calendar.esm.min.js +1 -1
  35. package/modules/chart-calendar.min.cjs +129 -0
  36. package/modules/chart-calendar.min.js +129 -0
  37. package/modules/chart-decomposition.d.ts +1 -1
  38. package/modules/chart-decomposition.esm.min.js +1 -1
  39. package/modules/chart-decomposition.min.cjs +131 -0
  40. package/modules/chart-decomposition.min.js +131 -0
  41. package/modules/chart-diverging.d.ts +1 -1
  42. package/modules/chart-diverging.esm.min.js +1 -1
  43. package/modules/chart-diverging.min.cjs +104 -0
  44. package/modules/chart-diverging.min.js +104 -0
  45. package/modules/chart-dumbbell.d.ts +1 -1
  46. package/modules/chart-dumbbell.esm.min.js +1 -1
  47. package/modules/chart-dumbbell.min.cjs +114 -0
  48. package/modules/chart-dumbbell.min.js +114 -0
  49. package/modules/chart-fan.d.ts +1 -1
  50. package/modules/chart-fan.esm.min.js +1 -1
  51. package/modules/chart-fan.min.cjs +139 -0
  52. package/modules/chart-fan.min.js +139 -0
  53. package/modules/chart-hexbin.d.ts +1 -1
  54. package/modules/chart-hexbin.esm.min.js +1 -1
  55. package/modules/chart-hexbin.min.cjs +148 -0
  56. package/modules/chart-hexbin.min.js +148 -0
  57. package/modules/chart-hexmap.d.ts +1 -1
  58. package/modules/chart-hexmap.esm.min.js +46 -6
  59. package/modules/chart-hexmap.min.cjs +164 -0
  60. package/modules/chart-hexmap.min.js +164 -0
  61. package/modules/chart-icicle.d.ts +1 -1
  62. package/modules/chart-icicle.esm.min.js +1 -1
  63. package/modules/chart-icicle.min.cjs +97 -0
  64. package/modules/chart-icicle.min.js +97 -0
  65. package/modules/chart-parallel.d.ts +1 -1
  66. package/modules/chart-parallel.esm.min.js +1 -1
  67. package/modules/chart-parallel.min.cjs +123 -0
  68. package/modules/chart-parallel.min.js +123 -0
  69. package/modules/chart-ridgeline.d.ts +1 -1
  70. package/modules/chart-ridgeline.esm.min.js +1 -1
  71. package/modules/chart-ridgeline.min.cjs +119 -0
  72. package/modules/chart-ridgeline.min.js +119 -0
  73. package/modules/chart-roc.d.ts +1 -1
  74. package/modules/chart-roc.esm.min.js +1 -1
  75. package/modules/chart-roc.min.cjs +181 -0
  76. package/modules/chart-roc.min.js +181 -0
  77. package/modules/chart-slope.d.ts +1 -1
  78. package/modules/chart-slope.esm.min.js +1 -1
  79. package/modules/chart-slope.min.cjs +100 -0
  80. package/modules/chart-slope.min.js +100 -0
  81. package/modules/chart-splom.d.ts +1 -1
  82. package/modules/chart-splom.esm.min.js +1 -1
  83. package/modules/chart-splom.min.cjs +124 -0
  84. package/modules/chart-splom.min.js +124 -0
  85. package/modules/chart-waffle.d.ts +1 -1
  86. package/modules/chart-waffle.esm.min.js +1 -1
  87. package/modules/chart-waffle.min.cjs +97 -0
  88. package/modules/chart-waffle.min.js +97 -0
  89. package/modules/charts.d.ts +1 -1
  90. package/modules/charts.esm.min.js +1917 -662
  91. package/modules/charts.min.cjs +1917 -662
  92. package/modules/charts.min.js +1917 -662
  93. package/modules/data-router.d.ts +1 -1
  94. package/modules/data-router.esm.min.js +129 -20
  95. package/modules/data-router.min.cjs +129 -20
  96. package/modules/data-router.min.js +129 -20
  97. package/modules/devtools.d.ts +1 -1
  98. package/modules/devtools.esm.min.js +2 -2
  99. package/modules/devtools.min.cjs +2 -2
  100. package/modules/devtools.min.js +2 -2
  101. package/modules/dhtmlx-compat.d.ts +1 -1
  102. package/modules/dhtmlx-compat.esm.min.js +4 -16
  103. package/modules/dhtmlx-compat.min.cjs +4 -16
  104. package/modules/dhtmlx-compat.min.js +4 -16
  105. package/modules/gantt.d.ts +1 -1
  106. package/modules/gantt.esm.min.js +187 -82
  107. package/modules/gantt.min.cjs +187 -82
  108. package/modules/gantt.min.js +187 -82
  109. package/modules/geo-europe-nuts.d.ts +16 -0
  110. package/modules/geo-europe-nuts.esm.min.js +29 -0
  111. package/modules/geo-uk.d.ts +18 -0
  112. package/modules/geo-uk.esm.min.js +29 -0
  113. package/modules/geo-us-states.d.ts +16 -0
  114. package/modules/geo-us-states.esm.min.js +29 -0
  115. package/modules/geo-world-110m.d.ts +17 -0
  116. package/modules/geo-world-110m.esm.min.js +29 -0
  117. package/modules/geo-world-50m.d.ts +16 -0
  118. package/modules/geo-world-50m.esm.min.js +29 -0
  119. package/modules/htmx.d.ts +1 -1
  120. package/modules/htmx.esm.min.js +856 -78
  121. package/modules/htmx.min.cjs +856 -78
  122. package/modules/htmx.min.js +856 -78
  123. package/modules/kanban.d.ts +1 -1
  124. package/modules/kanban.esm.min.js +4 -16
  125. package/modules/kanban.min.cjs +4 -16
  126. package/modules/kanban.min.js +4 -16
  127. package/modules/kpi.d.ts +1 -1
  128. package/modules/kpi.esm.min.js +29 -24
  129. package/modules/kpi.min.cjs +29 -24
  130. package/modules/kpi.min.js +29 -24
  131. package/modules/layout.d.ts +1 -1
  132. package/modules/layout.esm.min.js +4 -16
  133. package/modules/layout.min.cjs +4 -16
  134. package/modules/layout.min.js +4 -16
  135. package/modules/mock-socket.d.ts +1 -1
  136. package/modules/mock-socket.esm.min.js +2 -2
  137. package/modules/mock-socket.min.cjs +2 -2
  138. package/modules/mock-socket.min.js +2 -2
  139. package/modules/react.d.ts +308 -3
  140. package/modules/react.esm.min.js +1072 -22
  141. package/modules/react.min.cjs +1056 -21
  142. package/modules/react.min.js +1056 -21
  143. package/modules/svelte.d.ts +1 -1
  144. package/modules/svelte.esm.min.js +2 -2
  145. package/modules/svelte.min.cjs +2 -2
  146. package/modules/svelte.min.js +2 -2
  147. package/modules/tabs.d.ts +1 -1
  148. package/modules/tabs.esm.min.js +4 -16
  149. package/modules/tabs.min.cjs +4 -16
  150. package/modules/tabs.min.js +4 -16
  151. package/modules/vue.d.ts +1 -1
  152. package/modules/vue.esm.min.js +2 -2
  153. package/modules/vue.min.cjs +2 -2
  154. package/modules/vue.min.js +2 -2
  155. package/modules/webcomponent.d.ts +1 -1
  156. package/modules/webcomponent.esm.min.js +856 -78
  157. package/modules/webcomponent.min.cjs +856 -78
  158. package/modules/webcomponent.min.js +856 -78
  159. package/package.json +1 -1
@@ -0,0 +1,129 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-calendar module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ (function(root){
7
+ 'use strict';
8
+ var __mods=Object.create(null);
9
+ var __cache=Object.create(null);
10
+ function __def(id,fn){__mods[id]=fn;}
11
+ function __req(id){
12
+ var hit=__cache[id];
13
+ if(hit)return hit;
14
+ var exports=Object.create(null);
15
+ __cache[id]=exports;
16
+ var fn=__mods[id];
17
+ if(!fn)throw new Error('[lattice] missing module: '+id);
18
+ fn(exports,__req);
19
+ return exports;
20
+ }
21
+ var __extmods=Object.create(null);
22
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=(root["LatticeGrid"]||null);
23
+ function __ext(spec){
24
+ var mod=__extmods[spec];
25
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
26
+ if(mod)return mod;
27
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
28
+ 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);
29
+ }
30
+ __def("packages/modules/chart-calendar/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"drawCalendar",{enumerable:true,get:function(){return drawCalendar;}});
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 DAY=86_400_000;
37
+ const WEEKDAYS=['S','M','T','W','T','F','S'];
38
+ const MONTHS=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
39
+ function dayStart(ms){
40
+ return Math.floor(ms/DAY)*DAY;
41
+ }
42
+ function drawCalendar(ctx){
43
+ const{
44
+ plot,bound,scheme,fontSize,groups,spec,helpers,
45
+ }=ctx;
46
+ const{
47
+ toTime,measureDomain,colourRamp,Pool,attrs,round,setText,resolveScheme,NS,
48
+ }=helpers;
49
+ const sch=scheme||resolveScheme();
50
+ const series=bound.series&&bound.series[0];
51
+ const points=(series&&series.points)||[];
52
+ const byDay=new Map();
53
+ const values=[];
54
+ for(const p of points){
55
+ const ms=toTime(p.x);
56
+ if(ms===null||!Number.isFinite(p.y))continue;
57
+ const day=dayStart(ms);
58
+ byDay.set(day,(byDay.get(day)||0)+p.y);
59
+ }
60
+ for(const v of byDay.values())values.push(v);
61
+ if(!byDay.size)return{empty:true,legend:[]};
62
+ const days=[...byDay.keys()].sort((a,b)=>a-b);
63
+ const first=days[0];
64
+ const last=days[days.length-1];
65
+ const firstDow=new Date(first).getUTCDay();
66
+ const gridStart=first-firstDow*DAY;
67
+ const weeks=Math.floor((last-gridStart)/(7*DAY))+1;
68
+ const domain=measureDomain(values,{zero:true});
69
+ const ramp=colourRamp(domain,false,sch);
70
+ const gutterLeft=fontSize+4;
71
+ const gutterTop=fontSize+4;
72
+ const availW=plot.right-plot.left-gutterLeft;
73
+ const availH=plot.bottom-plot.top-gutterTop;
74
+ const cell=Math.max(2,Math.floor(Math.min(availW/weeks,availH/7))-1);
75
+ const gap=Math.max(1,Math.round(cell*0.12));
76
+ const originX=plot.left+gutterLeft;
77
+ const originY=plot.top+gutterTop;
78
+ const cellPool=new Pool(groups.marks);
79
+ let drawn=0;
80
+ let lastMonth=-1;
81
+ const overlay=new Pool(groups.overlay);
82
+ for(let d=gridStart;d<=last;d+=DAY){
83
+ const week=Math.floor((d-gridStart)/(7*DAY));
84
+ const dow=new Date(d).getUTCDay();
85
+ const x=originX+week*(cell+gap);
86
+ const y=originY+dow*(cell+gap);
87
+ const value=byDay.get(d);
88
+ const present=value!==undefined&&d>=first;
89
+ const rect=cellPool.next('rect',`${NS}__cal-cell ${NS}__mark`);
90
+ const cellAttrs={
91
+ x:round(x),y:round(y),width:cell,height:cell,rx:2,
92
+ fill:present?ramp(value):'currentColor',
93
+ 'fill-opacity':present?1:0.06,
94
+ };
95
+ if(present)cellAttrs['data-value']=value;
96
+ attrs(rect,cellAttrs);
97
+ if(present)drawn+=1;
98
+ const month=new Date(d).getUTCMonth();
99
+ if(dow===0&&month!==lastMonth){
100
+ lastMonth=month;
101
+ const label=overlay.next('text',`${NS}__cal-month`);
102
+ setText(label,MONTHS[month]);
103
+ attrs(label,{x:round(x),y:round(plot.top+fontSize),'font-size':fontSize});
104
+ }
105
+ }
106
+ const showDow=spec&&spec.weekdayLabels===false?[]:[1,3,5];
107
+ for(const dow of showDow){
108
+ const label=overlay.next('text',`${NS}__cal-dow`);
109
+ setText(label,WEEKDAYS[dow]);
110
+ attrs(label,{
111
+ x:round(plot.left),y:round(originY+dow*(cell+gap)+cell),
112
+ 'font-size':fontSize,
113
+ });
114
+ }
115
+ cellPool.finish();
116
+ overlay.finish();
117
+ return{cells:drawn,weeks,domain,legend:[]};
118
+ }
119
+ registerChartType('calendar',{draw:drawCalendar,freeform:true,labelled:false});
120
+ const __default=drawCalendar;
121
+ });
122
+ var __entry=__req("packages/modules/chart-calendar/index.js");
123
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
124
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
125
+ else{
126
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
127
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
128
+ }
129
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-decomposition module type declarations
2
+ * Lattice Grid 1.63.0, chart-decomposition module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-decomposition module
2
+ * Lattice Grid 1.63.0, chart-decomposition module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,131 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-decomposition module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ (function(root){
7
+ 'use strict';
8
+ var __mods=Object.create(null);
9
+ var __cache=Object.create(null);
10
+ function __def(id,fn){__mods[id]=fn;}
11
+ function __req(id){
12
+ var hit=__cache[id];
13
+ if(hit)return hit;
14
+ var exports=Object.create(null);
15
+ __cache[id]=exports;
16
+ var fn=__mods[id];
17
+ if(!fn)throw new Error('[lattice] missing module: '+id);
18
+ fn(exports,__req);
19
+ return exports;
20
+ }
21
+ var __extmods=Object.create(null);
22
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=(root["LatticeGrid"]||null);
23
+ function __ext(spec){
24
+ var mod=__extmods[spec];
25
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
26
+ if(mod)return mod;
27
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
28
+ 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);
29
+ }
30
+ __def("packages/modules/chart-decomposition/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindDecomposition",{enumerable:true,get:function(){return bindDecomposition;}});
33
+ Object.defineProperty(__exports,"drawDecomposition",{enumerable:true,get:function(){return drawDecomposition;}});
34
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
35
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
36
+ const registerChartType=__m0["registerChartType"];
37
+ const COMPONENTS=[
38
+ {key:'observed',label:'Observed'},
39
+ {key:'trend',label:'Trend'},
40
+ {key:'seasonal',label:'Seasonal'},
41
+ {key:'residual',label:'Residual'},
42
+ ];
43
+ function bindDecomposition(grid,spec){
44
+ const chosen=COMPONENTS.filter((c)=>spec[c.key]);
45
+ const n=grid.rows.count();
46
+ const panels=chosen.map((c)=>({key:c.key,label:c.label,col:spec[c.key],values:[]}));
47
+ for(let i=0;i<n;i++){
48
+ const row=grid.rows.get(i);
49
+ if(!row||row.group)continue;
50
+ for(const panel of panels){
51
+ const v=Number(grid.rows.value(row.key,panel.col));
52
+ panel.values.push(Number.isFinite(v)?v:null);
53
+ }
54
+ }
55
+ const rows=panels.length?panels[0].values.length:0;
56
+ return{panels,n:rows,empty:panels.length===0||rows===0};
57
+ }
58
+ function drawDecomposition(ctx){
59
+ const{
60
+ plot,bound,scheme,fontSize,groups,grid,helpers,
61
+ }=ctx;
62
+ const{
63
+ measureDomain,linearScale,linearTicks,Pool,attrs,path,round,setText,
64
+ formatters,resolveScheme,NS,
65
+ }=helpers;
66
+ const sch=scheme||resolveScheme();
67
+ const{panels,n}=bound;
68
+ const xScale=linearScale({min:0,max:Math.max(1,n-1)},[plot.left,plot.right]);
69
+ const gap=Math.round(fontSize*1.2);
70
+ const panelH=(plot.bottom-plot.top-gap*(panels.length-1))/panels.length;
71
+ const gridPool=new Pool(groups.grid);
72
+ const axisPool=new Pool(groups.axis);
73
+ const marks=new Pool(groups.marks);
74
+ const overlay=new Pool(groups.overlay);
75
+ panels.forEach((panel,p)=>{
76
+ const top=plot.top+p*(panelH+gap);
77
+ const bottom=top+panelH;
78
+ const present=panel.values.filter((v)=>v!==null);
79
+ const domain=measureDomain(present.length?present:[0,1],{zero:panel.key==='residual'});
80
+ const yScale=linearScale(domain,[bottom,top]);
81
+ const colour=sch.series(p);
82
+ attrs(gridPool.next('rect',`${NS}__decomp-frame`),{
83
+ x:round(plot.left),y:round(top),width:round(plot.right-plot.left),height:round(panelH),
84
+ fill:'none',stroke:'currentColor','stroke-opacity':0.12,
85
+ });
86
+ const fmt=formatters(grid,{kind:'linear',step:(domain.max-domain.min)/2||1});
87
+ for(const t of linearTicks(domain,2)){
88
+ const label=axisPool.next('text',`${NS}__tick`);
89
+ setText(label,fmt.tick(t));
90
+ attrs(label,{x:round(plot.left-4),y:round(yScale.of(t)),'text-anchor':'end','font-size':fontSize});
91
+ }
92
+ if(domain.min<0&&domain.max>0){
93
+ attrs(gridPool.next('line',`${NS}__decomp-zero`),{
94
+ x1:round(plot.left),y1:round(yScale.of(0)),x2:round(plot.right),y2:round(yScale.of(0)),
95
+ stroke:'currentColor','stroke-opacity':0.25,
96
+ });
97
+ }
98
+ const label=overlay.next('text',`${NS}__decomp-label`);
99
+ setText(label,panel.label);
100
+ attrs(label,{x:round(plot.left+2),y:round(top+fontSize),'font-size':fontSize});
101
+ const parts=[];
102
+ let pen=false;
103
+ panel.values.forEach((v,i)=>{
104
+ if(v===null){pen=false;return;}
105
+ parts.push(pen?'L':'M',round(xScale.of(i)),round(yScale.of(v)));
106
+ pen=true;
107
+ });
108
+ if(parts.length){
109
+ attrs(marks.next('path',`${NS}__decomp-line ${NS}__mark`),{
110
+ d:path(parts),stroke:colour,'stroke-width':panel.key==='residual'?1:2,fill:'none',
111
+ 'data-panel':panel.key,
112
+ });
113
+ }
114
+ });
115
+ gridPool.finish();
116
+ axisPool.finish();
117
+ marks.finish();
118
+ overlay.finish();
119
+ return{panels:panels.length,n,legend:[]};
120
+ }
121
+ registerChartType('decomposition',{draw:drawDecomposition,bind:bindDecomposition,freeform:true,labelled:false});
122
+ const __default=drawDecomposition;
123
+ });
124
+ var __entry=__req("packages/modules/chart-decomposition/index.js");
125
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
126
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
127
+ else{
128
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
129
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
130
+ }
131
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,131 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-decomposition module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ (function(root){
7
+ 'use strict';
8
+ var __mods=Object.create(null);
9
+ var __cache=Object.create(null);
10
+ function __def(id,fn){__mods[id]=fn;}
11
+ function __req(id){
12
+ var hit=__cache[id];
13
+ if(hit)return hit;
14
+ var exports=Object.create(null);
15
+ __cache[id]=exports;
16
+ var fn=__mods[id];
17
+ if(!fn)throw new Error('[lattice] missing module: '+id);
18
+ fn(exports,__req);
19
+ return exports;
20
+ }
21
+ var __extmods=Object.create(null);
22
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=(root["LatticeGrid"]||null);
23
+ function __ext(spec){
24
+ var mod=__extmods[spec];
25
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
26
+ if(mod)return mod;
27
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
28
+ 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);
29
+ }
30
+ __def("packages/modules/chart-decomposition/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindDecomposition",{enumerable:true,get:function(){return bindDecomposition;}});
33
+ Object.defineProperty(__exports,"drawDecomposition",{enumerable:true,get:function(){return drawDecomposition;}});
34
+ Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
35
+ const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
36
+ const registerChartType=__m0["registerChartType"];
37
+ const COMPONENTS=[
38
+ {key:'observed',label:'Observed'},
39
+ {key:'trend',label:'Trend'},
40
+ {key:'seasonal',label:'Seasonal'},
41
+ {key:'residual',label:'Residual'},
42
+ ];
43
+ function bindDecomposition(grid,spec){
44
+ const chosen=COMPONENTS.filter((c)=>spec[c.key]);
45
+ const n=grid.rows.count();
46
+ const panels=chosen.map((c)=>({key:c.key,label:c.label,col:spec[c.key],values:[]}));
47
+ for(let i=0;i<n;i++){
48
+ const row=grid.rows.get(i);
49
+ if(!row||row.group)continue;
50
+ for(const panel of panels){
51
+ const v=Number(grid.rows.value(row.key,panel.col));
52
+ panel.values.push(Number.isFinite(v)?v:null);
53
+ }
54
+ }
55
+ const rows=panels.length?panels[0].values.length:0;
56
+ return{panels,n:rows,empty:panels.length===0||rows===0};
57
+ }
58
+ function drawDecomposition(ctx){
59
+ const{
60
+ plot,bound,scheme,fontSize,groups,grid,helpers,
61
+ }=ctx;
62
+ const{
63
+ measureDomain,linearScale,linearTicks,Pool,attrs,path,round,setText,
64
+ formatters,resolveScheme,NS,
65
+ }=helpers;
66
+ const sch=scheme||resolveScheme();
67
+ const{panels,n}=bound;
68
+ const xScale=linearScale({min:0,max:Math.max(1,n-1)},[plot.left,plot.right]);
69
+ const gap=Math.round(fontSize*1.2);
70
+ const panelH=(plot.bottom-plot.top-gap*(panels.length-1))/panels.length;
71
+ const gridPool=new Pool(groups.grid);
72
+ const axisPool=new Pool(groups.axis);
73
+ const marks=new Pool(groups.marks);
74
+ const overlay=new Pool(groups.overlay);
75
+ panels.forEach((panel,p)=>{
76
+ const top=plot.top+p*(panelH+gap);
77
+ const bottom=top+panelH;
78
+ const present=panel.values.filter((v)=>v!==null);
79
+ const domain=measureDomain(present.length?present:[0,1],{zero:panel.key==='residual'});
80
+ const yScale=linearScale(domain,[bottom,top]);
81
+ const colour=sch.series(p);
82
+ attrs(gridPool.next('rect',`${NS}__decomp-frame`),{
83
+ x:round(plot.left),y:round(top),width:round(plot.right-plot.left),height:round(panelH),
84
+ fill:'none',stroke:'currentColor','stroke-opacity':0.12,
85
+ });
86
+ const fmt=formatters(grid,{kind:'linear',step:(domain.max-domain.min)/2||1});
87
+ for(const t of linearTicks(domain,2)){
88
+ const label=axisPool.next('text',`${NS}__tick`);
89
+ setText(label,fmt.tick(t));
90
+ attrs(label,{x:round(plot.left-4),y:round(yScale.of(t)),'text-anchor':'end','font-size':fontSize});
91
+ }
92
+ if(domain.min<0&&domain.max>0){
93
+ attrs(gridPool.next('line',`${NS}__decomp-zero`),{
94
+ x1:round(plot.left),y1:round(yScale.of(0)),x2:round(plot.right),y2:round(yScale.of(0)),
95
+ stroke:'currentColor','stroke-opacity':0.25,
96
+ });
97
+ }
98
+ const label=overlay.next('text',`${NS}__decomp-label`);
99
+ setText(label,panel.label);
100
+ attrs(label,{x:round(plot.left+2),y:round(top+fontSize),'font-size':fontSize});
101
+ const parts=[];
102
+ let pen=false;
103
+ panel.values.forEach((v,i)=>{
104
+ if(v===null){pen=false;return;}
105
+ parts.push(pen?'L':'M',round(xScale.of(i)),round(yScale.of(v)));
106
+ pen=true;
107
+ });
108
+ if(parts.length){
109
+ attrs(marks.next('path',`${NS}__decomp-line ${NS}__mark`),{
110
+ d:path(parts),stroke:colour,'stroke-width':panel.key==='residual'?1:2,fill:'none',
111
+ 'data-panel':panel.key,
112
+ });
113
+ }
114
+ });
115
+ gridPool.finish();
116
+ axisPool.finish();
117
+ marks.finish();
118
+ overlay.finish();
119
+ return{panels:panels.length,n,legend:[]};
120
+ }
121
+ registerChartType('decomposition',{draw:drawDecomposition,bind:bindDecomposition,freeform:true,labelled:false});
122
+ const __default=drawDecomposition;
123
+ });
124
+ var __entry=__req("packages/modules/chart-decomposition/index.js");
125
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
126
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
127
+ else{
128
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
129
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
130
+ }
131
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-diverging module type declarations
2
+ * Lattice Grid 1.63.0, chart-diverging module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-diverging module
2
+ * Lattice Grid 1.63.0, chart-diverging module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,104 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-diverging module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ (function(root){
7
+ 'use strict';
8
+ var __mods=Object.create(null);
9
+ var __cache=Object.create(null);
10
+ function __def(id,fn){__mods[id]=fn;}
11
+ function __req(id){
12
+ var hit=__cache[id];
13
+ if(hit)return hit;
14
+ var exports=Object.create(null);
15
+ __cache[id]=exports;
16
+ var fn=__mods[id];
17
+ if(!fn)throw new Error('[lattice] missing module: '+id);
18
+ fn(exports,__req);
19
+ return exports;
20
+ }
21
+ var __extmods=Object.create(null);
22
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=(root["LatticeGrid"]||null);
23
+ function __ext(spec){
24
+ var mod=__extmods[spec];
25
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
26
+ if(mod)return mod;
27
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
28
+ 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);
29
+ }
30
+ __def("packages/modules/chart-diverging/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"drawDiverging",{enumerable:true,get:function(){return drawDiverging;}});
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 drawDiverging(ctx){
37
+ const{
38
+ plot,bound,scheme,fontSize,groups,grid,helpers,
39
+ }=ctx;
40
+ const{
41
+ measureDomain,linearScale,bandScale,linearTicks,Pool,attrs,round,setText,
42
+ formatters,resolveScheme,NS,
43
+ }=helpers;
44
+ const sch=scheme||resolveScheme();
45
+ const pos=sch.series(0);
46
+ const neg=sch.series(1);
47
+ const series=bound.series&&bound.series[0];
48
+ const points=(series&&series.points)||[];
49
+ if(!points.length)return{empty:true,legend:[]};
50
+ const values=points.map((p)=>p.y).filter((v)=>v!==null);
51
+ const reach=Math.max(1,...values.map((v)=>Math.abs(v)));
52
+ const xDomain=measureDomain([-reach,reach],{zero:true});
53
+ const xScale=linearScale(xDomain,[plot.left,plot.right]);
54
+ const yScale=bandScale(points.map((p)=>p.label),[plot.top,plot.bottom],0.3);
55
+ const zero=xScale.of(0);
56
+ const gridPool=new Pool(groups.grid);
57
+ const axisPool=new Pool(groups.axis);
58
+ const fmt=formatters(grid,{kind:'linear',step:reach/3||1});
59
+ for(const t of linearTicks(xDomain,5)){
60
+ const x=xScale.of(t);
61
+ attrs(gridPool.next('line',`${NS}__gridline`),{
62
+ x1:round(x),y1:round(plot.top),x2:round(x),y2:round(plot.bottom),
63
+ stroke:'currentColor','stroke-opacity':t===0?0.35:0.1,
64
+ });
65
+ const tl=axisPool.next('text',`${NS}__tick`);
66
+ setText(tl,fmt.tick(t));
67
+ attrs(tl,{x:round(x),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
68
+ }
69
+ const marks=new Pool(groups.marks);
70
+ const overlay=new Pool(groups.overlay);
71
+ const bw=yScale.bandwidth;
72
+ for(const p of points){
73
+ if(p.y===null)continue;
74
+ const x=xScale.of(p.y);
75
+ const top=yScale.of(p.label);
76
+ attrs(marks.next('rect',`${NS}__diverging-bar ${NS}__mark`),{
77
+ x:round(Math.min(zero,x)),y:round(top),
78
+ width:round(Math.abs(x-zero)),height:round(bw),
79
+ fill:p.y>=0?pos:neg,'data-value':p.y,
80
+ });
81
+ const label=overlay.next('text',`${NS}__diverging-label`);
82
+ setText(label,String(p.label));
83
+ attrs(label,{
84
+ x:round(p.y>=0?zero-4:zero+4),y:round(top+bw/2),
85
+ 'text-anchor':p.y>=0?'end':'start','font-size':fontSize,
86
+ });
87
+ }
88
+ gridPool.finish();
89
+ axisPool.finish();
90
+ marks.finish();
91
+ overlay.finish();
92
+ return{bars:points.length,legend:[]};
93
+ }
94
+ registerChartType('diverging',{draw:drawDiverging,freeform:true,labelled:false});
95
+ const __default=drawDiverging;
96
+ });
97
+ var __entry=__req("packages/modules/chart-diverging/index.js");
98
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
99
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
100
+ else{
101
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
102
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
103
+ }
104
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,104 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-diverging module
3
+ * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
+ * https://latticegrid.dev
5
+ */
6
+ (function(root){
7
+ 'use strict';
8
+ var __mods=Object.create(null);
9
+ var __cache=Object.create(null);
10
+ function __def(id,fn){__mods[id]=fn;}
11
+ function __req(id){
12
+ var hit=__cache[id];
13
+ if(hit)return hit;
14
+ var exports=Object.create(null);
15
+ __cache[id]=exports;
16
+ var fn=__mods[id];
17
+ if(!fn)throw new Error('[lattice] missing module: '+id);
18
+ fn(exports,__req);
19
+ return exports;
20
+ }
21
+ var __extmods=Object.create(null);
22
+ __extmods["@toclocoinc/lattice-grid/modules/charts"]=(root["LatticeGrid"]||null);
23
+ function __ext(spec){
24
+ var mod=__extmods[spec];
25
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof self!=='undefined'?self:null);
26
+ if(mod)return mod;
27
+ if(spec==="@toclocoinc/lattice-grid/modules/charts"&&g&&g["LatticeGrid"])return g["LatticeGrid"];
28
+ 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);
29
+ }
30
+ __def("packages/modules/chart-diverging/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"drawDiverging",{enumerable:true,get:function(){return drawDiverging;}});
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 drawDiverging(ctx){
37
+ const{
38
+ plot,bound,scheme,fontSize,groups,grid,helpers,
39
+ }=ctx;
40
+ const{
41
+ measureDomain,linearScale,bandScale,linearTicks,Pool,attrs,round,setText,
42
+ formatters,resolveScheme,NS,
43
+ }=helpers;
44
+ const sch=scheme||resolveScheme();
45
+ const pos=sch.series(0);
46
+ const neg=sch.series(1);
47
+ const series=bound.series&&bound.series[0];
48
+ const points=(series&&series.points)||[];
49
+ if(!points.length)return{empty:true,legend:[]};
50
+ const values=points.map((p)=>p.y).filter((v)=>v!==null);
51
+ const reach=Math.max(1,...values.map((v)=>Math.abs(v)));
52
+ const xDomain=measureDomain([-reach,reach],{zero:true});
53
+ const xScale=linearScale(xDomain,[plot.left,plot.right]);
54
+ const yScale=bandScale(points.map((p)=>p.label),[plot.top,plot.bottom],0.3);
55
+ const zero=xScale.of(0);
56
+ const gridPool=new Pool(groups.grid);
57
+ const axisPool=new Pool(groups.axis);
58
+ const fmt=formatters(grid,{kind:'linear',step:reach/3||1});
59
+ for(const t of linearTicks(xDomain,5)){
60
+ const x=xScale.of(t);
61
+ attrs(gridPool.next('line',`${NS}__gridline`),{
62
+ x1:round(x),y1:round(plot.top),x2:round(x),y2:round(plot.bottom),
63
+ stroke:'currentColor','stroke-opacity':t===0?0.35:0.1,
64
+ });
65
+ const tl=axisPool.next('text',`${NS}__tick`);
66
+ setText(tl,fmt.tick(t));
67
+ attrs(tl,{x:round(x),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
68
+ }
69
+ const marks=new Pool(groups.marks);
70
+ const overlay=new Pool(groups.overlay);
71
+ const bw=yScale.bandwidth;
72
+ for(const p of points){
73
+ if(p.y===null)continue;
74
+ const x=xScale.of(p.y);
75
+ const top=yScale.of(p.label);
76
+ attrs(marks.next('rect',`${NS}__diverging-bar ${NS}__mark`),{
77
+ x:round(Math.min(zero,x)),y:round(top),
78
+ width:round(Math.abs(x-zero)),height:round(bw),
79
+ fill:p.y>=0?pos:neg,'data-value':p.y,
80
+ });
81
+ const label=overlay.next('text',`${NS}__diverging-label`);
82
+ setText(label,String(p.label));
83
+ attrs(label,{
84
+ x:round(p.y>=0?zero-4:zero+4),y:round(top+bw/2),
85
+ 'text-anchor':p.y>=0?'end':'start','font-size':fontSize,
86
+ });
87
+ }
88
+ gridPool.finish();
89
+ axisPool.finish();
90
+ marks.finish();
91
+ overlay.finish();
92
+ return{bars:points.length,legend:[]};
93
+ }
94
+ registerChartType('diverging',{draw:drawDiverging,freeform:true,labelled:false});
95
+ const __default=drawDiverging;
96
+ });
97
+ var __entry=__req("packages/modules/chart-diverging/index.js");
98
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
99
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
100
+ else{
101
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
102
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
103
+ }
104
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-dumbbell module type declarations
2
+ * Lattice Grid 1.63.0, chart-dumbbell module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-dumbbell module
2
+ * Lattice Grid 1.63.0, chart-dumbbell module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */