@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.
- package/README.md +23 -8
- 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 +856 -78
- package/lattice-grid.min.cjs +856 -78
- package/lattice-grid.min.js +856 -78
- 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 +147 -0
- package/modules/chart-alluvial.min.js +147 -0
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +106 -0
- package/modules/chart-arc.min.js +106 -0
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +42 -6
- package/modules/chart-bubblemap.min.cjs +126 -0
- package/modules/chart-bubblemap.min.js +126 -0
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +110 -0
- package/modules/chart-bump.min.js +110 -0
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +129 -0
- package/modules/chart-calendar.min.js +129 -0
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +131 -0
- package/modules/chart-decomposition.min.js +131 -0
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +104 -0
- package/modules/chart-diverging.min.js +104 -0
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +114 -0
- package/modules/chart-dumbbell.min.js +114 -0
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +139 -0
- package/modules/chart-fan.min.js +139 -0
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +148 -0
- package/modules/chart-hexbin.min.js +148 -0
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +46 -6
- package/modules/chart-hexmap.min.cjs +164 -0
- package/modules/chart-hexmap.min.js +164 -0
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +97 -0
- package/modules/chart-icicle.min.js +97 -0
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +123 -0
- package/modules/chart-parallel.min.js +123 -0
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +119 -0
- package/modules/chart-ridgeline.min.js +119 -0
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +181 -0
- package/modules/chart-roc.min.js +181 -0
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +100 -0
- package/modules/chart-slope.min.js +100 -0
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +124 -0
- package/modules/chart-splom.min.js +124 -0
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +97 -0
- package/modules/chart-waffle.min.js +97 -0
- 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 +856 -78
- package/modules/htmx.min.cjs +856 -78
- package/modules/htmx.min.js +856 -78
- 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 +856 -78
- package/modules/webcomponent.min.cjs +856 -78
- package/modules/webcomponent.min.js +856 -78
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.63.0, chart-icicle 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-icicle/index.js",function(__exports,__req){
|
|
31
|
+
'use strict';
|
|
32
|
+
Object.defineProperty(__exports,"drawIcicle",{enumerable:true,get:function(){return drawIcicle;}});
|
|
33
|
+
Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
|
|
34
|
+
const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
|
|
35
|
+
const registerChartType=__m0["registerChartType"];
|
|
36
|
+
function depthOf(node){
|
|
37
|
+
if(!node.children||!node.children.length)return 0;
|
|
38
|
+
let max=0;
|
|
39
|
+
for(const child of node.children)max=Math.max(max,depthOf(child));
|
|
40
|
+
return max+1;
|
|
41
|
+
}
|
|
42
|
+
function drawIcicle(ctx){
|
|
43
|
+
const{
|
|
44
|
+
plot,bound,scheme,fontSize,groups,helpers,
|
|
45
|
+
}=ctx;
|
|
46
|
+
const{
|
|
47
|
+
Pool,attrs,round,setText,resolveScheme,NS,
|
|
48
|
+
}=helpers;
|
|
49
|
+
const sch=scheme||resolveScheme();
|
|
50
|
+
const root=bound.root;
|
|
51
|
+
if(!root||!root.children||!root.children.length)return{empty:true,legend:[]};
|
|
52
|
+
const levels=Math.max(1,depthOf(root));
|
|
53
|
+
const rowH=(plot.bottom-plot.top)/levels;
|
|
54
|
+
const marks=new Pool(groups.marks);
|
|
55
|
+
const overlay=new Pool(groups.overlay);
|
|
56
|
+
let drawn=0;
|
|
57
|
+
const layout=(node,x0,x1,depth,topIndex)=>{
|
|
58
|
+
const children=node.children||[];
|
|
59
|
+
const total=children.reduce((t,c)=>t+(c.total||0),0)||1;
|
|
60
|
+
let cursor=x0;
|
|
61
|
+
children.forEach((child,i)=>{
|
|
62
|
+
const w=((child.total||0)/total)*(x1-x0);
|
|
63
|
+
const left=cursor;
|
|
64
|
+
const right=cursor+w;
|
|
65
|
+
cursor=right;
|
|
66
|
+
const colourIndex=depth===1?i:topIndex;
|
|
67
|
+
const y=plot.top+(depth-1)*rowH;
|
|
68
|
+
attrs(marks.next('rect',`${NS}__icicle-cell ${NS}__mark`),{
|
|
69
|
+
x:round(left),y:round(y),width:round(Math.max(0,right-left-1)),height:round(Math.max(0,rowH-1)),
|
|
70
|
+
fill:sch.series(colourIndex),'fill-opacity':0.85,stroke:'currentColor','stroke-opacity':0.15,
|
|
71
|
+
'data-depth':depth,
|
|
72
|
+
});
|
|
73
|
+
drawn+=1;
|
|
74
|
+
if(w>fontSize*3){
|
|
75
|
+
const label=overlay.next('text',`${NS}__icicle-label`);
|
|
76
|
+
setText(label,String(child.label));
|
|
77
|
+
attrs(label,{x:round(left+3),y:round(y+fontSize),'font-size':fontSize});
|
|
78
|
+
}
|
|
79
|
+
if(child.children&&child.children.length)layout(child,left,right,depth+1,colourIndex);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
layout(root,plot.left,plot.right,1,0);
|
|
83
|
+
marks.finish();
|
|
84
|
+
overlay.finish();
|
|
85
|
+
return{cells:drawn,levels,legend:[]};
|
|
86
|
+
}
|
|
87
|
+
registerChartType('icicle',{draw:drawIcicle,hierarchical:true,freeform:true,labelled:false});
|
|
88
|
+
const __default=drawIcicle;
|
|
89
|
+
});
|
|
90
|
+
var __entry=__req("packages/modules/chart-icicle/index.js");
|
|
91
|
+
if(typeof module==='object'&&module.exports){module.exports=__entry;}
|
|
92
|
+
else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
|
|
93
|
+
else{
|
|
94
|
+
var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
|
|
95
|
+
for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
|
|
96
|
+
}
|
|
97
|
+
})(typeof globalThis!=='undefined'?globalThis:this);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.63.0, chart-parallel 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-parallel/index.js",function(__exports,__req){
|
|
31
|
+
'use strict';
|
|
32
|
+
Object.defineProperty(__exports,"bindParallel",{enumerable:true,get:function(){return bindParallel;}});
|
|
33
|
+
Object.defineProperty(__exports,"drawParallel",{enumerable:true,get:function(){return drawParallel;}});
|
|
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 bindParallel(grid,spec){
|
|
38
|
+
const columns=(Array.isArray(spec.columns)?spec.columns:[]);
|
|
39
|
+
const rows=[];
|
|
40
|
+
const groupSet=[];
|
|
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 record={values:{},group:spec.colourBy?grid.rows.text(row.key,spec.colourBy):null};
|
|
46
|
+
let any=false;
|
|
47
|
+
for(const col of columns){
|
|
48
|
+
const v=Number(grid.rows.value(row.key,col));
|
|
49
|
+
record.values[col]=Number.isFinite(v)?v:null;
|
|
50
|
+
if(record.values[col]!==null)any=true;
|
|
51
|
+
}
|
|
52
|
+
if(record.group!==null&&!groupSet.includes(record.group))groupSet.push(record.group);
|
|
53
|
+
if(any)rows.push(record);
|
|
54
|
+
}
|
|
55
|
+
return{rows,columns,groups:groupSet,empty:rows.length===0||columns.length<2};
|
|
56
|
+
}
|
|
57
|
+
function drawParallel(ctx){
|
|
58
|
+
const{
|
|
59
|
+
plot,bound,scheme,fontSize,groups,helpers,hidden,
|
|
60
|
+
}=ctx;
|
|
61
|
+
const{
|
|
62
|
+
extent,linearScale,Pool,attrs,path,round,setText,resolveScheme,NS,
|
|
63
|
+
}=helpers;
|
|
64
|
+
const sch=scheme||resolveScheme();
|
|
65
|
+
const{rows,columns}=bound;
|
|
66
|
+
const isHidden=(group)=>!!(hidden&&typeof hidden.has==='function'&&hidden.has(group));
|
|
67
|
+
const axisX=columns.map((_,i)=>(columns.length===1
|
|
68
|
+
?(plot.left+plot.right)/2
|
|
69
|
+
:plot.left+(plot.right-plot.left)*(i/(columns.length-1))));
|
|
70
|
+
const scales={};
|
|
71
|
+
for(const col of columns){
|
|
72
|
+
const dom=extent(rows.map((r)=>r.values[col]).filter((v)=>v!==null))||{min:0,max:1};
|
|
73
|
+
scales[col]=linearScale(dom,[plot.bottom,plot.top]);
|
|
74
|
+
}
|
|
75
|
+
const axisPool=new Pool(groups.axis);
|
|
76
|
+
const labelPool=new Pool(groups.overlay);
|
|
77
|
+
columns.forEach((col,i)=>{
|
|
78
|
+
attrs(axisPool.next('line',`${NS}__pc-axis`),{
|
|
79
|
+
x1:round(axisX[i]),y1:round(plot.top),x2:round(axisX[i]),y2:round(plot.bottom),
|
|
80
|
+
stroke:'currentColor','stroke-opacity':0.3,
|
|
81
|
+
});
|
|
82
|
+
const label=labelPool.next('text',`${NS}__pc-label`);
|
|
83
|
+
setText(label,String(col));
|
|
84
|
+
attrs(label,{
|
|
85
|
+
x:round(axisX[i]),y:round(plot.top-4),
|
|
86
|
+
'text-anchor':i===0?'start':i===columns.length-1?'end':'middle',
|
|
87
|
+
'font-size':fontSize,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
const marks=new Pool(groups.marks);
|
|
91
|
+
let drawn=0;
|
|
92
|
+
for(const r of rows){
|
|
93
|
+
if(r.group!==null&&isHidden(r.group))continue;
|
|
94
|
+
const parts=[];
|
|
95
|
+
columns.forEach((col,i)=>{
|
|
96
|
+
const v=r.values[col];
|
|
97
|
+
if(v===null){return;}
|
|
98
|
+
parts.push(parts.length?'L':'M',round(axisX[i]),round(scales[col].of(v)));
|
|
99
|
+
});
|
|
100
|
+
if(parts.length<3)continue;
|
|
101
|
+
const colour=r.group!==null?sch.series(Math.max(0,bound.groups.indexOf(r.group))):sch.series(0);
|
|
102
|
+
attrs(marks.next('path',`${NS}__pc-line ${NS}__mark`),{
|
|
103
|
+
d:path(parts),stroke:colour,'stroke-width':1,'stroke-opacity':0.4,fill:'none',
|
|
104
|
+
});
|
|
105
|
+
drawn+=1;
|
|
106
|
+
}
|
|
107
|
+
axisPool.finish();
|
|
108
|
+
labelPool.finish();
|
|
109
|
+
marks.finish();
|
|
110
|
+
const legend=bound.groups.map((group,index)=>({key:group,label:String(group),index}));
|
|
111
|
+
return{rows:drawn,dimensions:columns.length,legend};
|
|
112
|
+
}
|
|
113
|
+
registerChartType('parallel',{draw:drawParallel,bind:bindParallel,freeform:true,labelled:false});
|
|
114
|
+
const __default=drawParallel;
|
|
115
|
+
});
|
|
116
|
+
var __entry=__req("packages/modules/chart-parallel/index.js");
|
|
117
|
+
if(typeof module==='object'&&module.exports){module.exports=__entry;}
|
|
118
|
+
else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
|
|
119
|
+
else{
|
|
120
|
+
var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
|
|
121
|
+
for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
|
|
122
|
+
}
|
|
123
|
+
})(typeof globalThis!=='undefined'?globalThis:this);
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.63.0, chart-parallel 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-parallel/index.js",function(__exports,__req){
|
|
31
|
+
'use strict';
|
|
32
|
+
Object.defineProperty(__exports,"bindParallel",{enumerable:true,get:function(){return bindParallel;}});
|
|
33
|
+
Object.defineProperty(__exports,"drawParallel",{enumerable:true,get:function(){return drawParallel;}});
|
|
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 bindParallel(grid,spec){
|
|
38
|
+
const columns=(Array.isArray(spec.columns)?spec.columns:[]);
|
|
39
|
+
const rows=[];
|
|
40
|
+
const groupSet=[];
|
|
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 record={values:{},group:spec.colourBy?grid.rows.text(row.key,spec.colourBy):null};
|
|
46
|
+
let any=false;
|
|
47
|
+
for(const col of columns){
|
|
48
|
+
const v=Number(grid.rows.value(row.key,col));
|
|
49
|
+
record.values[col]=Number.isFinite(v)?v:null;
|
|
50
|
+
if(record.values[col]!==null)any=true;
|
|
51
|
+
}
|
|
52
|
+
if(record.group!==null&&!groupSet.includes(record.group))groupSet.push(record.group);
|
|
53
|
+
if(any)rows.push(record);
|
|
54
|
+
}
|
|
55
|
+
return{rows,columns,groups:groupSet,empty:rows.length===0||columns.length<2};
|
|
56
|
+
}
|
|
57
|
+
function drawParallel(ctx){
|
|
58
|
+
const{
|
|
59
|
+
plot,bound,scheme,fontSize,groups,helpers,hidden,
|
|
60
|
+
}=ctx;
|
|
61
|
+
const{
|
|
62
|
+
extent,linearScale,Pool,attrs,path,round,setText,resolveScheme,NS,
|
|
63
|
+
}=helpers;
|
|
64
|
+
const sch=scheme||resolveScheme();
|
|
65
|
+
const{rows,columns}=bound;
|
|
66
|
+
const isHidden=(group)=>!!(hidden&&typeof hidden.has==='function'&&hidden.has(group));
|
|
67
|
+
const axisX=columns.map((_,i)=>(columns.length===1
|
|
68
|
+
?(plot.left+plot.right)/2
|
|
69
|
+
:plot.left+(plot.right-plot.left)*(i/(columns.length-1))));
|
|
70
|
+
const scales={};
|
|
71
|
+
for(const col of columns){
|
|
72
|
+
const dom=extent(rows.map((r)=>r.values[col]).filter((v)=>v!==null))||{min:0,max:1};
|
|
73
|
+
scales[col]=linearScale(dom,[plot.bottom,plot.top]);
|
|
74
|
+
}
|
|
75
|
+
const axisPool=new Pool(groups.axis);
|
|
76
|
+
const labelPool=new Pool(groups.overlay);
|
|
77
|
+
columns.forEach((col,i)=>{
|
|
78
|
+
attrs(axisPool.next('line',`${NS}__pc-axis`),{
|
|
79
|
+
x1:round(axisX[i]),y1:round(plot.top),x2:round(axisX[i]),y2:round(plot.bottom),
|
|
80
|
+
stroke:'currentColor','stroke-opacity':0.3,
|
|
81
|
+
});
|
|
82
|
+
const label=labelPool.next('text',`${NS}__pc-label`);
|
|
83
|
+
setText(label,String(col));
|
|
84
|
+
attrs(label,{
|
|
85
|
+
x:round(axisX[i]),y:round(plot.top-4),
|
|
86
|
+
'text-anchor':i===0?'start':i===columns.length-1?'end':'middle',
|
|
87
|
+
'font-size':fontSize,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
const marks=new Pool(groups.marks);
|
|
91
|
+
let drawn=0;
|
|
92
|
+
for(const r of rows){
|
|
93
|
+
if(r.group!==null&&isHidden(r.group))continue;
|
|
94
|
+
const parts=[];
|
|
95
|
+
columns.forEach((col,i)=>{
|
|
96
|
+
const v=r.values[col];
|
|
97
|
+
if(v===null){return;}
|
|
98
|
+
parts.push(parts.length?'L':'M',round(axisX[i]),round(scales[col].of(v)));
|
|
99
|
+
});
|
|
100
|
+
if(parts.length<3)continue;
|
|
101
|
+
const colour=r.group!==null?sch.series(Math.max(0,bound.groups.indexOf(r.group))):sch.series(0);
|
|
102
|
+
attrs(marks.next('path',`${NS}__pc-line ${NS}__mark`),{
|
|
103
|
+
d:path(parts),stroke:colour,'stroke-width':1,'stroke-opacity':0.4,fill:'none',
|
|
104
|
+
});
|
|
105
|
+
drawn+=1;
|
|
106
|
+
}
|
|
107
|
+
axisPool.finish();
|
|
108
|
+
labelPool.finish();
|
|
109
|
+
marks.finish();
|
|
110
|
+
const legend=bound.groups.map((group,index)=>({key:group,label:String(group),index}));
|
|
111
|
+
return{rows:drawn,dimensions:columns.length,legend};
|
|
112
|
+
}
|
|
113
|
+
registerChartType('parallel',{draw:drawParallel,bind:bindParallel,freeform:true,labelled:false});
|
|
114
|
+
const __default=drawParallel;
|
|
115
|
+
});
|
|
116
|
+
var __entry=__req("packages/modules/chart-parallel/index.js");
|
|
117
|
+
if(typeof module==='object'&&module.exports){module.exports=__entry;}
|
|
118
|
+
else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
|
|
119
|
+
else{
|
|
120
|
+
var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
|
|
121
|
+
for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
|
|
122
|
+
}
|
|
123
|
+
})(typeof globalThis!=='undefined'?globalThis:this);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.63.0, chart-ridgeline 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-ridgeline/index.js",function(__exports,__req){
|
|
31
|
+
'use strict';
|
|
32
|
+
Object.defineProperty(__exports,"drawRidgeline",{enumerable:true,get:function(){return drawRidgeline;}});
|
|
33
|
+
Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
|
|
34
|
+
const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
|
|
35
|
+
const registerChartType=__m0["registerChartType"];
|
|
36
|
+
const STEPS=64;
|
|
37
|
+
const DEFAULT_OVERLAP=1.7;
|
|
38
|
+
function drawRidgeline(ctx){
|
|
39
|
+
const{
|
|
40
|
+
plot,bound,scheme,fontSize,groups,grid,spec,helpers,
|
|
41
|
+
}=ctx;
|
|
42
|
+
const{
|
|
43
|
+
valuesByCategory,density,measureDomain,linearScale,linearTicks,
|
|
44
|
+
Pool,attrs,path,round,setText,formatters,resolveScheme,NS,
|
|
45
|
+
}=helpers;
|
|
46
|
+
const sch=scheme||resolveScheme();
|
|
47
|
+
const grouped=valuesByCategory(bound);
|
|
48
|
+
const categories=[...grouped.keys()];
|
|
49
|
+
if(!categories.length)return{empty:true,legend:[]};
|
|
50
|
+
const all=[];
|
|
51
|
+
for(const values of grouped.values())for(const n of values)all.push(n);
|
|
52
|
+
const domain=measureDomain(all,{zero:false});
|
|
53
|
+
const xScale=linearScale(domain,[plot.left,plot.right]);
|
|
54
|
+
const curves=categories.map((cat)=>density(grouped.get(cat),domain,STEPS));
|
|
55
|
+
let maxDensity=0;
|
|
56
|
+
for(const curve of curves)for(const p of curve)if(p.density>maxDensity)maxDensity=p.density;
|
|
57
|
+
maxDensity=maxDensity||1;
|
|
58
|
+
const rows=categories.length;
|
|
59
|
+
const rowStep=(plot.bottom-plot.top)/rows;
|
|
60
|
+
const overlap=spec&&Number.isFinite(spec.overlap)?spec.overlap:DEFAULT_OVERLAP;
|
|
61
|
+
const ridgeHeight=rowStep*overlap;
|
|
62
|
+
const gridPool=new Pool(groups.grid);
|
|
63
|
+
const axisPool=new Pool(groups.axis);
|
|
64
|
+
const fmt=formatters(grid,{kind:'linear',step:(domain.max-domain.min)/5||1});
|
|
65
|
+
for(const tick of linearTicks(domain,5)){
|
|
66
|
+
const x=xScale.of(tick);
|
|
67
|
+
attrs(gridPool.next('line',`${NS}__gridline`),{
|
|
68
|
+
x1:round(x),y1:round(plot.top),x2:round(x),y2:round(plot.bottom),
|
|
69
|
+
stroke:'currentColor','stroke-opacity':0.12,
|
|
70
|
+
});
|
|
71
|
+
const label=axisPool.next('text',`${NS}__tick`);
|
|
72
|
+
setText(label,fmt.tick(tick));
|
|
73
|
+
attrs(label,{
|
|
74
|
+
x:round(x),y:round(plot.bottom+fontSize+4),
|
|
75
|
+
'text-anchor':'middle','font-size':fontSize,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const marks=new Pool(groups.marks);
|
|
79
|
+
const overlayPool=new Pool(groups.overlay);
|
|
80
|
+
categories.forEach((cat,i)=>{
|
|
81
|
+
const baseline=plot.top+rowStep*(i+1);
|
|
82
|
+
const curve=curves[i];
|
|
83
|
+
const colour=sch.series(i);
|
|
84
|
+
const parts=['M',round(xScale.of(curve[0].at)),round(baseline)];
|
|
85
|
+
for(const p of curve){
|
|
86
|
+
parts.push('L',round(xScale.of(p.at)),round(baseline-(p.density/maxDensity)*ridgeHeight));
|
|
87
|
+
}
|
|
88
|
+
parts.push('L',round(xScale.of(curve[curve.length-1].at)),round(baseline),'Z');
|
|
89
|
+
attrs(marks.next('path',`${NS}__ridge ${NS}__mark`),{
|
|
90
|
+
d:path(parts),fill:colour,'fill-opacity':0.7,stroke:colour,'data-point':i,
|
|
91
|
+
});
|
|
92
|
+
attrs(marks.next('path',`${NS}__ridge-base`),{
|
|
93
|
+
d:path(['M',round(plot.left),round(baseline),'L',round(plot.right),round(baseline)]),
|
|
94
|
+
stroke:colour,'stroke-opacity':0.4,fill:'none',
|
|
95
|
+
});
|
|
96
|
+
const label=overlayPool.next('text',`${NS}__ridge-label`);
|
|
97
|
+
setText(label,String(cat));
|
|
98
|
+
attrs(label,{
|
|
99
|
+
x:round(plot.left-4),y:round(baseline-2),
|
|
100
|
+
'text-anchor':'end','font-size':fontSize,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
gridPool.finish();
|
|
104
|
+
axisPool.finish();
|
|
105
|
+
marks.finish();
|
|
106
|
+
overlayPool.finish();
|
|
107
|
+
return{xScale,categories,plot,legend:[]};
|
|
108
|
+
}
|
|
109
|
+
registerChartType('ridgeline',{draw:drawRidgeline,labelled:false});
|
|
110
|
+
const __default=drawRidgeline;
|
|
111
|
+
});
|
|
112
|
+
var __entry=__req("packages/modules/chart-ridgeline/index.js");
|
|
113
|
+
if(typeof module==='object'&&module.exports){module.exports=__entry;}
|
|
114
|
+
else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
|
|
115
|
+
else{
|
|
116
|
+
var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
|
|
117
|
+
for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
|
|
118
|
+
}
|
|
119
|
+
})(typeof globalThis!=='undefined'?globalThis:this);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.63.0, chart-ridgeline 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-ridgeline/index.js",function(__exports,__req){
|
|
31
|
+
'use strict';
|
|
32
|
+
Object.defineProperty(__exports,"drawRidgeline",{enumerable:true,get:function(){return drawRidgeline;}});
|
|
33
|
+
Object.defineProperty(__exports,"default",{enumerable:true,get:function(){return __default;}});
|
|
34
|
+
const __m0=__ext("@toclocoinc/lattice-grid/modules/charts");
|
|
35
|
+
const registerChartType=__m0["registerChartType"];
|
|
36
|
+
const STEPS=64;
|
|
37
|
+
const DEFAULT_OVERLAP=1.7;
|
|
38
|
+
function drawRidgeline(ctx){
|
|
39
|
+
const{
|
|
40
|
+
plot,bound,scheme,fontSize,groups,grid,spec,helpers,
|
|
41
|
+
}=ctx;
|
|
42
|
+
const{
|
|
43
|
+
valuesByCategory,density,measureDomain,linearScale,linearTicks,
|
|
44
|
+
Pool,attrs,path,round,setText,formatters,resolveScheme,NS,
|
|
45
|
+
}=helpers;
|
|
46
|
+
const sch=scheme||resolveScheme();
|
|
47
|
+
const grouped=valuesByCategory(bound);
|
|
48
|
+
const categories=[...grouped.keys()];
|
|
49
|
+
if(!categories.length)return{empty:true,legend:[]};
|
|
50
|
+
const all=[];
|
|
51
|
+
for(const values of grouped.values())for(const n of values)all.push(n);
|
|
52
|
+
const domain=measureDomain(all,{zero:false});
|
|
53
|
+
const xScale=linearScale(domain,[plot.left,plot.right]);
|
|
54
|
+
const curves=categories.map((cat)=>density(grouped.get(cat),domain,STEPS));
|
|
55
|
+
let maxDensity=0;
|
|
56
|
+
for(const curve of curves)for(const p of curve)if(p.density>maxDensity)maxDensity=p.density;
|
|
57
|
+
maxDensity=maxDensity||1;
|
|
58
|
+
const rows=categories.length;
|
|
59
|
+
const rowStep=(plot.bottom-plot.top)/rows;
|
|
60
|
+
const overlap=spec&&Number.isFinite(spec.overlap)?spec.overlap:DEFAULT_OVERLAP;
|
|
61
|
+
const ridgeHeight=rowStep*overlap;
|
|
62
|
+
const gridPool=new Pool(groups.grid);
|
|
63
|
+
const axisPool=new Pool(groups.axis);
|
|
64
|
+
const fmt=formatters(grid,{kind:'linear',step:(domain.max-domain.min)/5||1});
|
|
65
|
+
for(const tick of linearTicks(domain,5)){
|
|
66
|
+
const x=xScale.of(tick);
|
|
67
|
+
attrs(gridPool.next('line',`${NS}__gridline`),{
|
|
68
|
+
x1:round(x),y1:round(plot.top),x2:round(x),y2:round(plot.bottom),
|
|
69
|
+
stroke:'currentColor','stroke-opacity':0.12,
|
|
70
|
+
});
|
|
71
|
+
const label=axisPool.next('text',`${NS}__tick`);
|
|
72
|
+
setText(label,fmt.tick(tick));
|
|
73
|
+
attrs(label,{
|
|
74
|
+
x:round(x),y:round(plot.bottom+fontSize+4),
|
|
75
|
+
'text-anchor':'middle','font-size':fontSize,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const marks=new Pool(groups.marks);
|
|
79
|
+
const overlayPool=new Pool(groups.overlay);
|
|
80
|
+
categories.forEach((cat,i)=>{
|
|
81
|
+
const baseline=plot.top+rowStep*(i+1);
|
|
82
|
+
const curve=curves[i];
|
|
83
|
+
const colour=sch.series(i);
|
|
84
|
+
const parts=['M',round(xScale.of(curve[0].at)),round(baseline)];
|
|
85
|
+
for(const p of curve){
|
|
86
|
+
parts.push('L',round(xScale.of(p.at)),round(baseline-(p.density/maxDensity)*ridgeHeight));
|
|
87
|
+
}
|
|
88
|
+
parts.push('L',round(xScale.of(curve[curve.length-1].at)),round(baseline),'Z');
|
|
89
|
+
attrs(marks.next('path',`${NS}__ridge ${NS}__mark`),{
|
|
90
|
+
d:path(parts),fill:colour,'fill-opacity':0.7,stroke:colour,'data-point':i,
|
|
91
|
+
});
|
|
92
|
+
attrs(marks.next('path',`${NS}__ridge-base`),{
|
|
93
|
+
d:path(['M',round(plot.left),round(baseline),'L',round(plot.right),round(baseline)]),
|
|
94
|
+
stroke:colour,'stroke-opacity':0.4,fill:'none',
|
|
95
|
+
});
|
|
96
|
+
const label=overlayPool.next('text',`${NS}__ridge-label`);
|
|
97
|
+
setText(label,String(cat));
|
|
98
|
+
attrs(label,{
|
|
99
|
+
x:round(plot.left-4),y:round(baseline-2),
|
|
100
|
+
'text-anchor':'end','font-size':fontSize,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
gridPool.finish();
|
|
104
|
+
axisPool.finish();
|
|
105
|
+
marks.finish();
|
|
106
|
+
overlayPool.finish();
|
|
107
|
+
return{xScale,categories,plot,legend:[]};
|
|
108
|
+
}
|
|
109
|
+
registerChartType('ridgeline',{draw:drawRidgeline,labelled:false});
|
|
110
|
+
const __default=drawRidgeline;
|
|
111
|
+
});
|
|
112
|
+
var __entry=__req("packages/modules/chart-ridgeline/index.js");
|
|
113
|
+
if(typeof module==='object'&&module.exports){module.exports=__entry;}
|
|
114
|
+
else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
|
|
115
|
+
else{
|
|
116
|
+
var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
|
|
117
|
+
for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
|
|
118
|
+
}
|
|
119
|
+
})(typeof globalThis!=='undefined'?globalThis:this);
|
package/modules/chart-roc.d.ts
CHANGED