@genome-spy/app 1.1.1 → 1.3.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 (96) hide show
  1. package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
  2. package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
  3. package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
  4. package/dist/agentApi.es.js +6783 -5135
  5. package/dist/agentShared.es.js +433 -460
  6. package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
  7. package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
  8. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
  9. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
  10. package/dist/clipOptions-SrrxeAEU.js +4316 -0
  11. package/dist/clipOptions-clBEbkjv.js +4326 -0
  12. package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
  13. package/dist/color-uTRRsy8i.js +116 -0
  14. package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
  15. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
  16. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
  17. package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
  18. package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
  19. package/dist/dialog.es.js +1 -1
  20. package/dist/dist-CmY6iewb.js +1501 -0
  21. package/dist/dist-D6xbz5Ks.js +1501 -0
  22. package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
  23. package/dist/esm-BUkWqSr2.js +299 -0
  24. package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
  25. package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
  26. package/dist/esm-C6erfjPM.js +252 -0
  27. package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
  28. package/dist/esm-CqY5ezGz.js +1249 -0
  29. package/dist/esm-DfMIJ_N2.js +1522 -0
  30. package/dist/esm-Dls41IbZ.js +787 -0
  31. package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
  32. package/dist/esm-aGLCvYRP.js +238 -0
  33. package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
  34. package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
  35. package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
  36. package/dist/flowNode-BSjy0Wz3.js +1306 -0
  37. package/dist/flowOutput-D5qpxWe0.js +183 -0
  38. package/dist/index.es.js +4766 -5522
  39. package/dist/index.js +1089 -685
  40. package/dist/inflate-BdC5KvHn.js +886 -0
  41. package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
  42. package/dist/markUtils-RaatLEa-.js +78 -0
  43. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  44. package/dist/metadataUtils-DxEPe0vj.js +879 -0
  45. package/dist/order-BnKzKjt4.js +1151 -0
  46. package/dist/order-BpJnq_nV.js +1150 -0
  47. package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
  48. package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
  49. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
  50. package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
  51. package/dist/rectangle-BAdoDPXu.js +194 -0
  52. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  53. package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
  54. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
  55. package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
  56. package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
  57. package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
  58. package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
  59. package/dist/schema.json +33403 -16929
  60. package/dist/style.css +1 -1
  61. package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
  62. package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
  63. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
  64. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
  65. package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
  66. package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
  67. package/dist/url-DeOdSRrv.js +183 -0
  68. package/dist/viewError-B0TMfOpB.js +33 -0
  69. package/dist/viewError-D9aO90cI.js +33 -0
  70. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
  71. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
  72. package/dist/viewUtils-0SJOewM6.js +6195 -0
  73. package/dist/webgl-CXIO3OQz.js +5782 -0
  74. package/dist/webgl-Pdvfhio5.js +5783 -0
  75. package/package.json +7 -5
  76. package/src/agentApi/index.d.ts +3 -2
  77. package/src/agentShared/index.d.ts +2 -0
  78. package/src/appTypes.d.ts +1 -6
  79. package/src/embedTypes.d.ts +36 -1
  80. package/src/index.d.ts +6 -0
  81. package/src/spec/sampleView.d.ts +68 -13
  82. package/src/spec/view.d.ts +44 -5
  83. package/src/state/paramProvenanceTypes.d.ts +25 -2
  84. package/src/state.d.ts +14 -52
  85. package/dist/clipOptions-B5PibDq3.js +0 -2923
  86. package/dist/clipOptions-Cba4I0AO.js +0 -2903
  87. package/dist/esm-Dndm-NaA.js +0 -1193
  88. package/dist/order-B4uR9Q04.js +0 -1062
  89. package/dist/order-BSPy5DI8.js +0 -1062
  90. package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
  91. package/dist/vega-scale-Byaw1K8O.js +0 -2446
  92. package/dist/vega-scale-Ctz_wa3z.js +0 -2443
  93. package/dist/viewError-BiR9VCgL.js +0 -29
  94. package/dist/viewUtils-JX6CMEYH.js +0 -6664
  95. package/dist/webgl-DdmOwEH0.js +0 -5544
  96. package/dist/webgl-Dw8xqZpX.js +0 -5544
@@ -1,285 +0,0 @@
1
- import { Kt as e, a as t, m as n, o as r, s as i } from "./clipOptions-B5PibDq3.js";
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";
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);
9
- r.lineJoin = "miter";
10
- let o, s;
11
- return M(n, a, t, (e) => {
12
- e.headShapeFallback && t.warn(`Canvas2D rendered unsupported arrow headShape "${a.headShape}" as a triangle.`), r.beginPath();
13
- for (let t of e.boundaryLoops) {
14
- let e = t[0];
15
- r.moveTo(e.x, e.y);
16
- for (let e = 1; e < t.length; e++) r.lineTo(t[e].x, t[e].y);
17
- r.closePath();
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
- });
24
- }
25
- //#endregion
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);
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());
38
- i.strokeStyle = c, d = void 0;
39
- } else d != r && (i.strokeStyle = r, d = r);
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();
43
- });
44
- }
45
- //#endregion
46
- //#region ../core/src/rendering/canvas2d/renderers/point.js
47
- function L(e, t) {
48
- 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);
58
- else if (e.shape == "square") {
59
- 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());
63
- });
64
- }
65
- function R(e, t) {
66
- e.globalAlpha != t && (e.globalAlpha = t);
67
- }
68
- function z(e, t) {
69
- e.lineWidth != t && (e.lineWidth = t);
70
- }
71
- //#endregion
72
- //#region ../core/src/rendering/canvas2d/renderers/rect.js
73
- function B(e, t) {
74
- let n = e, r = b(n);
75
- r.hatch != "none" && t.warn("Canvas2D ignored unsupported rect hatch.");
76
- let i = t.start ?? 0;
77
- if (i === (t.end ?? t.data.length)) return 0;
78
- let a = t.context, o = n.encoders, s, u, d = [
79
- 0,
80
- 0,
81
- 0,
82
- 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
- });
89
- }
90
- function V(e, t, n, r) {
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;
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();
93
- try {
94
- i.beginPath(), i.rect(o.x1, o.y1, o.x2 - o.x1, o.y2 - o.y1), i.roundRect(c, l, u, d, r), i.clip("evenodd"), i.shadowBlur = Math.max(t.blur / 2.5, .25) * 2 * a, i.shadowOffsetX = t.offsetX * a, i.shadowOffsetY = t.offsetY * a, i.shadowColor = t.color, i.globalAlpha = t.opacity * n.viewOpacity, i.fillStyle = "black", i.beginPath(), i.roundRect(c, l, u, d, r), i.fill();
95
- } finally {
96
- i.restore();
97
- }
98
- }
99
- function H(e, t) {
100
- e.globalAlpha != t && (e.globalAlpha = t);
101
- }
102
- function U(e, t) {
103
- e.lineWidth != t && (e.lineWidth = t);
104
- }
105
- //#endregion
106
- //#region ../core/src/rendering/canvas2d/renderers/rule.js
107
- function W(e, t) {
108
- 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
- });
115
- }
116
- //#endregion
117
- //#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;
120
- [
121
- r.viewportEdgeFadeWidthTop,
122
- r.viewportEdgeFadeWidthRight,
123
- r.viewportEdgeFadeWidthBottom,
124
- 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, {
128
- ...t,
129
- fontMeasurement: a,
130
- measureLogoInkBounds: o
131
- }, (e) => {
132
- 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));
135
- });
136
- }
137
- //#endregion
138
- //#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);
141
- }
142
- //#endregion
143
- //#region ../core/src/rendering/sampleFacet.js
144
- function q(e) {
145
- let t = e.pixelToUnit, n = e.locSize.location * t, r = e.locSize.size * t;
146
- return !(n > 1 || n + r < 0);
147
- }
148
- //#endregion
149
- //#region ../core/src/rendering/canvas2d/canvas2DViewRenderingContext.js
150
- var J = 8, Y = 16777216, X = class extends s {
151
- #e = [];
152
- #t = /* @__PURE__ */ new WeakSet();
153
- #n = /* @__PURE__ */ new WeakMap();
154
- #r;
155
- #i;
156
- #a = new u();
157
- #o;
158
- #s = [0, 0];
159
- #c;
160
- #l;
161
- #u = [];
162
- 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 = {
164
- x: 0,
165
- y: 0,
166
- width: this.context.canvas.width,
167
- height: this.context.canvas.height
168
- }, this.paint) {
169
- let e = this.context;
170
- e.resetTransform(), e.clearRect(0, 0, e.canvas.width, e.canvas.height), e.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, 0, 0), e.globalAlpha = 1, e.globalCompositeOperation = "source-over", t.background != null && (e.fillStyle = t.background, e.fillRect(0, 0, this.width, this.height));
171
- }
172
- }
173
- getDevicePixelRatio() {
174
- return this.devicePixelRatio;
175
- }
176
- pushView(e, n) {
177
- this.paint && !this.#t.has(e) && (e.onBeforeRender(), this.#t.add(e));
178
- let r = e.getOpacity();
179
- 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);
181
- a.setTransform(this.devicePixelRatio, 0, 0, this.devicePixelRatio, -i.x, -i.y), this.#u.push({
182
- context: this.context,
183
- bounds: this.#c
184
- }), this.context = a, this.#c = i;
185
- }
186
- this.#e.push({
187
- view: e,
188
- coords: n,
189
- opacity: r
190
- });
191
- }
192
- popView(e) {
193
- let t = this.#e.pop();
194
- if (t?.view !== e) throw Error("Unbalanced Canvas2D view rendering context stack.");
195
- if (this.paint && t.opacity > 0 && t.opacity !== 1) {
196
- let e = this.#u.pop();
197
- if (!e) throw Error("Missing Canvas2D opacity parent target.");
198
- let n = this.context.canvas, r = this.#c;
199
- this.context = e.context, this.#c = e.bounds, this.context.save();
200
- try {
201
- this.context.globalAlpha = t.opacity, r.width && r.height && this.context.drawImage(n, r.x / this.devicePixelRatio, r.y / this.devicePixelRatio, r.width / this.devicePixelRatio, r.height / this.devicePixelRatio);
202
- } finally {
203
- this.context.restore();
204
- }
205
- }
206
- }
207
- renderMark(e, t) {
208
- 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;
211
- e.initializeRenderingRevisions(Object.keys(e.properties));
212
- let o = t.sampleFacetRenderingOptions;
213
- if (o && !e.encoders.facetIndex && (this.#i?.addCount("canvasSampleFacetOccurrences"), !q(o))) {
214
- this.#i?.addCount("canvasCulledSampleFacetOccurrences");
215
- return;
216
- }
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) {
221
- 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();
223
- }
224
- try {
225
- let n = e.getOrder?.(), r = n && n.isActive();
226
- d(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,
231
- devicePixelRatio: this.devicePixelRatio,
232
- coords: t,
233
- data: n,
234
- secondOrderPass: o,
235
- start: r,
236
- end: i,
237
- visibleBounds: u,
238
- anchorCullBounds: m,
239
- viewOpacity: 1,
240
- textMetrics: this.textMetrics,
241
- warn: (t) => a(`${t} View: ${e.unitView.getPathString()}`)
242
- });
243
- 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));
246
- return l;
247
- }, (t) => a(`Canvas2D could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`));
248
- } finally {
249
- g.restore();
250
- }
251
- }
252
- get currentCoords() {
253
- let t = e(this.#e);
254
- if (!t) throw Error("No current view in Canvas2D rendering context.");
255
- return t.coords;
256
- }
257
- };
258
- function Z(e, t, n, r) {
259
- 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
- return {
261
- x: o,
262
- y: s,
263
- width: c - o,
264
- height: l - s
265
- };
266
- }
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;
269
- if (!a || !s) {
270
- if (a = document.createElement("canvas").getContext("2d"), !a) throw Error("Unable to create a Canvas2D view group.");
271
- s && (e[t] = a);
272
- }
273
- 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;
274
- }
275
- function $(e, t, n) {
276
- return Math.min(n, Math.max(t, e));
277
- }
278
- //#endregion
279
- //#region ../core/src/rendering/canvas2d/renderCanvas2D.js
280
- function te(e) {
281
- let t = new X({ picking: !1 }, e);
282
- e.layoutResult.collectRenderCommands(t);
283
- }
284
- //#endregion
285
- export { q as n, te as t };