@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.
- package/README.md +1 -1
- package/docs/API.html +526 -16
- package/docs/CHART-CODES.md +141 -2
- package/docs/api-detail.html +194 -5
- package/lattice-grid.d.ts +235 -5
- package/lattice-grid.esm.min.js +786 -67
- package/lattice-grid.min.cjs +786 -67
- package/lattice-grid.min.js +786 -67
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +13 -16
- package/modules/ai.min.cjs +13 -16
- package/modules/ai.min.js +13 -16
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +42 -6
- package/modules/chart-bubblemap.min.cjs +42 -6
- package/modules/chart-bubblemap.min.js +42 -6
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +46 -6
- package/modules/chart-hexmap.min.cjs +46 -6
- package/modules/chart-hexmap.min.js +46 -6
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +1917 -662
- package/modules/charts.min.cjs +1917 -662
- package/modules/charts.min.js +1917 -662
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +129 -20
- package/modules/data-router.min.cjs +129 -20
- package/modules/data-router.min.js +129 -20
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +2 -2
- package/modules/devtools.min.cjs +2 -2
- package/modules/devtools.min.js +2 -2
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +4 -16
- package/modules/dhtmlx-compat.min.cjs +4 -16
- package/modules/dhtmlx-compat.min.js +4 -16
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +187 -82
- package/modules/gantt.min.cjs +187 -82
- package/modules/gantt.min.js +187 -82
- package/modules/geo-europe-nuts.d.ts +16 -0
- package/modules/geo-europe-nuts.esm.min.js +29 -0
- package/modules/geo-uk.d.ts +18 -0
- package/modules/geo-uk.esm.min.js +29 -0
- package/modules/geo-us-states.d.ts +16 -0
- package/modules/geo-us-states.esm.min.js +29 -0
- package/modules/geo-world-110m.d.ts +17 -0
- package/modules/geo-world-110m.esm.min.js +29 -0
- package/modules/geo-world-50m.d.ts +16 -0
- package/modules/geo-world-50m.esm.min.js +29 -0
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +786 -67
- package/modules/htmx.min.cjs +786 -67
- package/modules/htmx.min.js +786 -67
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +4 -16
- package/modules/kanban.min.cjs +4 -16
- package/modules/kanban.min.js +4 -16
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +29 -24
- package/modules/kpi.min.cjs +29 -24
- package/modules/kpi.min.js +29 -24
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +4 -16
- package/modules/layout.min.cjs +4 -16
- package/modules/layout.min.js +4 -16
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +2 -2
- package/modules/mock-socket.min.cjs +2 -2
- package/modules/mock-socket.min.js +2 -2
- package/modules/react.d.ts +308 -3
- package/modules/react.esm.min.js +1072 -22
- package/modules/react.min.cjs +1056 -21
- package/modules/react.min.js +1056 -21
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +4 -16
- package/modules/tabs.min.cjs +4 -16
- package/modules/tabs.min.js +4 -16
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +786 -67
- package/modules/webcomponent.min.cjs +786 -67
- package/modules/webcomponent.min.js +786 -67
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
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
|
*/
|
|
@@ -47,6 +47,22 @@ if(Number.isFinite(lon)&&Number.isFinite(lat))points.push({lon,lat});
|
|
|
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 binHex(pts,r){
|
|
51
67
|
const dx=r*2*Math.sin(Math.PI/3);
|
|
52
68
|
const dy=r*1.5;
|
|
@@ -78,25 +94,43 @@ plot,bound,scheme,groups,spec,helpers,
|
|
|
78
94
|
}=ctx;
|
|
79
95
|
const{
|
|
80
96
|
extent,measureDomain,linearScale,colourRamp,Pool,attrs,path,round,resolveScheme,
|
|
97
|
+
projectedPath,
|
|
81
98
|
}=helpers;
|
|
82
99
|
const NS=helpers.NS;
|
|
83
100
|
const sch=scheme||resolveScheme();
|
|
84
101
|
const{points}=bound;
|
|
102
|
+
const marks=new Pool(groups.marks);
|
|
103
|
+
const fit=packProjection({spec,plot,helpers});
|
|
104
|
+
let project;
|
|
105
|
+
if(fit){
|
|
106
|
+
for(const region of fit.regions){
|
|
107
|
+
const d=region.rings.map((ring)=>projectedPath(ring,fit.to)).filter(Boolean).join(' ');
|
|
108
|
+
if(!d)continue;
|
|
109
|
+
attrs(marks.next('path',`${NS}__region`),{
|
|
110
|
+
d,fill:'var(--lattice-chart-empty, #eceff1)',class:`${NS}__region`,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
project=fit.to;
|
|
114
|
+
}else{
|
|
85
115
|
const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
|
|
86
116
|
const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
|
|
87
117
|
const xScale=linearScale(lonD,[plot.left,plot.right]);
|
|
88
118
|
const yScale=linearScale(latD,[plot.bottom,plot.top]);
|
|
119
|
+
project=(lon,lat)=>[xScale.of(lon),yScale.of(lat)];
|
|
120
|
+
}
|
|
89
121
|
const radius=spec&&Number.isFinite(spec.radius)&&spec.radius>0?spec.radius:DEFAULT_RADIUS;
|
|
90
|
-
const pixels=points.map((p)=>
|
|
122
|
+
const pixels=points.map((p)=>{
|
|
123
|
+
const[x,y]=project(p.lon,p.lat);
|
|
124
|
+
return{px:x,py:y};
|
|
125
|
+
});
|
|
91
126
|
const bins=binHex(pixels,radius);
|
|
92
|
-
if(!bins.length)return{empty:true,legend:[]};
|
|
127
|
+
if(!bins.length)return{empty:true,legend:[],packed:!!fit};
|
|
93
128
|
let maxCount=0;
|
|
94
129
|
for(const b of bins)if(b.count>maxCount)maxCount=b.count;
|
|
95
130
|
const ramp=colourRamp(measureDomain([0,maxCount],{zero:true}),false,sch);
|
|
96
131
|
const third=Math.PI/3;
|
|
97
132
|
const hex=[];
|
|
98
133
|
for(let i=0;i<6;i++)hex.push([Math.sin(i*third)*radius,-Math.cos(i*third)*radius]);
|
|
99
|
-
const marks=new Pool(groups.marks);
|
|
100
134
|
for(const bin of bins){
|
|
101
135
|
const parts=['M'];
|
|
102
136
|
for(let i=0;i<6;i++){
|
|
@@ -105,11 +139,17 @@ if(i<5)parts.push('L');
|
|
|
105
139
|
}
|
|
106
140
|
parts.push('Z');
|
|
107
141
|
attrs(marks.next('path',`${NS}__hexmap-cell ${NS}__mark`),{
|
|
108
|
-
d:path(parts),
|
|
142
|
+
d:path(parts),
|
|
143
|
+
fill:ramp(bin.count),
|
|
144
|
+
stroke:'none',
|
|
145
|
+
'data-count':bin.count,
|
|
146
|
+
class:`${NS}__hexmap-cell ${NS}__mark`,
|
|
109
147
|
});
|
|
110
148
|
}
|
|
111
149
|
marks.finish();
|
|
112
|
-
return{
|
|
150
|
+
return{
|
|
151
|
+
bins:bins.length,maxCount,legend:[],packed:!!fit,
|
|
152
|
+
};
|
|
113
153
|
}
|
|
114
154
|
registerChartType('hexmap',{draw:drawHexMap,bind:bindHexMap,freeform:true,labelled:false});
|
|
115
155
|
const __default=drawHexMap;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
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
|
*/
|
|
@@ -47,6 +47,22 @@ if(Number.isFinite(lon)&&Number.isFinite(lat))points.push({lon,lat});
|
|
|
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 binHex(pts,r){
|
|
51
67
|
const dx=r*2*Math.sin(Math.PI/3);
|
|
52
68
|
const dy=r*1.5;
|
|
@@ -78,25 +94,43 @@ plot,bound,scheme,groups,spec,helpers,
|
|
|
78
94
|
}=ctx;
|
|
79
95
|
const{
|
|
80
96
|
extent,measureDomain,linearScale,colourRamp,Pool,attrs,path,round,resolveScheme,
|
|
97
|
+
projectedPath,
|
|
81
98
|
}=helpers;
|
|
82
99
|
const NS=helpers.NS;
|
|
83
100
|
const sch=scheme||resolveScheme();
|
|
84
101
|
const{points}=bound;
|
|
102
|
+
const marks=new Pool(groups.marks);
|
|
103
|
+
const fit=packProjection({spec,plot,helpers});
|
|
104
|
+
let project;
|
|
105
|
+
if(fit){
|
|
106
|
+
for(const region of fit.regions){
|
|
107
|
+
const d=region.rings.map((ring)=>projectedPath(ring,fit.to)).filter(Boolean).join(' ');
|
|
108
|
+
if(!d)continue;
|
|
109
|
+
attrs(marks.next('path',`${NS}__region`),{
|
|
110
|
+
d,fill:'var(--lattice-chart-empty, #eceff1)',class:`${NS}__region`,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
project=fit.to;
|
|
114
|
+
}else{
|
|
85
115
|
const lonD=extent(points.map((p)=>p.lon))||{min:0,max:1};
|
|
86
116
|
const latD=extent(points.map((p)=>p.lat))||{min:0,max:1};
|
|
87
117
|
const xScale=linearScale(lonD,[plot.left,plot.right]);
|
|
88
118
|
const yScale=linearScale(latD,[plot.bottom,plot.top]);
|
|
119
|
+
project=(lon,lat)=>[xScale.of(lon),yScale.of(lat)];
|
|
120
|
+
}
|
|
89
121
|
const radius=spec&&Number.isFinite(spec.radius)&&spec.radius>0?spec.radius:DEFAULT_RADIUS;
|
|
90
|
-
const pixels=points.map((p)=>
|
|
122
|
+
const pixels=points.map((p)=>{
|
|
123
|
+
const[x,y]=project(p.lon,p.lat);
|
|
124
|
+
return{px:x,py:y};
|
|
125
|
+
});
|
|
91
126
|
const bins=binHex(pixels,radius);
|
|
92
|
-
if(!bins.length)return{empty:true,legend:[]};
|
|
127
|
+
if(!bins.length)return{empty:true,legend:[],packed:!!fit};
|
|
93
128
|
let maxCount=0;
|
|
94
129
|
for(const b of bins)if(b.count>maxCount)maxCount=b.count;
|
|
95
130
|
const ramp=colourRamp(measureDomain([0,maxCount],{zero:true}),false,sch);
|
|
96
131
|
const third=Math.PI/3;
|
|
97
132
|
const hex=[];
|
|
98
133
|
for(let i=0;i<6;i++)hex.push([Math.sin(i*third)*radius,-Math.cos(i*third)*radius]);
|
|
99
|
-
const marks=new Pool(groups.marks);
|
|
100
134
|
for(const bin of bins){
|
|
101
135
|
const parts=['M'];
|
|
102
136
|
for(let i=0;i<6;i++){
|
|
@@ -105,11 +139,17 @@ if(i<5)parts.push('L');
|
|
|
105
139
|
}
|
|
106
140
|
parts.push('Z');
|
|
107
141
|
attrs(marks.next('path',`${NS}__hexmap-cell ${NS}__mark`),{
|
|
108
|
-
d:path(parts),
|
|
142
|
+
d:path(parts),
|
|
143
|
+
fill:ramp(bin.count),
|
|
144
|
+
stroke:'none',
|
|
145
|
+
'data-count':bin.count,
|
|
146
|
+
class:`${NS}__hexmap-cell ${NS}__mark`,
|
|
109
147
|
});
|
|
110
148
|
}
|
|
111
149
|
marks.finish();
|
|
112
|
-
return{
|
|
150
|
+
return{
|
|
151
|
+
bins:bins.length,maxCount,legend:[],packed:!!fit,
|
|
152
|
+
};
|
|
113
153
|
}
|
|
114
154
|
registerChartType('hexmap',{draw:drawHexMap,bind:bindHexMap,freeform:true,labelled:false});
|
|
115
155
|
const __default=drawHexMap;
|
package/modules/chart-roc.d.ts
CHANGED
package/modules/chart-roc.min.js
CHANGED
package/modules/chart-slope.d.ts
CHANGED
package/modules/chart-splom.d.ts
CHANGED
package/modules/charts.d.ts
CHANGED