@genome-spy/app 1.1.1 → 1.2.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-sPuuT0KS.js → agentApi-8hMSlqAQ.js} +8307 -6861
- package/dist/agentApi.es.js +5569 -4250
- package/dist/agentShared.es.js +9 -9
- package/dist/{canvas2d-iDK4BC5j.js → canvas2d-Bd8H8MMo.js} +149 -134
- package/dist/{canvas2d-MXaFeZnP.js → canvas2d-D6VYooRf.js} +136 -122
- package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
- package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
- package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CRJSc4bM.js} +24 -31
- package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-aEVmYmkA.js} +24 -31
- package/dist/{debug-DbigmdrK.js → debug-CQ0agCrd.js} +9 -9
- package/dist/{debug-BlqDxTw3.js → debug-DkIMiGdW.js} +10 -10
- package/dist/index.es.js +3582 -3566
- package/dist/index.js +698 -454
- package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
- package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
- package/dist/markUtils-CvLDz744.js +75 -0
- package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
- package/dist/{order-B4uR9Q04.js → order-BVvkjDRT.js} +369 -316
- package/dist/{order-BSPy5DI8.js → order-DmMoZsi1.js} +360 -308
- package/dist/{rasterExport-DQH3hVg_.js → rasterExport-DxvowWjH.js} +3 -3
- package/dist/{rasterExport-B62RmAK1.js → rasterExport-jeRVq6kY.js} +4 -4
- package/dist/{rasterization-B05bDo5e.js → rasterization-DFj3Cvx4.js} +26 -19
- package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
- package/dist/rectangle-Dl4Dy0hS.js +191 -0
- package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Bfm1NHFu.js} +96 -91
- package/dist/{renderCanvas2D-ChdoHGrU.js → renderCanvas2D-DVjhp834.js} +98 -93
- package/dist/{scalePosition-ByvlXaML.js → scalePosition-0aeqp_kz.js} +8 -1
- package/dist/schema.json +27198 -13709
- package/dist/style.css +1 -1
- package/dist/{svg-N3tj05-e.js → svg-Bm2zxBPu.js} +315 -316
- package/dist/{svg-DHsq1RpV.js → svg-CkfuhONt.js} +290 -291
- package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-DoRQEqFA.js} +2 -2
- package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-raDDhBF-.js} +3 -3
- package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
- package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
- package/dist/viewError-BkJeVYXA.js +33 -0
- package/dist/viewError-IYqyluc7.js +33 -0
- package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-7LyasQN-.js} +498 -434
- package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-CbmkSQRT.js} +549 -485
- package/dist/{viewUtils-JX6CMEYH.js → viewUtils-DuddMNNw.js} +2138 -2009
- package/dist/{webgl-Dw8xqZpX.js → webgl-CQfvgnxo.js} +1229 -1140
- package/dist/{webgl-DdmOwEH0.js → webgl-DVYkXtiZ.js} +1477 -1389
- package/package.json +4 -4
- package/src/spec/view.d.ts +44 -5
- package/dist/viewError-BiR9VCgL.js +0 -29
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pt as e, a as t, in as n, o as r, s as i } from "./clipOptions-DElJ8dTZ.js";
|
|
2
2
|
import { t as a } from "./warning-CpIIpk8e.js";
|
|
3
|
-
import { n as o } from "./
|
|
4
|
-
import { n as s } from "./
|
|
5
|
-
import { A as c,
|
|
3
|
+
import { n as o } from "./performanceProfiler-CPLEjApa.js";
|
|
4
|
+
import { n as s } from "./layoutResult-D50MSHXR.js";
|
|
5
|
+
import { A as c, C as l, D as u, I as d, L as f, M as p, N as m, O as h, P as g, S as _, T as v, _ as y, a as b, b as ee, c as x, d as S, g as C, h as w, i as T, j as E, l as D, m as O, p as k, s as A, t as j, u as M, v as N, x as P, y as F } from "./order-DmMoZsi1.js";
|
|
6
6
|
//#region ../core/src/rendering/canvas2d/renderers/arrow.js
|
|
7
|
-
function
|
|
8
|
-
let n = e, r = t.context, i = n.encoders, a =
|
|
7
|
+
function I(e, t) {
|
|
8
|
+
let n = e, r = t.context, i = n.encoders, a = l(n);
|
|
9
9
|
r.lineJoin = "miter";
|
|
10
|
-
let o, s;
|
|
11
|
-
return
|
|
10
|
+
let o = h(i.fill, t), s = h(i.stroke, t), c, d;
|
|
11
|
+
return v(n, a, t, (e) => {
|
|
12
12
|
e.headShapeFallback && t.warn(`Canvas2D rendered unsupported arrow headShape "${a.headShape}" as a triangle.`), r.beginPath();
|
|
13
13
|
for (let t of e.boundaryLoops) {
|
|
14
14
|
let e = t[0];
|
|
@@ -16,78 +16,83 @@ function F(e, t) {
|
|
|
16
16
|
for (let e = 1; e < t.length; e++) r.lineTo(t[e].x, t[e].y);
|
|
17
17
|
r.closePath();
|
|
18
18
|
}
|
|
19
|
-
let n =
|
|
20
|
-
n != "none" &&
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
});
|
|
19
|
+
let n = o ?? E(i.fill(e.datum)), l = u(i.fillOpacity, e.datum) * t.viewOpacity;
|
|
20
|
+
n != "none" && l > 0 && (c != n && (r.fillStyle = n, c = n), r.globalAlpha = l, r.fill());
|
|
21
|
+
let f = s ?? E(i.stroke(e.datum)), p = u(i.strokeOpacity, e.datum) * t.viewOpacity;
|
|
22
|
+
f != "none" && p > 0 && e.strokeWidth > 0 && (d != f && (r.strokeStyle = f, d = f), r.globalAlpha = p, r.lineWidth = e.strokeWidth, r.stroke());
|
|
23
|
+
}, s);
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region ../core/src/rendering/canvas2d/renderers/link.js
|
|
27
|
-
function
|
|
28
|
-
let r = t, i = n.context, a = 1 / n.devicePixelRatio, o = r.encoders, s =
|
|
29
|
-
i.lineCap = "butt";
|
|
30
|
-
let d;
|
|
31
|
-
return
|
|
32
|
-
let r =
|
|
27
|
+
function L(t, n) {
|
|
28
|
+
let r = t, i = n.context, a = 1 / n.devicePixelRatio, o = r.encoders, s = N(r), c = _(r, s.shape, n.secondOrderPass);
|
|
29
|
+
i.lineCap = "butt", i.lineJoin = "miter", i.miterLimit = 2;
|
|
30
|
+
let l = h(o.color, n), d;
|
|
31
|
+
return F(r, s, n, (t) => {
|
|
32
|
+
let r = l ?? E(o.color(t.datum)), s = u(o.opacity, t.datum) * n.viewOpacity;
|
|
33
33
|
if (r == "none" || s <= 0 || t.strokeWidth <= 0) return;
|
|
34
|
-
let f =
|
|
34
|
+
let f = c && t.geometry.type == "cubic" && P(t.geometry.points[0], t.geometry.points[3], c);
|
|
35
35
|
if (f) {
|
|
36
36
|
let { normalX: t, normalY: n, offset: a, start: o, end: s } = f, c = i.createLinearGradient(t * (a - s), n * (a - s), t * (a + s), n * (a + s)), l = e(r), u = l.opacity;
|
|
37
|
-
for (let e of
|
|
37
|
+
for (let e of ee(o, s)) l.opacity = u * e.opacity, c.addColorStop(e.offset, l.formatRgb());
|
|
38
38
|
i.strokeStyle = c, d = void 0;
|
|
39
39
|
} else d != r && (i.strokeStyle = r, d = r);
|
|
40
40
|
i.globalAlpha = s * Math.min(t.strokeWidth / a, 1), i.lineWidth = Math.max(t.strokeWidth, a);
|
|
41
|
-
let
|
|
42
|
-
i.beginPath(), i.moveTo(
|
|
41
|
+
let { geometry: p } = t, m = p.points[0];
|
|
42
|
+
if (i.beginPath(), i.moveTo(m[0], m[1]), p.type == "orthogonal") for (let e of p.points.slice(1)) i.lineTo(e[0], e[1]);
|
|
43
|
+
else {
|
|
44
|
+
let [, e, t, n] = p.points;
|
|
45
|
+
i.bezierCurveTo(e[0], e[1], t[0], t[1], n[0], n[1]);
|
|
46
|
+
}
|
|
47
|
+
i.stroke();
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
50
|
//#endregion
|
|
46
51
|
//#region ../core/src/rendering/canvas2d/renderers/point.js
|
|
47
|
-
function
|
|
52
|
+
function R(e, t) {
|
|
48
53
|
let n = e;
|
|
49
|
-
|
|
50
|
-
let r =
|
|
51
|
-
return
|
|
52
|
-
let n = e.datum, r = e.lineShape,
|
|
53
|
-
r && (
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
if (e.shape == "circle") i.arc(
|
|
54
|
+
c(n, n.properties.fillGradientStrength) && t.warn("Canvas2D ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("Canvas2D ignored unsupported point property geometricZoomBound.");
|
|
55
|
+
let r = C(n), i = t.context, a = n.encoders, o = h(a.fill, t), s = h(a.stroke, t), l, d;
|
|
56
|
+
return y(n, r, t, (e) => {
|
|
57
|
+
let n = e.datum, r = e.lineShape, c = o ?? E(a.fill(n)), f = u(a.fillOpacity, n) * t.viewOpacity, p = s ?? E(a.stroke(n)), m = u(a.strokeOpacity, n) * t.viewOpacity;
|
|
58
|
+
r && (p == "none" || m <= 0) && (p = c, m = f), i.beginPath();
|
|
59
|
+
let h = e.angle != 0 && e.shape != "circle";
|
|
60
|
+
h && (i.save(), i.translate(e.x, e.y), i.rotate(e.angle * Math.PI / 180));
|
|
61
|
+
let g = h ? 0 : e.x, _ = h ? 0 : e.y, v = !0;
|
|
62
|
+
if (e.shape == "circle") i.arc(g, _, e.geometryRadius, 0, Math.PI * 2);
|
|
58
63
|
else if (e.shape == "square") {
|
|
59
64
|
let t = e.geometryRadius * 2;
|
|
60
|
-
i.rect(
|
|
61
|
-
} else
|
|
62
|
-
|
|
65
|
+
i.rect(g - e.geometryRadius, _ - e.geometryRadius, t, t);
|
|
66
|
+
} else v = w(e.shape, g, _, e.geometryRadius, i);
|
|
67
|
+
h && i.restore(), v || (t.warn(`Canvas2D rendered unsupported point shape "${e.shape}" as a circle.`), i.arc(e.x, e.y, e.geometryRadius, 0, Math.PI * 2)), !r && c != "none" && f > 0 && (l != c && (i.fillStyle = c, l = c), z(i, f), i.fill()), p != "none" && m > 0 && e.strokeWidth > 0 && (r && i.lineCap != "butt" && (i.lineCap = "butt"), d != p && (i.strokeStyle = p, d = p), z(i, m), B(i, e.strokeWidth), i.stroke());
|
|
63
68
|
});
|
|
64
69
|
}
|
|
65
|
-
function
|
|
70
|
+
function z(e, t) {
|
|
66
71
|
e.globalAlpha != t && (e.globalAlpha = t);
|
|
67
72
|
}
|
|
68
|
-
function
|
|
73
|
+
function B(e, t) {
|
|
69
74
|
e.lineWidth != t && (e.lineWidth = t);
|
|
70
75
|
}
|
|
71
76
|
//#endregion
|
|
72
77
|
//#region ../core/src/rendering/canvas2d/renderers/rect.js
|
|
73
|
-
function
|
|
74
|
-
let n = e, r =
|
|
78
|
+
function V(e, t) {
|
|
79
|
+
let n = e, r = k(n);
|
|
75
80
|
r.hatch != "none" && t.warn("Canvas2D ignored unsupported rect hatch.");
|
|
76
81
|
let i = t.start ?? 0;
|
|
77
82
|
if (i === (t.end ?? t.data.length)) return 0;
|
|
78
|
-
let a = t.context, o = n.encoders, s,
|
|
83
|
+
let a = t.context, o = n.encoders, s, c, l = [
|
|
79
84
|
0,
|
|
80
85
|
0,
|
|
81
86
|
0,
|
|
82
87
|
0
|
|
83
|
-
],
|
|
84
|
-
return
|
|
85
|
-
r.shadow.opacity > 0 &&
|
|
86
|
-
let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0,
|
|
87
|
-
|
|
88
|
+
], d = o.strokeOpacity.constant, f = h(o.stroke, t), p = f == "none", m = !p && d ? u(o.strokeOpacity, t.data[i]) : 0;
|
|
89
|
+
return O(n, r, t, (e) => {
|
|
90
|
+
r.shadow.opacity > 0 && H(e, r.shadow, t, l);
|
|
91
|
+
let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0, h = f ?? E(o.stroke(e.datum)), g = (d ? m : u(o.strokeOpacity, e.datum)) * t.viewOpacity * n, _ = !p && h != "none" && g > 0 && e.strokeWidth > 0, v = r.hasCornerRadii && (e.radii.topLeft != 0 || e.radii.topRight != 0 || e.radii.bottomRight != 0 || e.radii.bottomLeft != 0);
|
|
92
|
+
v && (i || _) && (l[0] = e.radii.topLeft, l[1] = e.radii.topRight, l[2] = e.radii.bottomRight, l[3] = e.radii.bottomLeft, a.beginPath(), a.roundRect(e.x, e.y, e.width, e.height, l)), i && (s != e.fill && (a.fillStyle = e.fill, s = e.fill), U(a, e.fillOpacity * n), v ? a.fill() : a.fillRect(e.x, e.y, e.width, e.height)), _ && (c != h && (a.strokeStyle = h, c = h), U(a, g), W(a, e.strokeWidth), v ? a.stroke() : a.strokeRect(e.x, e.y, e.width, e.height));
|
|
88
93
|
});
|
|
89
94
|
}
|
|
90
|
-
function
|
|
95
|
+
function H(e, t, n, r) {
|
|
91
96
|
let { context: i, devicePixelRatio: a, visibleBounds: o } = n, s = e.strokeWidth / 2, c = e.x - s, l = e.y - s, u = e.width + s * 2, d = e.height + s * 2;
|
|
92
97
|
r[0] = e.radii.topLeft + s, r[1] = e.radii.topRight + s, r[2] = e.radii.bottomRight + s, r[3] = e.radii.bottomLeft + s, i.save();
|
|
93
98
|
try {
|
|
@@ -96,71 +101,71 @@ function V(e, t, n, r) {
|
|
|
96
101
|
i.restore();
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
|
-
function
|
|
104
|
+
function U(e, t) {
|
|
100
105
|
e.globalAlpha != t && (e.globalAlpha = t);
|
|
101
106
|
}
|
|
102
|
-
function
|
|
107
|
+
function W(e, t) {
|
|
103
108
|
e.lineWidth != t && (e.lineWidth = t);
|
|
104
109
|
}
|
|
105
110
|
//#endregion
|
|
106
111
|
//#region ../core/src/rendering/canvas2d/renderers/rule.js
|
|
107
|
-
function
|
|
112
|
+
function G(e, t) {
|
|
108
113
|
let n = e, r = t.context, i = n.encoders;
|
|
109
|
-
r.lineCap =
|
|
110
|
-
let a;
|
|
111
|
-
return
|
|
112
|
-
let n =
|
|
113
|
-
n == "none" ||
|
|
114
|
+
r.lineCap = c(n, n.properties.strokeCap), r.setLineDash(c(n, n.properties.strokeDash) ?? []), r.lineDashOffset = c(n, n.properties.strokeDashOffset);
|
|
115
|
+
let a = h(i.color, t), o;
|
|
116
|
+
return S(n, M(n), t, (e) => {
|
|
117
|
+
let n = a ?? E(i.color(e.datum)), s = u(i.opacity, e.datum) * t.viewOpacity;
|
|
118
|
+
n == "none" || s <= 0 || e.strokeWidth <= 0 || (o != n && (r.strokeStyle = n, o = n), r.globalAlpha = s, r.lineWidth = e.strokeWidth, r.beginPath(), r.moveTo(e.x1, e.y1), r.lineTo(e.x2, e.y2), r.stroke());
|
|
114
119
|
});
|
|
115
120
|
}
|
|
116
121
|
//#endregion
|
|
117
122
|
//#region ../core/src/rendering/canvas2d/renderers/text.js
|
|
118
|
-
function
|
|
119
|
-
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o =
|
|
123
|
+
function K(e, t) {
|
|
124
|
+
let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = T(i, r), s = x(n), l = t.context, d = n.encoders, f = b(r.font), p = `${r.fontStyle ?? "normal"} ${A(r.fontWeight ?? "normal")} `, m = s.baseline == "baseline" ? "alphabetic" : s.baseline;
|
|
120
125
|
[
|
|
121
126
|
r.viewportEdgeFadeWidthTop,
|
|
122
127
|
r.viewportEdgeFadeWidthRight,
|
|
123
128
|
r.viewportEdgeFadeWidthBottom,
|
|
124
129
|
r.viewportEdgeFadeWidthLeft
|
|
125
|
-
].some((e) =>
|
|
126
|
-
let h, _;
|
|
127
|
-
return s.logoLetters || (
|
|
130
|
+
].some((e) => c(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
|
|
131
|
+
let g = h(d.color, t), _, v;
|
|
132
|
+
return s.logoLetters || (l.textAlign = s.align, l.textBaseline = m), D(n, s, {
|
|
128
133
|
...t,
|
|
129
134
|
fontMeasurement: a,
|
|
130
135
|
measureLogoInkBounds: o
|
|
131
136
|
}, (e) => {
|
|
132
137
|
e.multiCharacterLogo && t.warn("Canvas2D stretches multi-character logo text as a single glyph cell.");
|
|
133
|
-
let n =
|
|
134
|
-
n == "none" || r <= 0 || (
|
|
138
|
+
let n = g ?? E(d.color(e.datum)), r = u(d.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
|
|
139
|
+
n == "none" || r <= 0 || (_ != n && (l.fillStyle = n, _ = n), l.globalAlpha = r, v != e.size && (l.font = `${p}${e.size}px ${f}`, v = e.size), e.logoTransform ? (l.save(), l.translate(e.x, e.y), l.rotate(e.angle * Math.PI / 180), l.translate(e.dx, e.dy), l.scale(e.logoTransform.scaleX, e.logoTransform.scaleY), l.translate(-e.logoTransform.originX, -e.logoTransform.originY), l.textAlign = "left", l.textBaseline = "alphabetic", l.fillText(e.text, 0, 0), l.restore()) : e.angle || e.scale != 1 ? (l.save(), l.translate(e.x, e.y), l.rotate(e.angle * Math.PI / 180), l.translate(e.dx, e.dy), l.scale(e.scale, e.scale), l.fillText(e.text, 0, 0), l.restore()) : l.fillText(e.text, e.x + e.dx, e.y + e.dy));
|
|
135
140
|
});
|
|
136
141
|
}
|
|
137
142
|
//#endregion
|
|
138
143
|
//#region ../core/src/rendering/canvas2d/renderers/index.js
|
|
139
|
-
function
|
|
140
|
-
return e.getType() == "arrow" ?
|
|
144
|
+
function q(e, t) {
|
|
145
|
+
return (t.start ?? 0) === (t.end ?? t.data.length) ? 0 : e.getType() == "arrow" ? I(e, t) : e.getType() == "link" ? L(e, t) : e.getType() == "rect" ? V(e, t) : e.getType() == "point" ? R(e, t) : e.getType() == "rule" || e.getType() == "tick" ? G(e, t) : e.getType() == "text" ? K(e, t) : (t.warn(`Canvas2D rendering is not implemented for mark type "${e.getType()}".`), 0);
|
|
141
146
|
}
|
|
142
147
|
//#endregion
|
|
143
148
|
//#region ../core/src/rendering/sampleFacet.js
|
|
144
|
-
function
|
|
149
|
+
function J(e) {
|
|
145
150
|
let t = e.pixelToUnit, n = e.locSize.location * t, r = e.locSize.size * t;
|
|
146
151
|
return !(n > 1 || n + r < 0);
|
|
147
152
|
}
|
|
148
153
|
//#endregion
|
|
149
154
|
//#region ../core/src/rendering/canvas2d/canvas2DViewRenderingContext.js
|
|
150
|
-
var
|
|
155
|
+
var Y = 8, X = 16777216, Z = class extends s {
|
|
151
156
|
#e = [];
|
|
152
157
|
#t = /* @__PURE__ */ new WeakSet();
|
|
153
158
|
#n = /* @__PURE__ */ new WeakMap();
|
|
154
159
|
#r;
|
|
155
160
|
#i;
|
|
156
|
-
#a = new
|
|
161
|
+
#a = new d();
|
|
157
162
|
#o;
|
|
158
163
|
#s = [0, 0];
|
|
159
164
|
#c;
|
|
160
165
|
#l;
|
|
161
166
|
#u = [];
|
|
162
167
|
constructor(e, t) {
|
|
163
|
-
if (super(e), this.context = t.context, this.width = t.width, this.height = t.height, this.devicePixelRatio = t.devicePixelRatio, this.paint = t.paint, this.textMetrics = t.textMetrics, this.#r = t.markPredicate ?? (() => !0), this.#i =
|
|
168
|
+
if (super(e), this.context = t.context, this.width = t.width, this.height = t.height, this.devicePixelRatio = t.devicePixelRatio, this.paint = t.paint, this.textMetrics = t.textMetrics, this.#r = t.markPredicate ?? (() => !0), this.#i = o(), this.#o = t.xIndexManager, this.#l = t.opacityLayers ?? [], this.#c = {
|
|
164
169
|
x: 0,
|
|
165
170
|
y: 0,
|
|
166
171
|
width: this.context.canvas.width,
|
|
@@ -177,7 +182,7 @@ var J = 8, Y = 16777216, X = class extends o {
|
|
|
177
182
|
this.paint && !this.#t.has(e) && (e.onBeforeRender(), this.#t.add(e));
|
|
178
183
|
let r = e.getOpacity();
|
|
179
184
|
if (this.paint && r > 0 && r !== 1) {
|
|
180
|
-
let r = t(e), i =
|
|
185
|
+
let r = t(e), i = Q(n, this.devicePixelRatio, this.#c, r), a = te(this.#l, this.#u.length, i.width, i.height);
|
|
181
186
|
a.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, -i.x, -i.y), this.#u.push({
|
|
182
187
|
context: this.context,
|
|
183
188
|
bounds: this.#c
|
|
@@ -206,28 +211,28 @@ var J = 8, Y = 16777216, X = class extends o {
|
|
|
206
211
|
}
|
|
207
212
|
renderMark(e, t) {
|
|
208
213
|
if (!this.paint || !this.#r(e)) return;
|
|
209
|
-
let
|
|
210
|
-
if (
|
|
214
|
+
let n = this.#n.get(e.unitView);
|
|
215
|
+
if (n === void 0 && (n = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, n)), n <= 0) return;
|
|
211
216
|
e.initializeRenderingRevisions(Object.keys(e.properties));
|
|
212
217
|
let o = t.sampleFacetRenderingOptions;
|
|
213
|
-
if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !
|
|
218
|
+
if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !J(o))) {
|
|
214
219
|
this.#i?.addCount("canvasCulledSampleFacetOccurrences");
|
|
215
220
|
return;
|
|
216
221
|
}
|
|
217
|
-
let s = this.currentCoords, c =
|
|
218
|
-
if (!
|
|
219
|
-
let
|
|
220
|
-
if (
|
|
222
|
+
let s = this.currentCoords, c = r(t), l = i(c, e.properties.clip, s), u = m(this.width, this.height, l);
|
|
223
|
+
if (!g(u)) return;
|
|
224
|
+
let d = p(s, c, e.properties.cullByVisibleRange), h = this.#o?.prepare(e) ?? !1, _ = this.context;
|
|
225
|
+
if (_.save(), l) {
|
|
221
226
|
let e = l.rect.flatten(), t = l.clipX ? e.x : 0, n = l.clipY ? e.y : 0, r = l.clipX ? e.width : this.width, i = l.clipY ? e.height : this.height;
|
|
222
|
-
|
|
227
|
+
_.beginPath(), _.rect(t, n, r, i), _.clip();
|
|
223
228
|
}
|
|
224
229
|
try {
|
|
225
230
|
let n = e.getOrder?.(), r = n && n.isActive();
|
|
226
|
-
|
|
231
|
+
f(e, t, s, this.#a, (t, i) => {
|
|
227
232
|
let o = 0, s = i.length;
|
|
228
233
|
h && this.#o.query(i, this.#s) && (o = this.#s[0], s = this.#s[1]);
|
|
229
|
-
let c = (n, r, i, o = !1) =>
|
|
230
|
-
context:
|
|
234
|
+
let c = (n, r, i, o = !1) => q(e, {
|
|
235
|
+
context: _,
|
|
231
236
|
devicePixelRatio: this.devicePixelRatio,
|
|
232
237
|
coords: t,
|
|
233
238
|
data: n,
|
|
@@ -235,27 +240,27 @@ var J = 8, Y = 16777216, X = class extends o {
|
|
|
235
240
|
start: r,
|
|
236
241
|
end: i,
|
|
237
242
|
visibleBounds: u,
|
|
238
|
-
anchorCullBounds:
|
|
243
|
+
anchorCullBounds: d,
|
|
239
244
|
viewOpacity: 1,
|
|
240
245
|
textMetrics: this.textMetrics,
|
|
241
246
|
warn: (t) => a(`${t} View: ${e.unitView.getPathString()}`)
|
|
242
247
|
});
|
|
243
248
|
if (!r) return c(i, o, s);
|
|
244
|
-
let l = 0,
|
|
245
|
-
for (let [e, t] of
|
|
249
|
+
let l = 0, f = j(i, o, s, n.predicate, n.passes);
|
|
250
|
+
for (let [e, t] of f.entries()) t.length > 0 && (l += c(t, 0, t.length, e === 1));
|
|
246
251
|
return l;
|
|
247
252
|
}, (t) => a(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
|
|
248
253
|
} finally {
|
|
249
|
-
|
|
254
|
+
_.restore();
|
|
250
255
|
}
|
|
251
256
|
}
|
|
252
257
|
get currentCoords() {
|
|
253
|
-
let e =
|
|
258
|
+
let e = n(this.#e);
|
|
254
259
|
if (!e) throw Error("No current view in Canvas2D rendering context.");
|
|
255
260
|
return e.coords;
|
|
256
261
|
}
|
|
257
262
|
};
|
|
258
|
-
function
|
|
263
|
+
function Q(e, t, n, r) {
|
|
259
264
|
let i = n.x + n.width, a = n.y + n.height, o = r.clipX ? $(Math.floor(e.x * t), n.x, i) : n.x, s = r.clipY ? $(Math.floor(e.y * t), n.y, a) : n.y, c = r.clipX ? $(Math.ceil((e.x + e.width) * t), o, i) : i, l = r.clipY ? $(Math.ceil((e.y + e.height) * t), s, a) : a;
|
|
260
265
|
return {
|
|
261
266
|
x: o,
|
|
@@ -264,8 +269,8 @@ function Z(e, t, n, r) {
|
|
|
264
269
|
height: l - s
|
|
265
270
|
};
|
|
266
271
|
}
|
|
267
|
-
function
|
|
268
|
-
let i = n * r, a = e[t], o = e.reduce((e, n, r) => r === t ? e : e + n.canvas.width * n.canvas.height, 0), s = t <
|
|
272
|
+
function te(e, t, n, r) {
|
|
273
|
+
let i = n * r, a = e[t], o = e.reduce((e, n, r) => r === t ? e : e + n.canvas.width * n.canvas.height, 0), s = t < Y && o + i <= X;
|
|
269
274
|
if (!a || !s) {
|
|
270
275
|
if (a = document.createElement("canvas").getContext("2d"), !a) throw Error("Unable to create a Canvas2D view group.");
|
|
271
276
|
s && (e[t] = a);
|
|
@@ -277,9 +282,9 @@ function $(e, t, n) {
|
|
|
277
282
|
}
|
|
278
283
|
//#endregion
|
|
279
284
|
//#region ../core/src/rendering/canvas2d/renderCanvas2D.js
|
|
280
|
-
function
|
|
281
|
-
let t = new
|
|
285
|
+
function ne(e) {
|
|
286
|
+
let t = new Z({ picking: !1 }, e);
|
|
282
287
|
e.layoutResult.collectRenderCommands(t);
|
|
283
288
|
}
|
|
284
289
|
//#endregion
|
|
285
|
-
export {
|
|
290
|
+
export { J as n, ne as t };
|