@genome-spy/app 1.1.1 → 1.3.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/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
- package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
- package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
- package/dist/agentApi.es.js +6783 -5135
- package/dist/agentShared.es.js +433 -460
- package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
- package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
- package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
- package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
- package/dist/clipOptions-SrrxeAEU.js +4316 -0
- package/dist/clipOptions-clBEbkjv.js +4326 -0
- package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
- package/dist/color-uTRRsy8i.js +116 -0
- package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
- package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
- package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
- package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
- package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
- package/dist/dialog.es.js +1 -1
- package/dist/dist-CmY6iewb.js +1501 -0
- package/dist/dist-D6xbz5Ks.js +1501 -0
- package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
- package/dist/esm-BUkWqSr2.js +299 -0
- package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
- package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
- package/dist/esm-C6erfjPM.js +252 -0
- package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
- package/dist/esm-CqY5ezGz.js +1249 -0
- package/dist/esm-DfMIJ_N2.js +1522 -0
- package/dist/esm-Dls41IbZ.js +787 -0
- package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
- package/dist/esm-aGLCvYRP.js +238 -0
- package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
- package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
- package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
- package/dist/flowNode-BSjy0Wz3.js +1306 -0
- package/dist/flowOutput-D5qpxWe0.js +183 -0
- package/dist/index.es.js +4766 -5522
- package/dist/index.js +1089 -685
- package/dist/inflate-BdC5KvHn.js +886 -0
- package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
- package/dist/markUtils-RaatLEa-.js +78 -0
- package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
- package/dist/metadataUtils-DxEPe0vj.js +879 -0
- package/dist/order-BnKzKjt4.js +1151 -0
- package/dist/order-BpJnq_nV.js +1150 -0
- package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
- package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
- package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
- package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
- package/dist/rectangle-BAdoDPXu.js +194 -0
- package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
- package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
- package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
- package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
- package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
- package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
- package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
- package/dist/schema.json +33403 -16929
- package/dist/style.css +1 -1
- package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
- package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
- package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
- package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
- package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
- package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
- package/dist/url-DeOdSRrv.js +183 -0
- package/dist/viewError-B0TMfOpB.js +33 -0
- package/dist/viewError-D9aO90cI.js +33 -0
- package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
- package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
- package/dist/viewUtils-0SJOewM6.js +6195 -0
- package/dist/webgl-CXIO3OQz.js +5782 -0
- package/dist/webgl-Pdvfhio5.js +5783 -0
- package/package.json +7 -5
- package/src/agentApi/index.d.ts +3 -2
- package/src/agentShared/index.d.ts +2 -0
- package/src/appTypes.d.ts +1 -6
- package/src/embedTypes.d.ts +36 -1
- package/src/index.d.ts +6 -0
- package/src/spec/sampleView.d.ts +68 -13
- package/src/spec/view.d.ts +44 -5
- package/src/state/paramProvenanceTypes.d.ts +25 -2
- package/src/state.d.ts +14 -52
- package/dist/clipOptions-B5PibDq3.js +0 -2923
- package/dist/clipOptions-Cba4I0AO.js +0 -2903
- package/dist/esm-Dndm-NaA.js +0 -1193
- package/dist/order-B4uR9Q04.js +0 -1062
- package/dist/order-BSPy5DI8.js +0 -1062
- package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
- package/dist/vega-scale-Byaw1K8O.js +0 -2446
- package/dist/vega-scale-Ctz_wa3z.js +0 -2443
- package/dist/viewError-BiR9VCgL.js +0 -29
- package/dist/viewUtils-JX6CMEYH.js +0 -6664
- package/dist/webgl-DdmOwEH0.js +0 -5544
- package/dist/webgl-Dw8xqZpX.js +0 -5544
|
@@ -187,7 +187,7 @@ var t = (typeof document < "u" && document.currentScript && document.currentScri
|
|
|
187
187
|
return t === -1 ? e : e.substr(0, t);
|
|
188
188
|
}, we = (e, t, n) => {
|
|
189
189
|
switch (t) {
|
|
190
|
-
case 1: return n ? (e) => d[e
|
|
190
|
+
case 1: return n ? (e) => d[e | 0] : (e) => f[e | 0];
|
|
191
191
|
case 2: return n ? (e) => p[e >> 1] : (e) => m[e >> 1];
|
|
192
192
|
case 4: return n ? (e) => h[e >> 2] : (e) => g[e >> 2];
|
|
193
193
|
default: throw TypeError(`invalid integer width (${t}): ${e}`);
|
|
@@ -579,8 +579,8 @@ var t = (typeof document < "u" && document.currentScript && document.currentScri
|
|
|
579
579
|
var n = 0;
|
|
580
580
|
return Fe().forEach((r, i) => {
|
|
581
581
|
var a = t + n;
|
|
582
|
-
for (i = g[e + 4 * i >> 2] = a, a = 0; a < r.length; ++a) d[i++
|
|
583
|
-
d[i
|
|
582
|
+
for (i = g[e + 4 * i >> 2] = a, a = 0; a < r.length; ++a) d[i++ | 0] = r.charCodeAt(a);
|
|
583
|
+
d[i | 0] = 0, n += r.length + 1;
|
|
584
584
|
}), 0;
|
|
585
585
|
},
|
|
586
586
|
u: (e, t) => {
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Et as e, _ as t, o as n, s as r, un as i } from "./clipOptions-SrrxeAEU.js";
|
|
2
|
+
import { r as a } from "./arrayUtils-Bm7QnzhN.js";
|
|
3
3
|
import { t as o } from "./warning-CpIIpk8e.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { n as j,
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
4
|
+
import { l as s } from "./markUtils-RaatLEa-.js";
|
|
5
|
+
import { t as c } from "./rectangle-DZTR6NFQ.js";
|
|
6
|
+
import { n as l, r as u } from "./color-jETn8xK_.js";
|
|
7
|
+
import { n as d, r as f, t as p } from "./performanceProfiler-CPLEjApa.js";
|
|
8
|
+
import { C as m, D as h, E as g, F as _, L as v, N as y, P as b, R as x, S, _ as C, c as w, d as T, f as E, g as D, i as O, j as k, l as ee, m as te, n as ne, p as re, u as ie, v as ae, w as A, x as j, y as M } from "./order-BnKzKjt4.js";
|
|
9
|
+
import { n as N, t as P } from "./renderCanvas2D-Y7pkRzbC.js";
|
|
10
|
+
import { t as F } from "./canvasSizeHelper-foL2YvGL.js";
|
|
11
|
+
import { exportCanvas as I, exportRaster as L } from "./rasterExport-C_vx4Jwd.js";
|
|
12
|
+
import { createCanvas2DSvgRasterizer as R } from "./svgRasterizer-6OcftuoI.js";
|
|
12
13
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingRasterizer.js
|
|
13
|
-
var
|
|
14
|
+
var z = 12, B = .5, V = class {
|
|
14
15
|
#e = [];
|
|
15
16
|
#t = [];
|
|
16
17
|
#n = [
|
|
@@ -50,7 +51,7 @@ var L = 12, R = .5, z = class {
|
|
|
50
51
|
}
|
|
51
52
|
setClip(e, t, n, r) {
|
|
52
53
|
if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) throw RangeError("Software picking clip must be finite.");
|
|
53
|
-
this.#r =
|
|
54
|
+
this.#r = W(Math.floor(Math.min(e, n)), 0, this.buffer.width), this.#i = W(Math.floor(Math.min(t, r)), 0, this.buffer.height), this.#a = W(Math.ceil(Math.max(e, n)), this.#r, this.buffer.width), this.#o = W(Math.ceil(Math.max(t, r)), this.#i, this.buffer.height);
|
|
54
55
|
}
|
|
55
56
|
fillRect(e, t, n, r, i) {
|
|
56
57
|
this.#s++, this.#p(e, t, n, r, i);
|
|
@@ -95,24 +96,21 @@ var L = 12, R = .5, z = class {
|
|
|
95
96
|
if (!(a > 0) || !Number.isFinite(a)) return;
|
|
96
97
|
this.#u++;
|
|
97
98
|
let s = a / 2, c = this.#n;
|
|
98
|
-
if (!
|
|
99
|
+
if (!E(t, n, r, i, this.#r - s, this.#i - s, this.#a + s, this.#o + s, c)) return;
|
|
99
100
|
let l = c[2] - c[0], u = c[3] - c[1], d = Math.ceil(Math.max(Math.abs(l), Math.abs(u)));
|
|
100
|
-
if (d == 0)
|
|
101
|
-
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
for (let t = 0; t <= d; t++) {
|
|
101
|
+
if (d == 0) this.#h(e, c[0], c[1], s, o);
|
|
102
|
+
else for (let t = 0; t <= d; t++) {
|
|
105
103
|
let n = t / d;
|
|
106
104
|
this.#h(e, c[0] + l * n, c[1] + u * n, s, o);
|
|
107
105
|
}
|
|
108
106
|
}
|
|
109
|
-
strokeCubic(e, t, n, r, i, a, o, s, c, l, u =
|
|
107
|
+
strokeCubic(e, t, n, r, i, a, o, s, c, l, u = B, d) {
|
|
110
108
|
if (!(l > 0) || !Number.isFinite(l) || !(u > 0) || !Number.isFinite(u) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(c)) return;
|
|
111
109
|
this.#d++;
|
|
112
110
|
let f = this.#e;
|
|
113
111
|
for (f.length = 0, f.push(t, n, r, i, a, o, s, c, 0); f.length;) {
|
|
114
112
|
let t = f.pop(), n = f.pop(), r = f.pop(), i = f.pop(), a = f.pop(), o = f.pop(), s = f.pop(), c = f.pop(), p = f.pop();
|
|
115
|
-
if (t >=
|
|
113
|
+
if (t >= z || H(p, c, s, o, a, i, r, n, u)) {
|
|
116
114
|
this.strokeSegment(e, p, c, r, n, l, d);
|
|
117
115
|
continue;
|
|
118
116
|
}
|
|
@@ -138,106 +136,108 @@ var L = 12, R = .5, z = class {
|
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
138
|
};
|
|
141
|
-
function
|
|
142
|
-
if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) return !1;
|
|
143
|
-
let l = n - e, u = r - t, d = 0, f = 1;
|
|
144
|
-
if (l == 0) {
|
|
145
|
-
if (e < i || e > o) return !1;
|
|
146
|
-
} else {
|
|
147
|
-
let t = (i - e) / l, n = (o - e) / l;
|
|
148
|
-
d = Math.max(d, Math.min(t, n)), f = Math.min(f, Math.max(t, n));
|
|
149
|
-
}
|
|
150
|
-
if (u == 0) {
|
|
151
|
-
if (t < a || t > s) return !1;
|
|
152
|
-
} else {
|
|
153
|
-
let e = (a - t) / u, n = (s - t) / u;
|
|
154
|
-
d = Math.max(d, Math.min(e, n)), f = Math.min(f, Math.max(e, n));
|
|
155
|
-
}
|
|
156
|
-
return d > f ? !1 : (c[0] = e + d * l, c[1] = t + d * u, c[2] = e + f * l, c[3] = t + f * u, !0);
|
|
157
|
-
}
|
|
158
|
-
function V(e, t, n, r, i, a, o, s, c) {
|
|
139
|
+
function H(e, t, n, r, i, a, o, s, c) {
|
|
159
140
|
let l = o - e, u = s - t, d = l * l + u * u, f = c * c;
|
|
160
141
|
if (d == 0) {
|
|
161
|
-
let o =
|
|
142
|
+
let o = U(e, t, n, r), s = U(e, t, i, a);
|
|
162
143
|
return Math.max(o, s) <= f;
|
|
163
144
|
}
|
|
164
145
|
let p = u * (n - e) - l * (r - t), m = u * (i - e) - l * (a - t);
|
|
165
146
|
return Math.max(p * p, m * m) <= f * d;
|
|
166
147
|
}
|
|
167
|
-
function
|
|
148
|
+
function U(e, t, n, r) {
|
|
168
149
|
let i = n - e, a = r - t;
|
|
169
150
|
return i * i + a * a;
|
|
170
151
|
}
|
|
171
|
-
function
|
|
152
|
+
function W(e, t, n) {
|
|
172
153
|
return Math.max(t, Math.min(n, e));
|
|
173
154
|
}
|
|
174
155
|
//#endregion
|
|
175
156
|
//#region ../core/src/rendering/canvas2d/picking/renderers/index.js
|
|
176
|
-
var
|
|
177
|
-
function
|
|
157
|
+
var G = 1;
|
|
158
|
+
function K(e, t) {
|
|
178
159
|
let n = e.getType();
|
|
179
|
-
return n == "arrow" ?
|
|
160
|
+
return n == "arrow" ? J(e, t) : n == "rect" ? oe(e, t) : n == "point" ? se(e, t) : n == "rule" || n == "tick" ? ce(e, t) : n == "link" ? le(e, t) : n == "text" ? ue(e, t) : 0;
|
|
180
161
|
}
|
|
181
|
-
function
|
|
162
|
+
function q(e) {
|
|
182
163
|
let t = e.getType();
|
|
183
164
|
return t == "rect" || t == "arrow" || t == "point" || t == "rule" || t == "tick" || t == "link" || t == "text";
|
|
184
165
|
}
|
|
185
|
-
function
|
|
186
|
-
let n = e, r =
|
|
187
|
-
return
|
|
166
|
+
function J(e, t) {
|
|
167
|
+
let n = e, r = m(n), i = Array(8).fill(0);
|
|
168
|
+
return g(n, r, t, (e) => {
|
|
188
169
|
let a = Y(n, e.datum), o = e.strokeWidth / 2;
|
|
189
|
-
r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth),
|
|
170
|
+
r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth), A(e, (n, r, s, c) => {
|
|
190
171
|
let l = e.headHalfWidth + o, u = n + s.x * o, d = r + s.y * o, f = e.headRepeatFootprint + o, p = n - s.x * f, m = r - s.y * f;
|
|
191
|
-
|
|
172
|
+
de(i, u, d, p, m, c.x, c.y, l), t.rasterizer.fillConvexPolygon(a, i);
|
|
192
173
|
});
|
|
193
174
|
});
|
|
194
175
|
}
|
|
195
|
-
function J(e, t) {
|
|
196
|
-
let n = e;
|
|
197
|
-
return re(n, T(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
|
|
198
|
-
}
|
|
199
176
|
function oe(e, t) {
|
|
200
|
-
let n = e
|
|
201
|
-
return
|
|
177
|
+
let n = e;
|
|
178
|
+
return te(n, re(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
|
|
202
179
|
}
|
|
203
180
|
function se(e, t) {
|
|
204
|
-
let n = e;
|
|
205
|
-
return
|
|
181
|
+
let n = e, r = k(n, n.properties.minPickingSize);
|
|
182
|
+
return C(n, D(n), t, (e) => t.rasterizer.fillSquare(Y(n, e.datum), e.x, e.y, Math.max(e.boundsRadius, r / 2)));
|
|
206
183
|
}
|
|
207
184
|
function ce(e, t) {
|
|
208
|
-
let n = e, r =
|
|
209
|
-
return
|
|
210
|
-
let
|
|
211
|
-
t.rasterizer.
|
|
185
|
+
let n = e, r = ie(n);
|
|
186
|
+
return T(n, r, t, (e) => {
|
|
187
|
+
let i = e.x2 - e.x1, a = e.y2 - e.y1, o = r.strokeCap === "square" && e.strokeWidth > 0 ? (e.size / 2 + e.strokeWidth) / Math.hypot(i, a) : 0;
|
|
188
|
+
t.rasterizer.strokeSegment(Y(n, e.datum), e.x1 - i * o, e.y1 - a * o, e.x2 + i * o, e.y2 + a * o, Math.max(e.size + 2 * e.strokeWidth, G));
|
|
212
189
|
});
|
|
213
190
|
}
|
|
214
191
|
function le(e, t) {
|
|
215
|
-
let n = e, r =
|
|
216
|
-
return
|
|
192
|
+
let n = e, r = k(n, n.properties.minPickingSize), i = ae(n), a = S(n, i.shape);
|
|
193
|
+
return M(n, i, {
|
|
194
|
+
...t,
|
|
195
|
+
minPickingSize: r
|
|
196
|
+
}, (e) => {
|
|
197
|
+
let { geometry: i } = e;
|
|
198
|
+
if (i.type == "orthogonal") {
|
|
199
|
+
let [a, o, s] = i.points, c = Y(n, e.datum), l = Math.max(e.strokeWidth, r) / 2;
|
|
200
|
+
for (let e = 0; e < 2; e++) {
|
|
201
|
+
let n = i.points[e], r = i.points[e + 1], a = Math.abs(r[0] - n[0]), o = Math.abs(r[1] - n[1]);
|
|
202
|
+
(a != 0 || o != 0) && t.rasterizer.fillRect(c, Math.min(n[0], r[0]) - (a == 0 ? l : 0), Math.min(n[1], r[1]) - (o == 0 ? l : 0), a + (a == 0 ? 2 * l : 0), o + (o == 0 ? 2 * l : 0));
|
|
203
|
+
}
|
|
204
|
+
if ((a[0] != o[0] || a[1] != o[1]) && (s[0] != o[0] || s[1] != o[1])) {
|
|
205
|
+
let e = o[0] + l * (Math.sign(o[0] - a[0]) - Math.sign(s[0] - o[0])), n = o[1] + l * (Math.sign(o[1] - a[1]) - Math.sign(s[1] - o[1]));
|
|
206
|
+
t.rasterizer.fillRect(c, Math.min(o[0], e), Math.min(o[1], n), l, l);
|
|
207
|
+
}
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
let [o, s, c, l] = i.points, u = a && j(o, l, a);
|
|
211
|
+
t.rasterizer.strokeCubic(Y(n, e.datum), o[0], o[1], s[0], s[1], c[0], c[1], l[0], l[1], Math.max(e.strokeWidth, r), void 0, u ? (e, t) => Math.abs(u.normalX * e + u.normalY * t - u.offset) < u.end : void 0);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function ue(e, t) {
|
|
215
|
+
let n = e, r = t.textMetrics ?? n.unitView.context.textMetrics, i = r.requestFont(n.properties), a = O(r, n.properties);
|
|
216
|
+
return ee(n, w(n), {
|
|
217
217
|
...t,
|
|
218
218
|
fontMeasurement: i,
|
|
219
219
|
measureLogoInkBounds: a
|
|
220
220
|
}, (e) => t.rasterizer.fillConvexPolygon(Y(n, e.datum), e.boundsQuad));
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function de(e, t, n, r, i, a, o, s) {
|
|
223
223
|
let c = a * s, l = o * s;
|
|
224
224
|
e[0] = t + c, e[1] = n + l, e[2] = r + c, e[3] = i + l, e[4] = r - c, e[5] = i - l, e[6] = t - c, e[7] = n - l;
|
|
225
225
|
}
|
|
226
226
|
function Y(e, t) {
|
|
227
227
|
let n = e.encoders;
|
|
228
|
-
return
|
|
228
|
+
return h(n.uniqueId, t);
|
|
229
229
|
}
|
|
230
230
|
//#endregion
|
|
231
231
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingViewRenderingContext.js
|
|
232
|
-
var
|
|
232
|
+
var fe = class extends u {
|
|
233
233
|
#e = [];
|
|
234
234
|
#t = /* @__PURE__ */ new Set();
|
|
235
235
|
#n;
|
|
236
|
-
#r = new
|
|
236
|
+
#r = new v();
|
|
237
237
|
#i;
|
|
238
238
|
#a = [0, 0];
|
|
239
239
|
constructor(e) {
|
|
240
|
-
super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.textMetrics = e.textMetrics, this.#n =
|
|
240
|
+
super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.textMetrics = e.textMetrics, this.#n = d(), this.#i = e.xIndexManager;
|
|
241
241
|
}
|
|
242
242
|
getDevicePixelRatio() {
|
|
243
243
|
return this.devicePixelRatio;
|
|
@@ -251,24 +251,24 @@ var de = class extends c {
|
|
|
251
251
|
popView(e) {
|
|
252
252
|
if (this.#e.pop()?.view !== e) throw Error("Unbalanced software picking view rendering context stack.");
|
|
253
253
|
}
|
|
254
|
-
renderMark(e,
|
|
255
|
-
if (!e.isPickingParticipant() || !
|
|
256
|
-
let i =
|
|
257
|
-
if (i && !e.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !
|
|
254
|
+
renderMark(e, t) {
|
|
255
|
+
if (!e.isPickingParticipant() || !q(e)) return;
|
|
256
|
+
let i = t.sampleFacetRenderingOptions;
|
|
257
|
+
if (i && !e.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !N(i))) {
|
|
258
258
|
this.#n?.addCount("canvasCulledSampleFacetOccurrences");
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
261
|
let a = e.unitView.getEffectiveOpacity();
|
|
262
262
|
if (a <= 0) return;
|
|
263
|
-
let s = this.currentCoords, c = t
|
|
264
|
-
if (!
|
|
265
|
-
let d =
|
|
266
|
-
|
|
263
|
+
let s = this.currentCoords, c = n(t), l = r(c, e.properties.clip, s), u = b(this.width, this.height, l);
|
|
264
|
+
if (!_(u)) return;
|
|
265
|
+
let d = y(s, c, e.properties.cullByVisibleRange), f = this.#i?.prepare(e) ?? !1;
|
|
266
|
+
x(e, t, s, this.#r, (t, n) => {
|
|
267
267
|
if (n.length == 0) return;
|
|
268
268
|
let r = 0, i = n.length;
|
|
269
269
|
if (f && this.#i.query(n, this.#a) && (r = this.#a[0], i = this.#a[1], r === i)) return;
|
|
270
270
|
let o = this.getRasterizer();
|
|
271
|
-
o.setClip(u.x1, u.y1, u.x2, u.y2),
|
|
271
|
+
o.setClip(u.x1, u.y1, u.x2, u.y2), K(e, {
|
|
272
272
|
rasterizer: o,
|
|
273
273
|
coords: t,
|
|
274
274
|
data: n,
|
|
@@ -282,15 +282,15 @@ var de = class extends c {
|
|
|
282
282
|
}, (t) => o(`Canvas2D picking could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
|
|
283
283
|
}
|
|
284
284
|
get currentCoords() {
|
|
285
|
-
let e =
|
|
285
|
+
let e = a(this.#e);
|
|
286
286
|
if (!e) throw Error("No current view in software picking rendering context.");
|
|
287
287
|
return e.coords;
|
|
288
288
|
}
|
|
289
|
-
}, X = 2 ** 31 - 1,
|
|
290
|
-
function
|
|
289
|
+
}, X = 2 ** 31 - 1, pe = -(2 ** 31);
|
|
290
|
+
function me(t, n, r, i = r) {
|
|
291
291
|
let a = Array(t);
|
|
292
292
|
a.fill(X);
|
|
293
|
-
let o =
|
|
293
|
+
let o = pe, s = -Infinity, c = !1, l = Array(t);
|
|
294
294
|
l.fill(0);
|
|
295
295
|
let u = n[0], d = (n[1] - n[0]) / t, f = (n, r) => {
|
|
296
296
|
let i = (n - u) / d, a = Math.floor(i);
|
|
@@ -320,15 +320,7 @@ function pe(t, n, r, i = r) {
|
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
322
|
let u = r(e), d = i(e);
|
|
323
|
-
if (!Number.isFinite(u) || !Number.isFinite(d)) {
|
|
324
|
-
c = !0;
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
if (u < s) {
|
|
328
|
-
c = !0;
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
if (d < u) {
|
|
323
|
+
if (!Number.isFinite(u) || !Number.isFinite(d) || u < s || d < u) {
|
|
332
324
|
c = !0;
|
|
333
325
|
return;
|
|
334
326
|
}
|
|
@@ -349,28 +341,43 @@ function pe(t, n, r, i = r) {
|
|
|
349
341
|
return p.getIndex = g, m.getIndex = g, r == i ? p : m;
|
|
350
342
|
}
|
|
351
343
|
//#endregion
|
|
344
|
+
//#region ../core/src/utils/forEachInBatch.js
|
|
345
|
+
var he = 0;
|
|
346
|
+
function ge(e, t) {
|
|
347
|
+
if (e.length > 1e4) Function("data", "visit", `
|
|
348
|
+
// batch loop ${he++}
|
|
349
|
+
for (let i = 0; i < data.length; i++) {
|
|
350
|
+
visit(data[i], i);
|
|
351
|
+
}
|
|
352
|
+
`)(e, t);
|
|
353
|
+
else for (let n = 0; n < e.length; n++) t(e[n], n);
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
352
356
|
//#region ../core/src/rendering/xIndex/markXIndex.js
|
|
353
|
-
function
|
|
357
|
+
function _e(e, t, n = 0) {
|
|
354
358
|
if (!t.length) return;
|
|
355
|
-
let r =
|
|
356
|
-
return t
|
|
359
|
+
let r = me(Math.min(256, Math.ceil(Math.sqrt(t.length))), e.indexDomain, e.xAccessor, e.x2Accessor);
|
|
360
|
+
return ge(t, (e, t) => {
|
|
361
|
+
let i = n + t;
|
|
362
|
+
r(e, i, i + 1);
|
|
363
|
+
}), r.getIndex();
|
|
357
364
|
}
|
|
358
|
-
function
|
|
359
|
-
let
|
|
360
|
-
if (!
|
|
361
|
-
let
|
|
362
|
-
if (
|
|
363
|
-
let o =
|
|
365
|
+
function ve(e) {
|
|
366
|
+
let n = e.encoders?.x, r = e.encoders?.x2;
|
|
367
|
+
if (!n?.channelDef || !("buildIndex" in n.channelDef) || !n.channelDef.buildIndex || !n.scale || !i(n.scale.type) && !["index", "locus"].includes(n.scale.type) || n.branches.length !== 1) return;
|
|
368
|
+
let a = e.getType();
|
|
369
|
+
if (a === "point" && s(e, "x") || a !== "point" && a !== "rect") return;
|
|
370
|
+
let o = t(n)?.asNumberAccessor();
|
|
364
371
|
if (!o) return;
|
|
365
|
-
let
|
|
366
|
-
if (
|
|
367
|
-
let
|
|
368
|
-
if (!(!
|
|
372
|
+
let c;
|
|
373
|
+
if (r && (r.scale !== n.scale || r.branches.length !== 1 || (c = t(r)?.asNumberAccessor(), !c))) return;
|
|
374
|
+
let l = e.unitView.getScaleResolution("x"), u = l?.zoomExtent;
|
|
375
|
+
if (!(!l || !u || !Number.isFinite(u[0]) || !Number.isFinite(u[1]) || u[1] <= u[0])) return {
|
|
369
376
|
xAccessor: o,
|
|
370
|
-
x2Accessor:
|
|
371
|
-
scaleResolution:
|
|
372
|
-
indexDomain: [
|
|
373
|
-
domainStartOffset: ["index", "locus"].includes(
|
|
377
|
+
x2Accessor: c,
|
|
378
|
+
scaleResolution: l,
|
|
379
|
+
indexDomain: [u[0], u[1]],
|
|
380
|
+
domainStartOffset: ["index", "locus"].includes(n.scale.type) ? -1 : 0
|
|
374
381
|
};
|
|
375
382
|
}
|
|
376
383
|
function Z(e, t) {
|
|
@@ -381,7 +388,7 @@ function Z(e, t) {
|
|
|
381
388
|
}
|
|
382
389
|
//#endregion
|
|
383
390
|
//#region ../core/src/rendering/canvas2d/canvasXIndexManager.js
|
|
384
|
-
var
|
|
391
|
+
var ye = class {
|
|
385
392
|
#e = /* @__PURE__ */ new WeakMap();
|
|
386
393
|
#t = [0, 0];
|
|
387
394
|
#n;
|
|
@@ -389,7 +396,7 @@ var ge = class {
|
|
|
389
396
|
if (this.#n = void 0, e.encoders.facetIndex) return this.#r();
|
|
390
397
|
let t = e.unitView.getCollector(), n = e.unitView.getScaleResolution("x"), r = n?.zoomExtent, i = this.#e.get(e);
|
|
391
398
|
if (!i || i.collector !== t || i.dataRevision !== t.dataRevision || i.xEncoder !== e.encoders.x || i.x2Encoder !== e.encoders.x2 || i.xScaleResolution !== n || i.xIndexDomainStart !== r?.[0] || i.xIndexDomainEnd !== r?.[1]) {
|
|
392
|
-
let a =
|
|
399
|
+
let a = ve(e);
|
|
393
400
|
i = {
|
|
394
401
|
collector: t,
|
|
395
402
|
dataRevision: t.dataRevision,
|
|
@@ -408,16 +415,16 @@ var ge = class {
|
|
|
408
415
|
query(e, t) {
|
|
409
416
|
let n = this.#n;
|
|
410
417
|
if (!n?.spec) throw Error("Canvas x-index query was not prepared.");
|
|
411
|
-
|
|
418
|
+
p("canvasXIndexNativeItems", e.length);
|
|
412
419
|
let r = n.batches.get(e);
|
|
413
|
-
return r === void 0 && (r =
|
|
420
|
+
return r === void 0 && (r = _e(n.spec, e) ?? null, n.batches.set(e, r), p("canvasXIndexBuilds"), r || p("canvasXIndexRejectedBuilds")), r ? (r(this.#t[0], this.#t[1], t), p("canvasXIndexQueries"), p("canvasXIndexCandidateItems", t[1] - t[0]), t[0] === t[1] && p("canvasXIndexEmptyRanges"), !0) : this.#r();
|
|
414
421
|
}
|
|
415
422
|
#r() {
|
|
416
|
-
return
|
|
423
|
+
return p("canvasXIndexFallbackQueries"), !1;
|
|
417
424
|
}
|
|
418
|
-
},
|
|
425
|
+
}, be = class {
|
|
419
426
|
constructor(e) {
|
|
420
|
-
this.viewRoot = e.viewRoot, this.context = e.context, this.surface = e.surface, this.textMetrics = e.textMetrics, this.getBackground = e.getBackground, this.broadcast = e.broadcast, this.onLayoutComputed = e.onLayoutComputed, this.layoutResult = void 0, this.pickingRasterizer = void 0, this.dirtyPickingBuffer = !0, this.xIndexManager = new
|
|
427
|
+
this.viewRoot = e.viewRoot, this.context = e.context, this.surface = e.surface, this.textMetrics = e.textMetrics, this.getBackground = e.getBackground, this.broadcast = e.broadcast, this.onLayoutComputed = e.onLayoutComputed, this.layoutResult = void 0, this.pickingRasterizer = void 0, this.dirtyPickingBuffer = !0, this.xIndexManager = new ye(), this.opacityLayers = [];
|
|
421
428
|
}
|
|
422
429
|
computeLayout() {
|
|
423
430
|
this.broadcast("layout"), this.surface.invalidateSize();
|
|
@@ -437,10 +444,10 @@ var ge = class {
|
|
|
437
444
|
if (!e) return;
|
|
438
445
|
let t = this.surface.getLogicalCanvasSize();
|
|
439
446
|
if (isNaN(t.width) || isNaN(t.height)) return;
|
|
440
|
-
let n =
|
|
447
|
+
let n = d();
|
|
441
448
|
n?.beginFrame("canvas");
|
|
442
449
|
try {
|
|
443
|
-
|
|
450
|
+
f("render", () => P({
|
|
444
451
|
layoutResult: e,
|
|
445
452
|
context: this.context,
|
|
446
453
|
width: t.width,
|
|
@@ -462,17 +469,17 @@ var ge = class {
|
|
|
462
469
|
let t = this.surface.getLogicalCanvasSize();
|
|
463
470
|
if (isNaN(t.width) || isNaN(t.height)) return;
|
|
464
471
|
this.surface.clearPickingBuffer();
|
|
465
|
-
let n = this.pickingRasterizer, r = !1, i = new
|
|
472
|
+
let n = this.pickingRasterizer, r = !1, i = new fe({
|
|
466
473
|
width: t.width,
|
|
467
474
|
height: t.height,
|
|
468
475
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
469
476
|
textMetrics: this.textMetrics,
|
|
470
|
-
getRasterizer: () => (n || (n = new
|
|
477
|
+
getRasterizer: () => (n || (n = new V(this.surface.getPickingBuffer()), this.pickingRasterizer = n), r ||= (n.resetClip(), n.resetStatistics(), !0), n),
|
|
471
478
|
xIndexManager: this.xIndexManager
|
|
472
|
-
}), a =
|
|
479
|
+
}), a = d();
|
|
473
480
|
a?.beginFrame("canvas", "picking");
|
|
474
481
|
try {
|
|
475
|
-
|
|
482
|
+
f("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r && xe(n, a);
|
|
476
483
|
} finally {
|
|
477
484
|
a?.endFrame();
|
|
478
485
|
}
|
|
@@ -482,20 +489,20 @@ var ge = class {
|
|
|
482
489
|
}
|
|
483
490
|
#e() {
|
|
484
491
|
let e = this.surface.getLogicalCanvasSize();
|
|
485
|
-
if (!(isNaN(e.width) || isNaN(e.height))) return l(this.viewRoot,
|
|
492
|
+
if (!(isNaN(e.width) || isNaN(e.height))) return l(this.viewRoot, c.create(0, 0, e.width, e.height), {
|
|
486
493
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
487
494
|
renderingOptions: { firstFacet: !0 }
|
|
488
495
|
});
|
|
489
496
|
}
|
|
490
497
|
};
|
|
491
|
-
function
|
|
498
|
+
function xe(e, t) {
|
|
492
499
|
if (!t) return;
|
|
493
500
|
let n = e.getStatistics();
|
|
494
501
|
t.addCount("pickingRectangles", n.rectangles), t.addCount("pickingSquares", n.squares), t.addCount("pickingPolygons", n.polygons), t.addCount("pickingSegments", n.segments), t.addCount("pickingCubics", n.cubics), t.addCount("pickingSpans", n.spans);
|
|
495
502
|
}
|
|
496
503
|
//#endregion
|
|
497
504
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingBuffer.js
|
|
498
|
-
var Q = /* @__PURE__ */ new Uint32Array(),
|
|
505
|
+
var Q = /* @__PURE__ */ new Uint32Array(), Se = class {
|
|
499
506
|
#e = Q;
|
|
500
507
|
width = 0;
|
|
501
508
|
height = 0;
|
|
@@ -530,7 +537,7 @@ function $(e, t) {
|
|
|
530
537
|
}
|
|
531
538
|
//#endregion
|
|
532
539
|
//#region ../core/src/rendering/canvas2d/canvas2DSurface.js
|
|
533
|
-
var
|
|
540
|
+
var Ce = class {
|
|
534
541
|
#e;
|
|
535
542
|
#t;
|
|
536
543
|
#n;
|
|
@@ -540,7 +547,7 @@ var be = class {
|
|
|
540
547
|
if (!n) throw Error("Unable to initialize a Canvas2D rendering context.");
|
|
541
548
|
this.canvas = t, this.context = n, e.container.appendChild(t);
|
|
542
549
|
try {
|
|
543
|
-
this.#e = new
|
|
550
|
+
this.#e = new F(e.container, t, e.sizeSource, () => {
|
|
544
551
|
this.#i() && e.onCanvasResize();
|
|
545
552
|
}), this.#i();
|
|
546
553
|
} catch (e) {
|
|
@@ -568,7 +575,7 @@ var be = class {
|
|
|
568
575
|
getPickingBuffer() {
|
|
569
576
|
if (this.#r) throw Error("Canvas2D surface has been finalized.");
|
|
570
577
|
let e = this.getLogicalCanvasSize();
|
|
571
|
-
return this.#n ??= new
|
|
578
|
+
return this.#n ??= new Se(e.width, e.height), this.#n;
|
|
572
579
|
}
|
|
573
580
|
clearPickingBuffer() {
|
|
574
581
|
this.#n?.clear();
|
|
@@ -602,32 +609,32 @@ var be = class {
|
|
|
602
609
|
};
|
|
603
610
|
//#endregion
|
|
604
611
|
//#region ../core/src/rendering/canvas2d/index.js
|
|
605
|
-
function
|
|
606
|
-
let t = new
|
|
612
|
+
function we(e) {
|
|
613
|
+
let t = new Ce(e), n = ne(e.container.ownerDocument);
|
|
607
614
|
return {
|
|
608
615
|
surface: t,
|
|
609
616
|
textMetrics: n,
|
|
610
|
-
createRenderCoordinator: (e) => new
|
|
617
|
+
createRenderCoordinator: (e) => new be({
|
|
611
618
|
...e,
|
|
612
619
|
surface: t,
|
|
613
620
|
context: t.context,
|
|
614
621
|
textMetrics: n
|
|
615
622
|
}),
|
|
616
|
-
exportCanvas: (e) =>
|
|
623
|
+
exportCanvas: (e) => I({
|
|
617
624
|
...e,
|
|
618
625
|
liveSize: t.getLogicalCanvasSize(),
|
|
619
626
|
liveDevicePixelRatio: t.getDevicePixelRatio(),
|
|
620
627
|
textMetrics: n
|
|
621
628
|
}),
|
|
622
|
-
exportRaster: (e) =>
|
|
629
|
+
exportRaster: (e) => L({
|
|
623
630
|
...e,
|
|
624
631
|
liveSize: t.getLogicalCanvasSize(),
|
|
625
632
|
liveDevicePixelRatio: t.getDevicePixelRatio(),
|
|
626
633
|
textMetrics: n
|
|
627
634
|
}),
|
|
628
|
-
rasterizeSvgRuns: (e) =>
|
|
635
|
+
rasterizeSvgRuns: (e) => R()(e),
|
|
629
636
|
readPickingId: (e, n) => t.readPickingId(e, n)
|
|
630
637
|
};
|
|
631
638
|
}
|
|
632
639
|
//#endregion
|
|
633
|
-
export {
|
|
640
|
+
export { we as createCanvas2DRenderingBackend };
|