@toclocoinc/lattice-grid 1.61.0 → 1.62.1

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 (149) hide show
  1. package/README.md +23 -8
  2. package/docs/API.html +16 -14
  3. package/docs/api-detail.html +863 -17
  4. package/lattice-grid.d.ts +22 -11
  5. package/lattice-grid.esm.min.js +525 -53
  6. package/lattice-grid.min.cjs +525 -53
  7. package/lattice-grid.min.css +1 -1
  8. package/lattice-grid.min.js +525 -53
  9. package/modules/ai.d.ts +11 -2
  10. package/modules/ai.esm.min.js +6 -4
  11. package/modules/ai.min.cjs +6 -4
  12. package/modules/ai.min.js +6 -4
  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 +1 -1
  27. package/modules/chart-bubblemap.min.cjs +90 -0
  28. package/modules/chart-bubblemap.min.js +90 -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 +1 -1
  59. package/modules/chart-hexmap.min.cjs +124 -0
  60. package/modules/chart-hexmap.min.js +124 -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 +17 -11
  91. package/modules/charts.min.cjs +17 -11
  92. package/modules/charts.min.js +17 -11
  93. package/modules/data-router.d.ts +1 -1
  94. package/modules/data-router.esm.min.js +4 -4
  95. package/modules/data-router.min.cjs +4 -4
  96. package/modules/data-router.min.js +4 -4
  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 -4
  103. package/modules/dhtmlx-compat.min.cjs +4 -4
  104. package/modules/dhtmlx-compat.min.js +4 -4
  105. package/modules/gantt.d.ts +1 -1
  106. package/modules/gantt.esm.min.js +4 -4
  107. package/modules/gantt.min.cjs +4 -4
  108. package/modules/gantt.min.js +4 -4
  109. package/modules/htmx.d.ts +1 -1
  110. package/modules/htmx.esm.min.js +525 -53
  111. package/modules/htmx.min.cjs +525 -53
  112. package/modules/htmx.min.js +525 -53
  113. package/modules/kanban.d.ts +1 -1
  114. package/modules/kanban.esm.min.js +4 -4
  115. package/modules/kanban.min.cjs +4 -4
  116. package/modules/kanban.min.js +4 -4
  117. package/modules/kpi.d.ts +1 -1
  118. package/modules/kpi.esm.min.js +19 -6
  119. package/modules/kpi.min.cjs +19 -6
  120. package/modules/kpi.min.js +19 -6
  121. package/modules/layout.d.ts +1 -1
  122. package/modules/layout.esm.min.js +4 -4
  123. package/modules/layout.min.cjs +4 -4
  124. package/modules/layout.min.js +4 -4
  125. package/modules/mock-socket.d.ts +1 -1
  126. package/modules/mock-socket.esm.min.js +2 -2
  127. package/modules/mock-socket.min.cjs +2 -2
  128. package/modules/mock-socket.min.js +2 -2
  129. package/modules/react.d.ts +1 -1
  130. package/modules/react.esm.min.js +2 -2
  131. package/modules/react.min.cjs +2 -2
  132. package/modules/react.min.js +2 -2
  133. package/modules/svelte.d.ts +1 -1
  134. package/modules/svelte.esm.min.js +2 -2
  135. package/modules/svelte.min.cjs +2 -2
  136. package/modules/svelte.min.js +2 -2
  137. package/modules/tabs.d.ts +1 -1
  138. package/modules/tabs.esm.min.js +4 -4
  139. package/modules/tabs.min.cjs +4 -4
  140. package/modules/tabs.min.js +4 -4
  141. package/modules/vue.d.ts +1 -1
  142. package/modules/vue.esm.min.js +2 -2
  143. package/modules/vue.min.cjs +2 -2
  144. package/modules/vue.min.js +2 -2
  145. package/modules/webcomponent.d.ts +1 -1
  146. package/modules/webcomponent.esm.min.js +525 -53
  147. package/modules/webcomponent.min.cjs +525 -53
  148. package/modules/webcomponent.min.js +525 -53
  149. package/package.json +1 -1
@@ -0,0 +1,131 @@
1
+ /*!
2
+ * Lattice Grid 1.62.1, 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.62.1, 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.61.0, chart-diverging module type declarations
2
+ * Lattice Grid 1.62.1, 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.61.0, chart-diverging module
2
+ * Lattice Grid 1.62.1, 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.62.1, 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.62.1, 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.61.0, chart-dumbbell module type declarations
2
+ * Lattice Grid 1.62.1, 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.61.0, chart-dumbbell module
2
+ * Lattice Grid 1.62.1, chart-dumbbell module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,114 @@
1
+ /*!
2
+ * Lattice Grid 1.62.1, chart-dumbbell 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-dumbbell/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindDumbbell",{enumerable:true,get:function(){return bindDumbbell;}});
33
+ Object.defineProperty(__exports,"drawDumbbell",{enumerable:true,get:function(){return drawDumbbell;}});
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
+ function bindDumbbell(grid,spec){
38
+ const rows=[];
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 start=Number(grid.rows.value(row.key,spec.start));
44
+ const end=Number(grid.rows.value(row.key,spec.end));
45
+ if(!Number.isFinite(start)||!Number.isFinite(end))continue;
46
+ rows.push({label:spec.x?grid.rows.text(row.key,spec.x):String(rows.length),start,end});
47
+ }
48
+ return{rows,empty:rows.length===0};
49
+ }
50
+ function drawDumbbell(ctx){
51
+ const{
52
+ plot,bound,scheme,fontSize,groups,grid,helpers,
53
+ }=ctx;
54
+ const{
55
+ measureDomain,linearScale,bandScale,linearTicks,Pool,attrs,path,round,setText,
56
+ formatters,resolveScheme,NS,
57
+ }=helpers;
58
+ const sch=scheme||resolveScheme();
59
+ const startColour=sch.series(0);
60
+ const endColour=sch.series(1);
61
+ const{rows}=bound;
62
+ const values=[];
63
+ for(const r of rows)values.push(r.start,r.end);
64
+ const xDomain=measureDomain(values,{zero:false});
65
+ const xScale=linearScale(xDomain,[plot.left,plot.right]);
66
+ const yScale=bandScale(rows.map((r)=>r.label),[plot.top,plot.bottom],0.4);
67
+ const gridPool=new Pool(groups.grid);
68
+ const axisPool=new Pool(groups.axis);
69
+ const fmt=formatters(grid,{kind:'linear',step:(xDomain.max-xDomain.min)/5||1});
70
+ for(const t of linearTicks(xDomain,5)){
71
+ const x=xScale.of(t);
72
+ attrs(gridPool.next('line',`${NS}__gridline`),{
73
+ x1:round(x),y1:round(plot.top),x2:round(x),y2:round(plot.bottom),stroke:'currentColor','stroke-opacity':0.1,
74
+ });
75
+ const tl=axisPool.next('text',`${NS}__tick`);
76
+ setText(tl,fmt.tick(t));
77
+ attrs(tl,{x:round(x),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
78
+ }
79
+ const marks=new Pool(groups.marks);
80
+ const overlay=new Pool(groups.overlay);
81
+ const bw=yScale.bandwidth;
82
+ for(const r of rows){
83
+ const cy=yScale.of(r.label)+bw/2;
84
+ attrs(marks.next('path',`${NS}__dumbbell-bar ${NS}__mark`),{
85
+ d:path(['M',round(xScale.of(r.start)),round(cy),'L',round(xScale.of(r.end)),round(cy)]),
86
+ stroke:'currentColor','stroke-opacity':0.35,'stroke-width':2,fill:'none',
87
+ });
88
+ attrs(marks.next('circle',`${NS}__dumbbell-start ${NS}__mark`),{
89
+ cx:round(xScale.of(r.start)),cy:round(cy),r:4,fill:startColour,
90
+ });
91
+ attrs(marks.next('circle',`${NS}__dumbbell-end ${NS}__mark`),{
92
+ cx:round(xScale.of(r.end)),cy:round(cy),r:4,fill:endColour,
93
+ });
94
+ const label=overlay.next('text',`${NS}__dumbbell-label`);
95
+ setText(label,String(r.label));
96
+ attrs(label,{x:round(plot.left-4),y:round(cy),'text-anchor':'end','font-size':fontSize});
97
+ }
98
+ gridPool.finish();
99
+ axisPool.finish();
100
+ marks.finish();
101
+ overlay.finish();
102
+ return{rows:rows.length,legend:[]};
103
+ }
104
+ registerChartType('dumbbell',{draw:drawDumbbell,bind:bindDumbbell,freeform:true,labelled:false});
105
+ const __default=drawDumbbell;
106
+ });
107
+ var __entry=__req("packages/modules/chart-dumbbell/index.js");
108
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
109
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
110
+ else{
111
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
112
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
113
+ }
114
+ })(typeof globalThis!=='undefined'?globalThis:this);