@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.
Files changed (45) hide show
  1. package/dist/{agentApi-sPuuT0KS.js → agentApi-8hMSlqAQ.js} +8307 -6861
  2. package/dist/agentApi.es.js +5569 -4250
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-Bd8H8MMo.js} +149 -134
  5. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-D6VYooRf.js} +136 -122
  6. package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
  7. package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
  8. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CRJSc4bM.js} +24 -31
  9. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-aEVmYmkA.js} +24 -31
  10. package/dist/{debug-DbigmdrK.js → debug-CQ0agCrd.js} +9 -9
  11. package/dist/{debug-BlqDxTw3.js → debug-DkIMiGdW.js} +10 -10
  12. package/dist/index.es.js +3582 -3566
  13. package/dist/index.js +698 -454
  14. package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
  15. package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
  16. package/dist/markUtils-CvLDz744.js +75 -0
  17. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  18. package/dist/{order-B4uR9Q04.js → order-BVvkjDRT.js} +369 -316
  19. package/dist/{order-BSPy5DI8.js → order-DmMoZsi1.js} +360 -308
  20. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-DxvowWjH.js} +3 -3
  21. package/dist/{rasterExport-B62RmAK1.js → rasterExport-jeRVq6kY.js} +4 -4
  22. package/dist/{rasterization-B05bDo5e.js → rasterization-DFj3Cvx4.js} +26 -19
  23. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  24. package/dist/rectangle-Dl4Dy0hS.js +191 -0
  25. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Bfm1NHFu.js} +96 -91
  26. package/dist/{renderCanvas2D-ChdoHGrU.js → renderCanvas2D-DVjhp834.js} +98 -93
  27. package/dist/{scalePosition-ByvlXaML.js → scalePosition-0aeqp_kz.js} +8 -1
  28. package/dist/schema.json +27198 -13709
  29. package/dist/style.css +1 -1
  30. package/dist/{svg-N3tj05-e.js → svg-Bm2zxBPu.js} +315 -316
  31. package/dist/{svg-DHsq1RpV.js → svg-CkfuhONt.js} +290 -291
  32. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-DoRQEqFA.js} +2 -2
  33. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-raDDhBF-.js} +3 -3
  34. package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
  35. package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
  36. package/dist/viewError-BkJeVYXA.js +33 -0
  37. package/dist/viewError-IYqyluc7.js +33 -0
  38. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-7LyasQN-.js} +498 -434
  39. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-CbmkSQRT.js} +549 -485
  40. package/dist/{viewUtils-JX6CMEYH.js → viewUtils-DuddMNNw.js} +2138 -2009
  41. package/dist/{webgl-Dw8xqZpX.js → webgl-CQfvgnxo.js} +1229 -1140
  42. package/dist/{webgl-DdmOwEH0.js → webgl-DVYkXtiZ.js} +1477 -1389
  43. package/package.json +4 -4
  44. package/src/spec/view.d.ts +44 -5
  45. package/dist/viewError-BiR9VCgL.js +0 -29
@@ -1,14 +1,14 @@
1
- import { Kt as e, a as t, m as n, o as r, s as i } from "./clipOptions-B5PibDq3.js";
1
+ import { Dt as e, a as t, o as n, rn as r, s as i } from "./clipOptions-D_wBNhzs.js";
2
2
  import { t as a } from "./warning-CpIIpk8e.js";
3
- import { n as o } from "./performanceProfiler-CPLEjApa.js";
4
- import { n as s } from "./layoutResult-D50MSHXR.js";
5
- import { A as c, E as l, F as u, I as d, M as f, N as p, S as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as C, j as w, k as T, l as ee, m as E, p as D, s as O, t as k, u as A, v as j, w as M, x as N, y as P } from "./order-BSPy5DI8.js";
3
+ import { n as o } from "./layoutResult-D50MSHXR.js";
4
+ import { n as s } from "./performanceProfiler-CPLEjApa.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-BVvkjDRT.js";
6
6
  //#region ../core/src/rendering/canvas2d/renderers/arrow.js
7
- function F(e, t) {
8
- let n = e, r = t.context, i = n.encoders, a = m(n);
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 M(n, a, t, (e) => {
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 = c(i.fill(e.datum)), u = l(i.fillOpacity, e.datum) * t.viewOpacity;
20
- n != "none" && u > 0 && (o != n && (r.fillStyle = n, o = n), r.globalAlpha = u, r.fill());
21
- let d = c(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
- });
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 I(e, t) {
28
- let r = e, i = t.context, a = 1 / t.devicePixelRatio, o = r.encoders, s = h(r), u = N(r, s.shape, t.secondOrderPass);
29
- i.lineCap = "butt";
30
- let d;
31
- return j(r, s, t, (e) => {
32
- let r = c(o.color(e.datum)), s = l(o.opacity, e.datum) * t.viewOpacity;
33
- if (r == "none" || s <= 0 || e.strokeWidth <= 0) return;
34
- let f = u && _(e.points[0], e.points[3], u);
27
+ function L(e, t) {
28
+ let n = e, i = t.context, a = 1 / t.devicePixelRatio, o = n.encoders, s = N(n), c = _(n, s.shape, t.secondOrderPass);
29
+ i.lineCap = "butt", i.lineJoin = "miter", i.miterLimit = 2;
30
+ let l = h(o.color, t), d;
31
+ return F(n, s, t, (e) => {
32
+ let n = l ?? E(o.color(e.datum)), s = u(o.opacity, e.datum) * t.viewOpacity;
33
+ if (n == "none" || s <= 0 || e.strokeWidth <= 0) return;
34
+ let f = c && e.geometry.type == "cubic" && P(e.geometry.points[0], e.geometry.points[3], c);
35
35
  if (f) {
36
- let { normalX: e, normalY: t, offset: a, start: o, end: s } = f, c = i.createLinearGradient(e * (a - s), t * (a - s), e * (a + s), t * (a + s)), l = n(r), u = l.opacity;
37
- for (let e of P(o, s)) l.opacity = u * e.opacity, c.addColorStop(e.offset, l.formatRgb());
36
+ let { normalX: e, normalY: t, offset: a, start: o, end: s } = f, c = i.createLinearGradient(e * (a - s), t * (a - s), e * (a + s), t * (a + s)), l = r(n), u = l.opacity;
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
- } else d != r && (i.strokeStyle = r, d = r);
39
+ } else d != n && (i.strokeStyle = n, d = n);
40
40
  i.globalAlpha = s * Math.min(e.strokeWidth / a, 1), i.lineWidth = Math.max(e.strokeWidth, a);
41
- let [p, m, h, g] = e.points;
42
- i.beginPath(), i.moveTo(p[0], p[1]), i.bezierCurveTo(m[0], m[1], h[0], h[1], g[0], g[1]), i.stroke();
41
+ let { geometry: p } = e, 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 L(e, t) {
52
+ function R(e, t) {
48
53
  let n = e;
49
- T(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 = S(n), i = t.context, a = n.encoders, o, s;
51
- return x(n, r, t, (e) => {
52
- let n = e.datum, r = e.lineShape, u = c(a.fill(n)), d = l(a.fillOpacity, n) * t.viewOpacity, f = c(a.stroke(n)), p = l(a.strokeOpacity, n) * t.viewOpacity;
53
- r && (f == "none" || p <= 0) && (f = u, 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);
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(h - e.geometryRadius, g - e.geometryRadius, t, t);
61
- } else _ = E(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 && u != "none" && d > 0 && (o != u && (i.fillStyle = u, o = u), 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());
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 R(e, t) {
70
+ function z(e, t) {
66
71
  e.globalAlpha != t && (e.globalAlpha = t);
67
72
  }
68
- function z(e, t) {
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 B(e, t) {
74
- let n = e, r = b(n);
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, u, d = [
83
+ let a = t.context, o = n.encoders, s, c, l = [
79
84
  0,
80
85
  0,
81
86
  0,
82
87
  0
83
- ], f = o.stroke.constant, p = o.strokeOpacity.constant, m = f ? c(o.stroke(t.data[i])) : "none", h = f && m == "none", g = !h && p ? l(o.strokeOpacity, t.data[i]) : 0;
84
- return D(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 : c(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 && (u != _ && (a.strokeStyle = _, u = _), H(a, v), U(a, e.strokeWidth), b ? a.stroke() : a.strokeRect(e.x, e.y, e.width, e.height));
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 V(e, t, n, r) {
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 H(e, t) {
104
+ function U(e, t) {
100
105
  e.globalAlpha != t && (e.globalAlpha = t);
101
106
  }
102
- function U(e, t) {
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 W(e, t) {
112
+ function G(e, t) {
108
113
  let n = e, r = t.context, i = n.encoders;
109
- r.lineCap = T(n, n.properties.strokeCap), r.setLineDash(T(n, n.properties.strokeDash) ?? []), r.lineDashOffset = T(n, n.properties.strokeDashOffset);
110
- let a;
111
- return y(n, A(n), t, (e) => {
112
- let n = c(i.color(e.datum)), o = l(i.opacity, e.datum) * t.viewOpacity;
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());
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 G(e, t) {
119
- let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = C(i, r), s = v(n), u = t.context, d = n.encoders, f = g(r.font), p = `${r.fontStyle ?? "normal"} ${O(r.fontWeight ?? "normal")} `, m = s.baseline == "baseline" ? "alphabetic" : s.baseline;
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) => T(n, e) > 0) && t.warn("Canvas2D ignored unsupported text viewport edge fading.");
126
- let h, _;
127
- return s.logoLetters || (u.textAlign = s.align, u.textBaseline = m), ee(n, s, {
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 = c(d.color(e.datum)), r = l(d.opacity, e.datum) * t.viewOpacity * e.fadeOpacity;
134
- n == "none" || r <= 0 || (h != n && (u.fillStyle = n, h = n), u.globalAlpha = r, _ != e.size && (u.font = `${p}${e.size}px ${f}`, _ = e.size), e.logoTransform ? (u.save(), u.translate(e.x, e.y), u.rotate(e.angle * Math.PI / 180), u.translate(e.dx, e.dy), u.scale(e.logoTransform.scaleX, e.logoTransform.scaleY), u.translate(-e.logoTransform.originX, -e.logoTransform.originY), u.textAlign = "left", u.textBaseline = "alphabetic", u.fillText(e.text, 0, 0), u.restore()) : e.angle || e.scale != 1 ? (u.save(), u.translate(e.x, e.y), u.rotate(e.angle * Math.PI / 180), u.translate(e.dx, e.dy), u.scale(e.scale, e.scale), u.fillText(e.text, 0, 0), u.restore()) : u.fillText(e.text, e.x + e.dx, e.y + e.dy));
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 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);
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 q(e) {
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 J = 8, Y = 16777216, X = class extends s {
155
+ var Y = 8, X = 16777216, Z = class extends o {
151
156
  #e = [];
152
157
  #t = /* @__PURE__ */ new WeakSet();
153
158
  #n = /* @__PURE__ */ new WeakMap();
154
159
  #r;
155
160
  #i;
156
- #a = new u();
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 = o(), this.#o = t.xIndexManager, this.#l = t.opacityLayers ?? [], this.#c = {
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 = s(), 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 s {
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 = Z(n, this.devicePixelRatio, this.#c, r), a = Q(this.#l, this.#u.length, i.width, i.height);
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 s {
206
211
  }
207
212
  renderMark(e, t) {
208
213
  if (!this.paint || !this.#r(e)) return;
209
- let n = this.#n.get(e.unitView);
210
- if (n === void 0 && (n = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, n)), n <= 0) return;
214
+ let r = this.#n.get(e.unitView);
215
+ if (r === void 0 && (r = e.unitView.getEffectiveOpacity(), this.#n.set(e.unitView, r)), r <= 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"), !q(o))) {
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 = r(t), l = i(c, e.properties.clip, s), u = f(this.width, this.height, l);
218
- if (!p(u)) return;
219
- let m = w(s, c, e.properties.cullByVisibleRange), h = this.#o?.prepare(e) ?? !1, g = this.context;
220
- if (g.save(), l) {
222
+ let s = this.currentCoords, c = n(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
- g.beginPath(), g.rect(t, n, r, i), g.clip();
227
+ _.beginPath(), _.rect(t, n, r, i), _.clip();
223
228
  }
224
229
  try {
225
230
  let n = e.getOrder?.(), r = n && n.isActive();
226
- d(e, t, s, this.#a, (t, i) => {
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) => K(e, {
230
- context: g,
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,18 +240,18 @@ var J = 8, Y = 16777216, X = class extends s {
235
240
  start: r,
236
241
  end: i,
237
242
  visibleBounds: u,
238
- anchorCullBounds: m,
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, d = k(i, o, s, n.predicate, n.passes);
245
- for (let [e, t] of d.entries()) t.length > 0 && (l += c(t, 0, t.length, e === 1));
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
- g.restore();
254
+ _.restore();
250
255
  }
251
256
  }
252
257
  get currentCoords() {
@@ -255,7 +260,7 @@ var J = 8, Y = 16777216, X = class extends s {
255
260
  return t.coords;
256
261
  }
257
262
  };
258
- function Z(e, t, n, r) {
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 Q(e, t, n, r) {
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 < J && o + i <= Y;
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 te(e) {
281
- let t = new X({ picking: !1 }, e);
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 { q as n, te as t };
290
+ export { J as n, ne as t };
@@ -7,5 +7,12 @@ function e(e, t = .5) {
7
7
  }
8
8
  return 0;
9
9
  }
10
+ function t(e, t, n) {
11
+ if ("gapMapping" in e) {
12
+ let r = e;
13
+ return r.gapMapping(n)?.invertPoint(t).value ?? r.invert(t);
14
+ }
15
+ return e.invert(t);
16
+ }
10
17
  //#endregion
11
- export { e as t };
18
+ export { t as n, e as t };