@genome-spy/app 0.85.0 → 0.86.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 +28 -0
- package/dist/{agentApi-Cz0hCnVp.js → agentApi-DgopQbMV.js} +5019 -6824
- package/dist/agentApi.es.js +2757 -2852
- package/dist/agentShared.es.js +15 -14
- package/dist/canvas2d-8uxuN_vx.js +619 -0
- package/dist/canvas2d-BtQC7Xr8.js +619 -0
- package/dist/{arrayUtils-LJpQOu-U.js → clipOptions-BQfNhxgP.js} +625 -561
- package/dist/{paramUtils-BYI4rwyL.js → clipOptions-taFzEljc.js} +192 -128
- package/dist/{debug-BvCZWumf.js → debug-Bzc3SoRg.js} +8 -8
- package/dist/{debug-CgDtmspT.js → debug-D_VtWQ6l.js} +8 -8
- package/dist/index.es.js +2992 -2915
- package/dist/index.js +2006 -2004
- package/dist/indexer-qiFctgR3.js +72 -0
- package/dist/indexer-qy_dq5l5.js +72 -0
- package/dist/layoutResult-D50MSHXR.js +97 -0
- package/dist/{nativeText-m5AUINMq.js → nativeText-DFV5XIx8.js} +247 -193
- package/dist/{nativeText-DMO8gLt7.js → nativeText-vT3AWE14.js} +244 -190
- package/dist/performanceProfiler-CPLEjApa.js +20 -0
- package/dist/rasterExport-B8pVoOsj.js +44 -0
- package/dist/rasterExport-C4r4xjQT.js +44 -0
- package/dist/rasterImage-B4rPLaW9.js +18 -0
- package/dist/rasterization-CFogVB3B.js +50 -0
- package/dist/rectangle-DKnrAmKs.js +142 -0
- package/dist/renderCanvas2D-BQrRWp2Z.js +271 -0
- package/dist/renderCanvas2D-CHVNfIUz.js +271 -0
- package/dist/schema.json +71 -131
- package/dist/{svg-CCu8kYy2.js → svg-C-Sw6E6G.js} +286 -277
- package/dist/{svg-yFj875aX.js → svg-CKHwwKRt.js} +278 -269
- package/dist/svgRasterizer-BgD72AmG.js +40 -0
- package/dist/svgRasterizer-BgSNqI3L.js +40 -0
- package/dist/vega-scale-CK0_al6O.js +2700 -0
- package/dist/vega-scale-D46-iCaL.js +2700 -0
- package/dist/viewError-BiR9VCgL.js +29 -0
- package/dist/{viewIdentityRegistry-D3oPbN4O.js → viewIdentityRegistry-B-VGlez1.js} +1 -1
- package/dist/{viewIdentityRegistry-BUdkK9zT.js → viewIdentityRegistry-CDtVktJD.js} +1 -1
- package/dist/viewSelectors-CKfxF_LM.js +1817 -0
- package/dist/viewSelectors-D_imtq5Z.js +1817 -0
- package/dist/viewUtils-nCJ7AoaI.js +5782 -0
- package/dist/webgl-BaA3jSa2.js +4128 -0
- package/dist/webgl-FP-4EsBL.js +4128 -0
- package/package.json +7 -6
- package/dist/bmFontMetrics-CuNB-kNN.js +0 -31
- package/dist/canvas2d-DoAXEiF9.js +0 -309
- package/dist/canvas2d-f5jl4A5D.js +0 -310
- package/dist/clipOptions-gqdb3fvW.js +0 -43
- package/dist/color-W5zffv-z.js +0 -335
- package/dist/framebufferReadback-CCLOjStu.js +0 -148
- package/dist/framebufferReadback-THWwFqs8.js +0 -1994
- package/dist/twgl-full.module-DB2UdP1k.js +0 -1849
- package/dist/viewRenderingContext-HtpqwS_x.js +0 -120
- package/dist/viewSelectors-DGCspRN3.js +0 -4198
- package/dist/viewSelectors-U5oLCLHV.js +0 -4195
- package/dist/viewUtils-Dg4RA40Q.js +0 -7503
- package/dist/warning-DRGdb6BF.js +0 -59
- package/dist/webgl-Ci6ZhCCf.js +0 -54
- package/dist/webgl-Dpz8a3TI.js +0 -53
|
@@ -1,36 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nt as e, R as t, Xt as n, u as r } from "./clipOptions-taFzEljc.js";
|
|
2
|
+
import { t as i } from "./rectangle-DKnrAmKs.js";
|
|
2
3
|
//#region ../core/src/rendering/immediate/markData.js
|
|
3
|
-
var
|
|
4
|
-
|
|
4
|
+
var a = [], o = class {
|
|
5
|
+
#e = {
|
|
6
|
+
x: 0,
|
|
7
|
+
y: 0,
|
|
8
|
+
width: 0,
|
|
9
|
+
height: 0
|
|
10
|
+
};
|
|
11
|
+
#t = new i(() => this.#e.x, () => this.#e.y, () => this.#e.width, () => this.#e.height);
|
|
12
|
+
#n;
|
|
13
|
+
#r = 0;
|
|
14
|
+
#i = 0;
|
|
15
|
+
#a = NaN;
|
|
16
|
+
#o = NaN;
|
|
17
|
+
#s = NaN;
|
|
18
|
+
resolveFacet(e, t) {
|
|
19
|
+
this.#c(e);
|
|
20
|
+
let n = t.locSize.location, r = t.locSize.size;
|
|
21
|
+
return (this.#a !== n || this.#o !== r || this.#s !== t.pixelToUnit) && (this.#l(n, r, t.pixelToUnit), this.#a = n, this.#o = r, this.#s = t.pixelToUnit), this.#t;
|
|
22
|
+
}
|
|
23
|
+
resolvePlacement(e, t, n) {
|
|
24
|
+
if (!t) return;
|
|
25
|
+
let r = t.getSnapshot().rectangles, i = n * 4;
|
|
26
|
+
if (!(i + 3 >= r.length)) return this.#c(e), this.#l(r[i + 1], r[i + 3], 1), this.#a = NaN, this.#o = NaN, this.#s = NaN, this.#t;
|
|
27
|
+
}
|
|
28
|
+
#c(e) {
|
|
29
|
+
this.#n !== e && (this.#e.x = e.x, this.#r = e.y, this.#e.width = e.width, this.#i = e.height, this.#n = e, this.#a = NaN, this.#o = NaN, this.#s = NaN);
|
|
30
|
+
}
|
|
31
|
+
#l(e, t, n) {
|
|
32
|
+
this.#e.y = this.#r + e * n * this.#i, this.#e.height = t * n * this.#i;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function s(e, t) {
|
|
5
36
|
let n = e.unitView.getCollector();
|
|
6
37
|
if (!n) throw Error(`Cannot render an uninitialized mark. View: ${e.unitView.getPathString()}`);
|
|
7
38
|
let r = n.facetBatches.get(void 0);
|
|
8
|
-
return r?.length ? r : n.facetBatches.get(t.facetId) ??
|
|
9
|
-
}
|
|
10
|
-
function
|
|
11
|
-
let o =
|
|
12
|
-
if (t.sampleFacetRenderingOptions) r(
|
|
13
|
-
else if (e.encoders.facetIndex) for (let [
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
locSize: o,
|
|
17
|
-
pixelToUnit: 1
|
|
18
|
-
}), a) : i(t);
|
|
19
|
-
}
|
|
20
|
-
else r(n, o);
|
|
21
|
-
}
|
|
22
|
-
function s(e, t) {
|
|
23
|
-
let n = t.locSize.location * t.pixelToUnit, r = t.locSize.size * t.pixelToUnit;
|
|
24
|
-
return e.modify({
|
|
25
|
-
y: () => e.y + n * e.height,
|
|
26
|
-
height: () => r * e.height
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function c(e, t) {
|
|
30
|
-
for (let n of e.unitView.getLayoutAncestors()) {
|
|
31
|
-
let e = n.getSampleFacetPosition(t);
|
|
32
|
-
if (e) return e;
|
|
39
|
+
return r?.length ? r : n.facetBatches.get(t.facetId) ?? a;
|
|
40
|
+
}
|
|
41
|
+
function c(e, t, n, r, i, a) {
|
|
42
|
+
let o = s(e, t);
|
|
43
|
+
if (t.sampleFacetRenderingOptions) i(r.resolveFacet(n, t.sampleFacetRenderingOptions), o);
|
|
44
|
+
else if (e.encoders.facetIndex) for (let [s, c] of l(e.encoders.facetIndex, o)) {
|
|
45
|
+
let e = r.resolvePlacement(n, t.placement?.source, s);
|
|
46
|
+
e ? i(e, c) : a(s);
|
|
33
47
|
}
|
|
48
|
+
else i(n, o);
|
|
34
49
|
}
|
|
35
50
|
function l(e, t) {
|
|
36
51
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -227,8 +242,8 @@ function z(e) {
|
|
|
227
242
|
function B(e) {
|
|
228
243
|
let t = e.properties, n = R(e, t.headSpacing);
|
|
229
244
|
return {
|
|
230
|
-
configuredRHeadSlope:
|
|
231
|
-
configuredRHeadNotchSlope:
|
|
245
|
+
configuredRHeadSlope: oe(R(e, t.headAngle)),
|
|
246
|
+
configuredRHeadNotchSlope: oe(R(e, t.headNotchAngle)),
|
|
232
247
|
headShape: R(e, t.headShape),
|
|
233
248
|
headWidth: R(e, t.headWidth),
|
|
234
249
|
minSize: R(e, t.minSize),
|
|
@@ -241,26 +256,68 @@ function B(e) {
|
|
|
241
256
|
};
|
|
242
257
|
}
|
|
243
258
|
function V(e, t, n, r) {
|
|
244
|
-
let {
|
|
259
|
+
let { viewOpacity: i } = n, a = e.encoders;
|
|
260
|
+
return H(e, t, n, (e) => {
|
|
261
|
+
let n = t.stem ? te(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch) : null, o = n ? [n] : [];
|
|
262
|
+
U(e, (t, n) => {
|
|
263
|
+
let r = {
|
|
264
|
+
x: t,
|
|
265
|
+
y: n
|
|
266
|
+
};
|
|
267
|
+
o.push(e.renderedHeadShape == "open" ? ne(r, e.tangent, e.normal, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : ee(r, e.tangent, e.normal, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
|
|
268
|
+
});
|
|
269
|
+
let s = z(a.stroke(e.datum)) != "none" && P(a.strokeOpacity, e.datum) * i > 0 && e.strokeWidth > 0;
|
|
270
|
+
r({
|
|
271
|
+
datum: e.datum,
|
|
272
|
+
boundaryLoops: o.length == 1 || !s ? o : g(o),
|
|
273
|
+
strokeWidth: e.strokeWidth,
|
|
274
|
+
headShapeFallback: e.headShapeFallback
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function H(e, t, n, r) {
|
|
279
|
+
let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, c = e.encoders;
|
|
245
280
|
if (a.length == 0) return 0;
|
|
246
|
-
let
|
|
281
|
+
let l = M(i, c, "x", a[0]), u = M(i, c, "y", a[0]), d = [0, 0], f = [0, 0], p = {
|
|
282
|
+
datum: {},
|
|
283
|
+
tail: {
|
|
284
|
+
x: 0,
|
|
285
|
+
y: 0
|
|
286
|
+
},
|
|
287
|
+
tip: {
|
|
288
|
+
x: 0,
|
|
289
|
+
y: 0
|
|
290
|
+
},
|
|
291
|
+
tangent: {
|
|
292
|
+
x: 0,
|
|
293
|
+
y: 0
|
|
294
|
+
},
|
|
295
|
+
normal: {
|
|
296
|
+
x: 0,
|
|
297
|
+
y: 0
|
|
298
|
+
},
|
|
299
|
+
size: 0,
|
|
300
|
+
stemHalfWidth: 0,
|
|
301
|
+
headHalfWidth: 0,
|
|
302
|
+
headAxisLength: 0,
|
|
303
|
+
rHeadSlope: 0,
|
|
304
|
+
rHeadNotchSlope: 0,
|
|
305
|
+
strokeWidth: 0,
|
|
306
|
+
repeatSpacing: Infinity,
|
|
307
|
+
headRepeatFootprint: 0,
|
|
308
|
+
geometryLength: 0,
|
|
309
|
+
stemContainsHead: !1,
|
|
310
|
+
renderedHeadShape: "triangle",
|
|
311
|
+
headShapeFallback: !1
|
|
312
|
+
}, h = 0;
|
|
247
313
|
for (let e of a) {
|
|
248
|
-
|
|
249
|
-
let
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}, b = L(l.direction, e), x = b == "reverse" ? y : v, S = b == "reverse" ? v : y, C = ae(S, x), w = Math.hypot(C.x, C.y);
|
|
256
|
-
if (w == 0) continue;
|
|
257
|
-
let T = G(C, 1 / w), E = {
|
|
258
|
-
x: -T.y,
|
|
259
|
-
y: T.x
|
|
260
|
-
}, D = Math.max(P(l.size, e), t.minSize), O = D / 2, k = Math.max(t.headWidth * D, 0) / 2, A = re({
|
|
261
|
-
segmentLength: w,
|
|
262
|
-
headHalfWidth: k,
|
|
263
|
-
stemHalfWidth: t.stem ? O : -O,
|
|
314
|
+
l(e, d), u(e, f);
|
|
315
|
+
let n = L(c.direction, e) == "reverse", i = n ? d[1] : d[0], a = n ? f[1] : f[0], g = n ? d[0] : d[1], _ = n ? f[0] : f[1], v = g - i, y = _ - a, b = Math.hypot(v, y);
|
|
316
|
+
if (b == 0) continue;
|
|
317
|
+
let x = v / b, S = y / b, C = Math.max(P(c.size, e), t.minSize), w = C / 2, T = Math.max(t.headWidth * C, 0) / 2, E = re({
|
|
318
|
+
segmentLength: b,
|
|
319
|
+
headHalfWidth: T,
|
|
320
|
+
stemHalfWidth: t.stem ? w : -w,
|
|
264
321
|
configuredRHeadSlope: t.configuredRHeadSlope,
|
|
265
322
|
configuredRHeadNotchSlope: t.configuredRHeadNotchSlope,
|
|
266
323
|
headRepeat: t.repeatHeads,
|
|
@@ -268,23 +325,16 @@ function V(e, t, n, r) {
|
|
|
268
325
|
startNotch: t.startNotch,
|
|
269
326
|
minStemLength: t.minStemLength,
|
|
270
327
|
headShape: t.headShape
|
|
271
|
-
}),
|
|
272
|
-
if (!m(o, Math.min(
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
let n = W(F, G(T, -e));
|
|
276
|
-
if (J.push(K == "open" ? ne(n, T, E, k, A, j, D) : ee(n, T, E, k, A, j)), !t.repeatHeads || X <= 0) break;
|
|
277
|
-
}
|
|
278
|
-
let Q = z(l.stroke(e)) != "none" && P(l.strokeOpacity, e) * s > 0 && H > 0;
|
|
279
|
-
r({
|
|
280
|
-
datum: e,
|
|
281
|
-
boundaryLoops: J.length == 1 || !Q ? J : g(J),
|
|
282
|
-
strokeWidth: H,
|
|
283
|
-
headShapeFallback: K != t.headShape
|
|
284
|
-
});
|
|
328
|
+
}), D = t.headShape == "open" ? E : Math.min(t.configuredRHeadNotchSlope, E), O = t.headShape == "open" ? C : 0, k = t.headPlacement == "outside" ? ae(T, E, D, O) : 0, A = g + x * k, j = _ + S * k, M = T * E, N = Math.hypot(T, M), F = t.headShape == "open" && N > 0 ? C * T / N : 0, I = A - x * (M + F), R = j - S * (M + F), z = P(c.strokeWidth, e), B = Math.max(t.stem ? w : 0, T) + z * 2;
|
|
329
|
+
if (!m(o, Math.min(i, A, I), Math.min(a, j, R), Math.max(i, A, I), Math.max(a, j, R), B) || (h++, s)) continue;
|
|
330
|
+
let V = t.headShape == "triangle" || t.headShape == "open" ? t.headShape : "triangle", H = M + O / Math.hypot(E, 1) + z, U = t.repeatHeads ? Math.max((t.headSpacing ?? 0) * C, H) : Infinity;
|
|
331
|
+
p.datum = e, K(p.tail, i, a), K(p.tip, A, j), K(p.tangent, x, S), K(p.normal, -S, x), p.size = C, p.stemHalfWidth = w, p.headHalfWidth = T, p.headAxisLength = M, p.rHeadSlope = E, p.rHeadNotchSlope = D, p.strokeWidth = z, p.repeatSpacing = U, p.headRepeatFootprint = H, p.geometryLength = Math.hypot(A - i, j - a), p.stemContainsHead = t.stem && V == "triangle" && !t.repeatHeads && T <= w, p.renderedHeadShape = V, p.headShapeFallback = V != t.headShape, r(p);
|
|
285
332
|
}
|
|
286
333
|
return h;
|
|
287
334
|
}
|
|
335
|
+
function U(e, t) {
|
|
336
|
+
for (let n = 0; !e.stemContainsHead && !(n > 0 && n + e.headRepeatFootprint - e.strokeWidth / 2 > e.geometryLength || (t(e.tip.x - e.tangent.x * n, e.tip.y - e.tangent.y * n), !(e.repeatSpacing > 0) || !Number.isFinite(e.repeatSpacing))); n += e.repeatSpacing);
|
|
337
|
+
}
|
|
288
338
|
function ee(e, t, n, r, i, a) {
|
|
289
339
|
let o = r * i, s = o - r * a, c = W(W(e, G(t, -o)), G(n, r)), l = W(W(e, G(t, -o)), G(n, -r));
|
|
290
340
|
return [
|
|
@@ -321,18 +371,18 @@ function re({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRH
|
|
|
321
371
|
if (o == "outside") return !s || n <= 0 ? r : Math.min(r, Math.max(e - c, 0) / n);
|
|
322
372
|
if (l != "triangle") return r;
|
|
323
373
|
let u = Math.max(e - c, 0);
|
|
324
|
-
return
|
|
374
|
+
return ie(n, t, r, i) <= u ? r : u < n * i ? n > 0 ? q(u / n, 0, r) : 0 : q((u + (t - n) * i) / t, 0, r);
|
|
325
375
|
}
|
|
326
|
-
function
|
|
376
|
+
function ie(e, t, n, r) {
|
|
327
377
|
return t * n - (t - e) * Math.min(r, n);
|
|
328
378
|
}
|
|
329
|
-
function
|
|
379
|
+
function ae(e, t, n, r) {
|
|
330
380
|
if (e <= 0) return 0;
|
|
331
381
|
let i = e * t, a = Math.hypot(e, i);
|
|
332
382
|
return i + r * e / a - (e - r * i / a) * n;
|
|
333
383
|
}
|
|
334
|
-
function
|
|
335
|
-
let t =
|
|
384
|
+
function oe(e) {
|
|
385
|
+
let t = q(e, 1, 90) * Math.PI / 180;
|
|
336
386
|
return 1 / Math.max(Math.tan(t), 1e-6);
|
|
337
387
|
}
|
|
338
388
|
function W(e, t) {
|
|
@@ -341,12 +391,6 @@ function W(e, t) {
|
|
|
341
391
|
y: e.y + t.y
|
|
342
392
|
};
|
|
343
393
|
}
|
|
344
|
-
function ae(e, t) {
|
|
345
|
-
return {
|
|
346
|
-
x: e.x - t.x,
|
|
347
|
-
y: e.y - t.y
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
394
|
function G(e, t) {
|
|
351
395
|
return {
|
|
352
396
|
x: e.x * t,
|
|
@@ -354,38 +398,41 @@ function G(e, t) {
|
|
|
354
398
|
};
|
|
355
399
|
}
|
|
356
400
|
function K(e, t, n) {
|
|
401
|
+
e.x = t, e.y = n;
|
|
402
|
+
}
|
|
403
|
+
function q(e, t, n) {
|
|
357
404
|
return Math.min(Math.max(e, t), n);
|
|
358
405
|
}
|
|
359
406
|
//#endregion
|
|
360
407
|
//#region ../core/src/rendering/immediate/geometry/linkGeometry.js
|
|
361
|
-
function
|
|
408
|
+
function se(e, t, n, r) {
|
|
362
409
|
if (r.shape == "arc") {
|
|
363
|
-
let i = [...e], a = [...t], o =
|
|
410
|
+
let i = [...e], a = [...t], o = Y(a, i), s = de(o);
|
|
364
411
|
if (s == 0) return [
|
|
365
412
|
i,
|
|
366
413
|
i,
|
|
367
414
|
a,
|
|
368
415
|
a
|
|
369
416
|
];
|
|
370
|
-
let c =
|
|
371
|
-
s =
|
|
372
|
-
let u =
|
|
417
|
+
let c = X(o, 1 / s), l = [-c[1], c[0]];
|
|
418
|
+
s = ce(i, a, s, r.maxChordLength, n);
|
|
419
|
+
let u = X(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
|
|
373
420
|
return [
|
|
374
421
|
i,
|
|
375
|
-
|
|
376
|
-
|
|
422
|
+
J(i, u),
|
|
423
|
+
J(a, u),
|
|
377
424
|
a
|
|
378
425
|
];
|
|
379
426
|
} else if (r.shape == "dome") {
|
|
380
427
|
let i, a, o;
|
|
381
428
|
r.orient == "vertical" ? (i = [Math.min(e[0], t[0]), t[1]], a = [Math.max(e[0], t[0]), t[1]], o = [0, e[1] - t[1]]) : (i = [t[0], Math.min(e[1], t[1])], a = [t[0], Math.max(e[1], t[1])], o = [e[0] - t[0], 0]);
|
|
382
|
-
let s =
|
|
383
|
-
|
|
384
|
-
let c =
|
|
429
|
+
let s = de(Y(a, i));
|
|
430
|
+
ce(i, a, s, r.maxChordLength, n), r.clampApex && le(i, a, r.orient, n);
|
|
431
|
+
let c = X(o, 1 / .75);
|
|
385
432
|
return [
|
|
386
433
|
i,
|
|
387
|
-
|
|
388
|
-
|
|
434
|
+
J(i, c),
|
|
435
|
+
J(a, c),
|
|
389
436
|
a
|
|
390
437
|
];
|
|
391
438
|
} else if (r.shape == "diagonal") if (r.orient == "vertical") {
|
|
@@ -406,7 +453,7 @@ function q(e, t, n, r) {
|
|
|
406
453
|
];
|
|
407
454
|
}
|
|
408
455
|
else if (r.shape == "line") {
|
|
409
|
-
let n =
|
|
456
|
+
let n = X(J(e, t), .5);
|
|
410
457
|
return [
|
|
411
458
|
e,
|
|
412
459
|
n,
|
|
@@ -415,35 +462,35 @@ function q(e, t, n, r) {
|
|
|
415
462
|
];
|
|
416
463
|
} else throw Error(`Unsupported link shape: ${r.shape}`);
|
|
417
464
|
}
|
|
418
|
-
function
|
|
465
|
+
function ce(e, t, n, r, i) {
|
|
419
466
|
if (n <= r) return n;
|
|
420
|
-
let a =
|
|
421
|
-
return
|
|
467
|
+
let a = X(Y(t, e), 1 / n);
|
|
468
|
+
return ue(e, i, 2) ? (fe(t, J(e, X(a, r))), r) : ue(t, i, 2) ? (fe(e, Y(t, X(a, r))), r) : n;
|
|
422
469
|
}
|
|
423
|
-
function
|
|
470
|
+
function le(e, t, n, r) {
|
|
424
471
|
n == "vertical" ? (t[0] > 0 && (e[0] = Math.max(e[0], -t[0])), e[0] < r.width && (t[0] = Math.min(t[0], 2 * r.width - e[0]))) : (t[1] > 0 && (e[1] = Math.max(e[1], -t[1])), e[1] < r.height && (t[1] = Math.min(t[1], 2 * r.height - e[1])));
|
|
425
472
|
}
|
|
426
|
-
function
|
|
473
|
+
function ue(e, t, n) {
|
|
427
474
|
return e[0] >= -t.width * n && e[0] <= t.width * (1 + n) && e[1] >= -t.height * n && e[1] <= t.height * (1 + n);
|
|
428
475
|
}
|
|
429
|
-
function
|
|
476
|
+
function J(e, t) {
|
|
430
477
|
return [e[0] + t[0], e[1] + t[1]];
|
|
431
478
|
}
|
|
432
|
-
function
|
|
479
|
+
function Y(e, t) {
|
|
433
480
|
return [e[0] - t[0], e[1] - t[1]];
|
|
434
481
|
}
|
|
435
|
-
function
|
|
482
|
+
function X(e, t) {
|
|
436
483
|
return [e[0] * t, e[1] * t];
|
|
437
484
|
}
|
|
438
|
-
function
|
|
485
|
+
function de(e) {
|
|
439
486
|
return Math.hypot(e[0], e[1]);
|
|
440
487
|
}
|
|
441
|
-
function
|
|
488
|
+
function fe(e, t) {
|
|
442
489
|
e[0] = t[0], e[1] = t[1];
|
|
443
490
|
}
|
|
444
491
|
//#endregion
|
|
445
492
|
//#region ../core/src/rendering/immediate/marks/link.js
|
|
446
|
-
function
|
|
493
|
+
function pe(e) {
|
|
447
494
|
let t = e.properties;
|
|
448
495
|
return {
|
|
449
496
|
shape: R(e, t.linkShape),
|
|
@@ -454,7 +501,7 @@ function le(e) {
|
|
|
454
501
|
clampApex: R(e, t.clampApex)
|
|
455
502
|
};
|
|
456
503
|
}
|
|
457
|
-
function
|
|
504
|
+
function me(e, t, n, r) {
|
|
458
505
|
let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
|
|
459
506
|
if (a.length == 0) return 0;
|
|
460
507
|
let c = M(i, s, "x", a[0]), l = M(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = i.x, p = i.y, h = {
|
|
@@ -463,7 +510,7 @@ function ue(e, t, n, r) {
|
|
|
463
510
|
}, g = p + h.height, _ = 0;
|
|
464
511
|
for (let e of a) {
|
|
465
512
|
c(e, u), l(e, d);
|
|
466
|
-
let [n, i] = u, [a, p] = d, v =
|
|
513
|
+
let [n, i] = u, [a, p] = d, v = se([n - f, g - a], [i - f, g - p], h, t);
|
|
467
514
|
for (let e of v) e[0] += f, e[1] = g - e[1];
|
|
468
515
|
let [y, b, x, S] = v, C = P(s.size, e);
|
|
469
516
|
m(o, Math.min(y[0], b[0], x[0], S[0]), Math.min(y[1], b[1], x[1], S[1]), Math.max(y[0], b[0], x[0], S[0]), Math.max(y[1], b[1], x[1], S[1]), C / 2) && (_++, r({
|
|
@@ -476,37 +523,39 @@ function ue(e, t, n, r) {
|
|
|
476
523
|
}
|
|
477
524
|
//#endregion
|
|
478
525
|
//#region ../core/src/rendering/immediate/marks/point.js
|
|
479
|
-
function
|
|
526
|
+
function he(e) {
|
|
480
527
|
return { inwardStroke: R(e, e.properties.inwardStroke) };
|
|
481
528
|
}
|
|
482
|
-
function
|
|
483
|
-
let { coords: i, data: a, visibleBounds: o, anchorCullBounds: s } = n, c = e.encoders;
|
|
484
|
-
if (
|
|
485
|
-
let
|
|
529
|
+
function ge(e, t, n, r) {
|
|
530
|
+
let { coords: i, data: a, visibleBounds: o, anchorCullBounds: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
|
|
531
|
+
if (c === l) return 0;
|
|
532
|
+
let d = M(i, u, "x", a[c]), f = M(i, u, "y", a[c]), h = [0, 0], g = [0, 0], _ = e.getSemanticThreshold(), v = {
|
|
486
533
|
datum: {},
|
|
487
534
|
shape: "circle",
|
|
488
535
|
x: 0,
|
|
489
536
|
y: 0,
|
|
490
537
|
geometryRadius: 0,
|
|
538
|
+
boundsRadius: 0,
|
|
491
539
|
angle: 0,
|
|
492
540
|
strokeWidth: 0,
|
|
493
541
|
lineShape: !1
|
|
494
|
-
},
|
|
495
|
-
for (let e
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
542
|
+
}, y = 0;
|
|
543
|
+
for (let e = c; e < l; e++) {
|
|
544
|
+
let n = a[e];
|
|
545
|
+
if (P(u.semanticScore, n) < _) continue;
|
|
546
|
+
d(n, h), f(n, g);
|
|
547
|
+
let i = h[0] + P(u.dx, n), c = g[0] - P(u.dy, n);
|
|
548
|
+
if (p(s, i, c)) continue;
|
|
549
|
+
let l = Math.sqrt(P(u.size, n)) / 2;
|
|
550
|
+
if (t.inwardStroke && l <= 0) continue;
|
|
551
|
+
let b = L(u.shape, n), x = P(u.strokeWidth, n), S = b == "x" || b == "+", C = t.inwardStroke && !S ? Math.min(x, l) : x, w = t.inwardStroke && !S ? l - C / 2 : l, T = t.inwardStroke ? 0 : x / 2, E = l * Math.SQRT2 + T;
|
|
552
|
+
m(o, i - E, c - E, i + E, c + E) && (y++, v.datum = n, v.shape = b, v.x = i, v.y = c, v.geometryRadius = w, v.boundsRadius = E, v.angle = P(u.angle, n), v.strokeWidth = C, v.lineShape = S, r(v));
|
|
504
553
|
}
|
|
505
|
-
return
|
|
554
|
+
return y;
|
|
506
555
|
}
|
|
507
556
|
//#endregion
|
|
508
557
|
//#region ../core/src/rendering/immediate/geometry/pointPath.js
|
|
509
|
-
function
|
|
558
|
+
function _e(e, t, n, r, i) {
|
|
510
559
|
let a = r * .4, o = r * .15, s = Math.sqrt(3) * r / 2;
|
|
511
560
|
switch (e) {
|
|
512
561
|
case "diamond": return i.moveTo(t, n - r), i.lineTo(t + r, n), i.lineTo(t, n + r), i.lineTo(t - r, n), i.closePath(), !0;
|
|
@@ -515,22 +564,22 @@ function pe(e, t, n, r, i) {
|
|
|
515
564
|
case "triangle-right": return i.moveTo(t + s, n), i.lineTo(t - s, n + r), i.lineTo(t - s, n - r), i.closePath(), !0;
|
|
516
565
|
case "triangle-down": return i.moveTo(t, n + s), i.lineTo(t - r, n - s), i.lineTo(t + r, n - s), i.closePath(), !0;
|
|
517
566
|
case "triangle-left": return i.moveTo(t - s, n), i.lineTo(t + s, n - r), i.lineTo(t + s, n + r), i.closePath(), !0;
|
|
518
|
-
case "tick-up": return
|
|
519
|
-
case "tick-right": return
|
|
520
|
-
case "tick-down": return
|
|
521
|
-
case "tick-left": return
|
|
567
|
+
case "tick-up": return Z(i, t - o, n - r, t + o, n), !0;
|
|
568
|
+
case "tick-right": return Z(i, t, n - o, t + r, n + o), !0;
|
|
569
|
+
case "tick-down": return Z(i, t - o, n, t + o, n + r), !0;
|
|
570
|
+
case "tick-left": return Z(i, t - r, n - o, t, n + o), !0;
|
|
522
571
|
case "+": return i.moveTo(t - r, n), i.lineTo(t + r, n), i.moveTo(t, n - r), i.lineTo(t, n + r), !0;
|
|
523
572
|
case "x": return i.moveTo(t - r, n - r), i.lineTo(t + r, n + r), i.moveTo(t + r, n - r), i.lineTo(t - r, n + r), !0;
|
|
524
573
|
default: return !1;
|
|
525
574
|
}
|
|
526
575
|
}
|
|
527
|
-
function
|
|
576
|
+
function Z(e, t, n, r, i) {
|
|
528
577
|
e.moveTo(t, n), e.lineTo(r, n), e.lineTo(r, i), e.lineTo(t, i), e.closePath();
|
|
529
578
|
}
|
|
530
579
|
//#endregion
|
|
531
580
|
//#region ../core/src/rendering/immediate/marks/rect.js
|
|
532
|
-
var
|
|
533
|
-
function
|
|
581
|
+
var ve = .1;
|
|
582
|
+
function ye(e) {
|
|
534
583
|
let t = e.properties, n = R(e, t.cornerRadius), r = {
|
|
535
584
|
topLeft: R(e, t.cornerRadiusTopLeft ?? n),
|
|
536
585
|
topRight: R(e, t.cornerRadiusTopRight ?? n),
|
|
@@ -542,7 +591,7 @@ function he(e) {
|
|
|
542
591
|
offsetX: R(e, t.shadowOffsetX ?? 0),
|
|
543
592
|
offsetY: R(e, t.shadowOffsetY ?? 0),
|
|
544
593
|
opacity: R(e, t.shadowOpacity ?? 0)
|
|
545
|
-
}, a = R(e, t.hatch ?? "none");
|
|
594
|
+
}, a = R(e, t.hatch ?? "none"), o = !Ce(r);
|
|
546
595
|
return {
|
|
547
596
|
cornerRadii: r,
|
|
548
597
|
minWidth: R(e, t.minWidth),
|
|
@@ -550,13 +599,14 @@ function he(e) {
|
|
|
550
599
|
minOpacity: R(e, t.minOpacity),
|
|
551
600
|
shadow: i,
|
|
552
601
|
hatch: a,
|
|
553
|
-
|
|
602
|
+
hasCornerRadii: o,
|
|
603
|
+
canPadSeams: a == "none" && i.opacity == 0 && !o
|
|
554
604
|
};
|
|
555
605
|
}
|
|
556
|
-
function
|
|
557
|
-
let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = e.encoders;
|
|
558
|
-
if (
|
|
559
|
-
let
|
|
606
|
+
function be(e, t, n, r) {
|
|
607
|
+
let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
|
|
608
|
+
if (c === l) return 0;
|
|
609
|
+
let d = u.strokeWidth.constant, f = u.fillOpacity.constant, p = d ? P(u.strokeWidth, a[c]) : 0, h = f ? P(u.fillOpacity, a[c]) : 0, g = u.fill.constant, _ = g ? z(u.fill(a[c])) : "none", v = t.shadow.opacity > 0 ? t.shadow.blur + Math.max(Math.abs(t.shadow.offsetX), Math.abs(t.shadow.offsetY)) : 0, y = M(i, u, "x", a[c]), b = M(i, u, "y", a[c]), x = [0, 0], S = [0, 0], C = {
|
|
560
610
|
datum: {},
|
|
561
611
|
x: 0,
|
|
562
612
|
y: 0,
|
|
@@ -572,34 +622,33 @@ function ge(e, t, n, r) {
|
|
|
572
622
|
strokeWidth: 0,
|
|
573
623
|
fill: "none",
|
|
574
624
|
fillOpacity: 0
|
|
575
|
-
},
|
|
576
|
-
for (let e
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
m(o, n, i, n + a, i + v, S / 2 + E) && (_++, g.datum = e, g.x = n, g.y = i, g.width = a, g.height = v, g.opacityFactor = x, g.strokeWidth = S, g.fill = C, g.fillOpacity = w, ve(t.cornerRadii, a, v, g.radii), r(g));
|
|
625
|
+
}, w = 0;
|
|
626
|
+
for (let e = c; e < l; e++) {
|
|
627
|
+
let n = a[e];
|
|
628
|
+
y(n, x), b(n, S);
|
|
629
|
+
let i = Math.min(x[0], x[1]), c = Math.min(S[0], S[1]), l = Math.abs(x[1] - x[0]), T = Math.abs(S[1] - S[0]), E = xe(l, t.minWidth), D = xe(T, t.minHeight), O = Math.max(t.minOpacity, E * D);
|
|
630
|
+
l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth), T < t.minHeight && (c -= (t.minHeight - T) / 2, T = t.minHeight);
|
|
631
|
+
let k = d ? p : P(u.strokeWidth, n), A = g ? _ : z(u.fill(n)), j = (f ? h : P(u.fillOpacity, n)) * s, M = k == 0 && j == 1 && O == 1 && t.canPadSeams && A != "none" ? ve : 0;
|
|
632
|
+
M && (i -= M, c -= M, l += M * 2, T += M * 2), m(o, i, c, i + l, c + T, k / 2 + v) && (w++, C.datum = n, C.x = i, C.y = c, C.width = l, C.height = T, C.opacityFactor = O, C.strokeWidth = k, C.fill = A, C.fillOpacity = j, t.hasCornerRadii && Se(t.cornerRadii, l, T, C.radii), r(C));
|
|
584
633
|
}
|
|
585
|
-
return
|
|
634
|
+
return w;
|
|
586
635
|
}
|
|
587
|
-
function
|
|
636
|
+
function xe(e, t) {
|
|
588
637
|
return t > 0 && e < t ? e / t : 1;
|
|
589
638
|
}
|
|
590
|
-
function
|
|
639
|
+
function Se(e, t, n, r) {
|
|
591
640
|
let i = Math.min(t, n) / 2;
|
|
592
641
|
r.topLeft = Math.max(0, Math.min(e.topLeft, i)), r.topRight = Math.max(0, Math.min(e.topRight, i)), r.bottomRight = Math.max(0, Math.min(e.bottomRight, i)), r.bottomLeft = Math.max(0, Math.min(e.bottomLeft, i));
|
|
593
642
|
}
|
|
594
|
-
function
|
|
643
|
+
function Ce(e) {
|
|
595
644
|
return e.topLeft == 0 && e.topRight == 0 && e.bottomRight == 0 && e.bottomLeft == 0;
|
|
596
645
|
}
|
|
597
646
|
//#endregion
|
|
598
647
|
//#region ../core/src/rendering/immediate/marks/rule.js
|
|
599
|
-
function
|
|
648
|
+
function we(e) {
|
|
600
649
|
return { minLength: R(e, e.properties.minLength) };
|
|
601
650
|
}
|
|
602
|
-
function
|
|
651
|
+
function Te(e, t, n, r) {
|
|
603
652
|
let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
|
|
604
653
|
if (a.length == 0) return 0;
|
|
605
654
|
let c = M(i, s, "x", a[0]), l = M(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = {
|
|
@@ -624,7 +673,7 @@ function xe(e, t, n, r) {
|
|
|
624
673
|
}
|
|
625
674
|
//#endregion
|
|
626
675
|
//#region ../core/src/rendering/immediate/marks/text.js
|
|
627
|
-
function
|
|
676
|
+
function Ee(e) {
|
|
628
677
|
let t = e.properties;
|
|
629
678
|
return {
|
|
630
679
|
align: R(e, t.align),
|
|
@@ -639,10 +688,10 @@ function Se(e) {
|
|
|
639
688
|
dy: R(e, t.dy)
|
|
640
689
|
};
|
|
641
690
|
}
|
|
642
|
-
function
|
|
691
|
+
function De(r, i, a, o) {
|
|
643
692
|
let { coords: s, data: c, visibleBounds: l, anchorCullBounds: u } = a, { align: d, baseline: f } = i, m = r.encoders;
|
|
644
693
|
if (c.length == 0) return 0;
|
|
645
|
-
let h = m.size.constant ? P(m.size, c[0]) : 0, g = m.angle.constant ? P(m.angle, c[0]) : 0, _ = M(s, m, "x", c[0]), v = M(s, m, "y", c[0]), y = r.encoding.text, b = "format" in y ?
|
|
694
|
+
let h = m.size.constant ? P(m.size, c[0]) : 0, g = m.angle.constant ? P(m.angle, c[0]) : 0, _ = M(s, m, "x", c[0]), v = M(s, m, "y", c[0]), y = r.encoding.text, b = "format" in y ? n(y.format) : (e) => e, x = [0, 0], S = [0, 0], C = {
|
|
646
695
|
width: 0,
|
|
647
696
|
height: 0
|
|
648
697
|
}, w = {
|
|
@@ -654,7 +703,7 @@ function Ce(r, i, a, o) {
|
|
|
654
703
|
}, E = {
|
|
655
704
|
width: 0,
|
|
656
705
|
heightScale: 0
|
|
657
|
-
}, D = {
|
|
706
|
+
}, D = Array(8).fill(0), O = {
|
|
658
707
|
datum: {},
|
|
659
708
|
text: "",
|
|
660
709
|
x: 0,
|
|
@@ -667,45 +716,50 @@ function Ce(r, i, a, o) {
|
|
|
667
716
|
fadeOpacity: 1,
|
|
668
717
|
scale: 1,
|
|
669
718
|
logoScale: void 0,
|
|
670
|
-
multiCharacterLogo: !1
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
719
|
+
multiCharacterLogo: !1,
|
|
720
|
+
boundsQuad: D
|
|
721
|
+
}, k = !!m.x2, A = !!m.y2, j = 0;
|
|
722
|
+
for (let n of c) {
|
|
723
|
+
let a = b(m.text(n)), c = e(a) ? a : a === null ? "" : "" + a;
|
|
674
724
|
if (!c) continue;
|
|
675
|
-
_(
|
|
676
|
-
let [y,
|
|
725
|
+
_(n, x), v(n, S);
|
|
726
|
+
let [y, M] = x, [N, F] = S, I = m.size.constant ? h : P(m.size, n), L = m.angle.constant ? g : P(m.angle, n);
|
|
677
727
|
if (i.logoLetters) {
|
|
678
|
-
let e =
|
|
679
|
-
if (
|
|
680
|
-
let a = r.font.metrics.getChar(c[0]), s =
|
|
681
|
-
|
|
728
|
+
let e = I, t = I;
|
|
729
|
+
if (k && (e = M - y, y = (y + M) / 2), A && (t = N - F, N = (N + F) / 2), Oe(D, y, N, Math.abs(e), Math.abs(t), "center", "middle", L, i.dx, i.dy), !e || !t || p(u, y, N) || !ke(l, D)) continue;
|
|
730
|
+
let a = r.font.metrics.getChar(c[0]), s = t * r.font.metrics.common.base * (a.height + 10) / (a.height * a.height);
|
|
731
|
+
j++, O.datum = n, O.text = c, O.x = y, O.y = N, O.size = 1, O.width = 1, O.angle = L, O.fadeOpacity = 1, O.scale = 1, E.width = e, E.heightScale = s, O.logoScale = E, O.multiCharacterLogo = c.length > 1, o(O);
|
|
682
732
|
continue;
|
|
683
733
|
}
|
|
684
|
-
let
|
|
685
|
-
|
|
686
|
-
let R = 1;
|
|
687
|
-
if (O && (Ee(Math.min(y, j), Math.max(y, j), C.width, i.paddingX, w.x, i.flushX, s.x, s.x2, T), y = T.position, R *= T.scale), k && (Ee(Math.min(M, N), Math.max(M, N), C.height * R, i.paddingY, w.y, i.flushY, s.y, s.y2, T), M = T.position, R *= T.scale), p(u, y, M)) continue;
|
|
734
|
+
let R = r.font.metrics.measureWidth(c, I);
|
|
735
|
+
Ae(R, I, L, C), k || A ? Me(d, f, L, w) : (w.x = $[d], w.y = Ne[f]);
|
|
688
736
|
let z = 1;
|
|
689
|
-
if (
|
|
690
|
-
|
|
691
|
-
|
|
737
|
+
if (k && (je(Math.min(y, M), Math.max(y, M), C.width, i.paddingX, w.x, i.flushX, s.x, s.x2, T), y = T.position, z *= T.scale), A && (je(Math.min(N, F), Math.max(N, F), C.height * z, i.paddingY, w.y, i.flushY, s.y, s.y2, T), N = T.position, z *= T.scale), p(u, y, N)) continue;
|
|
738
|
+
let B = 1;
|
|
739
|
+
if (z < 1) {
|
|
740
|
+
if (!i.squeeze || z < 3 / I) continue;
|
|
741
|
+
B = t(3 / I, 6 / I, z);
|
|
692
742
|
}
|
|
693
|
-
let
|
|
694
|
-
|
|
743
|
+
let V = I * z, H = R * z;
|
|
744
|
+
Oe(D, y, N, H, V, d, f, L, i.dx, i.dy), ke(l, D) && (j++, O.datum = n, O.text = c, O.x = y, O.y = N, O.size = V, O.width = H, O.angle = L, O.fadeOpacity = B, O.scale = z, O.logoScale = void 0, O.multiCharacterLogo = !1, o(O));
|
|
695
745
|
}
|
|
696
|
-
return
|
|
746
|
+
return j;
|
|
697
747
|
}
|
|
698
|
-
function
|
|
699
|
-
let u = t + c - (
|
|
700
|
-
|
|
701
|
-
let h = s * Math.PI / 180, g = Math.sin(h), _ = Math.cos(h), v = t + (u - t) * _ - (d - n) * g, y = n + (u - t) * g + (d - n) * _, b = t + (f - t) * _ - (d - n) * g, x = n + (f - t) * g + (d - n) * _, S = t + (f - t) * _ - (p - n) * g, C = n + (f - t) * g + (p - n) * _, w = t + (u - t) * _ - (p - n) * g, T = n + (u - t) * g + (p - n) * _;
|
|
702
|
-
return m(e, Math.min(v, b, S, w), Math.min(y, x, C, T), Math.max(v, b, S, w), Math.max(y, x, C, T), 1);
|
|
748
|
+
function Oe(e, t, n, r, i, a, o, s, c, l) {
|
|
749
|
+
let u = t + c - ($[a] + 1) / 2 * r, d = n + l - (Ne[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
|
|
750
|
+
return Q(e, 0, t, n, u, d, h, g), Q(e, 2, t, n, f, d, h, g), Q(e, 4, t, n, f, p, h, g), Q(e, 6, t, n, u, p, h, g), e;
|
|
703
751
|
}
|
|
704
|
-
function
|
|
752
|
+
function ke(e, t) {
|
|
753
|
+
return m(e, Math.min(t[0], t[2], t[4], t[6]), Math.min(t[1], t[3], t[5], t[7]), Math.max(t[0], t[2], t[4], t[6]), Math.max(t[1], t[3], t[5], t[7]), 1);
|
|
754
|
+
}
|
|
755
|
+
function Q(e, t, n, r, i, a, o, s) {
|
|
756
|
+
e[t] = n + (i - n) * s - (a - r) * o, e[t + 1] = r + (i - n) * o + (a - r) * s;
|
|
757
|
+
}
|
|
758
|
+
function Ae(e, t, n, r) {
|
|
705
759
|
let i = n * Math.PI / 180, a = Math.abs(Math.sin(i)), o = Math.abs(Math.cos(i));
|
|
706
760
|
r.width = e * o + t * a, r.height = e * a + t * o;
|
|
707
761
|
}
|
|
708
|
-
function
|
|
762
|
+
function je(e, t, n, r, i, a, o, s, c) {
|
|
709
763
|
let l = t - e, u = n + 2 * r;
|
|
710
764
|
if (e > s || t < o) {
|
|
711
765
|
c.position = 0, c.scale = 0;
|
|
@@ -730,21 +784,21 @@ function Ee(e, t, n, r, i, a, o, s, c) {
|
|
|
730
784
|
}
|
|
731
785
|
c.position = f, c.scale = Math.max(0, Math.min(1, (l - r) / u));
|
|
732
786
|
}
|
|
733
|
-
function
|
|
734
|
-
let i =
|
|
787
|
+
function Me(e, t, n, r) {
|
|
788
|
+
let i = $[e], a = -Ne[t], o = ((n + 45) % 360 + 360) % 360, s, c;
|
|
735
789
|
o < 90 ? (s = i, c = a) : o < 180 ? (s = a, c = -i) : o < 270 ? (s = -i, c = a) : (s = -a, c = i), r.x = s, r.y = -c;
|
|
736
790
|
}
|
|
737
|
-
var
|
|
791
|
+
var $ = {
|
|
738
792
|
left: -1,
|
|
739
793
|
center: 0,
|
|
740
794
|
right: 1
|
|
741
|
-
},
|
|
795
|
+
}, Ne = {
|
|
742
796
|
top: -1,
|
|
743
797
|
middle: 0,
|
|
744
798
|
bottom: 1,
|
|
745
799
|
alphabetic: 1,
|
|
746
800
|
baseline: 1
|
|
747
|
-
},
|
|
801
|
+
}, Pe = {
|
|
748
802
|
thin: 100,
|
|
749
803
|
light: 300,
|
|
750
804
|
regular: 400,
|
|
@@ -753,12 +807,12 @@ var Oe = {
|
|
|
753
807
|
bold: 700,
|
|
754
808
|
black: 900
|
|
755
809
|
};
|
|
756
|
-
function
|
|
757
|
-
return typeof e == "number" ? e :
|
|
810
|
+
function Fe(e) {
|
|
811
|
+
return typeof e == "number" ? e : Pe[e];
|
|
758
812
|
}
|
|
759
813
|
//#endregion
|
|
760
814
|
//#region ../core/src/rendering/nativeText.js
|
|
761
|
-
var
|
|
815
|
+
var Ie = [
|
|
762
816
|
"Lato",
|
|
763
817
|
"Avenir Next",
|
|
764
818
|
"Avenir",
|
|
@@ -769,7 +823,7 @@ var Me = [
|
|
|
769
823
|
"Helvetica",
|
|
770
824
|
"Arial",
|
|
771
825
|
"sans-serif"
|
|
772
|
-
],
|
|
826
|
+
], Le = /* @__PURE__ */ new Set([
|
|
773
827
|
"serif",
|
|
774
828
|
"sans-serif",
|
|
775
829
|
"monospace",
|
|
@@ -784,11 +838,11 @@ var Me = [
|
|
|
784
838
|
"math",
|
|
785
839
|
"fangsong"
|
|
786
840
|
]);
|
|
787
|
-
function
|
|
841
|
+
function Re(e) {
|
|
788
842
|
let t = e ?? "Lato";
|
|
789
|
-
return [t, ...
|
|
843
|
+
return [t, ...Ie.filter((e) => e.toLowerCase() != t.toLowerCase())].map(Be).join(", ");
|
|
790
844
|
}
|
|
791
|
-
function
|
|
845
|
+
function ze(e, t) {
|
|
792
846
|
switch (e) {
|
|
793
847
|
case "top": return .79 * t;
|
|
794
848
|
case "middle": return .35 * t;
|
|
@@ -798,9 +852,9 @@ function Fe(e, t) {
|
|
|
798
852
|
default: throw Error(`Unknown text baseline: ${e}`);
|
|
799
853
|
}
|
|
800
854
|
}
|
|
801
|
-
function
|
|
855
|
+
function Be(e) {
|
|
802
856
|
let t = e.toLowerCase();
|
|
803
|
-
return
|
|
857
|
+
return Le.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
|
|
804
858
|
}
|
|
805
859
|
//#endregion
|
|
806
|
-
export {
|
|
860
|
+
export { z as C, m as D, f as E, o as O, R as S, u as T, V as _, De as a, A as b, ye as c, he as d, ge as f, U as g, B as h, Ee as i, c as k, be as l, me as m, ze as n, we as o, pe as p, Fe as r, Te as s, Re as t, _e as u, H as v, d as w, j as x, P as y };
|