@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.
Files changed (36) hide show
  1. package/dist/{agentApi-DgopQbMV.js → agentApi-BYFBKiRQ.js} +8170 -7390
  2. package/dist/agentApi.es.js +3945 -3862
  3. package/dist/agentShared.es.js +7 -7
  4. package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-BVQ7-2eJ.js} +141 -140
  5. package/dist/{canvas2d-8uxuN_vx.js → canvas2d-D7SZK3xv.js} +117 -116
  6. package/dist/clipOptions-BWHr3aTa.js +2675 -0
  7. package/dist/{clipOptions-BQfNhxgP.js → clipOptions-DTMcB_9z.js} +1147 -731
  8. package/dist/{debug-D_VtWQ6l.js → debug-CVpoEOWx.js} +2 -2
  9. package/dist/{debug-Bzc3SoRg.js → debug-DYAMZZKl.js} +2 -2
  10. package/dist/index.es.js +3398 -3428
  11. package/dist/index.js +441 -411
  12. package/dist/{indexer-qy_dq5l5.js → indexer-CXjZDo2Q.js} +1 -1
  13. package/dist/{indexer-qiFctgR3.js → indexer-DAH_ruVn.js} +1 -1
  14. package/dist/{nativeText-vT3AWE14.js → order-C5CzA37O.js} +144 -86
  15. package/dist/{nativeText-DFV5XIx8.js → order-DvY7KNcu.js} +133 -75
  16. package/dist/{rasterExport-B8pVoOsj.js → rasterExport-BgZ98e6U.js} +1 -1
  17. package/dist/{rasterExport-C4r4xjQT.js → rasterExport-DEr8fOLm.js} +1 -1
  18. package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-DtcJjqpB.js} +109 -96
  19. package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-DxturTEW.js} +108 -95
  20. package/dist/schema.json +10839 -2862
  21. package/dist/{svg-C-Sw6E6G.js → svg-CyrLfa9e.js} +389 -428
  22. package/dist/{svg-CKHwwKRt.js → svg-SDJMzL--.js} +389 -428
  23. package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-f7DJ3UO0.js} +1 -1
  24. package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-mWK7HTkx.js} +1 -1
  25. package/dist/{vega-scale-D46-iCaL.js → vega-scale-CypF85iS.js} +894 -1191
  26. package/dist/{vega-scale-CK0_al6O.js → vega-scale-DLKCwWRs.js} +893 -1190
  27. package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-DIDo44XQ.js} +1 -1
  28. package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-Dl-vMN9I.js} +1 -1
  29. package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-CymbZyE6.js} +692 -459
  30. package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DNiDip5e.js} +667 -434
  31. package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-BrJLIj2o.js} +3032 -2332
  32. package/dist/{webgl-BaA3jSa2.js → webgl-CqTDifWM.js} +1087 -1056
  33. package/dist/{webgl-FP-4EsBL.js → webgl-jaC2m0Zr.js} +1113 -1082
  34. package/package.json +5 -5
  35. package/src/embedTypes.d.ts +1 -1
  36. package/dist/clipOptions-taFzEljc.js +0 -2259
@@ -1,14 +1,14 @@
1
- import { a as e, o as t, s as n, u as r } from "./clipOptions-BQfNhxgP.js";
2
- import { t as i } from "./warning-CpIIpk8e.js";
3
- import { n as a } from "./layoutResult-D50MSHXR.js";
1
+ import { a as e, m as t, o as n, s as r, un as i } from "./clipOptions-BWHr3aTa.js";
2
+ import { t as a } from "./warning-CpIIpk8e.js";
4
3
  import { n as o } from "./performanceProfiler-CPLEjApa.js";
5
- import { C as s, E as c, O as l, S as u, T as d, _ as f, a as p, c as m, d as h, f as g, h as _, i as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, w as k, y as A } from "./nativeText-DFV5XIx8.js";
4
+ import { n as s } from "./layoutResult-D50MSHXR.js";
5
+ import { A as c, C as l, D as u, E as d, M as f, N as p, O as m, _ as h, a as g, c as _, d as v, f as y, g as b, h as x, i as S, k as C, l as w, m as ee, n as T, o as E, p as D, r as O, s as k, t as A, u as j, v as M, x as N, y as P } from "./order-C5CzA37O.js";
6
6
  //#region ../core/src/rendering/canvas2d/renderers/arrow.js
7
- function j(e, t) {
8
- let n = e, r = t.context, i = n.encoders, a = _(n);
7
+ function F(e, t) {
8
+ let n = e, r = t.context, i = n.encoders, a = P(n);
9
9
  r.lineJoin = "miter";
10
- let o, c;
11
- return f(n, a, t, (e) => {
10
+ let o, s;
11
+ return N(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,72 +16,78 @@ function j(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 = s(i.fill(e.datum)), l = A(i.fillOpacity, e.datum) * t.viewOpacity;
20
- n != "none" && l > 0 && (o != n && (r.fillStyle = n, o = n), r.globalAlpha = l, r.fill());
21
- let u = s(i.stroke(e.datum)), d = A(i.strokeOpacity, e.datum) * t.viewOpacity;
22
- u != "none" && d > 0 && e.strokeWidth > 0 && (c != u && (r.strokeStyle = u, c = u), r.globalAlpha = d, r.lineWidth = e.strokeWidth, r.stroke());
19
+ let n = u(i.fill(e.datum)), c = l(i.fillOpacity, e.datum) * t.viewOpacity;
20
+ n != "none" && c > 0 && (o != n && (r.fillStyle = n, o = n), r.globalAlpha = c, r.fill());
21
+ let d = u(i.stroke(e.datum)), f = l(i.strokeOpacity, e.datum) * t.viewOpacity;
22
+ d != "none" && f > 0 && e.strokeWidth > 0 && (s != d && (r.strokeStyle = d, s = d), r.globalAlpha = f, r.lineWidth = e.strokeWidth, r.stroke());
23
23
  });
24
24
  }
25
25
  //#endregion
26
26
  //#region ../core/src/rendering/canvas2d/renderers/link.js
27
- function M(e, t) {
28
- let n = e, r = t.context, i = n.encoders, a = u(n, n.properties.arcFadingDistance), o = w(n);
29
- o.shape == "arc" && a !== !1 && a[0] > 0 && a[1] > 0 && t.warn("Canvas2D ignored unsupported link arc fading."), r.lineCap = "butt";
27
+ function I(e, n) {
28
+ let r = e, i = n.context, a = r.encoders, o = ee(r), s = M(r, o.shape, n.secondOrderPass);
29
+ i.lineCap = "butt";
30
30
  let c;
31
- return x(n, o, t, (e) => {
32
- let n = s(i.color(e.datum)), a = A(i.opacity, e.datum) * t.viewOpacity;
33
- if (n == "none" || a <= 0 || e.strokeWidth <= 0) return;
34
- c != n && (r.strokeStyle = n, c = n), r.globalAlpha = a, r.lineWidth = e.strokeWidth;
35
- let [o, l, u, d] = e.points;
36
- r.beginPath(), r.moveTo(o[0], o[1]), r.bezierCurveTo(l[0], l[1], u[0], u[1], d[0], d[1]), r.stroke();
31
+ return x(r, o, n, (e) => {
32
+ let r = u(a.color(e.datum)), o = l(a.opacity, e.datum) * n.viewOpacity;
33
+ if (r == "none" || o <= 0 || e.strokeWidth <= 0) return;
34
+ let d = s && h(e.points[0], e.points[3], s);
35
+ if (d) {
36
+ let { normalX: e, normalY: n, offset: a, start: o, end: s } = d, l = i.createLinearGradient(e * (a - s), n * (a - s), e * (a + s), n * (a + s)), u = t(r), f = u.opacity;
37
+ for (let e of b(o, s)) u.opacity = f * e.opacity, l.addColorStop(e.offset, u.formatRgb());
38
+ i.strokeStyle = l, c = void 0;
39
+ } else c != r && (i.strokeStyle = r, c = r);
40
+ i.globalAlpha = o, i.lineWidth = e.strokeWidth;
41
+ let [f, p, m, g] = e.points;
42
+ i.beginPath(), i.moveTo(f[0], f[1]), i.bezierCurveTo(p[0], p[1], m[0], m[1], g[0], g[1]), i.stroke();
37
43
  });
38
44
  }
39
45
  //#endregion
40
46
  //#region ../core/src/rendering/canvas2d/renderers/point.js
41
- function N(e, t) {
47
+ function L(e, t) {
42
48
  let n = e;
43
- u(n, n.properties.fillGradientStrength) && t.warn("Canvas2D ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("Canvas2D ignored unsupported point property geometricZoomBound.");
44
- let r = h(n), i = t.context, a = n.encoders, o, c;
45
- return g(n, r, t, (e) => {
46
- let n = e.datum, r = e.lineShape, l = s(a.fill(n)), u = A(a.fillOpacity, n) * t.viewOpacity, d = s(a.stroke(n)), f = A(a.strokeOpacity, n) * t.viewOpacity;
47
- r && (d == "none" || f <= 0) && (d = l, f = u), i.beginPath();
48
- let p = e.angle != 0 && e.shape != "circle";
49
- p && (i.save(), i.translate(e.x, e.y), i.rotate(e.angle * Math.PI / 180));
50
- let m = p ? 0 : e.x, h = p ? 0 : e.y, g = !0;
51
- if (e.shape == "circle") i.arc(m, h, e.geometryRadius, 0, Math.PI * 2);
49
+ d(n, n.properties.fillGradientStrength) && t.warn("Canvas2D ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("Canvas2D ignored unsupported point property geometricZoomBound.");
50
+ let r = y(n), i = t.context, a = n.encoders, o, s;
51
+ return D(n, r, t, (e) => {
52
+ let n = e.datum, r = e.lineShape, c = u(a.fill(n)), d = l(a.fillOpacity, n) * t.viewOpacity, f = u(a.stroke(n)), p = l(a.strokeOpacity, n) * t.viewOpacity;
53
+ r && (f == "none" || p <= 0) && (f = c, p = d), i.beginPath();
54
+ let m = e.angle != 0 && e.shape != "circle";
55
+ m && (i.save(), i.translate(e.x, e.y), i.rotate(e.angle * Math.PI / 180));
56
+ let h = m ? 0 : e.x, g = m ? 0 : e.y, _ = !0;
57
+ if (e.shape == "circle") i.arc(h, g, e.geometryRadius, 0, Math.PI * 2);
52
58
  else if (e.shape == "square") {
53
59
  let t = e.geometryRadius * 2;
54
- i.rect(m - e.geometryRadius, h - e.geometryRadius, t, t);
55
- } else g = O(e.shape, m, h, e.geometryRadius, i);
56
- p && i.restore(), g || (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 && l != "none" && u > 0 && (o != l && (i.fillStyle = l, o = l), P(i, u), i.fill()), d != "none" && f > 0 && e.strokeWidth > 0 && (r && i.lineCap != "butt" && (i.lineCap = "butt"), c != d && (i.strokeStyle = d, c = d), P(i, f), F(i, e.strokeWidth), i.stroke());
60
+ i.rect(h - e.geometryRadius, g - e.geometryRadius, t, t);
61
+ } else _ = v(e.shape, h, g, e.geometryRadius, i);
62
+ m && i.restore(), _ || (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" && d > 0 && (o != c && (i.fillStyle = c, o = c), R(i, d), i.fill()), f != "none" && p > 0 && e.strokeWidth > 0 && (r && i.lineCap != "butt" && (i.lineCap = "butt"), s != f && (i.strokeStyle = f, s = f), R(i, p), z(i, e.strokeWidth), i.stroke());
57
63
  });
58
64
  }
59
- function P(e, t) {
65
+ function R(e, t) {
60
66
  e.globalAlpha != t && (e.globalAlpha = t);
61
67
  }
62
- function F(e, t) {
68
+ function z(e, t) {
63
69
  e.lineWidth != t && (e.lineWidth = t);
64
70
  }
65
71
  //#endregion
66
72
  //#region ../core/src/rendering/canvas2d/renderers/rect.js
67
- function I(e, t) {
68
- let n = e, r = m(n);
73
+ function B(e, t) {
74
+ let n = e, r = w(n);
69
75
  r.hatch != "none" && t.warn("Canvas2D ignored unsupported rect hatch.");
70
76
  let i = t.start ?? 0;
71
77
  if (i === (t.end ?? t.data.length)) return 0;
72
- let a = t.context, o = n.encoders, c, l, u = [
78
+ let a = t.context, o = n.encoders, s, c, d = [
73
79
  0,
74
80
  0,
75
81
  0,
76
82
  0
77
- ], d = o.stroke.constant, f = o.strokeOpacity.constant, p = d ? s(o.stroke(t.data[i])) : "none", h = d && p == "none", g = !h && f ? A(o.strokeOpacity, t.data[i]) : 0;
78
- return b(n, r, t, (e) => {
79
- r.shadow.opacity > 0 && L(e, r.shadow, t, u);
80
- let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0, m = d ? p : s(o.stroke(e.datum)), _ = (f ? g : A(o.strokeOpacity, e.datum)) * t.viewOpacity * n, v = !h && m != "none" && _ > 0 && e.strokeWidth > 0, y = r.hasCornerRadii && (e.radii.topLeft != 0 || e.radii.topRight != 0 || e.radii.bottomRight != 0 || e.radii.bottomLeft != 0);
81
- y && (i || v) && (u[0] = e.radii.topLeft, u[1] = e.radii.topRight, u[2] = e.radii.bottomRight, u[3] = e.radii.bottomLeft, a.beginPath(), a.roundRect(e.x, e.y, e.width, e.height, u)), i && (c != e.fill && (a.fillStyle = e.fill, c = e.fill), R(a, e.fillOpacity * n), y ? a.fill() : a.fillRect(e.x, e.y, e.width, e.height)), v && (l != m && (a.strokeStyle = m, l = m), R(a, _), z(a, e.strokeWidth), y ? a.stroke() : a.strokeRect(e.x, e.y, e.width, e.height));
83
+ ], f = o.stroke.constant, p = o.strokeOpacity.constant, m = f ? u(o.stroke(t.data[i])) : "none", h = f && m == "none", g = !h && p ? l(o.strokeOpacity, t.data[i]) : 0;
84
+ return j(n, r, t, (e) => {
85
+ r.shadow.opacity > 0 && V(e, r.shadow, t, d);
86
+ let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0, _ = f ? m : u(o.stroke(e.datum)), v = (p ? g : l(o.strokeOpacity, e.datum)) * t.viewOpacity * n, y = !h && _ != "none" && v > 0 && e.strokeWidth > 0, b = r.hasCornerRadii && (e.radii.topLeft != 0 || e.radii.topRight != 0 || e.radii.bottomRight != 0 || e.radii.bottomLeft != 0);
87
+ b && (i || y) && (d[0] = e.radii.topLeft, d[1] = e.radii.topRight, d[2] = e.radii.bottomRight, d[3] = e.radii.bottomLeft, a.beginPath(), a.roundRect(e.x, e.y, e.width, e.height, d)), i && (s != e.fill && (a.fillStyle = e.fill, s = e.fill), H(a, e.fillOpacity * n), b ? a.fill() : a.fillRect(e.x, e.y, e.width, e.height)), y && (c != _ && (a.strokeStyle = _, c = _), H(a, v), U(a, e.strokeWidth), b ? a.stroke() : a.strokeRect(e.x, e.y, e.width, e.height));
82
88
  });
83
89
  }
84
- function L(e, t, n, r) {
90
+ function V(e, t, n, r) {
85
91
  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;
86
92
  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();
87
93
  try {
@@ -90,64 +96,64 @@ function L(e, t, n, r) {
90
96
  i.restore();
91
97
  }
92
98
  }
93
- function R(e, t) {
99
+ function H(e, t) {
94
100
  e.globalAlpha != t && (e.globalAlpha = t);
95
101
  }
96
- function z(e, t) {
102
+ function U(e, t) {
97
103
  e.lineWidth != t && (e.lineWidth = t);
98
104
  }
99
105
  //#endregion
100
106
  //#region ../core/src/rendering/canvas2d/renderers/rule.js
101
- function B(e, t) {
107
+ function W(e, t) {
102
108
  let n = e, r = t.context, i = n.encoders;
103
- r.lineCap = u(n, n.properties.strokeCap), r.setLineDash(u(n, n.properties.strokeDash) ?? []), r.lineDashOffset = u(n, n.properties.strokeDashOffset);
109
+ r.lineCap = d(n, n.properties.strokeCap), r.setLineDash(d(n, n.properties.strokeDash) ?? []), r.lineDashOffset = d(n, n.properties.strokeDashOffset);
104
110
  let a;
105
- return E(n, C(n), t, (e) => {
106
- let n = s(i.color(e.datum)), o = A(i.opacity, e.datum) * t.viewOpacity;
111
+ return _(n, k(n), t, (e) => {
112
+ let n = u(i.color(e.datum)), o = l(i.opacity, e.datum) * t.viewOpacity;
107
113
  n == "none" || o <= 0 || e.strokeWidth <= 0 || (a != n && (r.strokeStyle = n, a = n), r.globalAlpha = o, r.lineWidth = e.strokeWidth, r.beginPath(), r.moveTo(e.x1, e.y1), r.lineTo(e.x2, e.y2), r.stroke());
108
114
  });
109
115
  }
110
116
  //#endregion
111
117
  //#region ../core/src/rendering/canvas2d/renderers/text.js
112
- function V(e, t) {
113
- let n = e, r = n.properties, i = v(n), a = t.context, o = n.encoders, c = D(r.font), l = `${r.fontStyle ?? "normal"} ${T(r.fontWeight ?? "normal")} `, d = i.baseline == "baseline" ? "alphabetic" : i.baseline;
118
+ function G(e, t) {
119
+ let n = e, r = n.properties, i = g(n), a = t.context, o = n.encoders, s = T(r.font), c = `${r.fontStyle ?? "normal"} ${S(r.fontWeight ?? "normal")} `, f = i.baseline == "baseline" ? "alphabetic" : i.baseline;
114
120
  [
115
121
  r.viewportEdgeFadeWidthTop,
116
122
  r.viewportEdgeFadeWidthRight,
117
123
  r.viewportEdgeFadeWidthBottom,
118
124
  r.viewportEdgeFadeWidthLeft
119
- ].some((e) => u(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
120
- let f, m;
121
- return i.logoLetters || (a.textAlign = i.align, a.textBaseline = d), p(n, i, t, (e) => {
125
+ ].some((e) => d(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
126
+ let p, m;
127
+ return i.logoLetters || (a.textAlign = i.align, a.textBaseline = f), E(n, i, t, (e) => {
122
128
  e.multiCharacterLogo && t.warn("Canvas2D stretches multi-character logo text as a single glyph cell.");
123
- let n = s(o.color(e.datum)), r = A(o.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
124
- if (!(n == "none" || r <= 0)) if (f != n && (a.fillStyle = n, f = n), a.globalAlpha = r, m != e.size && (a.font = `${l}${e.size}px ${c}`, m = e.size), e.logoScale) {
129
+ let n = u(o.color(e.datum)), r = l(o.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
130
+ if (!(n == "none" || r <= 0)) if (p != n && (a.fillStyle = n, p = n), a.globalAlpha = r, m != e.size && (a.font = `${c}${e.size}px ${s}`, m = e.size), e.logoScale) {
125
131
  a.save(), a.translate(e.x, e.y), a.rotate(e.angle * Math.PI / 180), a.translate(e.dx, e.dy);
126
132
  let t = a.measureText(e.text).width;
127
- a.scale(e.logoScale.width / t, e.logoScale.heightScale), a.textAlign = "center", a.textBaseline = "alphabetic", a.fillText(e.text, 0, S("middle", 1)), a.restore();
133
+ a.scale(e.logoScale.width / t, e.logoScale.heightScale), a.textAlign = "center", a.textBaseline = "alphabetic", a.fillText(e.text, 0, O("middle", 1)), a.restore();
128
134
  } else e.angle ? (a.save(), a.translate(e.x, e.y), a.rotate(e.angle * Math.PI / 180), a.fillText(e.text, e.dx, e.dy, e.width), a.restore()) : a.fillText(e.text, e.x + e.dx, e.y + e.dy, e.width);
129
135
  });
130
136
  }
131
137
  //#endregion
132
138
  //#region ../core/src/rendering/canvas2d/renderers/index.js
133
- function H(e, t) {
134
- return e.getType() == "arrow" ? j(e, t) : e.getType() == "link" ? M(e, t) : e.getType() == "rect" ? I(e, t) : e.getType() == "point" ? N(e, t) : e.getType() == "rule" || e.getType() == "tick" ? B(e, t) : e.getType() == "text" ? V(e, t) : (t.warn(`Canvas2D rendering is not implemented for mark type "${e.getType()}".`), 0);
139
+ function K(e, t) {
140
+ return e.getType() == "arrow" ? F(e, t) : e.getType() == "link" ? I(e, t) : e.getType() == "rect" ? B(e, t) : e.getType() == "point" ? L(e, t) : e.getType() == "rule" || e.getType() == "tick" ? W(e, t) : e.getType() == "text" ? G(e, t) : (t.warn(`Canvas2D rendering is not implemented for mark type "${e.getType()}".`), 0);
135
141
  }
136
142
  //#endregion
137
143
  //#region ../core/src/rendering/sampleFacet.js
138
- function U(e) {
144
+ function q(e) {
139
145
  let t = e.pixelToUnit, n = e.locSize.location * t, r = e.locSize.size * t;
140
146
  return !(n > 1 || n + r < 0);
141
147
  }
142
148
  //#endregion
143
149
  //#region ../core/src/rendering/canvas2d/canvas2DViewRenderingContext.js
144
- var W = 8, G = 16777216, K = class extends a {
150
+ var J = 8, Y = 16777216, X = class extends s {
145
151
  #e = [];
146
152
  #t = /* @__PURE__ */ new WeakSet();
147
153
  #n = /* @__PURE__ */ new WeakMap();
148
154
  #r;
149
155
  #i;
150
- #a = new l();
156
+ #a = new f();
151
157
  #o;
152
158
  #s = [0, 0];
153
159
  #c;
@@ -171,7 +177,7 @@ var W = 8, G = 16777216, K = class extends a {
171
177
  this.paint && !this.#t.has(t) && (t.onBeforeRender(), this.#t.add(t));
172
178
  let r = t.getOpacity();
173
179
  if (this.paint && r > 0 && r !== 1) {
174
- let r = e(t), i = q(n, this.devicePixelRatio, this.#c, r), a = J(this.#l, this.#u.length, i.width, i.height);
180
+ let r = e(t), i = Z(n, this.devicePixelRatio, this.#c, r), a = Q(this.#l, this.#u.length, i.width, i.height);
175
181
  a.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, -i.x, -i.y), this.#u.push({
176
182
  context: this.context,
177
183
  bounds: this.#c
@@ -198,51 +204,58 @@ var W = 8, G = 16777216, K = class extends a {
198
204
  }
199
205
  }
200
206
  }
201
- renderMark(e, r) {
207
+ renderMark(e, t) {
202
208
  if (!this.paint || !this.#r(e)) return;
203
- let a = this.#n.get(e.unitView);
204
- if (a === void 0 && (a = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, a)), a <= 0) return;
205
- e.initializeRenderingRevisions([]);
206
- let o = r.sampleFacetRenderingOptions;
207
- if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !U(o))) {
209
+ let i = this.#n.get(e.unitView);
210
+ if (i === void 0 && (i = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, i)), i <= 0) return;
211
+ e.initializeRenderingRevisions(Object.keys(e.properties));
212
+ let o = t.sampleFacetRenderingOptions;
213
+ if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !q(o))) {
208
214
  this.#i?.addCount("canvasCulledSampleFacetOccurrences");
209
215
  return;
210
216
  }
211
- let s = this.currentCoords, l = t(r), u = n(l, e.properties.clip, s), f = d(this.width, this.height, u);
212
- if (!c(f)) return;
213
- let p = k(s, l, e.properties.cullByVisibleRange), m = this.#o?.prepare(e) ?? !1, h = this.context;
214
- if (h.save(), u) {
217
+ let s = this.currentCoords, l = n(t), u = r(l, e.properties.clip, s), d = C(this.width, this.height, u);
218
+ if (!c(d)) return;
219
+ let f = m(s, l, e.properties.cullByVisibleRange), h = this.#o?.prepare(e) ?? !1, g = this.context;
220
+ if (g.save(), u) {
215
221
  let e = u.rect.flatten(), t = u.clipX ? e.x : 0, n = u.clipY ? e.y : 0, r = u.clipX ? e.width : this.width, i = u.clipY ? e.height : this.height;
216
- h.beginPath(), h.rect(t, n, r, i), h.clip();
222
+ g.beginPath(), g.rect(t, n, r, i), g.clip();
217
223
  }
218
224
  try {
219
- y(e, r, s, this.#a, (t, n) => {
220
- let r = 0, a = n.length;
221
- return m && this.#o.query(n, this.#s) && (r = this.#s[0], a = this.#s[1]), H(e, {
222
- context: h,
225
+ let n = e.getOrder?.(), r = n && n.isActive();
226
+ p(e, t, s, this.#a, (t, i) => {
227
+ let o = 0, s = i.length;
228
+ h && this.#o.query(i, this.#s) && (o = this.#s[0], s = this.#s[1]);
229
+ let c = (n, r, i, o = !1) => K(e, {
230
+ context: g,
223
231
  devicePixelRatio: this.devicePixelRatio,
224
232
  coords: t,
225
233
  data: n,
234
+ secondOrderPass: o,
226
235
  start: r,
227
- end: a,
228
- visibleBounds: f,
229
- anchorCullBounds: p,
236
+ end: i,
237
+ visibleBounds: d,
238
+ anchorCullBounds: f,
230
239
  viewOpacity: 1,
231
- warn: (t) => i(`${t} View: ${e.unitView.getPathString()}`)
240
+ warn: (t) => a(`${t} View: ${e.unitView.getPathString()}`)
232
241
  });
233
- }, (t) => i(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
242
+ if (!r) return c(i, o, s);
243
+ let l = 0, u = A(i, o, s, n.predicate, n.passes);
244
+ for (let [e, t] of u.entries()) t.length > 0 && (l += c(t, 0, t.length, e === 1));
245
+ return l;
246
+ }, (t) => a(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
234
247
  } finally {
235
- h.restore();
248
+ g.restore();
236
249
  }
237
250
  }
238
251
  get currentCoords() {
239
- let e = r(this.#e);
252
+ let e = i(this.#e);
240
253
  if (!e) throw Error("No current view in Canvas2D rendering context.");
241
254
  return e.coords;
242
255
  }
243
256
  };
244
- function q(e, t, n, r) {
245
- let i = n.x + n.width, a = n.y + n.height, o = r.clipX ? Y(Math.floor(e.x * t), n.x, i) : n.x, s = r.clipY ? Y(Math.floor(e.y * t), n.y, a) : n.y, c = r.clipX ? Y(Math.ceil((e.x + e.width) * t), o, i) : i, l = r.clipY ? Y(Math.ceil((e.y + e.height) * t), s, a) : a;
257
+ function Z(e, t, n, r) {
258
+ 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;
246
259
  return {
247
260
  x: o,
248
261
  y: s,
@@ -250,22 +263,22 @@ function q(e, t, n, r) {
250
263
  height: l - s
251
264
  };
252
265
  }
253
- function J(e, t, n, r) {
254
- 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 < W && o + i <= G;
266
+ function Q(e, t, n, r) {
267
+ 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 < J && o + i <= Y;
255
268
  if (!a || !s) {
256
269
  if (a = document.createElement("canvas").getContext("2d"), !a) throw Error("Unable to create a Canvas2D view group.");
257
270
  s && (e[t] = a);
258
271
  }
259
272
  return a.canvas.width != n || a.canvas.height != r ? (a.canvas.width = n, a.canvas.height = r) : (a.resetTransform(), a.clearRect(0, 0, n, r)), a.globalAlpha = 1, a.globalCompositeOperation = "source-over", a;
260
273
  }
261
- function Y(e, t, n) {
274
+ function $(e, t, n) {
262
275
  return Math.min(n, Math.max(t, e));
263
276
  }
264
277
  //#endregion
265
278
  //#region ../core/src/rendering/canvas2d/renderCanvas2D.js
266
- function X(e) {
267
- let t = new K({ picking: !1 }, e);
279
+ function te(e) {
280
+ let t = new X({ picking: !1 }, e);
268
281
  e.layoutResult.collectRenderCommands(t);
269
282
  }
270
283
  //#endregion
271
- export { U as n, X as t };
284
+ export { q as n, te as t };