@toclocoinc/lattice-grid 1.62.0 → 1.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +23 -8
  2. package/docs/API.html +526 -16
  3. package/docs/CHART-CODES.md +141 -2
  4. package/docs/api-detail.html +194 -5
  5. package/lattice-grid.d.ts +235 -5
  6. package/lattice-grid.esm.min.js +856 -78
  7. package/lattice-grid.min.cjs +856 -78
  8. package/lattice-grid.min.js +856 -78
  9. package/modules/ai.d.ts +1 -1
  10. package/modules/ai.esm.min.js +13 -16
  11. package/modules/ai.min.cjs +13 -16
  12. package/modules/ai.min.js +13 -16
  13. package/modules/angular.d.ts +1 -1
  14. package/modules/angular.esm.min.js +2 -2
  15. package/modules/angular.min.cjs +2 -2
  16. package/modules/angular.min.js +2 -2
  17. package/modules/chart-alluvial.d.ts +1 -1
  18. package/modules/chart-alluvial.esm.min.js +1 -1
  19. package/modules/chart-alluvial.min.cjs +147 -0
  20. package/modules/chart-alluvial.min.js +147 -0
  21. package/modules/chart-arc.d.ts +1 -1
  22. package/modules/chart-arc.esm.min.js +1 -1
  23. package/modules/chart-arc.min.cjs +106 -0
  24. package/modules/chart-arc.min.js +106 -0
  25. package/modules/chart-bubblemap.d.ts +1 -1
  26. package/modules/chart-bubblemap.esm.min.js +42 -6
  27. package/modules/chart-bubblemap.min.cjs +126 -0
  28. package/modules/chart-bubblemap.min.js +126 -0
  29. package/modules/chart-bump.d.ts +1 -1
  30. package/modules/chart-bump.esm.min.js +1 -1
  31. package/modules/chart-bump.min.cjs +110 -0
  32. package/modules/chart-bump.min.js +110 -0
  33. package/modules/chart-calendar.d.ts +1 -1
  34. package/modules/chart-calendar.esm.min.js +1 -1
  35. package/modules/chart-calendar.min.cjs +129 -0
  36. package/modules/chart-calendar.min.js +129 -0
  37. package/modules/chart-decomposition.d.ts +1 -1
  38. package/modules/chart-decomposition.esm.min.js +1 -1
  39. package/modules/chart-decomposition.min.cjs +131 -0
  40. package/modules/chart-decomposition.min.js +131 -0
  41. package/modules/chart-diverging.d.ts +1 -1
  42. package/modules/chart-diverging.esm.min.js +1 -1
  43. package/modules/chart-diverging.min.cjs +104 -0
  44. package/modules/chart-diverging.min.js +104 -0
  45. package/modules/chart-dumbbell.d.ts +1 -1
  46. package/modules/chart-dumbbell.esm.min.js +1 -1
  47. package/modules/chart-dumbbell.min.cjs +114 -0
  48. package/modules/chart-dumbbell.min.js +114 -0
  49. package/modules/chart-fan.d.ts +1 -1
  50. package/modules/chart-fan.esm.min.js +1 -1
  51. package/modules/chart-fan.min.cjs +139 -0
  52. package/modules/chart-fan.min.js +139 -0
  53. package/modules/chart-hexbin.d.ts +1 -1
  54. package/modules/chart-hexbin.esm.min.js +1 -1
  55. package/modules/chart-hexbin.min.cjs +148 -0
  56. package/modules/chart-hexbin.min.js +148 -0
  57. package/modules/chart-hexmap.d.ts +1 -1
  58. package/modules/chart-hexmap.esm.min.js +46 -6
  59. package/modules/chart-hexmap.min.cjs +164 -0
  60. package/modules/chart-hexmap.min.js +164 -0
  61. package/modules/chart-icicle.d.ts +1 -1
  62. package/modules/chart-icicle.esm.min.js +1 -1
  63. package/modules/chart-icicle.min.cjs +97 -0
  64. package/modules/chart-icicle.min.js +97 -0
  65. package/modules/chart-parallel.d.ts +1 -1
  66. package/modules/chart-parallel.esm.min.js +1 -1
  67. package/modules/chart-parallel.min.cjs +123 -0
  68. package/modules/chart-parallel.min.js +123 -0
  69. package/modules/chart-ridgeline.d.ts +1 -1
  70. package/modules/chart-ridgeline.esm.min.js +1 -1
  71. package/modules/chart-ridgeline.min.cjs +119 -0
  72. package/modules/chart-ridgeline.min.js +119 -0
  73. package/modules/chart-roc.d.ts +1 -1
  74. package/modules/chart-roc.esm.min.js +1 -1
  75. package/modules/chart-roc.min.cjs +181 -0
  76. package/modules/chart-roc.min.js +181 -0
  77. package/modules/chart-slope.d.ts +1 -1
  78. package/modules/chart-slope.esm.min.js +1 -1
  79. package/modules/chart-slope.min.cjs +100 -0
  80. package/modules/chart-slope.min.js +100 -0
  81. package/modules/chart-splom.d.ts +1 -1
  82. package/modules/chart-splom.esm.min.js +1 -1
  83. package/modules/chart-splom.min.cjs +124 -0
  84. package/modules/chart-splom.min.js +124 -0
  85. package/modules/chart-waffle.d.ts +1 -1
  86. package/modules/chart-waffle.esm.min.js +1 -1
  87. package/modules/chart-waffle.min.cjs +97 -0
  88. package/modules/chart-waffle.min.js +97 -0
  89. package/modules/charts.d.ts +1 -1
  90. package/modules/charts.esm.min.js +1917 -662
  91. package/modules/charts.min.cjs +1917 -662
  92. package/modules/charts.min.js +1917 -662
  93. package/modules/data-router.d.ts +1 -1
  94. package/modules/data-router.esm.min.js +129 -20
  95. package/modules/data-router.min.cjs +129 -20
  96. package/modules/data-router.min.js +129 -20
  97. package/modules/devtools.d.ts +1 -1
  98. package/modules/devtools.esm.min.js +2 -2
  99. package/modules/devtools.min.cjs +2 -2
  100. package/modules/devtools.min.js +2 -2
  101. package/modules/dhtmlx-compat.d.ts +1 -1
  102. package/modules/dhtmlx-compat.esm.min.js +4 -16
  103. package/modules/dhtmlx-compat.min.cjs +4 -16
  104. package/modules/dhtmlx-compat.min.js +4 -16
  105. package/modules/gantt.d.ts +1 -1
  106. package/modules/gantt.esm.min.js +187 -82
  107. package/modules/gantt.min.cjs +187 -82
  108. package/modules/gantt.min.js +187 -82
  109. package/modules/geo-europe-nuts.d.ts +16 -0
  110. package/modules/geo-europe-nuts.esm.min.js +29 -0
  111. package/modules/geo-uk.d.ts +18 -0
  112. package/modules/geo-uk.esm.min.js +29 -0
  113. package/modules/geo-us-states.d.ts +16 -0
  114. package/modules/geo-us-states.esm.min.js +29 -0
  115. package/modules/geo-world-110m.d.ts +17 -0
  116. package/modules/geo-world-110m.esm.min.js +29 -0
  117. package/modules/geo-world-50m.d.ts +16 -0
  118. package/modules/geo-world-50m.esm.min.js +29 -0
  119. package/modules/htmx.d.ts +1 -1
  120. package/modules/htmx.esm.min.js +856 -78
  121. package/modules/htmx.min.cjs +856 -78
  122. package/modules/htmx.min.js +856 -78
  123. package/modules/kanban.d.ts +1 -1
  124. package/modules/kanban.esm.min.js +4 -16
  125. package/modules/kanban.min.cjs +4 -16
  126. package/modules/kanban.min.js +4 -16
  127. package/modules/kpi.d.ts +1 -1
  128. package/modules/kpi.esm.min.js +29 -24
  129. package/modules/kpi.min.cjs +29 -24
  130. package/modules/kpi.min.js +29 -24
  131. package/modules/layout.d.ts +1 -1
  132. package/modules/layout.esm.min.js +4 -16
  133. package/modules/layout.min.cjs +4 -16
  134. package/modules/layout.min.js +4 -16
  135. package/modules/mock-socket.d.ts +1 -1
  136. package/modules/mock-socket.esm.min.js +2 -2
  137. package/modules/mock-socket.min.cjs +2 -2
  138. package/modules/mock-socket.min.js +2 -2
  139. package/modules/react.d.ts +308 -3
  140. package/modules/react.esm.min.js +1072 -22
  141. package/modules/react.min.cjs +1056 -21
  142. package/modules/react.min.js +1056 -21
  143. package/modules/svelte.d.ts +1 -1
  144. package/modules/svelte.esm.min.js +2 -2
  145. package/modules/svelte.min.cjs +2 -2
  146. package/modules/svelte.min.js +2 -2
  147. package/modules/tabs.d.ts +1 -1
  148. package/modules/tabs.esm.min.js +4 -16
  149. package/modules/tabs.min.cjs +4 -16
  150. package/modules/tabs.min.js +4 -16
  151. package/modules/vue.d.ts +1 -1
  152. package/modules/vue.esm.min.js +2 -2
  153. package/modules/vue.min.cjs +2 -2
  154. package/modules/vue.min.js +2 -2
  155. package/modules/webcomponent.d.ts +1 -1
  156. package/modules/webcomponent.esm.min.js +856 -78
  157. package/modules/webcomponent.min.cjs +856 -78
  158. package/modules/webcomponent.min.js +856 -78
  159. package/package.json +1 -1
@@ -0,0 +1,181 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-roc 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-roc/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindRoc",{enumerable:true,get:function(){return bindRoc;}});
33
+ Object.defineProperty(__exports,"drawRoc",{enumerable:true,get:function(){return drawRoc;}});
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 bindRoc(grid,spec){
38
+ const labelCol=spec.label;
39
+ const scoreCol=spec.score||(spec.y&&typeof spec.y==='object'?spec.y.col:spec.y);
40
+ const has=Object.prototype.hasOwnProperty.call(spec,'positive');
41
+ const rows=[];
42
+ const n=grid.rows.count();
43
+ for(let i=0;i<n;i++){
44
+ const row=grid.rows.get(i);
45
+ if(!row||row.group)continue;
46
+ const score=Number(grid.rows.value(row.key,scoreCol));
47
+ if(!Number.isFinite(score))continue;
48
+ const raw=grid.rows.value(row.key,labelCol);
49
+ const pos=has?raw===spec.positive:!!raw&&raw!==0&&raw!=='0'&&raw!=='false';
50
+ rows.push({score,pos});
51
+ }
52
+ const curve=['roc','pr','calibration'].includes(spec.curve)?spec.curve:'roc';
53
+ return{rows,curve,empty:rows.length===0};
54
+ }
55
+ function rocCurve(rows){
56
+ const sorted=[...rows].sort((a,b)=>b.score-a.score);
57
+ const P=sorted.filter((r)=>r.pos).length;
58
+ const N=sorted.length-P;
59
+ const points=[{x:0,y:0}];
60
+ let tp=0;
61
+ let fp=0;
62
+ let auc=0;
63
+ let prevX=0;
64
+ let prevY=0;
65
+ for(const r of sorted){
66
+ if(r.pos)tp+=1;else fp+=1;
67
+ const x=N?fp/N:0;
68
+ const y=P?tp/P:0;
69
+ if(x!==prevX)auc+=(x-prevX)*(y+prevY)/2;
70
+ points.push({x,y});
71
+ prevX=x;
72
+ prevY=y;
73
+ }
74
+ return{points,auc};
75
+ }
76
+ function prCurve(rows){
77
+ const sorted=[...rows].sort((a,b)=>b.score-a.score);
78
+ const P=sorted.filter((r)=>r.pos).length;
79
+ const points=[{x:0,y:1}];
80
+ let tp=0;
81
+ let fp=0;
82
+ for(const r of sorted){
83
+ if(r.pos)tp+=1;else fp+=1;
84
+ const recall=P?tp/P:0;
85
+ const precision=(tp+fp)?tp/(tp+fp):1;
86
+ points.push({x:recall,y:precision});
87
+ }
88
+ return{points,auc:P?tp/sorted.length:0};
89
+ }
90
+ function calibrationCurve(rows,bins){
91
+ const buckets=Array.from({length:bins},()=>({sum:0,pos:0,n:0}));
92
+ for(const r of rows){
93
+ const p=Math.min(0.999999,Math.max(0,r.score));
94
+ const b=Math.min(bins-1,Math.floor(p*bins));
95
+ buckets[b].sum+=r.score;
96
+ buckets[b].pos+=r.pos?1:0;
97
+ buckets[b].n+=1;
98
+ }
99
+ const points=[];
100
+ for(const b of buckets)if(b.n)points.push({x:b.sum/b.n,y:b.pos/b.n});
101
+ return{points};
102
+ }
103
+ function drawRoc(ctx){
104
+ const{
105
+ plot,bound,scheme,fontSize,groups,grid,spec,helpers,
106
+ }=ctx;
107
+ const{
108
+ linearScale,linearTicks,Pool,attrs,path,round,setText,formatters,resolveScheme,NS,
109
+ }=helpers;
110
+ const sch=scheme||resolveScheme();
111
+ const colour=sch.series(0);
112
+ const curve=bound.curve;
113
+ const model=curve==='pr'?prCurve(bound.rows)
114
+ :curve==='calibration'?calibrationCurve(bound.rows,spec&&spec.bins>0?spec.bins:10)
115
+ :rocCurve(bound.rows);
116
+ if(!model.points.length)return{empty:true,legend:[]};
117
+ const unit={min:0,max:1};
118
+ const xScale=linearScale(unit,[plot.left,plot.right]);
119
+ const yScale=linearScale(unit,[plot.bottom,plot.top]);
120
+ const gridPool=new Pool(groups.grid);
121
+ const axisPool=new Pool(groups.axis);
122
+ const fmt=formatters(grid,{kind:'linear',step:0.2});
123
+ for(const t of linearTicks(unit,5)){
124
+ attrs(gridPool.next('line',`${NS}__gridline`),{
125
+ x1:round(xScale.of(t)),y1:round(plot.top),x2:round(xScale.of(t)),y2:round(plot.bottom),
126
+ stroke:'currentColor','stroke-opacity':0.08,
127
+ });
128
+ const xl=axisPool.next('text',`${NS}__tick`);
129
+ setText(xl,fmt.tick(t));
130
+ attrs(xl,{x:round(xScale.of(t)),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
131
+ const yl=axisPool.next('text',`${NS}__tick`);
132
+ setText(yl,fmt.tick(t));
133
+ attrs(yl,{x:round(plot.left-4),y:round(yScale.of(t)),'text-anchor':'end','font-size':fontSize});
134
+ }
135
+ const marks=new Pool(groups.marks);
136
+ if(curve!=='pr'){
137
+ attrs(marks.next('path',`${NS}__roc-ref`),{
138
+ d:path(['M',round(xScale.of(0)),round(yScale.of(0)),'L',round(xScale.of(1)),round(yScale.of(1))]),
139
+ stroke:'currentColor','stroke-opacity':0.4,'stroke-dasharray':'4 4',fill:'none',
140
+ });
141
+ }
142
+ const line=['M'];
143
+ model.points.forEach((p,i)=>{
144
+ line.push(round(xScale.of(p.x)),round(yScale.of(p.y)));
145
+ if(i<model.points.length-1)line.push('L');
146
+ });
147
+ attrs(marks.next('path',`${NS}__roc-curve ${NS}__mark`),{
148
+ d:path(line),stroke:colour,'stroke-width':2,fill:'none',
149
+ });
150
+ if(curve==='calibration'){
151
+ for(const p of model.points){
152
+ attrs(marks.next('circle',`${NS}__roc-dot ${NS}__mark`),{
153
+ cx:round(xScale.of(p.x)),cy:round(yScale.of(p.y)),r:3,fill:colour,
154
+ });
155
+ }
156
+ }
157
+ const overlay=new Pool(groups.overlay);
158
+ if(curve==='roc'||curve==='pr'){
159
+ const label=overlay.next('text',`${NS}__roc-auc`);
160
+ setText(label,`${curve==='pr'?'AP':'AUC'} ${model.auc.toFixed(3)}`);
161
+ attrs(label,{x:round(plot.right-4),y:round(plot.top+fontSize),'text-anchor':'end','font-size':fontSize});
162
+ }
163
+ gridPool.finish();
164
+ axisPool.finish();
165
+ marks.finish();
166
+ overlay.finish();
167
+ return{
168
+ curve,points:model.points.length,auc:model.auc,legend:[],
169
+ };
170
+ }
171
+ registerChartType('roc',{draw:drawRoc,bind:bindRoc,labelled:false});
172
+ const __default=drawRoc;
173
+ });
174
+ var __entry=__req("packages/modules/chart-roc/index.js");
175
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
176
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
177
+ else{
178
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
179
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
180
+ }
181
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,181 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-roc 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-roc/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"bindRoc",{enumerable:true,get:function(){return bindRoc;}});
33
+ Object.defineProperty(__exports,"drawRoc",{enumerable:true,get:function(){return drawRoc;}});
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 bindRoc(grid,spec){
38
+ const labelCol=spec.label;
39
+ const scoreCol=spec.score||(spec.y&&typeof spec.y==='object'?spec.y.col:spec.y);
40
+ const has=Object.prototype.hasOwnProperty.call(spec,'positive');
41
+ const rows=[];
42
+ const n=grid.rows.count();
43
+ for(let i=0;i<n;i++){
44
+ const row=grid.rows.get(i);
45
+ if(!row||row.group)continue;
46
+ const score=Number(grid.rows.value(row.key,scoreCol));
47
+ if(!Number.isFinite(score))continue;
48
+ const raw=grid.rows.value(row.key,labelCol);
49
+ const pos=has?raw===spec.positive:!!raw&&raw!==0&&raw!=='0'&&raw!=='false';
50
+ rows.push({score,pos});
51
+ }
52
+ const curve=['roc','pr','calibration'].includes(spec.curve)?spec.curve:'roc';
53
+ return{rows,curve,empty:rows.length===0};
54
+ }
55
+ function rocCurve(rows){
56
+ const sorted=[...rows].sort((a,b)=>b.score-a.score);
57
+ const P=sorted.filter((r)=>r.pos).length;
58
+ const N=sorted.length-P;
59
+ const points=[{x:0,y:0}];
60
+ let tp=0;
61
+ let fp=0;
62
+ let auc=0;
63
+ let prevX=0;
64
+ let prevY=0;
65
+ for(const r of sorted){
66
+ if(r.pos)tp+=1;else fp+=1;
67
+ const x=N?fp/N:0;
68
+ const y=P?tp/P:0;
69
+ if(x!==prevX)auc+=(x-prevX)*(y+prevY)/2;
70
+ points.push({x,y});
71
+ prevX=x;
72
+ prevY=y;
73
+ }
74
+ return{points,auc};
75
+ }
76
+ function prCurve(rows){
77
+ const sorted=[...rows].sort((a,b)=>b.score-a.score);
78
+ const P=sorted.filter((r)=>r.pos).length;
79
+ const points=[{x:0,y:1}];
80
+ let tp=0;
81
+ let fp=0;
82
+ for(const r of sorted){
83
+ if(r.pos)tp+=1;else fp+=1;
84
+ const recall=P?tp/P:0;
85
+ const precision=(tp+fp)?tp/(tp+fp):1;
86
+ points.push({x:recall,y:precision});
87
+ }
88
+ return{points,auc:P?tp/sorted.length:0};
89
+ }
90
+ function calibrationCurve(rows,bins){
91
+ const buckets=Array.from({length:bins},()=>({sum:0,pos:0,n:0}));
92
+ for(const r of rows){
93
+ const p=Math.min(0.999999,Math.max(0,r.score));
94
+ const b=Math.min(bins-1,Math.floor(p*bins));
95
+ buckets[b].sum+=r.score;
96
+ buckets[b].pos+=r.pos?1:0;
97
+ buckets[b].n+=1;
98
+ }
99
+ const points=[];
100
+ for(const b of buckets)if(b.n)points.push({x:b.sum/b.n,y:b.pos/b.n});
101
+ return{points};
102
+ }
103
+ function drawRoc(ctx){
104
+ const{
105
+ plot,bound,scheme,fontSize,groups,grid,spec,helpers,
106
+ }=ctx;
107
+ const{
108
+ linearScale,linearTicks,Pool,attrs,path,round,setText,formatters,resolveScheme,NS,
109
+ }=helpers;
110
+ const sch=scheme||resolveScheme();
111
+ const colour=sch.series(0);
112
+ const curve=bound.curve;
113
+ const model=curve==='pr'?prCurve(bound.rows)
114
+ :curve==='calibration'?calibrationCurve(bound.rows,spec&&spec.bins>0?spec.bins:10)
115
+ :rocCurve(bound.rows);
116
+ if(!model.points.length)return{empty:true,legend:[]};
117
+ const unit={min:0,max:1};
118
+ const xScale=linearScale(unit,[plot.left,plot.right]);
119
+ const yScale=linearScale(unit,[plot.bottom,plot.top]);
120
+ const gridPool=new Pool(groups.grid);
121
+ const axisPool=new Pool(groups.axis);
122
+ const fmt=formatters(grid,{kind:'linear',step:0.2});
123
+ for(const t of linearTicks(unit,5)){
124
+ attrs(gridPool.next('line',`${NS}__gridline`),{
125
+ x1:round(xScale.of(t)),y1:round(plot.top),x2:round(xScale.of(t)),y2:round(plot.bottom),
126
+ stroke:'currentColor','stroke-opacity':0.08,
127
+ });
128
+ const xl=axisPool.next('text',`${NS}__tick`);
129
+ setText(xl,fmt.tick(t));
130
+ attrs(xl,{x:round(xScale.of(t)),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
131
+ const yl=axisPool.next('text',`${NS}__tick`);
132
+ setText(yl,fmt.tick(t));
133
+ attrs(yl,{x:round(plot.left-4),y:round(yScale.of(t)),'text-anchor':'end','font-size':fontSize});
134
+ }
135
+ const marks=new Pool(groups.marks);
136
+ if(curve!=='pr'){
137
+ attrs(marks.next('path',`${NS}__roc-ref`),{
138
+ d:path(['M',round(xScale.of(0)),round(yScale.of(0)),'L',round(xScale.of(1)),round(yScale.of(1))]),
139
+ stroke:'currentColor','stroke-opacity':0.4,'stroke-dasharray':'4 4',fill:'none',
140
+ });
141
+ }
142
+ const line=['M'];
143
+ model.points.forEach((p,i)=>{
144
+ line.push(round(xScale.of(p.x)),round(yScale.of(p.y)));
145
+ if(i<model.points.length-1)line.push('L');
146
+ });
147
+ attrs(marks.next('path',`${NS}__roc-curve ${NS}__mark`),{
148
+ d:path(line),stroke:colour,'stroke-width':2,fill:'none',
149
+ });
150
+ if(curve==='calibration'){
151
+ for(const p of model.points){
152
+ attrs(marks.next('circle',`${NS}__roc-dot ${NS}__mark`),{
153
+ cx:round(xScale.of(p.x)),cy:round(yScale.of(p.y)),r:3,fill:colour,
154
+ });
155
+ }
156
+ }
157
+ const overlay=new Pool(groups.overlay);
158
+ if(curve==='roc'||curve==='pr'){
159
+ const label=overlay.next('text',`${NS}__roc-auc`);
160
+ setText(label,`${curve==='pr'?'AP':'AUC'} ${model.auc.toFixed(3)}`);
161
+ attrs(label,{x:round(plot.right-4),y:round(plot.top+fontSize),'text-anchor':'end','font-size':fontSize});
162
+ }
163
+ gridPool.finish();
164
+ axisPool.finish();
165
+ marks.finish();
166
+ overlay.finish();
167
+ return{
168
+ curve,points:model.points.length,auc:model.auc,legend:[],
169
+ };
170
+ }
171
+ registerChartType('roc',{draw:drawRoc,bind:bindRoc,labelled:false});
172
+ const __default=drawRoc;
173
+ });
174
+ var __entry=__req("packages/modules/chart-roc/index.js");
175
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
176
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
177
+ else{
178
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
179
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
180
+ }
181
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-slope module type declarations
2
+ * Lattice Grid 1.63.0, chart-slope 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-slope module
2
+ * Lattice Grid 1.63.0, chart-slope module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -0,0 +1,100 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-slope 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-slope/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"drawSlope",{enumerable:true,get:function(){return drawSlope;}});
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 drawSlope(ctx){
37
+ const{
38
+ plot,bound,scheme,fontSize,groups,helpers,
39
+ }=ctx;
40
+ const{
41
+ measureDomain,linearScale,bandScale,Pool,attrs,path,round,setText,resolveScheme,NS,
42
+ }=helpers;
43
+ const sch=scheme||resolveScheme();
44
+ const labels=bound.labels||[];
45
+ if(labels.length<2)return{empty:true,legend:[]};
46
+ const values=[];
47
+ for(const s of bound.series)for(const p of s.points)if(p.y!==null)values.push(p.y);
48
+ const yDomain=measureDomain(values,{zero:false});
49
+ const yScale=linearScale(yDomain,[plot.bottom,plot.top]);
50
+ const xScale=bandScale(labels,[plot.left,plot.right],0.5);
51
+ const colX=labels.map((l)=>xScale.of(l)+xScale.bandwidth/2);
52
+ const axisPool=new Pool(groups.axis);
53
+ labels.forEach((label,i)=>{
54
+ const t=axisPool.next('text',`${NS}__tick`);
55
+ setText(t,String(label));
56
+ attrs(t,{x:round(colX[i]),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
57
+ });
58
+ const marks=new Pool(groups.marks);
59
+ const overlay=new Pool(groups.overlay);
60
+ bound.series.forEach((s,i)=>{
61
+ const colour=sch.series(i);
62
+ const parts=[];
63
+ s.points.forEach((p,j)=>{
64
+ if(p.y===null)return;
65
+ parts.push(parts.length?'L':'M',round(colX[j]),round(yScale.of(p.y)));
66
+ });
67
+ if(parts.length>=3){
68
+ attrs(marks.next('path',`${NS}__slope-line ${NS}__mark`),{
69
+ d:path(parts),stroke:colour,'stroke-width':2,fill:'none','data-series':i,
70
+ });
71
+ }
72
+ s.points.forEach((p,j)=>{
73
+ if(p.y===null)return;
74
+ attrs(marks.next('circle',`${NS}__slope-dot ${NS}__mark`),{
75
+ cx:round(colX[j]),cy:round(yScale.of(p.y)),r:3,fill:colour,
76
+ });
77
+ });
78
+ const last=[...s.points].reverse().find((p)=>p.y!==null);
79
+ if(last){
80
+ const t=overlay.next('text',`${NS}__slope-label`);
81
+ setText(t,String(s.label||s.key));
82
+ attrs(t,{x:round(plot.right+2),y:round(yScale.of(last.y)),'font-size':fontSize});
83
+ }
84
+ });
85
+ axisPool.finish();
86
+ marks.finish();
87
+ overlay.finish();
88
+ return{series:bound.series.length,legend:[]};
89
+ }
90
+ registerChartType('slope',{draw:drawSlope,labelled:false});
91
+ const __default=drawSlope;
92
+ });
93
+ var __entry=__req("packages/modules/chart-slope/index.js");
94
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
95
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
96
+ else{
97
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
98
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
99
+ }
100
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -0,0 +1,100 @@
1
+ /*!
2
+ * Lattice Grid 1.63.0, chart-slope 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-slope/index.js",function(__exports,__req){
31
+ 'use strict';
32
+ Object.defineProperty(__exports,"drawSlope",{enumerable:true,get:function(){return drawSlope;}});
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 drawSlope(ctx){
37
+ const{
38
+ plot,bound,scheme,fontSize,groups,helpers,
39
+ }=ctx;
40
+ const{
41
+ measureDomain,linearScale,bandScale,Pool,attrs,path,round,setText,resolveScheme,NS,
42
+ }=helpers;
43
+ const sch=scheme||resolveScheme();
44
+ const labels=bound.labels||[];
45
+ if(labels.length<2)return{empty:true,legend:[]};
46
+ const values=[];
47
+ for(const s of bound.series)for(const p of s.points)if(p.y!==null)values.push(p.y);
48
+ const yDomain=measureDomain(values,{zero:false});
49
+ const yScale=linearScale(yDomain,[plot.bottom,plot.top]);
50
+ const xScale=bandScale(labels,[plot.left,plot.right],0.5);
51
+ const colX=labels.map((l)=>xScale.of(l)+xScale.bandwidth/2);
52
+ const axisPool=new Pool(groups.axis);
53
+ labels.forEach((label,i)=>{
54
+ const t=axisPool.next('text',`${NS}__tick`);
55
+ setText(t,String(label));
56
+ attrs(t,{x:round(colX[i]),y:round(plot.bottom+fontSize+4),'text-anchor':'middle','font-size':fontSize});
57
+ });
58
+ const marks=new Pool(groups.marks);
59
+ const overlay=new Pool(groups.overlay);
60
+ bound.series.forEach((s,i)=>{
61
+ const colour=sch.series(i);
62
+ const parts=[];
63
+ s.points.forEach((p,j)=>{
64
+ if(p.y===null)return;
65
+ parts.push(parts.length?'L':'M',round(colX[j]),round(yScale.of(p.y)));
66
+ });
67
+ if(parts.length>=3){
68
+ attrs(marks.next('path',`${NS}__slope-line ${NS}__mark`),{
69
+ d:path(parts),stroke:colour,'stroke-width':2,fill:'none','data-series':i,
70
+ });
71
+ }
72
+ s.points.forEach((p,j)=>{
73
+ if(p.y===null)return;
74
+ attrs(marks.next('circle',`${NS}__slope-dot ${NS}__mark`),{
75
+ cx:round(colX[j]),cy:round(yScale.of(p.y)),r:3,fill:colour,
76
+ });
77
+ });
78
+ const last=[...s.points].reverse().find((p)=>p.y!==null);
79
+ if(last){
80
+ const t=overlay.next('text',`${NS}__slope-label`);
81
+ setText(t,String(s.label||s.key));
82
+ attrs(t,{x:round(plot.right+2),y:round(yScale.of(last.y)),'font-size':fontSize});
83
+ }
84
+ });
85
+ axisPool.finish();
86
+ marks.finish();
87
+ overlay.finish();
88
+ return{series:bound.series.length,legend:[]};
89
+ }
90
+ registerChartType('slope',{draw:drawSlope,labelled:false});
91
+ const __default=drawSlope;
92
+ });
93
+ var __entry=__req("packages/modules/chart-slope/index.js");
94
+ if(typeof module==='object'&&module.exports){module.exports=__entry;}
95
+ else if(typeof define==='function'&&define.amd){define(function(){return __entry;});}
96
+ else{
97
+ var __t=root["LatticeGrid"]||(root["LatticeGrid"]={});
98
+ for(var __k in __entry){if(__k!=='default')__t[__k]=__entry[__k];}
99
+ }
100
+ })(typeof globalThis!=='undefined'?globalThis:this);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.62.0, chart-splom module type declarations
2
+ * Lattice Grid 1.63.0, chart-splom 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-splom module
2
+ * Lattice Grid 1.63.0, chart-splom module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */