@genome-spy/app 0.86.0 → 0.87.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-BZ1JCo1N.js} +6994 -6499
  2. package/dist/agentApi.es.js +3057 -3225
  3. package/dist/agentShared.es.js +7 -7
  4. package/dist/{canvas2d-8uxuN_vx.js → canvas2d-B_PnIof-.js} +108 -107
  5. package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-Cafq5v-N.js} +128 -127
  6. package/dist/{clipOptions-taFzEljc.js → clipOptions-D6eh9T-_.js} +1508 -1166
  7. package/dist/{clipOptions-BQfNhxgP.js → clipOptions-H68pJyEZ.js} +1496 -1114
  8. package/dist/{debug-D_VtWQ6l.js → debug-BGzgZmyk.js} +2 -2
  9. package/dist/{debug-Bzc3SoRg.js → debug-UYKZLNh4.js} +2 -2
  10. package/dist/index.es.js +96 -106
  11. package/dist/index.js +399 -392
  12. package/dist/{indexer-qy_dq5l5.js → indexer-Di57GyxX.js} +1 -1
  13. package/dist/{indexer-qiFctgR3.js → indexer-o6Hpg4nN.js} +1 -1
  14. package/dist/nativeText-D9SoxpaD.js +934 -0
  15. package/dist/nativeText-DAjvkrzc.js +934 -0
  16. package/dist/{rasterExport-B8pVoOsj.js → rasterExport-DzldLv6E.js} +1 -1
  17. package/dist/{rasterExport-C4r4xjQT.js → rasterExport-IAbJwi8F.js} +1 -1
  18. package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-BJ93Ptqj.js} +102 -96
  19. package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-yJ1IrDcX.js} +103 -97
  20. package/dist/schema.json +10169 -2852
  21. package/dist/{svg-C-Sw6E6G.js → svg-BRpl2Xub.js} +338 -384
  22. package/dist/{svg-CKHwwKRt.js → svg-DJuqHIyc.js} +353 -399
  23. package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-CGZQ5njV.js} +1 -1
  24. package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-PAoqLn1j.js} +1 -1
  25. package/dist/{vega-scale-D46-iCaL.js → vega-scale-BGC53c22.js} +887 -1184
  26. package/dist/{vega-scale-CK0_al6O.js → vega-scale-DdW2NzQ3.js} +898 -1195
  27. package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-D4p067HU.js} +1 -1
  28. package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-Dc2hXYsO.js} +1 -1
  29. package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-DNXnGwEW.js} +519 -321
  30. package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DYYlOt91.js} +584 -386
  31. package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-EdhZTPrJ.js} +2930 -2264
  32. package/dist/{webgl-BaA3jSa2.js → webgl-C53DwzVT.js} +427 -428
  33. package/dist/{webgl-FP-4EsBL.js → webgl-CdgNFlJk.js} +639 -640
  34. package/package.json +5 -5
  35. package/dist/nativeText-DFV5XIx8.js +0 -860
  36. package/dist/nativeText-vT3AWE14.js +0 -860
@@ -1,14 +1,14 @@
1
- import { Jt as e, a as t, o as n, s as r } from "./clipOptions-taFzEljc.js";
2
- import { t as i } from "./warning-CpIIpk8e.js";
3
- import { n as a } from "./performanceProfiler-CPLEjApa.js";
1
+ import { Kt as e, a as t, o as n, s as r, u as i } from "./clipOptions-D6eh9T-_.js";
2
+ import { t as a } from "./warning-CpIIpk8e.js";
4
3
  import { n as o } from "./layoutResult-D50MSHXR.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-vT3AWE14.js";
4
+ import { n as s } from "./performanceProfiler-CPLEjApa.js";
5
+ import { D as c, E as l, M as u, O as d, S as f, T as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, j as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P } from "./nativeText-D9SoxpaD.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 g(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 = l(i.fill(e.datum)), c = f(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 u = l(i.stroke(e.datum)), d = f(i.strokeOpacity, e.datum) * t.viewOpacity;
22
+ u != "none" && d > 0 && e.strokeWidth > 0 && (s != u && (r.strokeStyle = u, s = u), r.globalAlpha = d, 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(t, n) {
28
+ let r = t, i = n.context, a = r.encoders, o = k(r), s = b(r, o.shape);
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 E(r, o, n, (t) => {
32
+ let r = l(a.color(t.datum)), o = f(a.opacity, t.datum) * n.viewOpacity;
33
+ if (r == "none" || o <= 0 || t.strokeWidth <= 0) return;
34
+ let u = s(t.datum), d = u && m(t.points[0], t.points[3], u);
35
+ if (d) {
36
+ let { normalX: t, normalY: n, offset: a, start: o, end: s } = d, l = i.createLinearGradient(t * (a - s), n * (a - s), t * (a + s), n * (a + s)), u = e(r), f = u.opacity;
37
+ for (let e of x(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 = t.strokeWidth;
41
+ let [p, h, g, _] = t.points;
42
+ i.beginPath(), i.moveTo(p[0], p[1]), i.bezierCurveTo(h[0], h[1], g[0], g[1], _[0], _[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
+ p(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 = v(n), i = t.context, a = n.encoders, o, s;
51
+ return y(n, r, t, (e) => {
52
+ let n = e.datum, r = e.lineShape, c = l(a.fill(n)), u = f(a.fillOpacity, n) * t.viewOpacity, d = l(a.stroke(n)), p = f(a.strokeOpacity, n) * t.viewOpacity;
53
+ r && (d == "none" || p <= 0) && (d = c, p = u), 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 _ = N(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" && u > 0 && (o != c && (i.fillStyle = c, o = c), R(i, u), i.fill()), d != "none" && p > 0 && e.strokeWidth > 0 && (r && i.lineCap != "butt" && (i.lineCap = "butt"), s != d && (i.strokeStyle = d, s = d), 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 = _(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, u = [
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
+ ], d = o.stroke.constant, p = o.strokeOpacity.constant, m = d ? l(o.stroke(t.data[i])) : "none", h = d && m == "none", g = !h && p ? f(o.strokeOpacity, t.data[i]) : 0;
84
+ return T(n, r, t, (e) => {
85
+ r.shadow.opacity > 0 && V(e, r.shadow, t, u);
86
+ let n = e.opacityFactor, i = e.fill != "none" && e.fillOpacity > 0, _ = d ? m : l(o.stroke(e.datum)), v = (p ? g : f(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) && (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 && (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,71 +96,71 @@ 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 = p(n, n.properties.strokeCap), r.setLineDash(p(n, n.properties.strokeDash) ?? []), r.lineDashOffset = p(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 j(n, O(n), t, (e) => {
112
+ let n = l(i.color(e.datum)), o = f(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 = S(n), a = t.context, o = n.encoders, s = M(r.font), c = `${r.fontStyle ?? "normal"} ${A(r.fontWeight ?? "normal")} `, u = 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) => p(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
126
+ let d, m;
127
+ return i.logoLetters || (a.textAlign = i.align, a.textBaseline = u), h(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 = l(o.color(e.datum)), r = f(o.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
130
+ if (!(n == "none" || r <= 0)) if (d != n && (a.fillStyle = n, d = 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, D("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 o {
150
+ var J = 8, Y = 16777216, X = class extends o {
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 C();
151
157
  #o;
152
158
  #s = [0, 0];
153
159
  #c;
154
160
  #l;
155
161
  #u = [];
156
162
  constructor(e, t) {
157
- if (super(e), this.context = t.context, this.width = t.width, this.height = t.height, this.devicePixelRatio = t.devicePixelRatio, this.paint = t.paint, this.#r = t.markPredicate ?? (() => !0), this.#i = a(), this.#o = t.xIndexManager, this.#l = t.opacityLayers ?? [], this.#c = {
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.#r = t.markPredicate ?? (() => !0), this.#i = s(), this.#o = t.xIndexManager, this.#l = t.opacityLayers ?? [], this.#c = {
158
164
  x: 0,
159
165
  y: 0,
160
166
  width: this.context.canvas.width,
@@ -171,7 +177,7 @@ var W = 8, G = 16777216, K = class extends o {
171
177
  this.paint && !this.#t.has(e) && (e.onBeforeRender(), this.#t.add(e));
172
178
  let r = e.getOpacity();
173
179
  if (this.paint && r > 0 && r !== 1) {
174
- let r = t(e), i = q(n, this.devicePixelRatio, this.#c, r), a = J(this.#l, this.#u.length, i.width, i.height);
180
+ let r = t(e), 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
@@ -200,49 +206,49 @@ var W = 8, G = 16777216, K = class extends o {
200
206
  }
201
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([]);
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));
206
212
  let o = t.sampleFacetRenderingOptions;
207
- if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !U(o))) {
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 = n(t), u = r(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) {
215
- 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();
217
+ let s = this.currentCoords, l = n(t), f = r(l, e.properties.clip, s), p = d(this.width, this.height, f);
218
+ if (!w(p)) return;
219
+ let m = c(s, l, e.properties.cullByVisibleRange), h = this.#o?.prepare(e) ?? !1, g = this.context;
220
+ if (g.save(), f) {
221
+ let e = f.rect.flatten(), t = f.clipX ? e.x : 0, n = f.clipY ? e.y : 0, r = f.clipX ? e.width : this.width, i = f.clipY ? e.height : this.height;
222
+ g.beginPath(), g.rect(t, n, r, i), g.clip();
217
223
  }
218
224
  try {
219
- y(e, t, 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
+ u(e, t, s, this.#a, (t, n) => {
226
+ let r = 0, i = n.length;
227
+ return h && this.#o.query(n, this.#s) && (r = this.#s[0], i = this.#s[1]), K(e, {
228
+ context: g,
223
229
  devicePixelRatio: this.devicePixelRatio,
224
230
  coords: t,
225
231
  data: n,
226
232
  start: r,
227
- end: a,
228
- visibleBounds: f,
229
- anchorCullBounds: p,
233
+ end: i,
234
+ visibleBounds: p,
235
+ anchorCullBounds: m,
230
236
  viewOpacity: 1,
231
- warn: (t) => i(`${t} View: ${e.unitView.getPathString()}`)
237
+ warn: (t) => a(`${t} View: ${e.unitView.getPathString()}`)
232
238
  });
233
- }, (t) => i(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
239
+ }, (t) => a(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
234
240
  } finally {
235
- h.restore();
241
+ g.restore();
236
242
  }
237
243
  }
238
244
  get currentCoords() {
239
- let t = e(this.#e);
240
- if (!t) throw Error("No current view in Canvas2D rendering context.");
241
- return t.coords;
245
+ let e = i(this.#e);
246
+ if (!e) throw Error("No current view in Canvas2D rendering context.");
247
+ return e.coords;
242
248
  }
243
249
  };
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;
250
+ function Z(e, t, n, r) {
251
+ 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
252
  return {
247
253
  x: o,
248
254
  y: s,
@@ -250,22 +256,22 @@ function q(e, t, n, r) {
250
256
  height: l - s
251
257
  };
252
258
  }
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;
259
+ function Q(e, t, n, r) {
260
+ 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
261
  if (!a || !s) {
256
262
  if (a = document.createElement("canvas").getContext("2d"), !a) throw Error("Unable to create a Canvas2D view group.");
257
263
  s && (e[t] = a);
258
264
  }
259
265
  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
266
  }
261
- function Y(e, t, n) {
267
+ function $(e, t, n) {
262
268
  return Math.min(n, Math.max(t, e));
263
269
  }
264
270
  //#endregion
265
271
  //#region ../core/src/rendering/canvas2d/renderCanvas2D.js
266
- function X(e) {
267
- let t = new K({ picking: !1 }, e);
272
+ function ee(e) {
273
+ let t = new X({ picking: !1 }, e);
268
274
  e.layoutResult.collectRenderCommands(t);
269
275
  }
270
276
  //#endregion
271
- export { U as n, X as t };
277
+ export { q as n, ee as t };