@genome-spy/app 0.86.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-DgopQbMV.js → agentApi-BYFBKiRQ.js} +8170 -7390
- package/dist/agentApi.es.js +3945 -3862
- package/dist/agentShared.es.js +7 -7
- package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-BVQ7-2eJ.js} +141 -140
- package/dist/{canvas2d-8uxuN_vx.js → canvas2d-D7SZK3xv.js} +117 -116
- package/dist/clipOptions-BWHr3aTa.js +2675 -0
- package/dist/{clipOptions-BQfNhxgP.js → clipOptions-DTMcB_9z.js} +1147 -731
- package/dist/{debug-D_VtWQ6l.js → debug-CVpoEOWx.js} +2 -2
- package/dist/{debug-Bzc3SoRg.js → debug-DYAMZZKl.js} +2 -2
- package/dist/index.es.js +3398 -3428
- package/dist/index.js +441 -411
- package/dist/{indexer-qy_dq5l5.js → indexer-CXjZDo2Q.js} +1 -1
- package/dist/{indexer-qiFctgR3.js → indexer-DAH_ruVn.js} +1 -1
- package/dist/{nativeText-vT3AWE14.js → order-C5CzA37O.js} +144 -86
- package/dist/{nativeText-DFV5XIx8.js → order-DvY7KNcu.js} +133 -75
- package/dist/{rasterExport-B8pVoOsj.js → rasterExport-BgZ98e6U.js} +1 -1
- package/dist/{rasterExport-C4r4xjQT.js → rasterExport-DEr8fOLm.js} +1 -1
- package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-DtcJjqpB.js} +109 -96
- package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-DxturTEW.js} +108 -95
- package/dist/schema.json +10839 -2862
- package/dist/{svg-C-Sw6E6G.js → svg-CyrLfa9e.js} +389 -428
- package/dist/{svg-CKHwwKRt.js → svg-SDJMzL--.js} +389 -428
- package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-f7DJ3UO0.js} +1 -1
- package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-mWK7HTkx.js} +1 -1
- package/dist/{vega-scale-D46-iCaL.js → vega-scale-CypF85iS.js} +894 -1191
- package/dist/{vega-scale-CK0_al6O.js → vega-scale-DLKCwWRs.js} +893 -1190
- package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-DIDo44XQ.js} +1 -1
- package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-Dl-vMN9I.js} +1 -1
- package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-CymbZyE6.js} +692 -459
- package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DNiDip5e.js} +667 -434
- package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-BrJLIj2o.js} +3032 -2332
- package/dist/{webgl-BaA3jSa2.js → webgl-CqTDifWM.js} +1087 -1056
- package/dist/{webgl-FP-4EsBL.js → webgl-jaC2m0Zr.js} +1113 -1082
- package/package.json +5 -5
- package/src/embedTypes.d.ts +1 -1
- package/dist/clipOptions-taFzEljc.js +0 -2259
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ot as e, Vt as t, fn as n, lt as r } from "./clipOptions-DTMcB_9z.js";
|
|
2
2
|
import { t as i } from "./rectangle-DKnrAmKs.js";
|
|
3
3
|
//#region ../core/src/rendering/immediate/markData.js
|
|
4
4
|
var a = [], o = class {
|
|
@@ -404,35 +404,83 @@ function q(e, t, n) {
|
|
|
404
404
|
return Math.min(Math.max(e, t), n);
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
|
+
//#region ../core/src/rendering/immediate/linkFading.js
|
|
408
|
+
var se = 4;
|
|
409
|
+
function ce(e, t, n) {
|
|
410
|
+
let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
|
|
411
|
+
if (a == 0) return;
|
|
412
|
+
let o = -i / a, s = r / a;
|
|
413
|
+
(o < 0 || o == 0 && s < 0) && (o = -o, s = -s);
|
|
414
|
+
let c = o * e[0] + s * e[1], [l, u] = n, d = JSON.stringify([
|
|
415
|
+
J(o, 6),
|
|
416
|
+
J(s, 6),
|
|
417
|
+
J(c, 1),
|
|
418
|
+
J(l, 1),
|
|
419
|
+
J(u, 1)
|
|
420
|
+
]);
|
|
421
|
+
return {
|
|
422
|
+
normalX: o,
|
|
423
|
+
normalY: s,
|
|
424
|
+
offset: c,
|
|
425
|
+
start: l,
|
|
426
|
+
end: u,
|
|
427
|
+
key: d
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
function le(e, t, n = !1) {
|
|
431
|
+
let r = R(e, e.properties.arcFadingDistance);
|
|
432
|
+
return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n && R(e, e.properties.noFadingOnSecondPass) ? !1 : r;
|
|
433
|
+
}
|
|
434
|
+
function ue(e, t) {
|
|
435
|
+
let n = [], r = (r) => {
|
|
436
|
+
for (let i = 0; i <= se; i++) {
|
|
437
|
+
let a = i / se, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
|
|
438
|
+
n.push({
|
|
439
|
+
offset: s,
|
|
440
|
+
opacity: 1 - de(c)
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
return r(!0), r(!1), n;
|
|
445
|
+
}
|
|
446
|
+
function de(e) {
|
|
447
|
+
let t = Math.max(0, Math.min(1, e));
|
|
448
|
+
return t * t * (3 - 2 * t);
|
|
449
|
+
}
|
|
450
|
+
function J(e, t) {
|
|
451
|
+
let n = 10 ** t;
|
|
452
|
+
return Math.round(e * n) / n;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
407
455
|
//#region ../core/src/rendering/immediate/geometry/linkGeometry.js
|
|
408
|
-
function
|
|
456
|
+
function fe(e, t, n, r) {
|
|
409
457
|
if (r.shape == "arc") {
|
|
410
|
-
let i = [...e], a = [...t], o =
|
|
458
|
+
let i = [...e], a = [...t], o = X(a, i), s = ge(o);
|
|
411
459
|
if (s == 0) return [
|
|
412
460
|
i,
|
|
413
461
|
i,
|
|
414
462
|
a,
|
|
415
463
|
a
|
|
416
464
|
];
|
|
417
|
-
let c =
|
|
418
|
-
s =
|
|
419
|
-
let u =
|
|
465
|
+
let c = Z(o, 1 / s), l = [-c[1], c[0]];
|
|
466
|
+
s = pe(i, a, s, r.maxChordLength, n);
|
|
467
|
+
let u = Z(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
|
|
420
468
|
return [
|
|
421
469
|
i,
|
|
422
|
-
|
|
423
|
-
|
|
470
|
+
Y(i, u),
|
|
471
|
+
Y(a, u),
|
|
424
472
|
a
|
|
425
473
|
];
|
|
426
474
|
} else if (r.shape == "dome") {
|
|
427
475
|
let i, a, o;
|
|
428
476
|
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]);
|
|
429
|
-
let s =
|
|
430
|
-
|
|
431
|
-
let c =
|
|
477
|
+
let s = ge(X(a, i));
|
|
478
|
+
pe(i, a, s, r.maxChordLength, n), r.clampApex && me(i, a, r.orient, n);
|
|
479
|
+
let c = Z(o, 1 / .75);
|
|
432
480
|
return [
|
|
433
481
|
i,
|
|
434
|
-
|
|
435
|
-
|
|
482
|
+
Y(i, c),
|
|
483
|
+
Y(a, c),
|
|
436
484
|
a
|
|
437
485
|
];
|
|
438
486
|
} else if (r.shape == "diagonal") if (r.orient == "vertical") {
|
|
@@ -453,7 +501,7 @@ function se(e, t, n, r) {
|
|
|
453
501
|
];
|
|
454
502
|
}
|
|
455
503
|
else if (r.shape == "line") {
|
|
456
|
-
let n =
|
|
504
|
+
let n = Z(Y(e, t), .5);
|
|
457
505
|
return [
|
|
458
506
|
e,
|
|
459
507
|
n,
|
|
@@ -462,35 +510,35 @@ function se(e, t, n, r) {
|
|
|
462
510
|
];
|
|
463
511
|
} else throw Error(`Unsupported link shape: ${r.shape}`);
|
|
464
512
|
}
|
|
465
|
-
function
|
|
513
|
+
function pe(e, t, n, r, i) {
|
|
466
514
|
if (n <= r) return n;
|
|
467
|
-
let a = X(
|
|
468
|
-
return
|
|
515
|
+
let a = Z(X(t, e), 1 / n);
|
|
516
|
+
return he(e, i, 2) ? (_e(t, Y(e, Z(a, r))), r) : he(t, i, 2) ? (_e(e, X(t, Z(a, r))), r) : n;
|
|
469
517
|
}
|
|
470
|
-
function
|
|
518
|
+
function me(e, t, n, r) {
|
|
471
519
|
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])));
|
|
472
520
|
}
|
|
473
|
-
function
|
|
521
|
+
function he(e, t, n) {
|
|
474
522
|
return e[0] >= -t.width * n && e[0] <= t.width * (1 + n) && e[1] >= -t.height * n && e[1] <= t.height * (1 + n);
|
|
475
523
|
}
|
|
476
|
-
function
|
|
524
|
+
function Y(e, t) {
|
|
477
525
|
return [e[0] + t[0], e[1] + t[1]];
|
|
478
526
|
}
|
|
479
|
-
function
|
|
527
|
+
function X(e, t) {
|
|
480
528
|
return [e[0] - t[0], e[1] - t[1]];
|
|
481
529
|
}
|
|
482
|
-
function
|
|
530
|
+
function Z(e, t) {
|
|
483
531
|
return [e[0] * t, e[1] * t];
|
|
484
532
|
}
|
|
485
|
-
function
|
|
533
|
+
function ge(e) {
|
|
486
534
|
return Math.hypot(e[0], e[1]);
|
|
487
535
|
}
|
|
488
|
-
function
|
|
536
|
+
function _e(e, t) {
|
|
489
537
|
e[0] = t[0], e[1] = t[1];
|
|
490
538
|
}
|
|
491
539
|
//#endregion
|
|
492
540
|
//#region ../core/src/rendering/immediate/marks/link.js
|
|
493
|
-
function
|
|
541
|
+
function ve(e) {
|
|
494
542
|
let t = e.properties;
|
|
495
543
|
return {
|
|
496
544
|
shape: R(e, t.linkShape),
|
|
@@ -501,7 +549,7 @@ function pe(e) {
|
|
|
501
549
|
clampApex: R(e, t.clampApex)
|
|
502
550
|
};
|
|
503
551
|
}
|
|
504
|
-
function
|
|
552
|
+
function ye(e, t, n, r) {
|
|
505
553
|
let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
|
|
506
554
|
if (a.length == 0) return 0;
|
|
507
555
|
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 = {
|
|
@@ -510,7 +558,7 @@ function me(e, t, n, r) {
|
|
|
510
558
|
}, g = p + h.height, _ = 0;
|
|
511
559
|
for (let e of a) {
|
|
512
560
|
c(e, u), l(e, d);
|
|
513
|
-
let [n, i] = u, [a, p] = d, v =
|
|
561
|
+
let [n, i] = u, [a, p] = d, v = fe([n - f, g - a], [i - f, g - p], h, t);
|
|
514
562
|
for (let e of v) e[0] += f, e[1] = g - e[1];
|
|
515
563
|
let [y, b, x, S] = v, C = P(s.size, e);
|
|
516
564
|
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({
|
|
@@ -523,10 +571,10 @@ function me(e, t, n, r) {
|
|
|
523
571
|
}
|
|
524
572
|
//#endregion
|
|
525
573
|
//#region ../core/src/rendering/immediate/marks/point.js
|
|
526
|
-
function
|
|
574
|
+
function be(e) {
|
|
527
575
|
return { inwardStroke: R(e, e.properties.inwardStroke) };
|
|
528
576
|
}
|
|
529
|
-
function
|
|
577
|
+
function xe(e, t, n, r) {
|
|
530
578
|
let { coords: i, data: a, visibleBounds: o, anchorCullBounds: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
|
|
531
579
|
if (c === l) return 0;
|
|
532
580
|
let d = M(i, u, "x", a[c]), f = M(i, u, "y", a[c]), h = [0, 0], g = [0, 0], _ = e.getSemanticThreshold(), v = {
|
|
@@ -555,7 +603,7 @@ function ge(e, t, n, r) {
|
|
|
555
603
|
}
|
|
556
604
|
//#endregion
|
|
557
605
|
//#region ../core/src/rendering/immediate/geometry/pointPath.js
|
|
558
|
-
function
|
|
606
|
+
function Se(e, t, n, r, i) {
|
|
559
607
|
let a = r * .4, o = r * .15, s = Math.sqrt(3) * r / 2;
|
|
560
608
|
switch (e) {
|
|
561
609
|
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;
|
|
@@ -564,22 +612,22 @@ function _e(e, t, n, r, i) {
|
|
|
564
612
|
case "triangle-right": return i.moveTo(t + s, n), i.lineTo(t - s, n + r), i.lineTo(t - s, n - r), i.closePath(), !0;
|
|
565
613
|
case "triangle-down": return i.moveTo(t, n + s), i.lineTo(t - r, n - s), i.lineTo(t + r, n - s), i.closePath(), !0;
|
|
566
614
|
case "triangle-left": return i.moveTo(t - s, n), i.lineTo(t + s, n - r), i.lineTo(t + s, n + r), i.closePath(), !0;
|
|
567
|
-
case "tick-up": return
|
|
568
|
-
case "tick-right": return
|
|
569
|
-
case "tick-down": return
|
|
570
|
-
case "tick-left": return
|
|
615
|
+
case "tick-up": return Q(i, t - o, n - r, t + o, n), !0;
|
|
616
|
+
case "tick-right": return Q(i, t, n - o, t + r, n + o), !0;
|
|
617
|
+
case "tick-down": return Q(i, t - o, n, t + o, n + r), !0;
|
|
618
|
+
case "tick-left": return Q(i, t - r, n - o, t, n + o), !0;
|
|
571
619
|
case "+": return i.moveTo(t - r, n), i.lineTo(t + r, n), i.moveTo(t, n - r), i.lineTo(t, n + r), !0;
|
|
572
620
|
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;
|
|
573
621
|
default: return !1;
|
|
574
622
|
}
|
|
575
623
|
}
|
|
576
|
-
function
|
|
624
|
+
function Q(e, t, n, r, i) {
|
|
577
625
|
e.moveTo(t, n), e.lineTo(r, n), e.lineTo(r, i), e.lineTo(t, i), e.closePath();
|
|
578
626
|
}
|
|
579
627
|
//#endregion
|
|
580
628
|
//#region ../core/src/rendering/immediate/marks/rect.js
|
|
581
|
-
var
|
|
582
|
-
function
|
|
629
|
+
var Ce = .1;
|
|
630
|
+
function we(e) {
|
|
583
631
|
let t = e.properties, n = R(e, t.cornerRadius), r = {
|
|
584
632
|
topLeft: R(e, t.cornerRadiusTopLeft ?? n),
|
|
585
633
|
topRight: R(e, t.cornerRadiusTopRight ?? n),
|
|
@@ -591,7 +639,7 @@ function ye(e) {
|
|
|
591
639
|
offsetX: R(e, t.shadowOffsetX ?? 0),
|
|
592
640
|
offsetY: R(e, t.shadowOffsetY ?? 0),
|
|
593
641
|
opacity: R(e, t.shadowOpacity ?? 0)
|
|
594
|
-
}, a = R(e, t.hatch ?? "none"), o = !
|
|
642
|
+
}, a = R(e, t.hatch ?? "none"), o = !Oe(r);
|
|
595
643
|
return {
|
|
596
644
|
cornerRadii: r,
|
|
597
645
|
minWidth: R(e, t.minWidth),
|
|
@@ -603,7 +651,7 @@ function ye(e) {
|
|
|
603
651
|
canPadSeams: a == "none" && i.opacity == 0 && !o
|
|
604
652
|
};
|
|
605
653
|
}
|
|
606
|
-
function
|
|
654
|
+
function Te(e, t, n, r) {
|
|
607
655
|
let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
|
|
608
656
|
if (c === l) return 0;
|
|
609
657
|
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 = {
|
|
@@ -626,29 +674,29 @@ function be(e, t, n, r) {
|
|
|
626
674
|
for (let e = c; e < l; e++) {
|
|
627
675
|
let n = a[e];
|
|
628
676
|
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 =
|
|
677
|
+
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 = Ee(l, t.minWidth), D = Ee(T, t.minHeight), O = Math.max(t.minOpacity, E * D);
|
|
630
678
|
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" ?
|
|
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 &&
|
|
679
|
+
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" ? Ce : 0;
|
|
680
|
+
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 && De(t.cornerRadii, l, T, C.radii), r(C));
|
|
633
681
|
}
|
|
634
682
|
return w;
|
|
635
683
|
}
|
|
636
|
-
function
|
|
684
|
+
function Ee(e, t) {
|
|
637
685
|
return t > 0 && e < t ? e / t : 1;
|
|
638
686
|
}
|
|
639
|
-
function
|
|
687
|
+
function De(e, t, n, r) {
|
|
640
688
|
let i = Math.min(t, n) / 2;
|
|
641
689
|
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));
|
|
642
690
|
}
|
|
643
|
-
function
|
|
691
|
+
function Oe(e) {
|
|
644
692
|
return e.topLeft == 0 && e.topRight == 0 && e.bottomRight == 0 && e.bottomLeft == 0;
|
|
645
693
|
}
|
|
646
694
|
//#endregion
|
|
647
695
|
//#region ../core/src/rendering/immediate/marks/rule.js
|
|
648
|
-
function
|
|
696
|
+
function ke(e) {
|
|
649
697
|
return { minLength: R(e, e.properties.minLength) };
|
|
650
698
|
}
|
|
651
|
-
function
|
|
699
|
+
function Ae(e, t, n, r) {
|
|
652
700
|
let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
|
|
653
701
|
if (a.length == 0) return 0;
|
|
654
702
|
let c = M(i, s, "x", a[0]), l = M(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = {
|
|
@@ -673,7 +721,7 @@ function Te(e, t, n, r) {
|
|
|
673
721
|
}
|
|
674
722
|
//#endregion
|
|
675
723
|
//#region ../core/src/rendering/immediate/marks/text.js
|
|
676
|
-
function
|
|
724
|
+
function je(e) {
|
|
677
725
|
let t = e.properties;
|
|
678
726
|
return {
|
|
679
727
|
align: R(e, t.align),
|
|
@@ -688,7 +736,7 @@ function Ee(e) {
|
|
|
688
736
|
dy: R(e, t.dy)
|
|
689
737
|
};
|
|
690
738
|
}
|
|
691
|
-
function
|
|
739
|
+
function Me(e, i, a, o) {
|
|
692
740
|
let { coords: s, data: c, visibleBounds: l, anchorCullBounds: u } = a, { align: d, baseline: f } = i, m = e.encoders;
|
|
693
741
|
if (c.length == 0) return 0;
|
|
694
742
|
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 = e.encoding.text, b = "format" in y ? t(y.format) : (e) => e, x = [0, 0], S = [0, 0], C = {
|
|
@@ -726,40 +774,40 @@ function De(e, i, a, o) {
|
|
|
726
774
|
let [y, M] = x, [N, F] = S, I = m.size.constant ? h : P(m.size, t), L = m.angle.constant ? g : P(m.angle, t);
|
|
727
775
|
if (i.logoLetters) {
|
|
728
776
|
let n = I, r = I;
|
|
729
|
-
if (k && (n = M - y, y = (y + M) / 2), A && (r = N - F, N = (N + F) / 2),
|
|
777
|
+
if (k && (n = M - y, y = (y + M) / 2), A && (r = N - F, N = (N + F) / 2), Ne(D, y, N, Math.abs(n), Math.abs(r), "center", "middle", L, i.dx, i.dy), !n || !r || p(u, y, N) || !Pe(l, D)) continue;
|
|
730
778
|
let a = e.font.metrics.getChar(c[0]), s = r * e.font.metrics.common.base * (a.height + 10) / (a.height * a.height);
|
|
731
779
|
j++, O.datum = t, 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 = n, E.heightScale = s, O.logoScale = E, O.multiCharacterLogo = c.length > 1, o(O);
|
|
732
780
|
continue;
|
|
733
781
|
}
|
|
734
782
|
let R = e.font.metrics.measureWidth(c, I);
|
|
735
|
-
|
|
783
|
+
Fe(R, I, L, C), k || A ? Le(d, f, L, w) : (w.x = Re[d], w.y = ze[f]);
|
|
736
784
|
let z = 1;
|
|
737
|
-
if (k && (
|
|
785
|
+
if (k && (Ie(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 && (Ie(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
786
|
let B = 1;
|
|
739
787
|
if (z < 1) {
|
|
740
788
|
if (!i.squeeze || z < 3 / I) continue;
|
|
741
789
|
B = r(3 / I, 6 / I, z);
|
|
742
790
|
}
|
|
743
791
|
let V = I * z, H = R * z;
|
|
744
|
-
|
|
792
|
+
Ne(D, y, N, H, V, d, f, L, i.dx, i.dy), Pe(l, D) && (j++, O.datum = t, 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));
|
|
745
793
|
}
|
|
746
794
|
return j;
|
|
747
795
|
}
|
|
748
|
-
function
|
|
749
|
-
let u = t + c - (
|
|
750
|
-
return
|
|
796
|
+
function Ne(e, t, n, r, i, a, o, s, c, l) {
|
|
797
|
+
let u = t + c - (Re[a] + 1) / 2 * r, d = n + l - (ze[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
|
|
798
|
+
return $(e, 0, t, n, u, d, h, g), $(e, 2, t, n, f, d, h, g), $(e, 4, t, n, f, p, h, g), $(e, 6, t, n, u, p, h, g), e;
|
|
751
799
|
}
|
|
752
|
-
function
|
|
800
|
+
function Pe(e, t) {
|
|
753
801
|
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
802
|
}
|
|
755
|
-
function
|
|
803
|
+
function $(e, t, n, r, i, a, o, s) {
|
|
756
804
|
e[t] = n + (i - n) * s - (a - r) * o, e[t + 1] = r + (i - n) * o + (a - r) * s;
|
|
757
805
|
}
|
|
758
|
-
function
|
|
806
|
+
function Fe(e, t, n, r) {
|
|
759
807
|
let i = n * Math.PI / 180, a = Math.abs(Math.sin(i)), o = Math.abs(Math.cos(i));
|
|
760
808
|
r.width = e * o + t * a, r.height = e * a + t * o;
|
|
761
809
|
}
|
|
762
|
-
function
|
|
810
|
+
function Ie(e, t, n, r, i, a, o, s, c) {
|
|
763
811
|
let l = t - e, u = n + 2 * r;
|
|
764
812
|
if (e > s || t < o) {
|
|
765
813
|
c.position = 0, c.scale = 0;
|
|
@@ -784,21 +832,21 @@ function je(e, t, n, r, i, a, o, s, c) {
|
|
|
784
832
|
}
|
|
785
833
|
c.position = f, c.scale = Math.max(0, Math.min(1, (l - r) / u));
|
|
786
834
|
}
|
|
787
|
-
function
|
|
788
|
-
let i =
|
|
835
|
+
function Le(e, t, n, r) {
|
|
836
|
+
let i = Re[e], a = -ze[t], o = ((n + 45) % 360 + 360) % 360, s, c;
|
|
789
837
|
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;
|
|
790
838
|
}
|
|
791
|
-
var
|
|
839
|
+
var Re = {
|
|
792
840
|
left: -1,
|
|
793
841
|
center: 0,
|
|
794
842
|
right: 1
|
|
795
|
-
},
|
|
843
|
+
}, ze = {
|
|
796
844
|
top: -1,
|
|
797
845
|
middle: 0,
|
|
798
846
|
bottom: 1,
|
|
799
847
|
alphabetic: 1,
|
|
800
848
|
baseline: 1
|
|
801
|
-
},
|
|
849
|
+
}, Be = {
|
|
802
850
|
thin: 100,
|
|
803
851
|
light: 300,
|
|
804
852
|
regular: 400,
|
|
@@ -807,12 +855,12 @@ var $ = {
|
|
|
807
855
|
bold: 700,
|
|
808
856
|
black: 900
|
|
809
857
|
};
|
|
810
|
-
function
|
|
811
|
-
return typeof e == "number" ? e :
|
|
858
|
+
function Ve(e) {
|
|
859
|
+
return typeof e == "number" ? e : Be[e];
|
|
812
860
|
}
|
|
813
861
|
//#endregion
|
|
814
862
|
//#region ../core/src/rendering/nativeText.js
|
|
815
|
-
var
|
|
863
|
+
var He = [
|
|
816
864
|
"Lato",
|
|
817
865
|
"Avenir Next",
|
|
818
866
|
"Avenir",
|
|
@@ -823,7 +871,7 @@ var Ie = [
|
|
|
823
871
|
"Helvetica",
|
|
824
872
|
"Arial",
|
|
825
873
|
"sans-serif"
|
|
826
|
-
],
|
|
874
|
+
], Ue = /* @__PURE__ */ new Set([
|
|
827
875
|
"serif",
|
|
828
876
|
"sans-serif",
|
|
829
877
|
"monospace",
|
|
@@ -838,11 +886,11 @@ var Ie = [
|
|
|
838
886
|
"math",
|
|
839
887
|
"fangsong"
|
|
840
888
|
]);
|
|
841
|
-
function
|
|
889
|
+
function We(e) {
|
|
842
890
|
let t = e ?? "Lato";
|
|
843
|
-
return [t, ...
|
|
891
|
+
return [t, ...He.filter((e) => e.toLowerCase() != t.toLowerCase())].map(Ke).join(", ");
|
|
844
892
|
}
|
|
845
|
-
function
|
|
893
|
+
function Ge(e, t) {
|
|
846
894
|
switch (e) {
|
|
847
895
|
case "top": return .79 * t;
|
|
848
896
|
case "middle": return .35 * t;
|
|
@@ -852,9 +900,19 @@ function ze(e, t) {
|
|
|
852
900
|
default: throw Error(`Unknown text baseline: ${e}`);
|
|
853
901
|
}
|
|
854
902
|
}
|
|
855
|
-
function
|
|
903
|
+
function Ke(e) {
|
|
856
904
|
let t = e.toLowerCase();
|
|
857
|
-
return
|
|
905
|
+
return Ue.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
|
|
906
|
+
}
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region ../core/src/rendering/immediate/order.js
|
|
909
|
+
function qe(e, t, n, r, i) {
|
|
910
|
+
let a = [], o = [];
|
|
911
|
+
for (let i = t; i < n; i++) {
|
|
912
|
+
let t = e[i];
|
|
913
|
+
(r(t) ? a : o).push(t);
|
|
914
|
+
}
|
|
915
|
+
return i.map((e) => e === "matching" ? a : o);
|
|
858
916
|
}
|
|
859
917
|
//#endregion
|
|
860
|
-
export {
|
|
918
|
+
export { f as A, P as C, z as D, R as E, o as M, c as N, d as O, H as S, j as T, ce as _, je as a, U as b, Ae as c, Se as d, be as f, ue as g, ye as h, Ve as i, m as j, u as k, we as l, ve as m, We as n, Me as o, xe as p, Ge as r, ke as s, qe as t, Te as u, le as v, A as w, V as x, B as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rasterization-CFogVB3B.js";
|
|
2
2
|
import { t } from "./rectangle-DKnrAmKs.js";
|
|
3
3
|
import { t as n } from "./layoutResult-D50MSHXR.js";
|
|
4
|
-
import { t as r } from "./renderCanvas2D-
|
|
4
|
+
import { t as r } from "./renderCanvas2D-DtcJjqpB.js";
|
|
5
5
|
//#region ../core/src/rendering/canvas2d/rasterExport.js
|
|
6
6
|
async function i(e) {
|
|
7
7
|
let t = e.mimeType ?? "image/png";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rasterization-CFogVB3B.js";
|
|
2
2
|
import { t } from "./rectangle-DKnrAmKs.js";
|
|
3
3
|
import { t as n } from "./layoutResult-D50MSHXR.js";
|
|
4
|
-
import { t as r } from "./renderCanvas2D-
|
|
4
|
+
import { t as r } from "./renderCanvas2D-DxturTEW.js";
|
|
5
5
|
//#region ../core/src/rendering/canvas2d/rasterExport.js
|
|
6
6
|
async function i(e) {
|
|
7
7
|
let t = e.mimeType ?? "image/png";
|