@genome-spy/app 0.85.0 → 0.86.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 (56) hide show
  1. package/README.md +28 -0
  2. package/dist/{agentApi-Cz0hCnVp.js → agentApi-DgopQbMV.js} +5019 -6824
  3. package/dist/agentApi.es.js +2757 -2852
  4. package/dist/agentShared.es.js +15 -14
  5. package/dist/canvas2d-8uxuN_vx.js +619 -0
  6. package/dist/canvas2d-BtQC7Xr8.js +619 -0
  7. package/dist/{arrayUtils-LJpQOu-U.js → clipOptions-BQfNhxgP.js} +625 -561
  8. package/dist/{paramUtils-BYI4rwyL.js → clipOptions-taFzEljc.js} +192 -128
  9. package/dist/{debug-BvCZWumf.js → debug-Bzc3SoRg.js} +8 -8
  10. package/dist/{debug-CgDtmspT.js → debug-D_VtWQ6l.js} +8 -8
  11. package/dist/index.es.js +2992 -2915
  12. package/dist/index.js +2006 -2004
  13. package/dist/indexer-qiFctgR3.js +72 -0
  14. package/dist/indexer-qy_dq5l5.js +72 -0
  15. package/dist/layoutResult-D50MSHXR.js +97 -0
  16. package/dist/{nativeText-m5AUINMq.js → nativeText-DFV5XIx8.js} +247 -193
  17. package/dist/{nativeText-DMO8gLt7.js → nativeText-vT3AWE14.js} +244 -190
  18. package/dist/performanceProfiler-CPLEjApa.js +20 -0
  19. package/dist/rasterExport-B8pVoOsj.js +44 -0
  20. package/dist/rasterExport-C4r4xjQT.js +44 -0
  21. package/dist/rasterImage-B4rPLaW9.js +18 -0
  22. package/dist/rasterization-CFogVB3B.js +50 -0
  23. package/dist/rectangle-DKnrAmKs.js +142 -0
  24. package/dist/renderCanvas2D-BQrRWp2Z.js +271 -0
  25. package/dist/renderCanvas2D-CHVNfIUz.js +271 -0
  26. package/dist/schema.json +71 -131
  27. package/dist/{svg-CCu8kYy2.js → svg-C-Sw6E6G.js} +286 -277
  28. package/dist/{svg-yFj875aX.js → svg-CKHwwKRt.js} +278 -269
  29. package/dist/svgRasterizer-BgD72AmG.js +40 -0
  30. package/dist/svgRasterizer-BgSNqI3L.js +40 -0
  31. package/dist/vega-scale-CK0_al6O.js +2700 -0
  32. package/dist/vega-scale-D46-iCaL.js +2700 -0
  33. package/dist/viewError-BiR9VCgL.js +29 -0
  34. package/dist/{viewIdentityRegistry-D3oPbN4O.js → viewIdentityRegistry-B-VGlez1.js} +1 -1
  35. package/dist/{viewIdentityRegistry-BUdkK9zT.js → viewIdentityRegistry-CDtVktJD.js} +1 -1
  36. package/dist/viewSelectors-CKfxF_LM.js +1817 -0
  37. package/dist/viewSelectors-D_imtq5Z.js +1817 -0
  38. package/dist/viewUtils-nCJ7AoaI.js +5782 -0
  39. package/dist/webgl-BaA3jSa2.js +4128 -0
  40. package/dist/webgl-FP-4EsBL.js +4128 -0
  41. package/package.json +7 -6
  42. package/dist/bmFontMetrics-CuNB-kNN.js +0 -31
  43. package/dist/canvas2d-DoAXEiF9.js +0 -309
  44. package/dist/canvas2d-f5jl4A5D.js +0 -310
  45. package/dist/clipOptions-gqdb3fvW.js +0 -43
  46. package/dist/color-W5zffv-z.js +0 -335
  47. package/dist/framebufferReadback-CCLOjStu.js +0 -148
  48. package/dist/framebufferReadback-THWwFqs8.js +0 -1994
  49. package/dist/twgl-full.module-DB2UdP1k.js +0 -1849
  50. package/dist/viewRenderingContext-HtpqwS_x.js +0 -120
  51. package/dist/viewSelectors-DGCspRN3.js +0 -4198
  52. package/dist/viewSelectors-U5oLCLHV.js +0 -4195
  53. package/dist/viewUtils-Dg4RA40Q.js +0 -7503
  54. package/dist/warning-DRGdb6BF.js +0 -59
  55. package/dist/webgl-Ci6ZhCCf.js +0 -54
  56. package/dist/webgl-Dpz8a3TI.js +0 -53
@@ -1,8 +1,10 @@
1
- import { B as e, H as t, ft as n, r } from "./arrayUtils-LJpQOu-U.js";
2
- import { b as i, q as a } from "./viewSelectors-U5oLCLHV.js";
3
- import { a as o, o as s } from "./clipOptions-gqdb3fvW.js";
4
- import { n as c, t as l } from "./viewRenderingContext-HtpqwS_x.js";
5
- import { C as u, E 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, l as C, m as w, n as T, o as E, p as D, r as ee, s as te, t as ne, u as re, v as ie, w as O, x as k, y as ae } from "./nativeText-m5AUINMq.js";
1
+ import { Y as e, o as t, q as n, s as r, u as i, yt as a } from "./clipOptions-BQfNhxgP.js";
2
+ import { b as o } from "./viewSelectors-CKfxF_LM.js";
3
+ import { v as s } from "./vega-scale-CK0_al6O.js";
4
+ import { t as c } from "./rasterization-CFogVB3B.js";
5
+ import { t as l } from "./rectangle-DKnrAmKs.js";
6
+ import { n as u, t as d } from "./layoutResult-D50MSHXR.js";
7
+ import { C as f, D as p, E as m, O as h, S as g, T as _, _ as v, a as y, b as ee, c as b, d as x, f as S, h as C, i as w, k as T, l as E, m as D, n as O, o as te, p as ne, r as re, s as ie, t as ae, u as oe, w as se, x as ce, y as k } from "./nativeText-DFV5XIx8.js";
6
8
  import { n as A, t as j } from "./svgNumber-DNxESJQB.js";
7
9
  //#region ../core/src/rendering/svg/svgElement.js
8
10
  var M = "http://www.w3.org/2000/svg";
@@ -23,11 +25,11 @@ function F(e, t) {
23
25
  }
24
26
  //#endregion
25
27
  //#region ../core/src/rendering/svg/renderers/arrow.js
26
- function oe(e, t) {
28
+ function le(e, t) {
27
29
  let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, l = P(a, {
28
30
  fill: {
29
31
  encoder: c.fill,
30
- transform: k
32
+ transform: f
31
33
  },
32
34
  "fill-opacity": {
33
35
  encoder: c.fillOpacity,
@@ -35,7 +37,7 @@ function oe(e, t) {
35
37
  },
36
38
  stroke: {
37
39
  encoder: c.stroke,
38
- transform: k
40
+ transform: f
39
41
  },
40
42
  "stroke-opacity": {
41
43
  encoder: c.strokeOpacity,
@@ -47,8 +49,8 @@ function oe(e, t) {
47
49
  }
48
50
  });
49
51
  a.setAttribute("stroke-linejoin", "miter");
50
- let u = x(n);
51
- return b(n, u, {
52
+ let u = C(n);
53
+ return v(n, u, {
52
54
  coords: r,
53
55
  data: i,
54
56
  visibleBounds: s,
@@ -56,24 +58,24 @@ function oe(e, t) {
56
58
  countOnly: t.countOnly
57
59
  }, (e) => {
58
60
  t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${u.headShape}" as a triangle.`), a.appendChild(N("path", {
59
- d: e.boundaryLoops.map(se).join(" "),
61
+ d: e.boundaryLoops.map(ue).join(" "),
60
62
  ...l(e.datum)
61
63
  })));
62
64
  });
63
65
  }
64
- function se(e) {
65
- return `M ${e.map(ce).join(" L ")} Z`;
66
+ function ue(e) {
67
+ return `M ${e.map(de).join(" L ")} Z`;
66
68
  }
67
- function ce(e) {
69
+ function de(e) {
68
70
  return `${j(e.x)} ${j(e.y)}`;
69
71
  }
70
72
  //#endregion
71
73
  //#region ../core/src/rendering/svg/renderers/link.js
72
- function le(e, t) {
73
- let n = e, r = n.properties, i = g(n, r.arcFadingDistance), a = D(n), { coords: o, data: s, group: c, viewOpacity: l, visibleBounds: u } = t, d = n.encoders, f = g(n, r.noFadingOnPointSelection) ? ue(n, d) : [], p = P(c, {
74
+ function fe(e, t) {
75
+ let n = e, r = n.properties, i = g(n, r.arcFadingDistance), a = ne(n), { coords: o, data: s, group: c, viewOpacity: l, visibleBounds: u } = t, d = n.encoders, p = g(n, r.noFadingOnPointSelection) ? pe(n, d) : [], m = P(c, {
74
76
  stroke: {
75
77
  encoder: d.color,
76
- transform: k
78
+ transform: f
77
79
  },
78
80
  "stroke-opacity": {
79
81
  encoder: d.opacity,
@@ -84,15 +86,15 @@ function le(e, t) {
84
86
  transform: (e) => j(+e)
85
87
  }
86
88
  });
87
- return c.setAttribute("fill", "none"), c.setAttribute("stroke-linecap", "butt"), w(n, a, {
89
+ return c.setAttribute("fill", "none"), c.setAttribute("stroke-linecap", "butt"), D(n, a, {
88
90
  coords: o,
89
91
  data: s,
90
92
  visibleBounds: u
91
93
  }, ({ datum: e, points: n }) => {
92
94
  let [r, o, s, l] = n;
93
95
  if (t.countOnly) return;
94
- let u = p(e);
95
- if (a.shape == "arc" && i !== !1 && i[0] > 0 && i[1] > 0 && !de(e, f)) {
96
+ let u = m(e);
97
+ if (a.shape == "arc" && i !== !1 && i[0] > 0 && i[1] > 0 && !me(e, p)) {
96
98
  let e = t.getLinkArcFadeMaskUrl({
97
99
  p1: r,
98
100
  p4: l,
@@ -106,26 +108,26 @@ function le(e, t) {
106
108
  }));
107
109
  });
108
110
  }
109
- function ue(n, r) {
111
+ function pe(t, r) {
110
112
  let i = new Set(Object.values(r).flatMap((e) => e.branches).map((e) => e.predicate?.param).filter((e) => e));
111
- return Array.from(i).map((e) => n.unitView.paramRuntime.findValue(e)).filter((n) => n && (t(n) || e(n)));
113
+ return Array.from(i).map((e) => t.unitView.paramRuntime.findValue(e)).filter((t) => t && (e(t) || n(t)));
112
114
  }
113
- function de(e, r) {
114
- let i = e[n];
115
- return r.some((e) => t(e) ? e.uniqueId != null && e.uniqueId == i : e.data.has(i));
115
+ function me(t, n) {
116
+ let r = t[a];
117
+ return n.some((t) => e(t) ? t.uniqueId != null && t.uniqueId == r : t.data.has(r));
116
118
  }
117
119
  function I(e) {
118
120
  return e.map(j).join(" ");
119
121
  }
120
122
  //#endregion
121
123
  //#region ../core/src/rendering/svg/renderers/point.js
122
- function L(e, t) {
124
+ function he(e, t) {
123
125
  let n = e;
124
126
  g(n, n.properties.fillGradientStrength) && t.warn("SVG export ignored unsupported point property fillGradientStrength."), n.properties.geometricZoomBound && t.warn("SVG export ignored unsupported point property geometricZoomBound.");
125
- let r = v(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = P(a, {
127
+ let r = x(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = P(a, {
126
128
  fill: {
127
129
  encoder: s.fill,
128
- transform: k
130
+ transform: f
129
131
  },
130
132
  "fill-opacity": {
131
133
  encoder: s.fillOpacity,
@@ -133,7 +135,7 @@ function L(e, t) {
133
135
  },
134
136
  stroke: {
135
137
  encoder: s.stroke,
136
- transform: k
138
+ transform: f
137
139
  },
138
140
  "stroke-opacity": {
139
141
  encoder: s.strokeOpacity,
@@ -143,14 +145,14 @@ function L(e, t) {
143
145
  encoder: s.strokeWidth,
144
146
  transform: (e) => j(+e)
145
147
  }
146
- }), l = z();
147
- return y(n, r, t, (e) => {
148
+ }), l = R();
149
+ return S(n, r, t, (e) => {
148
150
  if (t.countOnly) return;
149
151
  let { datum: n, shape: r, x: u, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
150
152
  ...c(n),
151
153
  ...i && !h ? { "stroke-width": j(m) } : {},
152
- ...h ? B(s, n, o) : {}
153
- }, _ = R(r, u, d, f, g, l);
154
+ ...h ? ge(s, n, o) : {}
155
+ }, _ = L(r, u, d, f, g, l);
154
156
  _ ? (p && _.setAttribute("transform", `rotate(${j(p)} ${j(u)} ${j(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(N("circle", {
155
157
  cx: j(u),
156
158
  cy: j(d),
@@ -159,7 +161,7 @@ function L(e, t) {
159
161
  })));
160
162
  });
161
163
  }
162
- function R(e, t, n, r, i, a) {
164
+ function L(e, t, n, r, i, a) {
163
165
  let o = j(t), s = j(n), c = j(r);
164
166
  if (e == "circle") return N("circle", {
165
167
  cx: o,
@@ -180,7 +182,7 @@ function R(e, t, n, r, i, a) {
180
182
  ...i
181
183
  }) : void 0;
182
184
  }
183
- function z() {
185
+ function R() {
184
186
  let e = "", t = (e, t) => `${j(e)} ${j(t)}`, n = {
185
187
  moveTo(n, r) {
186
188
  e += `${e ? " M" : "M"} ${t(n, r)}`;
@@ -193,26 +195,26 @@ function z() {
193
195
  }
194
196
  };
195
197
  return { build(t, r, i, a) {
196
- return e = "", re(t, r, i, a, n) ? e : void 0;
198
+ return e = "", oe(t, r, i, a, n) ? e : void 0;
197
199
  } };
198
200
  }
199
- function B(e, t, n) {
200
- let r = e.stroke(t), i = m(e.strokeOpacity, t), a = r == null || i <= 0;
201
+ function ge(e, t, n) {
202
+ let r = e.stroke(t), i = k(e.strokeOpacity, t), a = r == null || i <= 0;
201
203
  return {
202
204
  fill: "none",
203
- stroke: k(a ? e.fill(t) : r),
204
- "stroke-opacity": (a ? m(e.fillOpacity, t) : i) * n,
205
- "stroke-width": j(m(e.strokeWidth, t)),
205
+ stroke: f(a ? e.fill(t) : r),
206
+ "stroke-opacity": (a ? k(e.fillOpacity, t) : i) * n,
207
+ "stroke-width": j(k(e.strokeWidth, t)),
206
208
  "stroke-linecap": "butt"
207
209
  };
208
210
  }
209
211
  //#endregion
210
212
  //#region ../core/src/rendering/svg/renderers/rect.js
211
- function V(e, t) {
212
- let n = e, r = _(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = P(o, {
213
+ function _e(e, t) {
214
+ let n = e, r = b(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = P(o, {
213
215
  fill: {
214
216
  encoder: c.fill,
215
- transform: k
217
+ transform: f
216
218
  },
217
219
  "fill-opacity": {
218
220
  encoder: c.fillOpacity,
@@ -220,7 +222,7 @@ function V(e, t) {
220
222
  },
221
223
  stroke: {
222
224
  encoder: c.stroke,
223
- transform: k
225
+ transform: f
224
226
  },
225
227
  "stroke-opacity": {
226
228
  encoder: c.strokeOpacity,
@@ -238,35 +240,35 @@ function V(e, t) {
238
240
  opacity: A(i.opacity * s),
239
241
  filter: t.getShadowFilterUrl(i)
240
242
  } : null;
241
- return C(n, r, t, (e) => {
243
+ return E(n, r, t, (e) => {
242
244
  if (t.countOnly) return;
243
- let { datum: n, x: r, y: i, width: d, height: f, radii: p, opacityFactor: h, strokeWidth: g, fill: _, fillOpacity: v } = e, y = {
245
+ let { datum: n, x: r, y: i, width: d, height: p, radii: m, opacityFactor: h, strokeWidth: g, fill: _, fillOpacity: v } = e, y = {
244
246
  ...l(n),
245
247
  ...h == 1 ? {} : { opacity: A(h) }
246
248
  };
247
249
  if (a != "none" && g > 0 && (y.fill = t.getRectHatchPatternUrl({
248
250
  type: a,
249
- fill: k(c.fill(n)),
250
- fillOpacity: m(c.fillOpacity, n) * s,
251
- stroke: k(c.stroke(n)),
252
- strokeOpacity: m(c.strokeOpacity, n) * s,
251
+ fill: f(c.fill(n)),
252
+ fillOpacity: k(c.fillOpacity, n) * s,
253
+ stroke: f(c.stroke(n)),
254
+ strokeOpacity: k(c.strokeOpacity, n) * s,
253
255
  strokeWidth: g
254
256
  }), y["fill-opacity"] = 1), u) {
255
- let e = H(r, i, d, f, p, {
257
+ let e = z(r, i, d, p, m, {
256
258
  ...u,
257
259
  "stroke-width": j(g)
258
260
  });
259
261
  if (a == "none" && _ != "none" && v == 1 && h == 1) o.appendChild(e);
260
262
  else {
261
- let n = g / 2, a = Object.fromEntries(Object.entries(p).map(([e, t]) => [e, t + n])), s = U(r - n, i - n, d + n * 2, f + n * 2, a), c = N("g", { "clip-path": t.getShadowClipPathUrl(s) });
263
+ let n = g / 2, a = Object.fromEntries(Object.entries(m).map(([e, t]) => [e, t + n])), s = B(r - n, i - n, d + n * 2, p + n * 2, a), c = N("g", { "clip-path": t.getShadowClipPathUrl(s) });
262
264
  c.appendChild(e), o.appendChild(c);
263
265
  }
264
266
  }
265
- o.appendChild(H(r, i, d, f, p, y));
267
+ o.appendChild(z(r, i, d, p, m, y));
266
268
  });
267
269
  }
268
- function H(e, t, n, r, i, a) {
269
- if (fe(i)) {
270
+ function z(e, t, n, r, i, a) {
271
+ if (ve(i)) {
270
272
  let o = i.topLeft, s = j(e), c = j(t), l = j(e + n), u = j(t + r);
271
273
  return N("rect", {
272
274
  x: s,
@@ -280,41 +282,41 @@ function H(e, t, n, r, i, a) {
280
282
  ...a
281
283
  });
282
284
  } else return N("path", {
283
- d: U(e, t, n, r, i),
285
+ d: B(e, t, n, r, i),
284
286
  ...a
285
287
  });
286
288
  }
287
- function fe(e) {
289
+ function ve(e) {
288
290
  return Object.values(e).every((t) => t == e.topLeft);
289
291
  }
290
- function U(e, t, n, r, i) {
292
+ function B(e, t, n, r, i) {
291
293
  let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
292
294
  return [
293
- `M ${G(e + s, t)}`,
295
+ `M ${H(e + s, t)}`,
294
296
  `H ${j(a - c)}`,
295
- W(c, a, t + c, a, t),
297
+ V(c, a, t + c, a, t),
296
298
  `V ${j(o - l)}`,
297
- W(l, a - l, o, a, o),
299
+ V(l, a - l, o, a, o),
298
300
  `H ${j(e + u)}`,
299
- W(u, e, o - u, e, o),
301
+ V(u, e, o - u, e, o),
300
302
  `V ${j(t + s)}`,
301
- W(s, e + s, t, e, t),
303
+ V(s, e + s, t, e, t),
302
304
  "Z"
303
305
  ].join(" ");
304
306
  }
305
- function W(e, t, n, r, i) {
306
- return e ? `A ${j(e)} ${j(e)} 0 0 1 ${G(t, n)}` : `L ${G(r, i)}`;
307
+ function V(e, t, n, r, i) {
308
+ return e ? `A ${j(e)} ${j(e)} 0 0 1 ${H(t, n)}` : `L ${H(r, i)}`;
307
309
  }
308
- function G(e, t) {
310
+ function H(e, t) {
309
311
  return `${j(e)} ${j(t)}`;
310
312
  }
311
313
  //#endregion
312
314
  //#region ../core/src/rendering/svg/renderers/rule.js
313
- function K(e, t) {
314
- let n = e, r = E(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = n.properties.strokeDash, d = P(o, {
315
+ function U(e, t) {
316
+ let n = e, r = te(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = n.properties.strokeDash, d = P(o, {
315
317
  stroke: {
316
318
  encoder: l.color,
317
- transform: k
319
+ transform: f
318
320
  },
319
321
  "stroke-opacity": {
320
322
  encoder: l.opacity,
@@ -325,7 +327,7 @@ function K(e, t) {
325
327
  transform: (e) => j(+e)
326
328
  }
327
329
  });
328
- return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), u && (o.setAttribute("stroke-dasharray", u.map(j).join(" ")), o.setAttribute("stroke-dashoffset", "" + j(n.properties.strokeDashOffset))), te(n, r, {
330
+ return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), u && (o.setAttribute("stroke-dasharray", u.map(j).join(" ")), o.setAttribute("stroke-dashoffset", "" + j(n.properties.strokeDashOffset))), ie(n, r, {
329
331
  coords: i,
330
332
  data: a,
331
333
  visibleBounds: c
@@ -341,11 +343,11 @@ function K(e, t) {
341
343
  }
342
344
  //#endregion
343
345
  //#region ../core/src/rendering/svg/renderers/text.js
344
- function pe(e, t) {
345
- let n = e, r = n.properties, i = S(n), { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l, anchorCullBounds: u } = t, d = n.encoders, f = P(s, {
346
+ function ye(e, t) {
347
+ let n = e, r = n.properties, i = w(n), { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l, anchorCullBounds: u } = t, d = n.encoders, p = P(s, {
346
348
  fill: {
347
349
  encoder: d.color,
348
- transform: k
350
+ transform: f
349
351
  },
350
352
  "fill-opacity": {
351
353
  encoder: d.opacity,
@@ -356,8 +358,8 @@ function pe(e, t) {
356
358
  transform: (e) => j(+e)
357
359
  }
358
360
  });
359
- s.setAttribute("font-family", ne(r.font)), s.setAttribute("font-style", r.fontStyle ?? "normal"), s.setAttribute("font-weight", "" + ee(r.fontWeight ?? "normal")), s.setAttribute("text-anchor", me[i.align]);
360
- let p = {
361
+ s.setAttribute("font-family", ae(r.font)), s.setAttribute("font-style", r.fontStyle ?? "normal"), s.setAttribute("font-weight", "" + re(r.fontWeight ?? "normal")), s.setAttribute("text-anchor", W[i.align]);
362
+ let m = {
361
363
  top: {
362
364
  width: g(n, r.viewportEdgeFadeWidthTop),
363
365
  distance: g(n, r.viewportEdgeFadeDistanceTop)
@@ -374,7 +376,7 @@ function pe(e, t) {
374
376
  width: g(n, r.viewportEdgeFadeWidthLeft),
375
377
  distance: g(n, r.viewportEdgeFadeDistanceLeft)
376
378
  }
377
- }, m = h(n, i, {
379
+ }, h = y(n, i, {
378
380
  coords: a,
379
381
  data: o,
380
382
  visibleBounds: l,
@@ -388,12 +390,12 @@ function pe(e, t) {
388
390
  let r = N("text", {
389
391
  x: 0,
390
392
  y: 0,
391
- dy: T("middle", 1),
393
+ dy: O("middle", 1),
392
394
  "text-anchor": "middle",
393
395
  lengthAdjust: "spacingAndGlyphs",
394
396
  textLength: 1,
395
397
  transform: n.join(" "),
396
- ...f(e.datum),
398
+ ...p(e.datum),
397
399
  "font-size": 1
398
400
  });
399
401
  r.textContent = e.text, s.appendChild(r);
@@ -403,73 +405,73 @@ function pe(e, t) {
403
405
  x: n,
404
406
  y: r,
405
407
  dx: j(e.dx),
406
- dy: j(e.dy + T(i.baseline, e.size)),
408
+ dy: j(e.dy + O(i.baseline, e.size)),
407
409
  lengthAdjust: "spacingAndGlyphs",
408
410
  textLength: j(e.width),
409
- ...f(e.datum),
411
+ ...p(e.datum),
410
412
  ...e.scale == 1 ? {} : { "font-size": j(e.size) },
411
413
  ...e.fadeOpacity == 1 ? {} : { opacity: A(e.fadeOpacity) }
412
414
  });
413
415
  a.textContent = e.text, e.angle && a.setAttribute("transform", `rotate(${j(e.angle)} ${n} ${r})`), s.appendChild(a);
414
416
  });
415
417
  if (!t.countOnly && s.childElementCount > 0) {
416
- let e = t.getViewportEdgeFadeMaskUrl(p);
418
+ let e = t.getViewportEdgeFadeMaskUrl(m);
417
419
  e && s.setAttribute("mask", e);
418
420
  }
419
- return m;
421
+ return h;
420
422
  }
421
- var me = {
423
+ var W = {
422
424
  left: "start",
423
425
  center: "middle",
424
426
  right: "end"
425
- }, q = 64;
426
- function he(e, t) {
427
- let n = _e(e.unitView);
427
+ }, G = 64;
428
+ function be(e, t) {
429
+ let n = Se(e.unitView);
428
430
  if (!n) return;
429
431
  let r = e.unitView.getScaleResolution(n.channel)?.getScale();
430
- if (!r || !a(r.type)) return;
431
- let { coords: i, data: o, group: s, viewOpacity: c, visibleBounds: l } = t;
432
- if (!o.length) return 0;
433
- let u = e.encoders, d = n.channel == "stroke" ? u.stroke : u.fill, f = ve(e.unitView.spec.encoding.x), m = Infinity, h = Infinity, g = -Infinity, _ = -Infinity, v = o.map((e) => {
434
- let [t, n] = ie(i, u, e), [r, a] = ae(i, u, e);
435
- return m = Math.min(m, t, n), h = Math.min(h, r, a), g = Math.max(g, t, n), _ = Math.max(_, r, a), {
432
+ if (!r || !s(r.type)) return;
433
+ let { coords: i, data: a, group: o, viewOpacity: c, visibleBounds: l } = t;
434
+ if (!a.length) return 0;
435
+ let u = e.encoders, d = n.channel == "stroke" ? u.stroke : u.fill, m = Ce(e.unitView.spec.encoding.x), h = Infinity, g = Infinity, _ = -Infinity, v = -Infinity, y = a.map((e) => {
436
+ let [t, n] = ee(i, u, e), [r, a] = ce(i, u, e);
437
+ return h = Math.min(h, t, n), g = Math.min(g, r, a), _ = Math.max(_, t, n), v = Math.max(v, r, a), {
436
438
  offset: Number(e.position),
437
- color: k(d(e))
439
+ color: f(d(e))
438
440
  };
439
441
  }).sort((e, t) => e.offset - t.offset);
440
- if (!p(l, m, h, g, _)) return 0;
441
- if (t.countOnly) return o.length;
442
- let y = ge(v), b = [
442
+ if (!p(l, h, g, _, v)) return 0;
443
+ if (t.countOnly) return a.length;
444
+ let b = xe(y), x = [
443
445
  {
444
446
  offset: 0,
445
- color: y[0].color
447
+ color: b[0].color
446
448
  },
447
- ...y,
449
+ ...b,
448
450
  {
449
451
  offset: 1,
450
- color: y.at(-1).color
452
+ color: b.at(-1).color
451
453
  }
452
- ], x = t.getLegendGradientUrl({
453
- x1: m,
454
- y1: f ? h : _,
455
- x2: f ? g : m,
456
- y2: h,
457
- stops: b
458
- }), S = j(m), C = j(h), w = j(g), T = j(_), E = Number(u.fillOpacity(o[0])) * c;
459
- return s.appendChild(N("rect", {
460
- x: S,
461
- y: C,
462
- width: j(w - S),
463
- height: j(T - C),
464
- fill: x,
465
- "fill-opacity": A(E),
454
+ ], S = t.getLegendGradientUrl({
455
+ x1: h,
456
+ y1: m ? g : v,
457
+ x2: m ? _ : h,
458
+ y2: g,
459
+ stops: x
460
+ }), C = j(h), w = j(g), T = j(_), E = j(v), D = Number(u.fillOpacity(a[0])) * c;
461
+ return o.appendChild(N("rect", {
462
+ x: C,
463
+ y: w,
464
+ width: j(T - C),
465
+ height: j(E - w),
466
+ fill: S,
467
+ "fill-opacity": A(D),
466
468
  stroke: "none"
467
- })), o.length;
469
+ })), a.length;
468
470
  }
469
- function ge(e) {
470
- return e.length <= q ? e : Array.from({ length: q }, (t, n) => e[Math.round(n * (e.length - 1) / (q - 1))]);
471
+ function xe(e) {
472
+ return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) / (G - 1))]);
471
473
  }
472
- function _e(e) {
474
+ function Se(e) {
473
475
  let t = e;
474
476
  for (; t;) {
475
477
  let e = t.spec.data;
@@ -477,32 +479,32 @@ function _e(e) {
477
479
  t = t.dataParent;
478
480
  }
479
481
  }
480
- function ve(e) {
482
+ function Ce(e) {
481
483
  return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
482
484
  }
483
485
  //#endregion
484
486
  //#region ../core/src/rendering/svg/renderers/index.js
485
- var ye = /* @__PURE__ */ new Map([
486
- ["arrow", oe],
487
- ["link", le],
488
- ["point", L],
489
- ["rect", V],
490
- ["rule", K],
491
- ["text", pe],
492
- ["tick", K]
487
+ var we = /* @__PURE__ */ new Map([
488
+ ["arrow", le],
489
+ ["link", fe],
490
+ ["point", he],
491
+ ["rect", _e],
492
+ ["rule", U],
493
+ ["text", ye],
494
+ ["tick", U]
493
495
  ]);
494
- function be(e, t) {
496
+ function Te(e, t) {
495
497
  if (e.getType() == "rect") {
496
- let n = he(e, t);
498
+ let n = be(e, t);
497
499
  if (n !== void 0) return n;
498
500
  }
499
- let n = ye.get(e.getType());
501
+ let n = we.get(e.getType());
500
502
  if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
501
503
  return n(e, t);
502
504
  }
503
505
  //#endregion
504
506
  //#region ../core/src/rendering/svg/rectHatchPattern.js
505
- function xe(e, t) {
507
+ function Ee(e, t) {
506
508
  let n = t.strokeWidth, r = [
507
509
  "dots",
508
510
  "rings",
@@ -536,9 +538,9 @@ function xe(e, t) {
536
538
  "stroke-width": j(s),
537
539
  "stroke-linecap": "square"
538
540
  });
539
- return Se(d, t.type, o, s), u.appendChild(d), u;
541
+ return De(d, t.type, o, s), u.appendChild(d), u;
540
542
  }
541
- function Se(e, t, n, r) {
543
+ function De(e, t, n, r) {
542
544
  let i = (t) => e.appendChild(N("path", { d: t })), a = (e) => j(e), o = (e) => {
543
545
  for (let t of [
544
546
  -n,
@@ -581,18 +583,18 @@ function Se(e, t, n, r) {
581
583
  }
582
584
  //#endregion
583
585
  //#region ../core/src/rendering/svg/linkArcFadeMask.js
584
- var J = 4;
585
- function Ce(e, t, n) {
586
+ var K = 4;
587
+ function Oe(e, t, n) {
586
588
  let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
587
589
  if (a == 0) return;
588
590
  let o = -i / a, s = r / a;
589
591
  (o < 0 || o == 0 && s < 0) && (o = -o, s = -s);
590
592
  let c = o * e[0] + s * e[1], [l, u] = n, d = JSON.stringify([
591
- Y(o, 6),
592
- Y(s, 6),
593
- Y(c, 1),
594
- Y(l, 1),
595
- Y(u, 1)
593
+ q(o, 6),
594
+ q(s, 6),
595
+ q(c, 1),
596
+ q(l, 1),
597
+ q(u, 1)
596
598
  ]);
597
599
  return {
598
600
  normalX: o,
@@ -603,7 +605,7 @@ function Ce(e, t, n) {
603
605
  key: d
604
606
  };
605
607
  }
606
- function we(e, t, n, r) {
608
+ function ke(e, t, n, r) {
607
609
  let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = N("linearGradient", {
608
610
  id: d,
609
611
  gradientUnits: "userSpaceOnUse",
@@ -613,10 +615,10 @@ function we(e, t, n, r) {
613
615
  y2: j(u + a * c),
614
616
  spreadMethod: "pad"
615
617
  });
616
- for (let { offset: e, opacity: t } of Te(s, c)) f.appendChild(N("stop", {
617
- offset: Y(e, 3),
618
+ for (let { offset: e, opacity: t } of Ae(s, c)) f.appendChild(N("stop", {
619
+ offset: q(e, 3),
618
620
  "stop-color": "white",
619
- "stop-opacity": Y(t, 3)
621
+ "stop-opacity": q(t, 3)
620
622
  }));
621
623
  let p = N("mask", {
622
624
  id: e,
@@ -637,29 +639,29 @@ function we(e, t, n, r) {
637
639
  mask: p
638
640
  };
639
641
  }
640
- function Te(e, t) {
642
+ function Ae(e, t) {
641
643
  let n = [], r = (r) => {
642
- for (let i = 0; i <= J; i++) {
643
- let a = i / J, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
644
+ for (let i = 0; i <= K; i++) {
645
+ let a = i / K, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
644
646
  n.push({
645
647
  offset: s,
646
- opacity: 1 - Ee(c)
648
+ opacity: 1 - je(c)
647
649
  });
648
650
  }
649
651
  };
650
652
  return r(!0), r(!1), n;
651
653
  }
652
- function Ee(e) {
654
+ function je(e) {
653
655
  let t = Math.max(0, Math.min(1, e));
654
656
  return t * t * (3 - 2 * t);
655
657
  }
656
- function Y(e, t) {
658
+ function q(e, t) {
657
659
  let n = 10 ** t;
658
660
  return Math.round(e * n) / n;
659
661
  }
660
662
  //#endregion
661
663
  //#region ../core/src/rendering/svg/svgViewRenderingContext.js
662
- var X = class extends l {
664
+ var J = class extends u {
663
665
  #e;
664
666
  #t;
665
667
  #n = [];
@@ -672,20 +674,21 @@ var X = class extends l {
672
674
  #l = /* @__PURE__ */ new Set();
673
675
  #u = !1;
674
676
  #d = /* @__PURE__ */ new Map();
675
- #f = N("g");
676
- #p;
677
+ #f = new h();
678
+ #p = N("g");
677
679
  #m;
678
- #h = [];
679
- #g;
680
- #_ = 0;
680
+ #h;
681
+ #g = [];
682
+ #_;
681
683
  #v = 0;
682
684
  #y = 0;
683
685
  #b = 0;
684
686
  #x = 0;
685
687
  #S = 0;
686
688
  #C = 0;
689
+ #w = 0;
687
690
  constructor(e, t) {
688
- super(e), this.width = t.width, this.height = t.height, this.#m = t.maxVectorInstances;
691
+ super(e), this.width = t.width, this.height = t.height, this.#h = t.maxVectorInstances;
689
692
  let n = j(t.width), r = j(t.height);
690
693
  this.#e = N("svg", {
691
694
  xmlns: M,
@@ -714,13 +717,13 @@ var X = class extends l {
714
717
  return new Map(this.#d);
715
718
  }
716
719
  getRasterRuns() {
717
- this.#T();
718
- for (let e of this.#h) e.image || this.#E(e);
719
- return this.#h;
720
+ this.#E();
721
+ for (let e of this.#g) e.image || this.#D(e);
722
+ return this.#g;
720
723
  }
721
724
  beginSampleFacetBatch() {
722
- if (this.#p) throw Error("Nested sample facet batches are not supported.");
723
- this.#p = {
725
+ if (this.#m) throw Error("Nested sample facet batches are not supported.");
726
+ this.#m = {
724
727
  viewGroups: /* @__PURE__ */ new WeakMap(),
725
728
  markGroups: /* @__PURE__ */ new WeakMap(),
726
729
  markGroupElements: /* @__PURE__ */ new Set(),
@@ -728,14 +731,14 @@ var X = class extends l {
728
731
  };
729
732
  }
730
733
  endSampleFacetBatch() {
731
- let e = this.#p;
734
+ let e = this.#m;
732
735
  if (!e) throw Error("No sample facet batch is active.");
733
736
  for (let t of e.markGroupElements) t.childElementCount || t.remove();
734
- this.#p = void 0;
737
+ this.#m = void 0;
735
738
  }
736
739
  pushView(e, t) {
737
740
  let n = e.getPathString();
738
- if (r(this.#n)?.exportExcluded || i(e) && e.name.startsWith("scrollbar-")) {
741
+ if (i(this.#n)?.exportExcluded || o(e) && e.name.startsWith("scrollbar-")) {
739
742
  this.#n.push({
740
743
  view: e,
741
744
  node: this.currentNode,
@@ -753,21 +756,21 @@ var X = class extends l {
753
756
  });
754
757
  return;
755
758
  }
756
- let a = this.#p, o = a?.viewGroups.get(e);
757
- if (o) {
758
- if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${n}`);
759
+ let r = this.#m, a = r?.viewGroups.get(e);
760
+ if (a) {
761
+ if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${n}`);
759
762
  } else {
760
- o = N("g", {
761
- id: De(e.name, this.#_++),
763
+ a = N("g", {
764
+ id: Me(e.name, this.#v++),
762
765
  "data-name": e.name,
763
766
  "data-view-path": n
764
767
  });
765
768
  let t = N("title");
766
- t.textContent = n, o.appendChild(t), this.currentNode.appendChild(o), a?.viewGroups.set(e, o);
769
+ t.textContent = n, a.appendChild(t), this.currentNode.appendChild(a), r?.viewGroups.set(e, a);
767
770
  }
768
771
  this.#n.push({
769
772
  view: e,
770
- node: o,
773
+ node: a,
771
774
  coords: t,
772
775
  exportExcluded: !1
773
776
  });
@@ -775,26 +778,26 @@ var X = class extends l {
775
778
  popView(e) {
776
779
  if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
777
780
  }
778
- renderMark(e, t) {
779
- if (r(this.#n)?.exportExcluded || e.unitView.getEffectiveOpacity() <= 0) return;
780
- let n = o(t), i = s(n, e.properties.clip, this.currentCoords), a = u(this.width, this.height, i);
781
- if (!O(a)) return;
781
+ renderMark(e, n) {
782
+ if (i(this.#n)?.exportExcluded || e.unitView.getEffectiveOpacity() <= 0) return;
783
+ let a = t(n), o = r(a, e.properties.clip, this.currentCoords), s = _(this.width, this.height, o);
784
+ if (!m(s)) return;
782
785
  let c = this.getVisibleInstanceCount(e);
783
- if (!this.#u && this.#m != null && c == 0) return;
784
- if (!this.#u && this.#m != null && c > this.#m) {
785
- this.#w(e, a);
786
+ if (!this.#u && this.#h != null && c == 0) return;
787
+ if (!this.#u && this.#h != null && c > this.#h) {
788
+ this.#T(e, s);
786
789
  return;
787
790
  }
788
- let l = !this.#u && this.#p != null, p = l ? this.getClipPathUrl(i) : void 0, m = l ? this.#p.markGroups.get(e)?.get(p ?? "") : void 0;
789
- !this.#u && !m && this.#T();
790
- let h = this.#u ? this.#f : this.#D(e, p), g = f(this.currentCoords, n, e.properties.cullByVisibleRange);
791
- if (d(e, t, this.currentCoords, (t, n) => {
792
- let r = be(e, {
791
+ let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, d = l ? this.#m.markGroups.get(e)?.get(u ?? "") : void 0;
792
+ !this.#u && !d && this.#E();
793
+ let f = this.#u ? this.#p : this.#O(e, u), p = se(this.currentCoords, a, e.properties.cullByVisibleRange);
794
+ if (T(e, n, this.currentCoords, this.#f, (t, n) => {
795
+ let r = Te(e, {
793
796
  coords: t,
794
797
  data: n,
795
- group: h,
796
- visibleBounds: a,
797
- anchorCullBounds: g,
798
+ group: f,
799
+ visibleBounds: s,
800
+ anchorCullBounds: p,
798
801
  viewOpacity: e.unitView.getEffectiveOpacity(),
799
802
  countOnly: this.#u,
800
803
  getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
@@ -808,19 +811,19 @@ var X = class extends l {
808
811
  }
809
812
  });
810
813
  this.#u && this.#d.set(e, this.getVisibleInstanceCount(e) + r);
811
- }, (t) => this.#l.add(`SVG export could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`)), !this.#u && !l && h.childElementCount > 0) {
812
- let e = this.getClipPathUrl(i);
813
- e && h.setAttribute("clip-path", e), this.currentNode.appendChild(h);
814
+ }, (t) => this.#l.add(`SVG export could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`)), !this.#u && !l && f.childElementCount > 0) {
815
+ let e = this.getClipPathUrl(o);
816
+ e && f.setAttribute("clip-path", e), this.currentNode.appendChild(f);
814
817
  }
815
818
  }
816
- #w(e, t) {
817
- let n = this.#p?.rasterRuns.get(e);
819
+ #T(e, t) {
820
+ let n = this.#m?.rasterRuns.get(e);
818
821
  if (n) {
819
- Z(n.bounds, t), n.viewNodes.add(this.currentNode);
822
+ Y(n.bounds, t), n.viewNodes.add(this.currentNode);
820
823
  return;
821
824
  }
822
- let r = this.#g;
823
- if (r) Z(r.bounds, t);
825
+ let r = this.#_;
826
+ if (r) Y(r.bounds, t);
824
827
  else {
825
828
  let e = document.createComment("raster-run");
826
829
  this.currentNode.appendChild(e), r = {
@@ -830,31 +833,31 @@ var X = class extends l {
830
833
  anchor: e,
831
834
  bounds: { ...t },
832
835
  image: void 0
833
- }, this.#g = r;
836
+ }, this.#_ = r;
834
837
  }
835
838
  r.marks.add(e), r.targets.push({
836
839
  mark: e,
837
840
  instanceCount: this.getVisibleInstanceCount(e)
838
- }), r.viewNodes.add(this.currentNode), this.#p?.rasterRuns.set(e, r);
841
+ }), r.viewNodes.add(this.currentNode), this.#m?.rasterRuns.set(e, r);
839
842
  }
840
- #T() {
841
- let e = this.#g;
842
- e && (this.#h.push(e), this.#g = void 0);
843
+ #E() {
844
+ let e = this.#_;
845
+ e && (this.#g.push(e), this.#_ = void 0);
843
846
  }
844
- #E(e) {
845
- let t = Oe(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = N("g", {
846
- id: `rasterized-${n.join("-")}-${this.#C++}`,
847
+ #D(e) {
848
+ let t = Ne(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = N("g", {
849
+ id: `rasterized-${n.join("-")}-${this.#w++}`,
847
850
  "data-name": `Rasterized ${n.join(", ")}`,
848
851
  "data-rasterized": ""
849
852
  }), i = N("image", { preserveAspectRatio: "none" });
850
853
  r.appendChild(i);
851
854
  let a = e.anchor.parentNode;
852
- t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, ke(a, t)), e.anchor.remove();
853
- for (let n of e.viewNodes) Ae(n, t);
855
+ t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Pe(a, t)), e.anchor.remove();
856
+ for (let n of e.viewNodes) Fe(n, t);
854
857
  e.image = i;
855
858
  }
856
- #D(e, t) {
857
- let n = this.#p;
859
+ #O(e, t) {
860
+ let n = this.#m;
858
861
  if (!n) return N("g", { "data-mark-type": e.getType() });
859
862
  let r = n.markGroups.get(e);
860
863
  r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
@@ -873,7 +876,7 @@ var X = class extends l {
873
876
  e.clipY ? t.height : this.height
874
877
  ].map(j), r = n.join(","), i = this.#r.get(r);
875
878
  if (!i) {
876
- i = "clip-" + this.#v++;
879
+ i = "clip-" + this.#y++;
877
880
  let e = N("clipPath", {
878
881
  id: i,
879
882
  clipPathUnits: "userSpaceOnUse"
@@ -894,7 +897,7 @@ var X = class extends l {
894
897
  r
895
898
  ].join(","), a = this.#a.get(i);
896
899
  if (!a) {
897
- a = "shadow-" + this.#b++;
900
+ a = "shadow-" + this.#x++;
898
901
  let e = N("filter", {
899
902
  id: a,
900
903
  x: 0,
@@ -921,7 +924,7 @@ var X = class extends l {
921
924
  getShadowClipPathUrl(e) {
922
925
  let t = this.#o.get(e);
923
926
  if (!t) {
924
- t = "shadow-clip-" + this.#v++;
927
+ t = "shadow-clip-" + this.#y++;
925
928
  let n = N("clipPath", {
926
929
  id: t,
927
930
  clipPathUnits: "userSpaceOnUse"
@@ -943,10 +946,10 @@ var X = class extends l {
943
946
  A(e.strokeOpacity),
944
947
  A(e.strokeWidth)
945
948
  ]), n = this.#s.get(t);
946
- return n || (n = "rect-hatch-" + this.#x++, this.#t.appendChild(xe(n, e)), this.#s.set(t, n)), `url(#${n})`;
949
+ return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Ee(n, e)), this.#s.set(t, n)), `url(#${n})`;
947
950
  }
948
951
  getLegendGradientUrl(e) {
949
- let t = "legend-gradient-" + this.#S++, n = N("linearGradient", {
952
+ let t = "legend-gradient-" + this.#C++, n = N("linearGradient", {
950
953
  id: t,
951
954
  gradientUnits: "userSpaceOnUse",
952
955
  x1: j(e.x1),
@@ -961,12 +964,12 @@ var X = class extends l {
961
964
  return this.#t.appendChild(n), `url(#${t})`;
962
965
  }
963
966
  getLinkArcFadeMaskUrl(e) {
964
- let t = Ce(e.p1, e.p4, e.distances);
967
+ let t = Oe(e.p1, e.p4, e.distances);
965
968
  if (!t) return;
966
969
  let n = this.#c.get(t.key);
967
970
  if (!n) {
968
- n = "link-arc-fade-" + this.#y++;
969
- let { gradient: e, mask: r } = we(n, this.width, this.height, t);
971
+ n = "link-arc-fade-" + this.#b++;
972
+ let { gradient: e, mask: r } = ke(n, this.width, this.height, t);
970
973
  this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
971
974
  }
972
975
  return `url(#${n})`;
@@ -974,37 +977,37 @@ var X = class extends l {
974
977
  getViewportEdgeFadeMaskUrl(e) {
975
978
  let t = Object.entries(e).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
976
979
  if (!t.length) return;
977
- let n = r(this.#n);
980
+ let n = i(this.#n);
978
981
  if (!n) throw Error("No current view in SVG rendering context.");
979
- let i = this.#i.get(n.view);
980
- if (!i) {
981
- i = "edge-fade-" + this.#y++;
982
- let e = j(this.width), r = j(this.height), a = N("mask", {
983
- id: i,
982
+ let r = this.#i.get(n.view);
983
+ if (!r) {
984
+ r = "edge-fade-" + this.#b++;
985
+ let e = j(this.width), i = j(this.height), a = N("mask", {
986
+ id: r,
984
987
  x: 0,
985
988
  y: 0,
986
989
  width: e,
987
- height: r,
990
+ height: i,
988
991
  maskUnits: "userSpaceOnUse",
989
992
  maskContentUnits: "userSpaceOnUse",
990
993
  "mask-type": "luminance"
991
994
  });
992
995
  a.appendChild(N("rect", {
993
996
  width: e,
994
- height: r,
997
+ height: i,
995
998
  fill: "white"
996
999
  }));
997
1000
  for (let [o, s] of t) {
998
- let t = i + "-" + o, c = je(t, o, s, n.coords);
1001
+ let t = r + "-" + o, c = Ie(t, o, s, n.coords);
999
1002
  this.#t.appendChild(c), a.appendChild(N("rect", {
1000
1003
  width: e,
1001
- height: r,
1004
+ height: i,
1002
1005
  fill: `url(#${t})`
1003
1006
  }));
1004
1007
  }
1005
- this.#t.appendChild(a), this.#i.set(n.view, i);
1008
+ this.#t.appendChild(a), this.#i.set(n.view, r);
1006
1009
  }
1007
- return `url(#${i})`;
1010
+ return `url(#${r})`;
1008
1011
  }
1009
1012
  getSvg() {
1010
1013
  return this.#e;
@@ -1013,39 +1016,39 @@ var X = class extends l {
1013
1016
  return Array.from(this.#l);
1014
1017
  }
1015
1018
  get currentNode() {
1016
- return r(this.#n)?.node ?? this.#e;
1019
+ return i(this.#n)?.node ?? this.#e;
1017
1020
  }
1018
1021
  get currentCoords() {
1019
- let e = r(this.#n);
1022
+ let e = i(this.#n);
1020
1023
  if (!e) throw Error("No current view in SVG rendering context.");
1021
1024
  return e.coords;
1022
1025
  }
1023
1026
  };
1024
- function De(e, t) {
1027
+ function Me(e, t) {
1025
1028
  let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
1026
1029
  return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
1027
1030
  }
1028
- function Z(e, t) {
1031
+ function Y(e, t) {
1029
1032
  e.x1 = Math.min(e.x1, t.x1), e.y1 = Math.min(e.y1, t.y1), e.x2 = Math.max(e.x2, t.x2), e.y2 = Math.max(e.y2, t.y2);
1030
1033
  }
1031
- function Oe(e) {
1034
+ function Ne(e) {
1032
1035
  let [t, ...n] = Array.from(e), r = t;
1033
1036
  for (; n.some((e) => !r.contains(e));) r = r.parentNode;
1034
1037
  return r;
1035
1038
  }
1036
- function ke(e, t) {
1039
+ function Pe(e, t) {
1037
1040
  let n = e;
1038
1041
  for (; n.parentNode != t;) n = n.parentNode;
1039
1042
  return n;
1040
1043
  }
1041
- function Ae(e, t) {
1044
+ function Fe(e, t) {
1042
1045
  let n = e;
1043
1046
  for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
1044
1047
  let e = n.parentNode;
1045
1048
  n.remove(), n = e;
1046
1049
  }
1047
1050
  }
1048
- function je(e, t, n, r) {
1051
+ function Ie(e, t, n, r) {
1049
1052
  let i = t == "top" ? r.y + n.distance : t == "right" ? r.x2 - n.distance : t == "bottom" ? r.y2 - n.distance : r.x + n.distance, a = t == "left" || t == "right", o = i + (t == "top" || t == "left" ? 1 : -1) * n.width, s = N("linearGradient", {
1050
1053
  id: e,
1051
1054
  gradientUnits: "userSpaceOnUse",
@@ -1066,24 +1069,24 @@ function je(e, t, n, r) {
1066
1069
  }
1067
1070
  //#endregion
1068
1071
  //#region ../core/src/rendering/svg/index.js
1069
- function Q({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white" }) {
1070
- let i = new X({ picking: !1 }, {
1072
+ function X({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white" }) {
1073
+ let i = new J({ picking: !1 }, {
1071
1074
  width: t,
1072
1075
  height: n,
1073
1076
  background: r
1074
1077
  });
1075
- return e.render(i, c.create(0, 0, t, n), { firstFacet: !0 }), {
1078
+ return d(e, l.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(i), {
1076
1079
  svg: i.getSvg(),
1077
1080
  warnings: i.getWarnings()
1078
1081
  };
1079
1082
  }
1080
- function Me({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1081
- let r = new X({ picking: !1 }, {
1083
+ function Le({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1084
+ let r = new J({ picking: !1 }, {
1082
1085
  width: t,
1083
1086
  height: n,
1084
1087
  background: null
1085
1088
  });
1086
- return r.beginInstanceCounting(), e.render(r, c.create(0, 0, t, n), { firstFacet: !0 }), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
1089
+ return r.beginInstanceCounting(), d(e, l.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(r), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
1087
1090
  viewName: e.unitView.name,
1088
1091
  viewTitle: e.unitView.getTitleText(),
1089
1092
  viewPath: e.unitView.getPathString(),
@@ -1091,55 +1094,53 @@ function Me({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1091
1094
  instanceCount: t
1092
1095
  })).filter((e) => e.instanceCount > 0) };
1093
1096
  }
1094
- async function Ne(e) {
1097
+ async function Re(e) {
1095
1098
  let t = e.rasterization;
1096
- if (!t) return {
1097
- ...Q(e),
1098
- rasterized: []
1099
- };
1100
- if ($(t), !e.webGLHelper) {
1101
- let t = Q(e);
1102
- return {
1103
- ...t,
1104
- warnings: [...t.warnings, "SVG rasterization was requested but no WebGL context is available; exported all marks as vectors."],
1105
- rasterized: []
1106
- };
1107
- }
1108
- return Pe({
1099
+ return t ? ($(t), e.rasterizeSvgRuns ? Z({
1109
1100
  ...e,
1110
- webGLHelper: e.webGLHelper,
1101
+ rasterizeSvgRuns: e.rasterizeSvgRuns,
1111
1102
  maxVectorInstances: t.maxVectorInstances,
1112
1103
  pixelRatio: t.pixelRatio
1113
- });
1104
+ }) : Q(e)) : {
1105
+ ...X(e),
1106
+ rasterized: []
1107
+ };
1114
1108
  }
1115
- async function Pe({ viewRoot: e, webGLHelper: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: a, pixelRatio: o = 2 }) {
1109
+ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: a, pixelRatio: o = 2 }) {
1116
1110
  $({
1117
1111
  maxVectorInstances: a,
1118
1112
  pixelRatio: o
1119
1113
  });
1120
- let s = new X({ picking: !1 }, {
1114
+ let s = new J({ picking: !1 }, {
1121
1115
  width: n,
1122
1116
  height: r,
1123
1117
  background: i,
1124
1118
  maxVectorInstances: a
1125
- }), l = c.create(0, 0, n, r);
1126
- s.beginInstanceCounting(), e.render(s, l, { firstFacet: !0 }), s.endInstanceCounting(), e.render(s, l, { firstFacet: !0 });
1127
- let u = s.getRasterRuns();
1128
- if (u.length) {
1129
- let { rasterizeSvgRuns: i } = await import("./webgl-Ci6ZhCCf.js");
1130
- i({
1131
- runs: u,
1119
+ }), u = d(e, l.create(0, 0, n, r), { renderingOptions: { firstFacet: !0 } });
1120
+ s.beginInstanceCounting(), u.collectRenderCommands(s), s.endInstanceCounting(), u.collectRenderCommands(s);
1121
+ let f = s.getRasterRuns();
1122
+ if (f.length) try {
1123
+ await t({
1124
+ runs: f,
1132
1125
  viewRoot: e,
1133
- webGLHelper: t,
1126
+ layoutResult: u,
1134
1127
  logicalWidth: n,
1135
1128
  logicalHeight: r,
1136
1129
  pixelRatio: o
1137
1130
  });
1131
+ } catch (t) {
1132
+ if (t instanceof c) return Q({
1133
+ viewRoot: e,
1134
+ logicalWidth: n,
1135
+ logicalHeight: r,
1136
+ background: i
1137
+ });
1138
+ throw t;
1138
1139
  }
1139
1140
  return {
1140
1141
  svg: s.getSvg(),
1141
1142
  warnings: s.getWarnings(),
1142
- rasterized: u.map((e) => ({
1143
+ rasterized: f.map((e) => ({
1143
1144
  targets: e.targets.map((e) => ({
1144
1145
  markType: e.mark.getType(),
1145
1146
  instanceCount: e.instanceCount
@@ -1150,9 +1151,17 @@ async function Pe({ viewRoot: e, webGLHelper: t, logicalWidth: n, logicalHeight:
1150
1151
  }))
1151
1152
  };
1152
1153
  }
1154
+ function Q(e) {
1155
+ let t = X(e);
1156
+ return {
1157
+ ...t,
1158
+ warnings: [...t.warnings, "SVG rasterization was requested but no raster rendering backend is available; exported all marks as vectors."],
1159
+ rasterized: []
1160
+ };
1161
+ }
1153
1162
  function $(e) {
1154
1163
  if (!Number.isInteger(e.maxVectorInstances) || e.maxVectorInstances < 0) throw RangeError("maxVectorInstances must be a non-negative integer.");
1155
1164
  if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
1156
1165
  }
1157
1166
  //#endregion
1158
- export { Me as analyzeSvgExport, Ne as createSvgExport };
1167
+ export { Le as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Re as createSvgExport };