@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,114 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, 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);
@@ -0,0 +1,114 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, 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);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-fan module type declarations
2
+ * Lattice Grid 1.63.0, chart-fan 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-fan module
2
+ * Lattice Grid 1.63.0, chart-fan module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,139 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-fan 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-fan/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindFan",{enumerable:true,get:function(){return bindFan;}});
33
+ Object.defineProperty(__exports,"drawFan",{enumerable:true,get:function(){return drawFan;}});
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 bindFan(grid,spec){
38
+ const yCol=spec.y&&typeof spec.y==='object'?spec.y.col:spec.y;
39
+ const num=(key,col)=>(col?Number(grid.rows.value(key,col)):NaN);
40
+ const points=[];
41
+ const n=grid.rows.count();
42
+ for(let i=0;i<n;i++){
43
+ const row=grid.rows.get(i);
44
+ if(!row||row.group)continue;
45
+ const actual=num(row.key,yCol);
46
+ const forecast=num(row.key,spec.forecast);
47
+ const lo=num(row.key,spec.lower);
48
+ const hi=num(row.key,spec.upper);
49
+ const label=spec.x?grid.rows.text(row.key,spec.x):String(points.length);
50
+ points.push({
51
+ i:points.length,
52
+ label,
53
+ actual:Number.isFinite(actual)?actual:null,
54
+ forecast:Number.isFinite(forecast)?forecast:null,
55
+ lo:Number.isFinite(lo)?lo:null,
56
+ hi:Number.isFinite(hi)?hi:null,
57
+ });
58
+ }
59
+ return{points,empty:points.length===0};
60
+ }
61
+ function drawFan(ctx){
62
+ const{
63
+ plot,bound,scheme,fontSize,groups,grid,helpers,
64
+ }=ctx;
65
+ const{
66
+ measureDomain,linearScale,linearTicks,Pool,attrs,path,round,setText,
67
+ formatters,resolveScheme,NS,
68
+ }=helpers;
69
+ const sch=scheme||resolveScheme();
70
+ const colour=sch.series(0);
71
+ const points=bound.points;
72
+ const values=[];
73
+ for(const p of points)for(const v of[p.actual,p.forecast,p.lo,p.hi])if(v!==null)values.push(v);
74
+ if(!values.length)return{empty:true,legend:[]};
75
+ const yDomain=measureDomain(values,{zero:false});
76
+ const xScale=linearScale({min:0,max:Math.max(1,points.length-1)},[plot.left,plot.right]);
77
+ const yScale=linearScale(yDomain,[plot.bottom,plot.top]);
78
+ const gridPool=new Pool(groups.grid);
79
+ const axisPool=new Pool(groups.axis);
80
+ const fmt=formatters(grid,{kind:'linear',step:(yDomain.max-yDomain.min)/5||1});
81
+ for(const t of linearTicks(yDomain,5)){
82
+ const y=yScale.of(t);
83
+ attrs(gridPool.next('line',`${NS}__gridline`),{
84
+ x1:round(plot.left),y1:round(y),x2:round(plot.right),y2:round(y),
85
+ stroke:'currentColor','stroke-opacity':0.1,
86
+ });
87
+ const label=axisPool.next('text',`${NS}__tick`);
88
+ setText(label,fmt.tick(t));
89
+ attrs(label,{x:round(plot.left-4),y:round(y),'text-anchor':'end','font-size':fontSize});
90
+ }
91
+ const marks=new Pool(groups.marks);
92
+ const band=points.filter((p)=>p.lo!==null&&p.hi!==null);
93
+ if(band.length>=2){
94
+ const parts=['M'];
95
+ band.forEach((p,i)=>{
96
+ parts.push(round(xScale.of(p.i)),round(yScale.of(p.hi)));
97
+ if(i<band.length-1)parts.push('L');
98
+ });
99
+ for(let i=band.length-1;i>=0;i--){
100
+ parts.push('L',round(xScale.of(band[i].i)),round(yScale.of(band[i].lo)));
101
+ }
102
+ parts.push('Z');
103
+ attrs(marks.next('path',`${NS}__fan-band ${NS}__mark`),{
104
+ d:path(parts),fill:colour,'fill-opacity':0.18,stroke:'none',
105
+ });
106
+ }
107
+ const line=(field,cls,dash)=>{
108
+ const seq=points.filter((p)=>p[field]!==null);
109
+ if(seq.length<1)return;
110
+ const parts=['M'];
111
+ seq.forEach((p,i)=>{
112
+ parts.push(round(xScale.of(p.i)),round(yScale.of(p[field])));
113
+ if(i<seq.length-1)parts.push('L');
114
+ });
115
+ const el=marks.next('path',`${cls} ${NS}__mark`);
116
+ const a={d:path(parts),stroke:colour,'stroke-width':2,fill:'none'};
117
+ if(dash)a['stroke-dasharray']=dash;
118
+ attrs(el,a);
119
+ };
120
+ line('actual',`${NS}__fan-actual`,'');
121
+ line('forecast',`${NS}__fan-forecast`,'5 4');
122
+ gridPool.finish();
123
+ axisPool.finish();
124
+ marks.finish();
125
+ return{
126
+ points:points.length,band:band.length,xScale,yScale,legend:[],
127
+ };
128
+ }
129
+ registerChartType('fan',{draw:drawFan,bind:bindFan,labelled:false});
130
+ const __default=drawFan;
131
+ });
132
+ var __entry=__req("packages/modules/chart-fan/index.js");
133
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
134
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
135
+ else{
136
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
137
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
138
+ }
139
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,139 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-fan 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-fan/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindFan",{enumerable:true,get:function(){return bindFan;}});
33
+ Object.defineProperty(__exports,"drawFan",{enumerable:true,get:function(){return drawFan;}});
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 bindFan(grid,spec){
38
+ const yCol=spec.y&&typeof spec.y==='object'?spec.y.col:spec.y;
39
+ const num=(key,col)=>(col?Number(grid.rows.value(key,col)):NaN);
40
+ const points=[];
41
+ const n=grid.rows.count();
42
+ for(let i=0;i<n;i++){
43
+ const row=grid.rows.get(i);
44
+ if(!row||row.group)continue;
45
+ const actual=num(row.key,yCol);
46
+ const forecast=num(row.key,spec.forecast);
47
+ const lo=num(row.key,spec.lower);
48
+ const hi=num(row.key,spec.upper);
49
+ const label=spec.x?grid.rows.text(row.key,spec.x):String(points.length);
50
+ points.push({
51
+ i:points.length,
52
+ label,
53
+ actual:Number.isFinite(actual)?actual:null,
54
+ forecast:Number.isFinite(forecast)?forecast:null,
55
+ lo:Number.isFinite(lo)?lo:null,
56
+ hi:Number.isFinite(hi)?hi:null,
57
+ });
58
+ }
59
+ return{points,empty:points.length===0};
60
+ }
61
+ function drawFan(ctx){
62
+ const{
63
+ plot,bound,scheme,fontSize,groups,grid,helpers,
64
+ }=ctx;
65
+ const{
66
+ measureDomain,linearScale,linearTicks,Pool,attrs,path,round,setText,
67
+ formatters,resolveScheme,NS,
68
+ }=helpers;
69
+ const sch=scheme||resolveScheme();
70
+ const colour=sch.series(0);
71
+ const points=bound.points;
72
+ const values=[];
73
+ for(const p of points)for(const v of[p.actual,p.forecast,p.lo,p.hi])if(v!==null)values.push(v);
74
+ if(!values.length)return{empty:true,legend:[]};
75
+ const yDomain=measureDomain(values,{zero:false});
76
+ const xScale=linearScale({min:0,max:Math.max(1,points.length-1)},[plot.left,plot.right]);
77
+ const yScale=linearScale(yDomain,[plot.bottom,plot.top]);
78
+ const gridPool=new Pool(groups.grid);
79
+ const axisPool=new Pool(groups.axis);
80
+ const fmt=formatters(grid,{kind:'linear',step:(yDomain.max-yDomain.min)/5||1});
81
+ for(const t of linearTicks(yDomain,5)){
82
+ const y=yScale.of(t);
83
+ attrs(gridPool.next('line',`${NS}__gridline`),{
84
+ x1:round(plot.left),y1:round(y),x2:round(plot.right),y2:round(y),
85
+ stroke:'currentColor','stroke-opacity':0.1,
86
+ });
87
+ const label=axisPool.next('text',`${NS}__tick`);
88
+ setText(label,fmt.tick(t));
89
+ attrs(label,{x:round(plot.left-4),y:round(y),'text-anchor':'end','font-size':fontSize});
90
+ }
91
+ const marks=new Pool(groups.marks);
92
+ const band=points.filter((p)=>p.lo!==null&&p.hi!==null);
93
+ if(band.length>=2){
94
+ const parts=['M'];
95
+ band.forEach((p,i)=>{
96
+ parts.push(round(xScale.of(p.i)),round(yScale.of(p.hi)));
97
+ if(i<band.length-1)parts.push('L');
98
+ });
99
+ for(let i=band.length-1;i>=0;i--){
100
+ parts.push('L',round(xScale.of(band[i].i)),round(yScale.of(band[i].lo)));
101
+ }
102
+ parts.push('Z');
103
+ attrs(marks.next('path',`${NS}__fan-band ${NS}__mark`),{
104
+ d:path(parts),fill:colour,'fill-opacity':0.18,stroke:'none',
105
+ });
106
+ }
107
+ const line=(field,cls,dash)=>{
108
+ const seq=points.filter((p)=>p[field]!==null);
109
+ if(seq.length<1)return;
110
+ const parts=['M'];
111
+ seq.forEach((p,i)=>{
112
+ parts.push(round(xScale.of(p.i)),round(yScale.of(p[field])));
113
+ if(i<seq.length-1)parts.push('L');
114
+ });
115
+ const el=marks.next('path',`${cls} ${NS}__mark`);
116
+ const a={d:path(parts),stroke:colour,'stroke-width':2,fill:'none'};
117
+ if(dash)a['stroke-dasharray']=dash;
118
+ attrs(el,a);
119
+ };
120
+ line('actual',`${NS}__fan-actual`,'');
121
+ line('forecast',`${NS}__fan-forecast`,'5 4');
122
+ gridPool.finish();
123
+ axisPool.finish();
124
+ marks.finish();
125
+ return{
126
+ points:points.length,band:band.length,xScale,yScale,legend:[],
127
+ };
128
+ }
129
+ registerChartType('fan',{draw:drawFan,bind:bindFan,labelled:false});
130
+ const __default=drawFan;
131
+ });
132
+ var __entry=__req("packages/modules/chart-fan/index.js");
133
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
134
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
135
+ else{
136
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
137
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
138
+ }
139
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-hexbin module type declarations
2
+ * Lattice Grid 1.63.0, chart-hexbin 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-hexbin module
2
+ * Lattice Grid 1.63.0, chart-hexbin module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,148 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-hexbin 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-hexbin/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindHexbin",{enumerable:true,get:function(){return bindHexbin;}});
33
+ Object.defineProperty(__exports,"drawHexbin",{enumerable:true,get:function(){return drawHexbin;}});
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 DEFAULT_RADIUS=10;
38
+ function bindHexbin(grid,spec){
39
+ const xCol=spec.x;
40
+ const yCol=spec.y&&typeof spec.y==='object'?spec.y.col:spec.y;
41
+ const points=[];
42
+ const n=grid.rows.count();
43
+ for(let i=0;i<n;i++){
44
+ const row=grid.rows.get(i);
45
+ if(!row||row.group)continue;
46
+ const x=Number(grid.rows.value(row.key,xCol));
47
+ const y=Number(grid.rows.value(row.key,yCol));
48
+ if(Number.isFinite(x)&&Number.isFinite(y))points.push({x,y});
49
+ }
50
+ return{points,xCol,yCol,empty:points.length===0};
51
+ }
52
+ function binHex(pts,r){
53
+ const dx=r*2*Math.sin(Math.PI/3);
54
+ const dy=r*1.5;
55
+ const bins=new Map();
56
+ for(const{px,py}of pts){
57
+ const y=py/dy;
58
+ let pj=Math.round(y);
59
+ const x=px/dx-(pj&1)/2;
60
+ let pi=Math.round(x);
61
+ const py1=y-pj;
62
+ if(Math.abs(py1)*3>1){
63
+ const px1=x-pi;
64
+ const pi2=pi+(x<pi?-1:1)/2;
65
+ const pj2=pj+(y<pj?-1:1);
66
+ const px2=x-pi2;
67
+ const py2=y-pj2;
68
+ if(px1*px1+py1*py1>px2*px2+py2*py2){pi=pi2+((pj&1)?1:-1)/2;pj=pj2;}
69
+ }
70
+ const k=`${pi}:${pj}`;
71
+ let bin=bins.get(k);
72
+ if(!bin){bin={x:(pi+(pj&1)/2)*dx,y:pj*dy,count:0};bins.set(k,bin);}
73
+ bin.count+=1;
74
+ }
75
+ return[...bins.values()];
76
+ }
77
+ function drawHexbin(ctx){
78
+ const{
79
+ plot,bound,scheme,fontSize,groups,grid,spec,helpers,
80
+ }=ctx;
81
+ const{
82
+ extent,measureDomain,linearScale,linearTicks,colourRamp,
83
+ Pool,attrs,path,round,setText,formatters,resolveScheme,NS,
84
+ }=helpers;
85
+ const sch=scheme||resolveScheme();
86
+ const xDomain=extent(bound.points.map((p)=>p.x))||{min:0,max:1};
87
+ const yDomain=extent(bound.points.map((p)=>p.y))||{min:0,max:1};
88
+ const xScale=linearScale(xDomain,[plot.left,plot.right]);
89
+ const yScale=linearScale(yDomain,[plot.bottom,plot.top]);
90
+ const radius=spec&&Number.isFinite(spec.radius)&&spec.radius>0?spec.radius:DEFAULT_RADIUS;
91
+ const pixels=bound.points.map((p)=>({px:xScale.of(p.x),py:yScale.of(p.y)}));
92
+ const bins=binHex(pixels,radius);
93
+ if(!bins.length)return{empty:true,legend:[]};
94
+ let maxCount=0;
95
+ for(const b of bins)if(b.count>maxCount)maxCount=b.count;
96
+ const countDomain=measureDomain([0,maxCount],{zero:true});
97
+ const ramp=colourRamp(countDomain,false,sch);
98
+ const gridPool=new Pool(groups.grid);
99
+ const axisPool=new Pool(groups.axis);
100
+ const xFmt=formatters(grid,{kind:'linear',step:(xDomain.max-xDomain.min)/5||1});
101
+ const yFmt=formatters(grid,{kind:'linear',step:(yDomain.max-yDomain.min)/5||1});
102
+ for(const t of linearTicks(xDomain,5)){
103
+ const x=xScale.of(t);
104
+ const label=axisPool.next('text',`${NS}__tick`);
105
+ setText(label,xFmt.tick(t));
106
+ attrs(label,{x:round(x),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
107
+ }
108
+ for(const t of linearTicks(yDomain,5)){
109
+ const y=yScale.of(t);
110
+ attrs(gridPool.next('line',`${NS}__gridline`),{
111
+ x1:round(plot.left),y1:round(y),x2:round(plot.right),y2:round(y),
112
+ stroke:'currentColor','stroke-opacity':0.1,
113
+ });
114
+ const label=axisPool.next('text',`${NS}__tick`);
115
+ setText(label,yFmt.tick(t));
116
+ attrs(label,{x:round(plot.left-4),y:round(y),'text-anchor':'end','font-size':fontSize});
117
+ }
118
+ const third=Math.PI/3;
119
+ const hex=[];
120
+ for(let i=0;i<6;i++)hex.push([Math.sin(i*third)*radius,-Math.cos(i*third)*radius]);
121
+ const marks=new Pool(groups.marks);
122
+ for(const bin of bins){
123
+ const parts=['M'];
124
+ for(let i=0;i<6;i++){
125
+ parts.push(round(bin.x+hex[i][0]),round(bin.y+hex[i][1]));
126
+ if(i<5)parts.push('L');
127
+ }
128
+ parts.push('Z');
129
+ attrs(marks.next('path',`${NS}__hex ${NS}__mark`),{
130
+ d:path(parts),fill:ramp(bin.count),stroke:'none','data-count':bin.count,
131
+ });
132
+ }
133
+ gridPool.finish();
134
+ axisPool.finish();
135
+ marks.finish();
136
+ return{bins:bins.length,maxCount,legend:[]};
137
+ }
138
+ registerChartType('hexbin',{draw:drawHexbin,bind:bindHexbin,labelled:false});
139
+ const __default=drawHexbin;
140
+ });
141
+ var __entry=__req("packages/modules/chart-hexbin/index.js");
142
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
143
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
144
+ else{
145
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
146
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
147
+ }
148
+ })(typeof globalThis!=='undefined'?globalThis:this);