@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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-alluvial module type declarations
2
+ * Lattice Grid 1.63.0, chart-alluvial 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-alluvial module
2
+ * Lattice Grid 1.63.0, chart-alluvial module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,147 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-alluvial 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-alluvial/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindAlluvial",{enumerable:true,get:function(){return bindAlluvial;}});
33
+ Object.defineProperty(__exports,"drawAlluvial",{enumerable:true,get:function(){return drawAlluvial;}});
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 bindAlluvial(grid,spec){
38
+ const flows=new Map();
39
+ const sources=[];
40
+ const targets=[];
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 s=String(grid.rows.text(row.key,spec.source));
46
+ const t=String(grid.rows.text(row.key,spec.target));
47
+ const v=spec.value?Number(grid.rows.value(row.key,spec.value)):1;
48
+ if(!Number.isFinite(v)||v<=0)continue;
49
+ if(!sources.includes(s))sources.push(s);
50
+ if(!targets.includes(t))targets.push(t);
51
+ const k=`${s}\u0001${t}`;
52
+ flows.set(k,(flows.get(k)||0)+v);
53
+ }
54
+ const list=[...flows.entries()].map(([k,value])=>{
55
+ const[source,target]=k.split('\u0001');
56
+ return{source,target,value};
57
+ });
58
+ return{flows:list,sources,targets,empty:list.length===0};
59
+ }
60
+ function drawAlluvial(ctx){
61
+ const{
62
+ plot,bound,scheme,fontSize,groups,helpers,
63
+ }=ctx;
64
+ const{
65
+ Pool,attrs,path,round,setText,resolveScheme,NS,
66
+ }=helpers;
67
+ const sch=scheme||resolveScheme();
68
+ const{flows,sources,targets}=bound;
69
+ const total=flows.reduce((t,f)=>t+f.value,0)||1;
70
+ const gap=Math.min(8,(plot.bottom-plot.top)*0.02);
71
+ const nodeW=Math.max(6,(plot.right-plot.left)*0.03);
72
+ const height=(plot.bottom-plot.top);
73
+ const stack=(names,weight)=>{
74
+ const totals=names.map(weight);
75
+ const sum=totals.reduce((t,v)=>t+v,0)||1;
76
+ const usable=height-gap*(names.length-1);
77
+ const bands=new Map();
78
+ let y=plot.top;
79
+ names.forEach((name,i)=>{
80
+ const h=(totals[i]/sum)*usable;
81
+ bands.set(name,{y0:y,y1:y+h,cursor:y});
82
+ y+=h+gap;
83
+ });
84
+ return bands;
85
+ };
86
+ const srcWeight=(s)=>flows.filter((f)=>f.source===s).reduce((t,f)=>t+f.value,0);
87
+ const tgtWeight=(t)=>flows.filter((f)=>f.target===t).reduce((a,f)=>a+f.value,0);
88
+ const left=stack(sources,srcWeight);
89
+ const right=stack(targets,tgtWeight);
90
+ const marks=new Pool(groups.marks);
91
+ const overlay=new Pool(groups.overlay);
92
+ sources.forEach((s,i)=>{
93
+ const b=left.get(s);
94
+ attrs(marks.next('rect',`${NS}__alluvial-node ${NS}__mark`),{
95
+ x:round(plot.left),y:round(b.y0),width:round(nodeW),height:round(Math.max(1,b.y1-b.y0)),
96
+ fill:sch.series(i),
97
+ });
98
+ const label=overlay.next('text',`${NS}__alluvial-label`);
99
+ setText(label,s);
100
+ attrs(label,{x:round(plot.left+nodeW+2),y:round((b.y0+b.y1)/2),'font-size':fontSize});
101
+ });
102
+ targets.forEach((t)=>{
103
+ const b=right.get(t);
104
+ attrs(marks.next('rect',`${NS}__alluvial-node ${NS}__mark`),{
105
+ x:round(plot.right-nodeW),y:round(b.y0),width:round(nodeW),height:round(Math.max(1,b.y1-b.y0)),
106
+ fill:'currentColor','fill-opacity':0.4,
107
+ });
108
+ const label=overlay.next('text',`${NS}__alluvial-label`);
109
+ setText(label,t);
110
+ attrs(label,{x:round(plot.right-nodeW-2),y:round((b.y0+b.y1)/2),'text-anchor':'end','font-size':fontSize});
111
+ });
112
+ const x0=plot.left+nodeW;
113
+ const x1=plot.right-nodeW;
114
+ const xm=(x0+x1)/2;
115
+ for(const f of flows){
116
+ const b0=left.get(f.source);
117
+ const b1=right.get(f.target);
118
+ const h=(f.value/total)*(height-gap*(Math.max(sources.length,targets.length)-1));
119
+ const sy=b0.cursor;b0.cursor+=h;
120
+ const ty=b1.cursor;b1.cursor+=h;
121
+ const si=sources.indexOf(f.source);
122
+ attrs(marks.next('path',`${NS}__alluvial-flow ${NS}__mark`),{
123
+ d:path([
124
+ 'M',round(x0),round(sy),
125
+ 'C',round(xm),round(sy),round(xm),round(ty),round(x1),round(ty),
126
+ 'L',round(x1),round(ty+h),
127
+ 'C',round(xm),round(ty+h),round(xm),round(sy+h),round(x0),round(sy+h),
128
+ 'Z',
129
+ ]),
130
+ fill:sch.series(si),'fill-opacity':0.35,stroke:'none','data-value':f.value,
131
+ });
132
+ }
133
+ marks.finish();
134
+ overlay.finish();
135
+ return{flows:flows.length,legend:[]};
136
+ }
137
+ registerChartType('alluvial',{draw:drawAlluvial,bind:bindAlluvial,freeform:true,labelled:false});
138
+ const __default=drawAlluvial;
139
+ });
140
+ var __entry=__req("packages/modules/chart-alluvial/index.js");
141
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
142
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
143
+ else{
144
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
145
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
146
+ }
147
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,147 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-alluvial 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-alluvial/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindAlluvial",{enumerable:true,get:function(){return bindAlluvial;}});
33
+ Object.defineProperty(__exports,"drawAlluvial",{enumerable:true,get:function(){return drawAlluvial;}});
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 bindAlluvial(grid,spec){
38
+ const flows=new Map();
39
+ const sources=[];
40
+ const targets=[];
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 s=String(grid.rows.text(row.key,spec.source));
46
+ const t=String(grid.rows.text(row.key,spec.target));
47
+ const v=spec.value?Number(grid.rows.value(row.key,spec.value)):1;
48
+ if(!Number.isFinite(v)||v<=0)continue;
49
+ if(!sources.includes(s))sources.push(s);
50
+ if(!targets.includes(t))targets.push(t);
51
+ const k=`${s}\u0001${t}`;
52
+ flows.set(k,(flows.get(k)||0)+v);
53
+ }
54
+ const list=[...flows.entries()].map(([k,value])=>{
55
+ const[source,target]=k.split('\u0001');
56
+ return{source,target,value};
57
+ });
58
+ return{flows:list,sources,targets,empty:list.length===0};
59
+ }
60
+ function drawAlluvial(ctx){
61
+ const{
62
+ plot,bound,scheme,fontSize,groups,helpers,
63
+ }=ctx;
64
+ const{
65
+ Pool,attrs,path,round,setText,resolveScheme,NS,
66
+ }=helpers;
67
+ const sch=scheme||resolveScheme();
68
+ const{flows,sources,targets}=bound;
69
+ const total=flows.reduce((t,f)=>t+f.value,0)||1;
70
+ const gap=Math.min(8,(plot.bottom-plot.top)*0.02);
71
+ const nodeW=Math.max(6,(plot.right-plot.left)*0.03);
72
+ const height=(plot.bottom-plot.top);
73
+ const stack=(names,weight)=>{
74
+ const totals=names.map(weight);
75
+ const sum=totals.reduce((t,v)=>t+v,0)||1;
76
+ const usable=height-gap*(names.length-1);
77
+ const bands=new Map();
78
+ let y=plot.top;
79
+ names.forEach((name,i)=>{
80
+ const h=(totals[i]/sum)*usable;
81
+ bands.set(name,{y0:y,y1:y+h,cursor:y});
82
+ y+=h+gap;
83
+ });
84
+ return bands;
85
+ };
86
+ const srcWeight=(s)=>flows.filter((f)=>f.source===s).reduce((t,f)=>t+f.value,0);
87
+ const tgtWeight=(t)=>flows.filter((f)=>f.target===t).reduce((a,f)=>a+f.value,0);
88
+ const left=stack(sources,srcWeight);
89
+ const right=stack(targets,tgtWeight);
90
+ const marks=new Pool(groups.marks);
91
+ const overlay=new Pool(groups.overlay);
92
+ sources.forEach((s,i)=>{
93
+ const b=left.get(s);
94
+ attrs(marks.next('rect',`${NS}__alluvial-node ${NS}__mark`),{
95
+ x:round(plot.left),y:round(b.y0),width:round(nodeW),height:round(Math.max(1,b.y1-b.y0)),
96
+ fill:sch.series(i),
97
+ });
98
+ const label=overlay.next('text',`${NS}__alluvial-label`);
99
+ setText(label,s);
100
+ attrs(label,{x:round(plot.left+nodeW+2),y:round((b.y0+b.y1)/2),'font-size':fontSize});
101
+ });
102
+ targets.forEach((t)=>{
103
+ const b=right.get(t);
104
+ attrs(marks.next('rect',`${NS}__alluvial-node ${NS}__mark`),{
105
+ x:round(plot.right-nodeW),y:round(b.y0),width:round(nodeW),height:round(Math.max(1,b.y1-b.y0)),
106
+ fill:'currentColor','fill-opacity':0.4,
107
+ });
108
+ const label=overlay.next('text',`${NS}__alluvial-label`);
109
+ setText(label,t);
110
+ attrs(label,{x:round(plot.right-nodeW-2),y:round((b.y0+b.y1)/2),'text-anchor':'end','font-size':fontSize});
111
+ });
112
+ const x0=plot.left+nodeW;
113
+ const x1=plot.right-nodeW;
114
+ const xm=(x0+x1)/2;
115
+ for(const f of flows){
116
+ const b0=left.get(f.source);
117
+ const b1=right.get(f.target);
118
+ const h=(f.value/total)*(height-gap*(Math.max(sources.length,targets.length)-1));
119
+ const sy=b0.cursor;b0.cursor+=h;
120
+ const ty=b1.cursor;b1.cursor+=h;
121
+ const si=sources.indexOf(f.source);
122
+ attrs(marks.next('path',`${NS}__alluvial-flow ${NS}__mark`),{
123
+ d:path([
124
+ 'M',round(x0),round(sy),
125
+ 'C',round(xm),round(sy),round(xm),round(ty),round(x1),round(ty),
126
+ 'L',round(x1),round(ty+h),
127
+ 'C',round(xm),round(ty+h),round(xm),round(sy+h),round(x0),round(sy+h),
128
+ 'Z',
129
+ ]),
130
+ fill:sch.series(si),'fill-opacity':0.35,stroke:'none','data-value':f.value,
131
+ });
132
+ }
133
+ marks.finish();
134
+ overlay.finish();
135
+ return{flows:flows.length,legend:[]};
136
+ }
137
+ registerChartType('alluvial',{draw:drawAlluvial,bind:bindAlluvial,freeform:true,labelled:false});
138
+ const __default=drawAlluvial;
139
+ });
140
+ var __entry=__req("packages/modules/chart-alluvial/index.js");
141
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
142
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
143
+ else{
144
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
145
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
146
+ }
147
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-arc module type declarations
2
+ * Lattice Grid 1.63.0, chart-arc 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-arc module
2
+ * Lattice Grid 1.63.0, chart-arc module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,106 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-arc 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-arc/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindArc",{enumerable:true,get:function(){return bindArc;}});
33
+ Object.defineProperty(__exports,"drawArc",{enumerable:true,get:function(){return drawArc;}});
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 bindArc(grid,spec){
38
+ const nodes=[];
39
+ const links=[];
40
+ const n=grid.rows.count();
41
+ for(let i=0;i<n;i++){
42
+ const row=grid.rows.get(i);
43
+ if(!row||row.group)continue;
44
+ const s=String(grid.rows.text(row.key,spec.source));
45
+ const t=String(grid.rows.text(row.key,spec.target));
46
+ if(!s||!t||s==='undefined'||t==='undefined')continue;
47
+ const v=spec.value?Number(grid.rows.value(row.key,spec.value)):1;
48
+ if(!nodes.includes(s))nodes.push(s);
49
+ if(!nodes.includes(t))nodes.push(t);
50
+ links.push({source:s,target:t,value:Number.isFinite(v)&&v>0?v:1});
51
+ }
52
+ return{nodes,links,empty:links.length===0};
53
+ }
54
+ function drawArc(ctx){
55
+ const{
56
+ plot,bound,scheme,fontSize,groups,helpers,
57
+ }=ctx;
58
+ const{
59
+ linearScale,extent,Pool,attrs,path,round,setText,resolveScheme,NS,
60
+ }=helpers;
61
+ const sch=scheme||resolveScheme();
62
+ const{nodes,links}=bound;
63
+ if(nodes.length<2)return{empty:true,legend:[]};
64
+ const baseline=plot.bottom-fontSize-4;
65
+ const step=(plot.right-plot.left)/Math.max(1,nodes.length-1);
66
+ const posOf=(name)=>plot.left+nodes.indexOf(name)*step;
67
+ const widthDomain=extent(links.map((l)=>l.value))||{min:1,max:1};
68
+ const widthScale=linearScale({min:0,max:widthDomain.max},[0.5,6]);
69
+ const marks=new Pool(groups.marks);
70
+ for(const link of links){
71
+ const x1=posOf(link.source);
72
+ const x2=posOf(link.target);
73
+ const r=Math.abs(x2-x1)/2;
74
+ const cap=Math.min(baseline-plot.top,r);
75
+ const mid=(x1+x2)/2;
76
+ attrs(marks.next('path',`${NS}__arc-link ${NS}__mark`),{
77
+ d:path(['M',round(x1),round(baseline),'Q',round(mid),round(baseline-cap*2),round(x2),round(baseline)]),
78
+ fill:'none',stroke:'currentColor','stroke-opacity':0.35,
79
+ 'stroke-width':round(widthScale.of(link.value)),'data-value':link.value,
80
+ });
81
+ }
82
+ const overlay=new Pool(groups.overlay);
83
+ nodes.forEach((name,i)=>{
84
+ const x=posOf(name);
85
+ attrs(marks.next('circle',`${NS}__arc-node ${NS}__mark`),{
86
+ cx:round(x),cy:round(baseline),r:4,fill:sch.series(i),
87
+ });
88
+ const label=overlay.next('text',`${NS}__arc-label`);
89
+ setText(label,name);
90
+ attrs(label,{x:round(x),y:round(baseline+fontSize+2),'text-anchor':'middle','font-size':fontSize});
91
+ });
92
+ marks.finish();
93
+ overlay.finish();
94
+ return{nodes:nodes.length,links:links.length,legend:[]};
95
+ }
96
+ registerChartType('arc',{draw:drawArc,bind:bindArc,freeform:true,labelled:false});
97
+ const __default=drawArc;
98
+ });
99
+ var __entry=__req("packages/modules/chart-arc/index.js");
100
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
101
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
102
+ else{
103
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
104
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
105
+ }
106
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,106 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-arc 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-arc/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindArc",{enumerable:true,get:function(){return bindArc;}});
33
+ Object.defineProperty(__exports,"drawArc",{enumerable:true,get:function(){return drawArc;}});
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 bindArc(grid,spec){
38
+ const nodes=[];
39
+ const links=[];
40
+ const n=grid.rows.count();
41
+ for(let i=0;i<n;i++){
42
+ const row=grid.rows.get(i);
43
+ if(!row||row.group)continue;
44
+ const s=String(grid.rows.text(row.key,spec.source));
45
+ const t=String(grid.rows.text(row.key,spec.target));
46
+ if(!s||!t||s==='undefined'||t==='undefined')continue;
47
+ const v=spec.value?Number(grid.rows.value(row.key,spec.value)):1;
48
+ if(!nodes.includes(s))nodes.push(s);
49
+ if(!nodes.includes(t))nodes.push(t);
50
+ links.push({source:s,target:t,value:Number.isFinite(v)&&v>0?v:1});
51
+ }
52
+ return{nodes,links,empty:links.length===0};
53
+ }
54
+ function drawArc(ctx){
55
+ const{
56
+ plot,bound,scheme,fontSize,groups,helpers,
57
+ }=ctx;
58
+ const{
59
+ linearScale,extent,Pool,attrs,path,round,setText,resolveScheme,NS,
60
+ }=helpers;
61
+ const sch=scheme||resolveScheme();
62
+ const{nodes,links}=bound;
63
+ if(nodes.length<2)return{empty:true,legend:[]};
64
+ const baseline=plot.bottom-fontSize-4;
65
+ const step=(plot.right-plot.left)/Math.max(1,nodes.length-1);
66
+ const posOf=(name)=>plot.left+nodes.indexOf(name)*step;
67
+ const widthDomain=extent(links.map((l)=>l.value))||{min:1,max:1};
68
+ const widthScale=linearScale({min:0,max:widthDomain.max},[0.5,6]);
69
+ const marks=new Pool(groups.marks);
70
+ for(const link of links){
71
+ const x1=posOf(link.source);
72
+ const x2=posOf(link.target);
73
+ const r=Math.abs(x2-x1)/2;
74
+ const cap=Math.min(baseline-plot.top,r);
75
+ const mid=(x1+x2)/2;
76
+ attrs(marks.next('path',`${NS}__arc-link ${NS}__mark`),{
77
+ d:path(['M',round(x1),round(baseline),'Q',round(mid),round(baseline-cap*2),round(x2),round(baseline)]),
78
+ fill:'none',stroke:'currentColor','stroke-opacity':0.35,
79
+ 'stroke-width':round(widthScale.of(link.value)),'data-value':link.value,
80
+ });
81
+ }
82
+ const overlay=new Pool(groups.overlay);
83
+ nodes.forEach((name,i)=>{
84
+ const x=posOf(name);
85
+ attrs(marks.next('circle',`${NS}__arc-node ${NS}__mark`),{
86
+ cx:round(x),cy:round(baseline),r:4,fill:sch.series(i),
87
+ });
88
+ const label=overlay.next('text',`${NS}__arc-label`);
89
+ setText(label,name);
90
+ attrs(label,{x:round(x),y:round(baseline+fontSize+2),'text-anchor':'middle','font-size':fontSize});
91
+ });
92
+ marks.finish();
93
+ overlay.finish();
94
+ return{nodes:nodes.length,links:links.length,legend:[]};
95
+ }
96
+ registerChartType('arc',{draw:drawArc,bind:bindArc,freeform:true,labelled:false});
97
+ const __default=drawArc;
98
+ });
99
+ var __entry=__req("packages/modules/chart-arc/index.js");
100
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
101
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
102
+ else{
103
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
104
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
105
+ }
106
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-bubblemap module type declarations
2
+ * Lattice Grid 1.63.0, chart-bubblemap 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-bubblemap module
2
+ * Lattice Grid 1.63.0, chart-bubblemap module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -47,34 +47,70 @@ points.push({lon,lat,size:Number.isFinite(size)?size:0,label:spec.label?grid.row
47
47
  }
48
48
  return{points,empty:points.length===0};
49
49
  }
50
+ function packProjection(opts){
51
+ const{spec,plot,helpers}=opts;
52
+ if(!spec||!spec.shapes)return null;
53
+ const{
54
+ resolvePack,packRegions,fitted,resolveProjection,
55
+ }=helpers;
56
+ const resolved=resolvePack(spec.shapes,spec.layer);
57
+ if(!resolved)return null;
58
+ const regions=packRegions(resolved.topology);
59
+ const project=resolveProjection(
60
+ spec.projection||resolved.pack.projection,
61
+ {...(resolved.pack.projectionOptions||{}),...(spec.projectionOptions||{})},
62
+ );
63
+ const fit=fitted({project,rings:regions.flatMap((r)=>r.rings),plot});
64
+ return{to:fit.to,regions};
65
+ }
50
66
  function drawBubbleMap(ctx){
51
67
  const{
52
68
  plot,bound,scheme,groups,spec,helpers,
53
69
  }=ctx;
54
70
  const{
55
- extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,
71
+ extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,projectedPath,
56
72
  }=helpers;
57
73
  const sch=scheme||resolveScheme();
58
74
  const colour=sch.series(0);
59
75
  const{points}=bound;
76
+ const marks=new Pool(groups.marks);
77
+ const fit=packProjection({spec,plot,helpers});
78
+ let project;
79
+ if(fit){
80
+ for(const region of fit.regions){
81
+ const d=region.rings.map((ring)=>projectedPath(ring,fit.to)).filter(Boolean).join(' ');
82
+ if(!d)continue;
83
+ attrs(marks.next('path',`${NS}__region`),{
84
+ d,fill:'var(--lattice-chart-empty, #eceff1)',class:`${NS}__region`,
85
+ });
86
+ }
87
+ project=fit.to;
88
+ }else{
60
89
  const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
61
90
  const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
62
91
  const pad=Math.max(8,spec&&spec.maxRadius>0?spec.maxRadius:20);
63
92
  const xScale=linearScale(lonD,[plot.left+pad,plot.right-pad]);
64
93
  const yScale=linearScale(latD,[plot.bottom-pad,plot.top+pad]);
94
+ project=(lon,lat)=>[xScale.of(lon),yScale.of(lat)];
95
+ }
65
96
  const sizeD=extent(points.map((p)=>p.size))||{min:0,max:1};
66
97
  const rScale=sqrtScale({min:0,max:Math.max(1e-9,sizeD.max)},[2,spec&&spec.maxRadius>0?spec.maxRadius:20]);
67
- const marks=new Pool(groups.marks);
68
98
  const ordered=[...points].sort((a,b)=>b.size-a.size);
69
99
  for(const p of ordered){
100
+ const[x,y]=project(p.lon,p.lat);
70
101
  attrs(marks.next('circle',`${NS}__bubblemap-dot ${NS}__mark`),{
71
- cx:round(xScale.of(p.lon)),cy:round(yScale.of(p.lat)),
102
+ cx:round(x),
103
+ cy:round(y),
72
104
  r:round(spec&&spec.size?rScale.of(p.size):4),
73
- fill:colour,'fill-opacity':0.5,stroke:colour,'data-size':p.size,
105
+ fill:colour,
106
+ 'fill-opacity':0.5,
107
+ stroke:colour,
108
+ 'data-size':p.size,
109
+ class:`${NS}__bubblemap-dot ${NS}__mark`,
74
110
  });
75
111
  }
76
112
  marks.finish();
77
- return{points:points.length,legend:[]};
113
+ return{points:points.length,legend:[],packed:!!fit};
78
114
  }
79
115
  registerChartType('bubblemap',{draw:drawBubbleMap,bind:bindBubbleMap,freeform:true,labelled:false});
80
116
  const __default=drawBubbleMap;