@toclocoinc/lattice-grid 1.62.1 → 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 +1 -1
  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 +786 -67
  7. package/lattice-grid.min.cjs +786 -67
  8. package/lattice-grid.min.js +786 -67
  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 +1 -1
  20. package/modules/chart-alluvial.min.js +1 -1
  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 +1 -1
  24. package/modules/chart-arc.min.js +1 -1
  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 +42 -6
  28. package/modules/chart-bubblemap.min.js +42 -6
  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 +1 -1
  32. package/modules/chart-bump.min.js +1 -1
  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 +1 -1
  36. package/modules/chart-calendar.min.js +1 -1
  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 +1 -1
  40. package/modules/chart-decomposition.min.js +1 -1
  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 +1 -1
  44. package/modules/chart-diverging.min.js +1 -1
  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 +1 -1
  48. package/modules/chart-dumbbell.min.js +1 -1
  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 +1 -1
  52. package/modules/chart-fan.min.js +1 -1
  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 +1 -1
  56. package/modules/chart-hexbin.min.js +1 -1
  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 +46 -6
  60. package/modules/chart-hexmap.min.js +46 -6
  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 +1 -1
  64. package/modules/chart-icicle.min.js +1 -1
  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 +1 -1
  68. package/modules/chart-parallel.min.js +1 -1
  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 +1 -1
  72. package/modules/chart-ridgeline.min.js +1 -1
  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 +1 -1
  76. package/modules/chart-roc.min.js +1 -1
  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 +1 -1
  80. package/modules/chart-slope.min.js +1 -1
  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 +1 -1
  84. package/modules/chart-splom.min.js +1 -1
  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 +1 -1
  88. package/modules/chart-waffle.min.js +1 -1
  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 +786 -67
  121. package/modules/htmx.min.cjs +786 -67
  122. package/modules/htmx.min.js +786 -67
  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 +786 -67
  157. package/modules/webcomponent.min.cjs +786 -67
  158. package/modules/webcomponent.min.js +786 -67
  159. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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.1, 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;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -48,34 +48,70 @@ points.push({lon,lat,size:Number.isFinite(size)?size:0,label:spec.label?grid.row
48
48
  }
49
49
  return{points,empty:points.length===0};
50
50
  }
51
+ function packProjection(opts){
52
+ const{spec,plot,helpers}=opts;
53
+ if(!spec||!spec.shapes)return null;
54
+ const{
55
+ resolvePack,packRegions,fitted,resolveProjection,
56
+ }=helpers;
57
+ const resolved=resolvePack(spec.shapes,spec.layer);
58
+ if(!resolved)return null;
59
+ const regions=packRegions(resolved.topology);
60
+ const project=resolveProjection(
61
+ spec.projection||resolved.pack.projection,
62
+ {...(resolved.pack.projectionOptions||{}),...(spec.projectionOptions||{})},
63
+ );
64
+ const fit=fitted({project,rings:regions.flatMap((r)=>r.rings),plot});
65
+ return{to:fit.to,regions};
66
+ }
51
67
  function drawBubbleMap(ctx){
52
68
  const{
53
69
  plot,bound,scheme,groups,spec,helpers,
54
70
  }=ctx;
55
71
  const{
56
- extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,
72
+ extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,projectedPath,
57
73
  }=helpers;
58
74
  const sch=scheme||resolveScheme();
59
75
  const colour=sch.series(0);
60
76
  const{points}=bound;
77
+ const marks=new Pool(groups.marks);
78
+ const fit=packProjection({spec,plot,helpers});
79
+ let project;
80
+ if(fit){
81
+ for(const region of fit.regions){
82
+ const d=region.rings.map((ring)=>projectedPath(ring,fit.to)).filter(Boolean).join(' ');
83
+ if(!d)continue;
84
+ attrs(marks.next('path',`${NS}__region`),{
85
+ d,fill:'var(--lattice-chart-empty, #eceff1)',class:`${NS}__region`,
86
+ });
87
+ }
88
+ project=fit.to;
89
+ }else{
61
90
  const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
62
91
  const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
63
92
  const pad=Math.max(8,spec&&spec.maxRadius>0?spec.maxRadius:20);
64
93
  const xScale=linearScale(lonD,[plot.left+pad,plot.right-pad]);
65
94
  const yScale=linearScale(latD,[plot.bottom-pad,plot.top+pad]);
95
+ project=(lon,lat)=>[xScale.of(lon),yScale.of(lat)];
96
+ }
66
97
  const sizeD=extent(points.map((p)=>p.size))||{min:0,max:1};
67
98
  const rScale=sqrtScale({min:0,max:Math.max(1e-9,sizeD.max)},[2,spec&&spec.maxRadius>0?spec.maxRadius:20]);
68
- const marks=new Pool(groups.marks);
69
99
  const ordered=[...points].sort((a,b)=>b.size-a.size);
70
100
  for(const p of ordered){
101
+ const[x,y]=project(p.lon,p.lat);
71
102
  attrs(marks.next('circle',`${NS}__bubblemap-dot ${NS}__mark`),{
72
- cx:round(xScale.of(p.lon)),cy:round(yScale.of(p.lat)),
103
+ cx:round(x),
104
+ cy:round(y),
73
105
  r:round(spec&&spec.size?rScale.of(p.size):4),
74
- fill:colour,'fill-opacity':0.5,stroke:colour,'data-size':p.size,
106
+ fill:colour,
107
+ 'fill-opacity':0.5,
108
+ stroke:colour,
109
+ 'data-size':p.size,
110
+ class:`${NS}__bubblemap-dot ${NS}__mark`,
75
111
  });
76
112
  }
77
113
  marks.finish();
78
- return{points:points.length,legend:[]};
114
+ return{points:points.length,legend:[],packed:!!fit};
79
115
  }
80
116
  registerChartType('bubblemap',{draw:drawBubbleMap,bind:bindBubbleMap,freeform:true,labelled:false});
81
117
  const __default=drawBubbleMap;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -48,34 +48,70 @@ points.push({lon,lat,size:Number.isFinite(size)?size:0,label:spec.label?grid.row
48
48
  }
49
49
  return{points,empty:points.length===0};
50
50
  }
51
+ function packProjection(opts){
52
+ const{spec,plot,helpers}=opts;
53
+ if(!spec||!spec.shapes)return null;
54
+ const{
55
+ resolvePack,packRegions,fitted,resolveProjection,
56
+ }=helpers;
57
+ const resolved=resolvePack(spec.shapes,spec.layer);
58
+ if(!resolved)return null;
59
+ const regions=packRegions(resolved.topology);
60
+ const project=resolveProjection(
61
+ spec.projection||resolved.pack.projection,
62
+ {...(resolved.pack.projectionOptions||{}),...(spec.projectionOptions||{})},
63
+ );
64
+ const fit=fitted({project,rings:regions.flatMap((r)=>r.rings),plot});
65
+ return{to:fit.to,regions};
66
+ }
51
67
  function drawBubbleMap(ctx){
52
68
  const{
53
69
  plot,bound,scheme,groups,spec,helpers,
54
70
  }=ctx;
55
71
  const{
56
- extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,
72
+ extent,linearScale,sqrtScale,Pool,attrs,round,resolveScheme,NS,projectedPath,
57
73
  }=helpers;
58
74
  const sch=scheme||resolveScheme();
59
75
  const colour=sch.series(0);
60
76
  const{points}=bound;
77
+ const marks=new Pool(groups.marks);
78
+ const fit=packProjection({spec,plot,helpers});
79
+ let project;
80
+ if(fit){
81
+ for(const region of fit.regions){
82
+ const d=region.rings.map((ring)=>projectedPath(ring,fit.to)).filter(Boolean).join(' ');
83
+ if(!d)continue;
84
+ attrs(marks.next('path',`${NS}__region`),{
85
+ d,fill:'var(--lattice-chart-empty, #eceff1)',class:`${NS}__region`,
86
+ });
87
+ }
88
+ project=fit.to;
89
+ }else{
61
90
  const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
62
91
  const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
63
92
  const pad=Math.max(8,spec&&spec.maxRadius>0?spec.maxRadius:20);
64
93
  const xScale=linearScale(lonD,[plot.left+pad,plot.right-pad]);
65
94
  const yScale=linearScale(latD,[plot.bottom-pad,plot.top+pad]);
95
+ project=(lon,lat)=>[xScale.of(lon),yScale.of(lat)];
96
+ }
66
97
  const sizeD=extent(points.map((p)=>p.size))||{min:0,max:1};
67
98
  const rScale=sqrtScale({min:0,max:Math.max(1e-9,sizeD.max)},[2,spec&&spec.maxRadius>0?spec.maxRadius:20]);
68
- const marks=new Pool(groups.marks);
69
99
  const ordered=[...points].sort((a,b)=>b.size-a.size);
70
100
  for(const p of ordered){
101
+ const[x,y]=project(p.lon,p.lat);
71
102
  attrs(marks.next('circle',`${NS}__bubblemap-dot ${NS}__mark`),{
72
- cx:round(xScale.of(p.lon)),cy:round(yScale.of(p.lat)),
103
+ cx:round(x),
104
+ cy:round(y),
73
105
  r:round(spec&&spec.size?rScale.of(p.size):4),
74
- fill:colour,'fill-opacity':0.5,stroke:colour,'data-size':p.size,
106
+ fill:colour,
107
+ 'fill-opacity':0.5,
108
+ stroke:colour,
109
+ 'data-size':p.size,
110
+ class:`${NS}__bubblemap-dot ${NS}__mark`,
75
111
  });
76
112
  }
77
113
  marks.finish();
78
- return{points:points.length,legend:[]};
114
+ return{points:points.length,legend:[],packed:!!fit};
79
115
  }
80
116
  registerChartType('bubblemap',{draw:drawBubbleMap,bind:bindBubbleMap,freeform:true,labelled:false});
81
117
  const __default=drawBubbleMap;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-bump module type declarations
2
+ * Lattice Grid 1.63.0, chart-bump 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.1, chart-bump module
2
+ * Lattice Grid 1.63.0, chart-bump module
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.1, chart-bump module
2
+ * Lattice Grid 1.63.0, chart-bump module
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.1, chart-bump module
2
+ * Lattice Grid 1.63.0, chart-bump module
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.1, chart-calendar module type declarations
2
+ * Lattice Grid 1.63.0, chart-calendar 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.1, chart-calendar module
2
+ * Lattice Grid 1.63.0, chart-calendar module
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.1, chart-calendar module
2
+ * Lattice Grid 1.63.0, chart-calendar module
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.1, chart-calendar module
2
+ * Lattice Grid 1.63.0, chart-calendar module
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.1, chart-decomposition module type declarations
2
+ * Lattice Grid 1.63.0, chart-decomposition module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-decomposition module
2
+ * Lattice Grid 1.63.0, chart-decomposition module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-decomposition module
2
+ * Lattice Grid 1.63.0, chart-decomposition module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-decomposition module
2
+ * Lattice Grid 1.63.0, chart-decomposition module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-diverging module type declarations
2
+ * Lattice Grid 1.63.0, chart-diverging module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-diverging module
2
+ * Lattice Grid 1.63.0, chart-diverging module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-diverging module
2
+ * Lattice Grid 1.63.0, chart-diverging module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-diverging module
2
+ * Lattice Grid 1.63.0, chart-diverging module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-dumbbell module type declarations
2
+ * Lattice Grid 1.63.0, chart-dumbbell module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-dumbbell module
2
+ * Lattice Grid 1.63.0, chart-dumbbell module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-dumbbell module
2
+ * Lattice Grid 1.63.0, chart-dumbbell module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-dumbbell module
2
+ * Lattice Grid 1.63.0, chart-dumbbell module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, 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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.1, chart-hexmap module type declarations
2
+ * Lattice Grid 1.63.0, chart-hexmap 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.1, chart-hexmap module
2
+ * Lattice Grid 1.63.0, chart-hexmap module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -46,6 +46,22 @@ if(Number.isFinite(lon)&&Number.isFinite(lat))points.push({lon,lat});
46
46
  }
47
47
  return{points,empty:points.length===0};
48
48
  }
49
+ function packProjection(opts){
50
+ const{spec,plot,helpers}=opts;
51
+ if(!spec||!spec.shapes)return null;
52
+ const{
53
+ resolvePack,packRegions,fitted,resolveProjection,
54
+ }=helpers;
55
+ const resolved=resolvePack(spec.shapes,spec.layer);
56
+ if(!resolved)return null;
57
+ const regions=packRegions(resolved.topology);
58
+ const project=resolveProjection(
59
+ spec.projection||resolved.pack.projection,
60
+ {...(resolved.pack.projectionOptions||{}),...(spec.projectionOptions||{})},
61
+ );
62
+ const fit=fitted({project,rings:regions.flatMap((r)=>r.rings),plot});
63
+ return{to:fit.to,regions};
64
+ }
49
65
  function binHex(pts,r){
50
66
  const dx=r*2*Math.sin(Math.PI/3);
51
67
  const dy=r*1.5;
@@ -77,25 +93,43 @@ plot,bound,scheme,groups,spec,helpers,
77
93
  }=ctx;
78
94
  const{
79
95
  extent,measureDomain,linearScale,colourRamp,Pool,attrs,path,round,resolveScheme,
96
+ projectedPath,
80
97
  }=helpers;
81
98
  const NS=helpers.NS;
82
99
  const sch=scheme||resolveScheme();
83
100
  const{points}=bound;
101
+ const marks=new Pool(groups.marks);
102
+ const fit=packProjection({spec,plot,helpers});
103
+ let project;
104
+ if(fit){
105
+ for(const region of fit.regions){
106
+ const d=region.rings.map((ring)=>projectedPath(ring,fit.to)).filter(Boolean).join(' ');
107
+ if(!d)continue;
108
+ attrs(marks.next('path',`${NS}__region`),{
109
+ d,fill:'var(--lattice-chart-empty, #eceff1)',class:`${NS}__region`,
110
+ });
111
+ }
112
+ project=fit.to;
113
+ }else{
84
114
  const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
85
115
  const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
86
116
  const xScale=linearScale(lonD,[plot.left,plot.right]);
87
117
  const yScale=linearScale(latD,[plot.bottom,plot.top]);
118
+ project=(lon,lat)=>[xScale.of(lon),yScale.of(lat)];
119
+ }
88
120
  const radius=spec&&Number.isFinite(spec.radius)&&spec.radius>0?spec.radius:DEFAULT_RADIUS;
89
- const pixels=points.map((p)=>({px:xScale.of(p.lon),py:yScale.of(p.lat)}));
121
+ const pixels=points.map((p)=>{
122
+ const[x,y]=project(p.lon,p.lat);
123
+ return{px:x,py:y};
124
+ });
90
125
  const bins=binHex(pixels,radius);
91
- if(!bins.length)return{empty:true,legend:[]};
126
+ if(!bins.length)return{empty:true,legend:[],packed:!!fit};
92
127
  let maxCount=0;
93
128
  for(const b of bins)if(b.count>maxCount)maxCount=b.count;
94
129
  const ramp=colourRamp(measureDomain([0,maxCount],{zero:true}),false,sch);
95
130
  const third=Math.PI/3;
96
131
  const hex=[];
97
132
  for(let i=0;i<6;i++)hex.push([Math.sin(i*third)*radius,-Math.cos(i*third)*radius]);
98
- const marks=new Pool(groups.marks);
99
133
  for(const bin of bins){
100
134
  const parts=['M'];
101
135
  for(let i=0;i<6;i++){
@@ -104,11 +138,17 @@ if(i<5)parts.push('L');
104
138
  }
105
139
  parts.push('Z');
106
140
  attrs(marks.next('path',`${NS}__hexmap-cell ${NS}__mark`),{
107
- d:path(parts),fill:ramp(bin.count),stroke:'none','data-count':bin.count,
141
+ d:path(parts),
142
+ fill:ramp(bin.count),
143
+ stroke:'none',
144
+ 'data-count':bin.count,
145
+ class:`${NS}__hexmap-cell ${NS}__mark`,
108
146
  });
109
147
  }
110
148
  marks.finish();
111
- return{bins:bins.length,maxCount,legend:[]};
149
+ return{
150
+ bins:bins.length,maxCount,legend:[],packed:!!fit,
151
+ };
112
152
  }
113
153
  registerChartType('hexmap',{draw:drawHexMap,bind:bindHexMap,freeform:true,labelled:false});
114
154
  const __default=drawHexMap;