@genome-spy/app 0.87.0 → 0.88.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/{agentApi-BZ1JCo1N.js → agentApi-BYFBKiRQ.js} +5365 -5080
- package/dist/agentApi.es.js +3160 -2909
- package/dist/agentShared.es.js +3 -3
- package/dist/{canvas2d-Cafq5v-N.js → canvas2d-BVQ7-2eJ.js} +68 -68
- package/dist/{canvas2d-B_PnIof-.js → canvas2d-D7SZK3xv.js} +39 -39
- package/dist/{clipOptions-H68pJyEZ.js → clipOptions-BWHr3aTa.js} +822 -768
- package/dist/{clipOptions-D6eh9T-_.js → clipOptions-DTMcB_9z.js} +547 -493
- package/dist/{debug-BGzgZmyk.js → debug-CVpoEOWx.js} +2 -2
- package/dist/{debug-UYKZLNh4.js → debug-DYAMZZKl.js} +2 -2
- package/dist/index.es.js +3390 -3410
- package/dist/index.js +397 -374
- package/dist/{indexer-Di57GyxX.js → indexer-CXjZDo2Q.js} +1 -1
- package/dist/{indexer-o6Hpg4nN.js → indexer-DAH_ruVn.js} +1 -1
- package/dist/{nativeText-DAjvkrzc.js → order-C5CzA37O.js} +271 -287
- package/dist/{nativeText-D9SoxpaD.js → order-DvY7KNcu.js} +271 -287
- package/dist/{rasterExport-DzldLv6E.js → rasterExport-BgZ98e6U.js} +1 -1
- package/dist/{rasterExport-IAbJwi8F.js → rasterExport-DEr8fOLm.js} +1 -1
- package/dist/{renderCanvas2D-yJ1IrDcX.js → renderCanvas2D-DtcJjqpB.js} +57 -50
- package/dist/{renderCanvas2D-BJ93Ptqj.js → renderCanvas2D-DxturTEW.js} +62 -55
- package/dist/schema.json +756 -96
- package/dist/{svg-DJuqHIyc.js → svg-CyrLfa9e.js} +364 -357
- package/dist/{svg-BRpl2Xub.js → svg-SDJMzL--.js} +338 -331
- package/dist/{svgRasterizer-PAoqLn1j.js → svgRasterizer-f7DJ3UO0.js} +1 -1
- package/dist/{svgRasterizer-CGZQ5njV.js → svgRasterizer-mWK7HTkx.js} +1 -1
- package/dist/{vega-scale-BGC53c22.js → vega-scale-CypF85iS.js} +801 -801
- package/dist/{vega-scale-DdW2NzQ3.js → vega-scale-DLKCwWRs.js} +65 -65
- package/dist/{viewIdentityRegistry-Dc2hXYsO.js → viewIdentityRegistry-DIDo44XQ.js} +1 -1
- package/dist/{viewIdentityRegistry-D4p067HU.js → viewIdentityRegistry-Dl-vMN9I.js} +1 -1
- package/dist/{viewSelectors-DNXnGwEW.js → viewSelectors-CymbZyE6.js} +375 -340
- package/dist/{viewSelectors-DYYlOt91.js → viewSelectors-DNiDip5e.js} +370 -335
- package/dist/{viewUtils-EdhZTPrJ.js → viewUtils-BrJLIj2o.js} +1750 -1716
- package/dist/{webgl-CdgNFlJk.js → webgl-CqTDifWM.js} +1196 -1164
- package/dist/{webgl-C53DwzVT.js → webgl-jaC2m0Zr.js} +1015 -983
- package/package.json +5 -5
- package/src/embedTypes.d.ts +1 -1
package/dist/agentShared.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-DF993M8W.js";
|
|
2
|
-
import { $ as t, F as n, H as r, I as i, L as a, N as o, P as s, Q as c, R as l, V as u, et as d, o as f, r as p, z as m } from "./viewUtils-
|
|
3
|
-
import { C as h, i as g, m as _, o as v, t as y } from "./viewSelectors-
|
|
4
|
-
import { y as b } from "./vega-scale-
|
|
2
|
+
import { $ as t, F as n, H as r, I as i, L as a, N as o, P as s, Q as c, R as l, V as u, et as d, o as f, r as p, z as m } from "./viewUtils-BrJLIj2o.js";
|
|
3
|
+
import { C as h, i as g, m as _, o as v, t as y } from "./viewSelectors-CymbZyE6.js";
|
|
4
|
+
import { y as b } from "./vega-scale-DLKCwWRs.js";
|
|
5
5
|
import { n as x, t as S } from "./componentStyles-FsNmIb22.js";
|
|
6
6
|
//#region src/viewScopeUtils.js
|
|
7
7
|
function C(e, t) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as a } from "./vega-scale-
|
|
3
|
-
import { t as o } from "./
|
|
4
|
-
import { t as s } from "./
|
|
5
|
-
import { n as c,
|
|
6
|
-
import { n as d, t as f } from "./
|
|
7
|
-
import {
|
|
8
|
-
import { n as A, t as j } from "./renderCanvas2D-
|
|
1
|
+
import { o as e, s as t, u as n, ut as r, v as i } from "./clipOptions-DTMcB_9z.js";
|
|
2
|
+
import { v as a } from "./vega-scale-DLKCwWRs.js";
|
|
3
|
+
import { t as o } from "./warning-CpIIpk8e.js";
|
|
4
|
+
import { t as s } from "./rectangle-DKnrAmKs.js";
|
|
5
|
+
import { n as c, t as l } from "./layoutResult-D50MSHXR.js";
|
|
6
|
+
import { n as u, r as d, t as f } from "./performanceProfiler-CPLEjApa.js";
|
|
7
|
+
import { A as p, C as m, E as h, M as g, N as _, O as v, S as y, _ as b, a as x, b as S, c as C, f as w, h as T, k as E, l as D, m as O, o as ee, p as te, s as ne, u as re, v as ie, y as k } from "./order-DvY7KNcu.js";
|
|
8
|
+
import { n as A, t as j } from "./renderCanvas2D-DtcJjqpB.js";
|
|
9
9
|
import { t as M } from "./canvasSizeHelper-7h_8rOcx.js";
|
|
10
|
-
import { exportCanvas as N, exportRaster as P } from "./rasterExport-
|
|
11
|
-
import { createCanvas2DSvgRasterizer as F } from "./svgRasterizer-
|
|
10
|
+
import { exportCanvas as N, exportRaster as P } from "./rasterExport-BgZ98e6U.js";
|
|
11
|
+
import { createCanvas2DSvgRasterizer as F } from "./svgRasterizer-f7DJ3UO0.js";
|
|
12
12
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingRasterizer.js
|
|
13
13
|
var I = 12, L = .5, R = class {
|
|
14
14
|
#e = [];
|
|
@@ -183,10 +183,10 @@ function G(e) {
|
|
|
183
183
|
return t == "rect" || t == "arrow" || t == "point" || t == "rule" || t == "tick" || t == "link" || t == "text";
|
|
184
184
|
}
|
|
185
185
|
function K(e, t) {
|
|
186
|
-
let n = e, r =
|
|
187
|
-
return
|
|
186
|
+
let n = e, r = k(n), i = Array(8).fill(0);
|
|
187
|
+
return y(n, r, t, (e) => {
|
|
188
188
|
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),
|
|
189
|
+
r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth), S(e, (n, r) => {
|
|
190
190
|
let s = e.headHalfWidth + o, c = n + e.tangent.x * o, l = r + e.tangent.y * o, u = e.headRepeatFootprint + o, d = n - e.tangent.x * u, f = r - e.tangent.y * u;
|
|
191
191
|
ce(i, c, l, d, f, e.normal.x, e.normal.y, s), t.rasterizer.fillConvexPolygon(a, i);
|
|
192
192
|
});
|
|
@@ -194,26 +194,26 @@ function K(e, t) {
|
|
|
194
194
|
}
|
|
195
195
|
function q(e, t) {
|
|
196
196
|
let n = e;
|
|
197
|
-
return
|
|
197
|
+
return re(n, D(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
|
|
198
198
|
}
|
|
199
199
|
function J(e, t) {
|
|
200
|
-
let n = e, r =
|
|
201
|
-
return
|
|
200
|
+
let n = e, r = h(n, n.properties.minPickingSize);
|
|
201
|
+
return te(n, w(n), t, (e) => t.rasterizer.fillSquare(Y(n, e.datum), e.x, e.y, Math.max(e.boundsRadius, r / 2)));
|
|
202
202
|
}
|
|
203
203
|
function ae(e, t) {
|
|
204
204
|
let n = e;
|
|
205
|
-
return
|
|
205
|
+
return C(n, ne(n), t, (e) => t.rasterizer.strokeSegment(Y(n, e.datum), e.x1, e.y1, e.x2, e.y2, Math.max(e.strokeWidth, U)));
|
|
206
206
|
}
|
|
207
207
|
function oe(e, t) {
|
|
208
|
-
let n = e, r =
|
|
209
|
-
return
|
|
210
|
-
let [i, o, s, c] = e.points, l = a
|
|
211
|
-
t.rasterizer.strokeCubic(Y(n, e.datum), i[0], i[1], o[0], o[1], s[0], s[1], c[0], c[1], Math.max(e.strokeWidth, r), void 0,
|
|
208
|
+
let n = e, r = h(n, n.properties.minPickingSize), i = O(n), a = ie(n, i.shape);
|
|
209
|
+
return T(n, i, t, (e) => {
|
|
210
|
+
let [i, o, s, c] = e.points, l = a && b(i, c, a);
|
|
211
|
+
t.rasterizer.strokeCubic(Y(n, e.datum), i[0], i[1], o[0], o[1], s[0], s[1], c[0], c[1], Math.max(e.strokeWidth, r), void 0, l ? (e, t) => Math.abs(l.normalX * e + l.normalY * t - l.offset) < l.end : void 0);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
function se(e, t) {
|
|
215
215
|
let n = e;
|
|
216
|
-
return
|
|
216
|
+
return ee(n, x(n), t, (e) => t.rasterizer.fillConvexPolygon(Y(n, e.datum), e.boundsQuad));
|
|
217
217
|
}
|
|
218
218
|
function ce(e, t, n, r, i, a, o, s) {
|
|
219
219
|
let c = a * s, l = o * s;
|
|
@@ -221,19 +221,19 @@ function ce(e, t, n, r, i, a, o, s) {
|
|
|
221
221
|
}
|
|
222
222
|
function Y(e, t) {
|
|
223
223
|
let n = e.encoders;
|
|
224
|
-
return
|
|
224
|
+
return m(n.uniqueId, t);
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingViewRenderingContext.js
|
|
228
|
-
var le = class extends
|
|
228
|
+
var le = class extends c {
|
|
229
229
|
#e = [];
|
|
230
230
|
#t = /* @__PURE__ */ new Set();
|
|
231
231
|
#n;
|
|
232
|
-
#r = new
|
|
232
|
+
#r = new g();
|
|
233
233
|
#i;
|
|
234
234
|
#a = [0, 0];
|
|
235
235
|
constructor(e) {
|
|
236
|
-
super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.#n =
|
|
236
|
+
super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.#n = u(), this.#i = e.xIndexManager;
|
|
237
237
|
}
|
|
238
238
|
getDevicePixelRatio() {
|
|
239
239
|
return this.devicePixelRatio;
|
|
@@ -247,74 +247,74 @@ var le = class extends d {
|
|
|
247
247
|
popView(e) {
|
|
248
248
|
if (this.#e.pop()?.view !== e) throw Error("Unbalanced software picking view rendering context stack.");
|
|
249
249
|
}
|
|
250
|
-
renderMark(
|
|
251
|
-
if (!
|
|
252
|
-
let
|
|
253
|
-
if (
|
|
250
|
+
renderMark(n, r) {
|
|
251
|
+
if (!n.isPickingParticipant() || !G(n)) return;
|
|
252
|
+
let i = r.sampleFacetRenderingOptions;
|
|
253
|
+
if (i && !n.encoders.facetIndex && (this.#n?.addCount("canvasSampleFacetOccurrences"), !A(i))) {
|
|
254
254
|
this.#n?.addCount("canvasCulledSampleFacetOccurrences");
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
|
-
let a =
|
|
257
|
+
let a = n.unitView.getEffectiveOpacity();
|
|
258
258
|
if (a <= 0) return;
|
|
259
|
-
let
|
|
260
|
-
if (!
|
|
261
|
-
let d =
|
|
262
|
-
|
|
263
|
-
if (
|
|
264
|
-
let r = 0, i =
|
|
265
|
-
if (f && this.#i.query(
|
|
259
|
+
let s = this.currentCoords, c = e(r), l = t(c, n.properties.clip, s), u = E(this.width, this.height, l);
|
|
260
|
+
if (!p(u)) return;
|
|
261
|
+
let d = v(s, c, n.properties.cullByVisibleRange), f = this.#i?.prepare(n) ?? !1;
|
|
262
|
+
_(n, r, s, this.#r, (e, t) => {
|
|
263
|
+
if (t.length == 0) return;
|
|
264
|
+
let r = 0, i = t.length;
|
|
265
|
+
if (f && this.#i.query(t, this.#a) && (r = this.#a[0], i = this.#a[1], r === i)) return;
|
|
266
266
|
let o = this.getRasterizer();
|
|
267
|
-
o.setClip(u.x1, u.y1, u.x2, u.y2), W(
|
|
267
|
+
o.setClip(u.x1, u.y1, u.x2, u.y2), W(n, {
|
|
268
268
|
rasterizer: o,
|
|
269
|
-
coords:
|
|
270
|
-
data:
|
|
269
|
+
coords: e,
|
|
270
|
+
data: t,
|
|
271
271
|
start: r,
|
|
272
272
|
end: i,
|
|
273
273
|
visibleBounds: u,
|
|
274
274
|
anchorCullBounds: d,
|
|
275
275
|
viewOpacity: a
|
|
276
276
|
});
|
|
277
|
-
}, (
|
|
277
|
+
}, (e) => o(`Canvas2D picking could not resolve sample facet index ${e}. View: ${n.unitView.getPathString()}`));
|
|
278
278
|
}
|
|
279
279
|
get currentCoords() {
|
|
280
|
-
let e =
|
|
280
|
+
let e = n(this.#e);
|
|
281
281
|
if (!e) throw Error("No current view in software picking rendering context.");
|
|
282
282
|
return e.coords;
|
|
283
283
|
}
|
|
284
284
|
}, X = 2 ** 31 - 1, ue = -(2 ** 31);
|
|
285
|
-
function de(t, n,
|
|
286
|
-
let a = Array(
|
|
285
|
+
function de(e, t, n, i = n) {
|
|
286
|
+
let a = Array(e);
|
|
287
287
|
a.fill(X);
|
|
288
|
-
let o = ue, s = -Infinity, c = !1, l = Array(
|
|
288
|
+
let o = ue, s = -Infinity, c = !1, l = Array(e);
|
|
289
289
|
l.fill(0);
|
|
290
|
-
let u =
|
|
291
|
-
let i = (
|
|
292
|
-
return
|
|
290
|
+
let u = t[0], d = (t[1] - t[0]) / e, f = (t, n) => {
|
|
291
|
+
let i = (t - u) / d, a = Math.floor(i);
|
|
292
|
+
return r(n && a == i ? a - 1 : a, 0, e - 1);
|
|
293
293
|
};
|
|
294
|
-
function p(e, t,
|
|
294
|
+
function p(e, t, r) {
|
|
295
295
|
if (c) return;
|
|
296
296
|
if (t > o) o = t;
|
|
297
297
|
else {
|
|
298
298
|
c = !0;
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
let i =
|
|
301
|
+
let i = n(e);
|
|
302
302
|
if (!Number.isFinite(i) || i < s) {
|
|
303
303
|
c = !0;
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
306
|
s = i;
|
|
307
307
|
let u = f(i, !1);
|
|
308
|
-
a[u] > t && (a[u] = t), l[u] <
|
|
308
|
+
a[u] > t && (a[u] = t), l[u] < r && (l[u] = r);
|
|
309
309
|
}
|
|
310
|
-
function m(e, t,
|
|
310
|
+
function m(e, t, r) {
|
|
311
311
|
if (c) return;
|
|
312
312
|
if (t > o) o = t;
|
|
313
313
|
else {
|
|
314
314
|
c = !0, console.debug("Items (vertices) are not ordered properly. Disabling binned index.");
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
|
-
let u =
|
|
317
|
+
let u = n(e), d = i(e);
|
|
318
318
|
if (!Number.isFinite(u) || !Number.isFinite(d)) {
|
|
319
319
|
c = !0;
|
|
320
320
|
return;
|
|
@@ -327,7 +327,7 @@ function de(t, n, r, i = r) {
|
|
|
327
327
|
}
|
|
328
328
|
s = u;
|
|
329
329
|
let p = f(u, !1), m = u === d ? p : f(d, !0);
|
|
330
|
-
for (let e = p; e <= m; e++) a[e] > t && (a[e] = t), l[e] <
|
|
330
|
+
for (let e = p; e <= m; e++) a[e] > t && (a[e] = t), l[e] < r && (l[e] = r);
|
|
331
331
|
}
|
|
332
332
|
let h = (e, t, n = [0, 0]) => {
|
|
333
333
|
let r = f(e, !1), i = f(t, !0), o = a[r], s = Math.max(l[i], o);
|
|
@@ -339,7 +339,7 @@ function de(t, n, r, i = r) {
|
|
|
339
339
|
for (let t = a.length - 1; t > 0; t--) e && a[t] == X ? (a[t] = l[t], e = !1) : a[t - 1] > a[t] && (a[t - 1] = a[t]);
|
|
340
340
|
return h;
|
|
341
341
|
};
|
|
342
|
-
return p.getIndex = g, m.getIndex = g,
|
|
342
|
+
return p.getIndex = g, m.getIndex = g, n == i ? p : m;
|
|
343
343
|
}
|
|
344
344
|
//#endregion
|
|
345
345
|
//#region ../core/src/rendering/xIndex/markXIndex.js
|
|
@@ -351,12 +351,12 @@ function fe(e, t, n = 0) {
|
|
|
351
351
|
function pe(e) {
|
|
352
352
|
let t = e.encoders?.x, n = e.encoders?.x2;
|
|
353
353
|
if (!t?.channelDef || !("buildIndex" in t.channelDef) || !t.channelDef.buildIndex || !t.scale || !a(t.scale.type) && !["index", "locus"].includes(t.scale.type) || t.branches.length !== 1) return;
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
let o =
|
|
354
|
+
let r = e.getType();
|
|
355
|
+
if (r !== "point" && r !== "rect") return;
|
|
356
|
+
let o = i(t)?.asNumberAccessor();
|
|
357
357
|
if (!o) return;
|
|
358
358
|
let s;
|
|
359
|
-
if (n && (n.scale !== t.scale || n.branches.length !== 1 || (s =
|
|
359
|
+
if (n && (n.scale !== t.scale || n.branches.length !== 1 || (s = i(n)?.asNumberAccessor(), !s))) return;
|
|
360
360
|
let c = e.unitView.getScaleResolution("x"), l = c?.zoomExtent;
|
|
361
361
|
if (!(!c || !l || !Number.isFinite(l[0]) || !Number.isFinite(l[1]) || l[1] <= l[0])) return {
|
|
362
362
|
xAccessor: o,
|
|
@@ -401,12 +401,12 @@ var he = class {
|
|
|
401
401
|
query(e, t) {
|
|
402
402
|
let n = this.#n;
|
|
403
403
|
if (!n?.spec) throw Error("Canvas x-index query was not prepared.");
|
|
404
|
-
|
|
404
|
+
f("canvasXIndexNativeItems", e.length);
|
|
405
405
|
let r = n.batches.get(e);
|
|
406
|
-
return r === void 0 && (r = fe(n.spec, e) ?? null, n.batches.set(e, r),
|
|
406
|
+
return r === void 0 && (r = fe(n.spec, e) ?? null, n.batches.set(e, r), f("canvasXIndexBuilds"), r || f("canvasXIndexRejectedBuilds")), r ? (r(this.#t[0], this.#t[1], t), f("canvasXIndexQueries"), f("canvasXIndexCandidateItems", t[1] - t[0]), t[0] === t[1] && f("canvasXIndexEmptyRanges"), !0) : this.#r();
|
|
407
407
|
}
|
|
408
408
|
#r() {
|
|
409
|
-
return
|
|
409
|
+
return f("canvasXIndexFallbackQueries"), !1;
|
|
410
410
|
}
|
|
411
411
|
}, Z = class {
|
|
412
412
|
constructor(e) {
|
|
@@ -430,10 +430,10 @@ var he = class {
|
|
|
430
430
|
if (!e) return;
|
|
431
431
|
let t = this.surface.getLogicalCanvasSize();
|
|
432
432
|
if (isNaN(t.width) || isNaN(t.height)) return;
|
|
433
|
-
let n =
|
|
433
|
+
let n = u();
|
|
434
434
|
n?.beginFrame("canvas");
|
|
435
435
|
try {
|
|
436
|
-
|
|
436
|
+
d("render", () => j({
|
|
437
437
|
layoutResult: e,
|
|
438
438
|
context: this.context,
|
|
439
439
|
width: t.width,
|
|
@@ -460,10 +460,10 @@ var he = class {
|
|
|
460
460
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
461
461
|
getRasterizer: () => (n || (n = new R(this.surface.getPickingBuffer()), this.pickingRasterizer = n), r ||= (n.resetClip(), n.resetStatistics(), !0), n),
|
|
462
462
|
xIndexManager: this.xIndexManager
|
|
463
|
-
}), a =
|
|
463
|
+
}), a = u();
|
|
464
464
|
a?.beginFrame("canvas", "picking");
|
|
465
465
|
try {
|
|
466
|
-
|
|
466
|
+
d("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r && ge(n, a);
|
|
467
467
|
} finally {
|
|
468
468
|
a?.endFrame();
|
|
469
469
|
}
|
|
@@ -473,7 +473,7 @@ var he = class {
|
|
|
473
473
|
}
|
|
474
474
|
#e() {
|
|
475
475
|
let e = this.surface.getLogicalCanvasSize();
|
|
476
|
-
if (!(isNaN(e.width) || isNaN(e.height))) return
|
|
476
|
+
if (!(isNaN(e.width) || isNaN(e.height))) return l(this.viewRoot, s.create(0, 0, e.width, e.height), {
|
|
477
477
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
478
478
|
renderingOptions: { firstFacet: !0 }
|
|
479
479
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as a } from "./vega-scale-
|
|
3
|
-
import { t as o } from "./
|
|
4
|
-
import { t as s } from "./
|
|
5
|
-
import { n as c,
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { n as A, t as j } from "./renderCanvas2D-
|
|
1
|
+
import { ct as e, et as t, o as n, s as r, un as i } from "./clipOptions-BWHr3aTa.js";
|
|
2
|
+
import { v as a } from "./vega-scale-CypF85iS.js";
|
|
3
|
+
import { t as o } from "./warning-CpIIpk8e.js";
|
|
4
|
+
import { t as s } from "./rectangle-DKnrAmKs.js";
|
|
5
|
+
import { n as c, r as l, t as u } from "./performanceProfiler-CPLEjApa.js";
|
|
6
|
+
import { n as d, t as f } from "./layoutResult-D50MSHXR.js";
|
|
7
|
+
import { A as p, C as m, E as h, M as g, N as _, O as v, S as y, _ as b, a as x, b as S, c as C, f as w, h as T, k as E, l as D, m as O, o as ee, p as te, s as ne, u as re, v as ie, y as k } from "./order-C5CzA37O.js";
|
|
8
|
+
import { n as A, t as j } from "./renderCanvas2D-DxturTEW.js";
|
|
9
9
|
import { t as M } from "./canvasSizeHelper-7h_8rOcx.js";
|
|
10
|
-
import { exportCanvas as N, exportRaster as P } from "./rasterExport-
|
|
11
|
-
import { createCanvas2DSvgRasterizer as F } from "./svgRasterizer-
|
|
10
|
+
import { exportCanvas as N, exportRaster as P } from "./rasterExport-DEr8fOLm.js";
|
|
11
|
+
import { createCanvas2DSvgRasterizer as F } from "./svgRasterizer-mWK7HTkx.js";
|
|
12
12
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingRasterizer.js
|
|
13
13
|
var I = 12, L = .5, R = class {
|
|
14
14
|
#e = [];
|
|
@@ -183,10 +183,10 @@ function G(e) {
|
|
|
183
183
|
return t == "rect" || t == "arrow" || t == "point" || t == "rule" || t == "tick" || t == "link" || t == "text";
|
|
184
184
|
}
|
|
185
185
|
function K(e, t) {
|
|
186
|
-
let n = e, r =
|
|
187
|
-
return
|
|
186
|
+
let n = e, r = k(n), i = Array(8).fill(0);
|
|
187
|
+
return y(n, r, t, (e) => {
|
|
188
188
|
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),
|
|
189
|
+
r.stem && t.rasterizer.strokeSegment(a, e.tail.x, e.tail.y, e.tip.x, e.tip.y, e.stemHalfWidth * 2 + e.strokeWidth), S(e, (n, r) => {
|
|
190
190
|
let s = e.headHalfWidth + o, c = n + e.tangent.x * o, l = r + e.tangent.y * o, u = e.headRepeatFootprint + o, d = n - e.tangent.x * u, f = r - e.tangent.y * u;
|
|
191
191
|
ce(i, c, l, d, f, e.normal.x, e.normal.y, s), t.rasterizer.fillConvexPolygon(a, i);
|
|
192
192
|
});
|
|
@@ -194,26 +194,26 @@ function K(e, t) {
|
|
|
194
194
|
}
|
|
195
195
|
function q(e, t) {
|
|
196
196
|
let n = e;
|
|
197
|
-
return
|
|
197
|
+
return re(n, D(n), t, (e) => t.rasterizer.fillRect(Y(n, e.datum), e.x, e.y, e.width, e.height));
|
|
198
198
|
}
|
|
199
199
|
function J(e, t) {
|
|
200
|
-
let n = e, r =
|
|
201
|
-
return
|
|
200
|
+
let n = e, r = h(n, n.properties.minPickingSize);
|
|
201
|
+
return te(n, w(n), t, (e) => t.rasterizer.fillSquare(Y(n, e.datum), e.x, e.y, Math.max(e.boundsRadius, r / 2)));
|
|
202
202
|
}
|
|
203
203
|
function ae(e, t) {
|
|
204
204
|
let n = e;
|
|
205
|
-
return
|
|
205
|
+
return C(n, ne(n), t, (e) => t.rasterizer.strokeSegment(Y(n, e.datum), e.x1, e.y1, e.x2, e.y2, Math.max(e.strokeWidth, U)));
|
|
206
206
|
}
|
|
207
207
|
function oe(e, t) {
|
|
208
|
-
let n = e, r =
|
|
209
|
-
return
|
|
210
|
-
let [i, o, s, c] = e.points, l = a
|
|
211
|
-
t.rasterizer.strokeCubic(Y(n, e.datum), i[0], i[1], o[0], o[1], s[0], s[1], c[0], c[1], Math.max(e.strokeWidth, r), void 0,
|
|
208
|
+
let n = e, r = h(n, n.properties.minPickingSize), i = O(n), a = ie(n, i.shape);
|
|
209
|
+
return T(n, i, t, (e) => {
|
|
210
|
+
let [i, o, s, c] = e.points, l = a && b(i, c, a);
|
|
211
|
+
t.rasterizer.strokeCubic(Y(n, e.datum), i[0], i[1], o[0], o[1], s[0], s[1], c[0], c[1], Math.max(e.strokeWidth, r), void 0, l ? (e, t) => Math.abs(l.normalX * e + l.normalY * t - l.offset) < l.end : void 0);
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
function se(e, t) {
|
|
215
215
|
let n = e;
|
|
216
|
-
return
|
|
216
|
+
return ee(n, x(n), t, (e) => t.rasterizer.fillConvexPolygon(Y(n, e.datum), e.boundsQuad));
|
|
217
217
|
}
|
|
218
218
|
function ce(e, t, n, r, i, a, o, s) {
|
|
219
219
|
let c = a * s, l = o * s;
|
|
@@ -221,19 +221,19 @@ function ce(e, t, n, r, i, a, o, s) {
|
|
|
221
221
|
}
|
|
222
222
|
function Y(e, t) {
|
|
223
223
|
let n = e.encoders;
|
|
224
|
-
return
|
|
224
|
+
return m(n.uniqueId, t);
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
227
|
//#region ../core/src/rendering/canvas2d/picking/softwarePickingViewRenderingContext.js
|
|
228
|
-
var le = class extends
|
|
228
|
+
var le = class extends d {
|
|
229
229
|
#e = [];
|
|
230
230
|
#t = /* @__PURE__ */ new Set();
|
|
231
231
|
#n;
|
|
232
|
-
#r = new
|
|
232
|
+
#r = new g();
|
|
233
233
|
#i;
|
|
234
234
|
#a = [0, 0];
|
|
235
235
|
constructor(e) {
|
|
236
|
-
super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.#n =
|
|
236
|
+
super({ picking: !0 }), this.width = e.width, this.height = e.height, this.devicePixelRatio = e.devicePixelRatio, this.getRasterizer = e.getRasterizer, this.#n = c(), this.#i = e.xIndexManager;
|
|
237
237
|
}
|
|
238
238
|
getDevicePixelRatio() {
|
|
239
239
|
return this.devicePixelRatio;
|
|
@@ -256,10 +256,10 @@ var le = class extends c {
|
|
|
256
256
|
}
|
|
257
257
|
let a = e.unitView.getEffectiveOpacity();
|
|
258
258
|
if (a <= 0) return;
|
|
259
|
-
let
|
|
260
|
-
if (!
|
|
261
|
-
let d =
|
|
262
|
-
|
|
259
|
+
let s = this.currentCoords, c = n(t), l = r(c, e.properties.clip, s), u = E(this.width, this.height, l);
|
|
260
|
+
if (!p(u)) return;
|
|
261
|
+
let d = v(s, c, e.properties.cullByVisibleRange), f = this.#i?.prepare(e) ?? !1;
|
|
262
|
+
_(e, t, s, this.#r, (t, n) => {
|
|
263
263
|
if (n.length == 0) return;
|
|
264
264
|
let r = 0, i = n.length;
|
|
265
265
|
if (f && this.#i.query(n, this.#a) && (r = this.#a[0], i = this.#a[1], r === i)) return;
|
|
@@ -274,7 +274,7 @@ var le = class extends c {
|
|
|
274
274
|
anchorCullBounds: d,
|
|
275
275
|
viewOpacity: a
|
|
276
276
|
});
|
|
277
|
-
}, (t) =>
|
|
277
|
+
}, (t) => o(`Canvas2D picking could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
|
|
278
278
|
}
|
|
279
279
|
get currentCoords() {
|
|
280
280
|
let e = i(this.#e);
|
|
@@ -401,12 +401,12 @@ var he = class {
|
|
|
401
401
|
query(e, t) {
|
|
402
402
|
let n = this.#n;
|
|
403
403
|
if (!n?.spec) throw Error("Canvas x-index query was not prepared.");
|
|
404
|
-
|
|
404
|
+
u("canvasXIndexNativeItems", e.length);
|
|
405
405
|
let r = n.batches.get(e);
|
|
406
|
-
return r === void 0 && (r = fe(n.spec, e) ?? null, n.batches.set(e, r),
|
|
406
|
+
return r === void 0 && (r = fe(n.spec, e) ?? null, n.batches.set(e, r), u("canvasXIndexBuilds"), r || u("canvasXIndexRejectedBuilds")), r ? (r(this.#t[0], this.#t[1], t), u("canvasXIndexQueries"), u("canvasXIndexCandidateItems", t[1] - t[0]), t[0] === t[1] && u("canvasXIndexEmptyRanges"), !0) : this.#r();
|
|
407
407
|
}
|
|
408
408
|
#r() {
|
|
409
|
-
return
|
|
409
|
+
return u("canvasXIndexFallbackQueries"), !1;
|
|
410
410
|
}
|
|
411
411
|
}, Z = class {
|
|
412
412
|
constructor(e) {
|
|
@@ -430,10 +430,10 @@ var he = class {
|
|
|
430
430
|
if (!e) return;
|
|
431
431
|
let t = this.surface.getLogicalCanvasSize();
|
|
432
432
|
if (isNaN(t.width) || isNaN(t.height)) return;
|
|
433
|
-
let n =
|
|
433
|
+
let n = c();
|
|
434
434
|
n?.beginFrame("canvas");
|
|
435
435
|
try {
|
|
436
|
-
|
|
436
|
+
l("render", () => j({
|
|
437
437
|
layoutResult: e,
|
|
438
438
|
context: this.context,
|
|
439
439
|
width: t.width,
|
|
@@ -460,10 +460,10 @@ var he = class {
|
|
|
460
460
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
461
461
|
getRasterizer: () => (n || (n = new R(this.surface.getPickingBuffer()), this.pickingRasterizer = n), r ||= (n.resetClip(), n.resetStatistics(), !0), n),
|
|
462
462
|
xIndexManager: this.xIndexManager
|
|
463
|
-
}), a =
|
|
463
|
+
}), a = c();
|
|
464
464
|
a?.beginFrame("canvas", "picking");
|
|
465
465
|
try {
|
|
466
|
-
|
|
466
|
+
l("picking", () => e.collectRenderCommands(i)), this.dirtyPickingBuffer = !1, r && ge(n, a);
|
|
467
467
|
} finally {
|
|
468
468
|
a?.endFrame();
|
|
469
469
|
}
|
|
@@ -473,7 +473,7 @@ var he = class {
|
|
|
473
473
|
}
|
|
474
474
|
#e() {
|
|
475
475
|
let e = this.surface.getLogicalCanvasSize();
|
|
476
|
-
if (!(isNaN(e.width) || isNaN(e.height))) return
|
|
476
|
+
if (!(isNaN(e.width) || isNaN(e.height))) return f(this.viewRoot, s.create(0, 0, e.width, e.height), {
|
|
477
477
|
devicePixelRatio: this.surface.getDevicePixelRatio(),
|
|
478
478
|
renderingOptions: { firstFacet: !0 }
|
|
479
479
|
});
|