@genome-spy/app 0.86.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/{agentApi-DgopQbMV.js → agentApi-BZ1JCo1N.js} +6994 -6499
  2. package/dist/agentApi.es.js +3057 -3225
  3. package/dist/agentShared.es.js +7 -7
  4. package/dist/{canvas2d-8uxuN_vx.js → canvas2d-B_PnIof-.js} +108 -107
  5. package/dist/{canvas2d-BtQC7Xr8.js → canvas2d-Cafq5v-N.js} +128 -127
  6. package/dist/{clipOptions-taFzEljc.js → clipOptions-D6eh9T-_.js} +1508 -1166
  7. package/dist/{clipOptions-BQfNhxgP.js → clipOptions-H68pJyEZ.js} +1496 -1114
  8. package/dist/{debug-D_VtWQ6l.js → debug-BGzgZmyk.js} +2 -2
  9. package/dist/{debug-Bzc3SoRg.js → debug-UYKZLNh4.js} +2 -2
  10. package/dist/index.es.js +96 -106
  11. package/dist/index.js +399 -392
  12. package/dist/{indexer-qy_dq5l5.js → indexer-Di57GyxX.js} +1 -1
  13. package/dist/{indexer-qiFctgR3.js → indexer-o6Hpg4nN.js} +1 -1
  14. package/dist/nativeText-D9SoxpaD.js +934 -0
  15. package/dist/nativeText-DAjvkrzc.js +934 -0
  16. package/dist/{rasterExport-B8pVoOsj.js → rasterExport-DzldLv6E.js} +1 -1
  17. package/dist/{rasterExport-C4r4xjQT.js → rasterExport-IAbJwi8F.js} +1 -1
  18. package/dist/{renderCanvas2D-BQrRWp2Z.js → renderCanvas2D-BJ93Ptqj.js} +102 -96
  19. package/dist/{renderCanvas2D-CHVNfIUz.js → renderCanvas2D-yJ1IrDcX.js} +103 -97
  20. package/dist/schema.json +10169 -2852
  21. package/dist/{svg-C-Sw6E6G.js → svg-BRpl2Xub.js} +338 -384
  22. package/dist/{svg-CKHwwKRt.js → svg-DJuqHIyc.js} +353 -399
  23. package/dist/{svgRasterizer-BgD72AmG.js → svgRasterizer-CGZQ5njV.js} +1 -1
  24. package/dist/{svgRasterizer-BgSNqI3L.js → svgRasterizer-PAoqLn1j.js} +1 -1
  25. package/dist/{vega-scale-D46-iCaL.js → vega-scale-BGC53c22.js} +887 -1184
  26. package/dist/{vega-scale-CK0_al6O.js → vega-scale-DdW2NzQ3.js} +898 -1195
  27. package/dist/{viewIdentityRegistry-CDtVktJD.js → viewIdentityRegistry-D4p067HU.js} +1 -1
  28. package/dist/{viewIdentityRegistry-B-VGlez1.js → viewIdentityRegistry-Dc2hXYsO.js} +1 -1
  29. package/dist/{viewSelectors-CKfxF_LM.js → viewSelectors-DNXnGwEW.js} +519 -321
  30. package/dist/{viewSelectors-D_imtq5Z.js → viewSelectors-DYYlOt91.js} +584 -386
  31. package/dist/{viewUtils-nCJ7AoaI.js → viewUtils-EdhZTPrJ.js} +2930 -2264
  32. package/dist/{webgl-BaA3jSa2.js → webgl-C53DwzVT.js} +427 -428
  33. package/dist/{webgl-FP-4EsBL.js → webgl-CdgNFlJk.js} +639 -640
  34. package/package.json +5 -5
  35. package/dist/nativeText-DFV5XIx8.js +0 -860
  36. package/dist/nativeText-vT3AWE14.js +0 -860
@@ -1,32 +1,32 @@
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";
8
- import { n as A, t as j } from "./svgNumber-DNxESJQB.js";
1
+ import { an as e, o as t, s as n } from "./clipOptions-H68pJyEZ.js";
2
+ import { v as r } from "./vega-scale-BGC53c22.js";
3
+ import { x as i } from "./viewSelectors-DYYlOt91.js";
4
+ import { t as a } from "./rasterization-CFogVB3B.js";
5
+ import { t as o } from "./rectangle-DKnrAmKs.js";
6
+ import { n as s, t as c } from "./layoutResult-D50MSHXR.js";
7
+ import { A as l, C as u, D as d, E as f, M as p, O as m, S as h, T as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as ee, n as k, o as A, p as te, r as ne, s as re, t as ie, u as ae, v as oe, w as se } from "./nativeText-DAjvkrzc.js";
8
+ import { n as j, t as M } from "./svgNumber-DNxESJQB.js";
9
9
  //#region ../core/src/rendering/svg/svgElement.js
10
- var M = "http://www.w3.org/2000/svg";
11
- function N(e, t) {
12
- let n = document.createElementNS(M, e);
10
+ var N = "http://www.w3.org/2000/svg";
11
+ function P(e, t) {
12
+ let n = document.createElementNS(N, e);
13
13
  if (t) for (let [e, r] of Object.entries(t)) n.setAttribute(e, "" + r);
14
14
  return n;
15
15
  }
16
16
  //#endregion
17
17
  //#region ../core/src/rendering/svg/svgAttributes.js
18
- function P(e, t) {
19
- let n = Object.entries(t).filter(([t, n]) => n.encoder.constant ? (e.setAttribute(t, "" + F(n, {})), !1) : !0);
20
- return (e) => Object.fromEntries(n.map(([t, n]) => [t, F(n, e)]));
21
- }
22
18
  function F(e, t) {
19
+ let n = Object.entries(t).filter(([t, n]) => n.encoder.constant ? (e.setAttribute(t, "" + I(n, {})), !1) : !0);
20
+ return (e) => Object.fromEntries(n.map(([t, n]) => [t, I(n, e)]));
21
+ }
22
+ function I(e, t) {
23
23
  let n = e.encoder(t);
24
24
  return e.transform ? e.transform(n) : "" + n;
25
25
  }
26
26
  //#endregion
27
27
  //#region ../core/src/rendering/svg/renderers/arrow.js
28
- function le(e, t) {
29
- let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, l = P(a, {
28
+ function ce(e, t) {
29
+ let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, l = F(a, {
30
30
  fill: {
31
31
  encoder: c.fill,
32
32
  transform: f
@@ -45,86 +45,78 @@ function le(e, t) {
45
45
  },
46
46
  "stroke-width": {
47
47
  encoder: c.strokeWidth,
48
- transform: (e) => j(+e)
48
+ transform: (e) => M(+e)
49
49
  }
50
50
  });
51
51
  a.setAttribute("stroke-linejoin", "miter");
52
- let u = C(n);
53
- return v(n, u, {
52
+ let u = oe(n);
53
+ return y(n, u, {
54
54
  coords: r,
55
55
  data: i,
56
56
  visibleBounds: s,
57
57
  viewOpacity: o,
58
58
  countOnly: t.countOnly
59
59
  }, (e) => {
60
- t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${u.headShape}" as a triangle.`), a.appendChild(N("path", {
61
- d: e.boundaryLoops.map(ue).join(" "),
60
+ t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${u.headShape}" as a triangle.`), a.appendChild(P("path", {
61
+ d: e.boundaryLoops.map(le).join(" "),
62
62
  ...l(e.datum)
63
63
  })));
64
64
  });
65
65
  }
66
- function ue(e) {
67
- return `M ${e.map(de).join(" L ")} Z`;
66
+ function le(e) {
67
+ return `M ${e.map(ue).join(" L ")} Z`;
68
68
  }
69
- function de(e) {
70
- return `${j(e.x)} ${j(e.y)}`;
69
+ function ue(e) {
70
+ return `${M(e.x)} ${M(e.y)}`;
71
71
  }
72
72
  //#endregion
73
73
  //#region ../core/src/rendering/svg/renderers/link.js
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
+ function de(e, t) {
75
+ let n = e, r = te(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = C(n, r.shape), d = F(o, {
76
76
  stroke: {
77
- encoder: d.color,
77
+ encoder: l.color,
78
78
  transform: f
79
79
  },
80
80
  "stroke-opacity": {
81
- encoder: d.opacity,
82
- transform: (e) => +e * l
81
+ encoder: l.opacity,
82
+ transform: (e) => +e * s
83
83
  },
84
84
  "stroke-width": {
85
- encoder: d.size,
86
- transform: (e) => j(+e)
85
+ encoder: l.size,
86
+ transform: (e) => M(+e)
87
87
  }
88
88
  });
89
- return c.setAttribute("fill", "none"), c.setAttribute("stroke-linecap", "butt"), D(n, a, {
90
- coords: o,
91
- data: s,
92
- visibleBounds: u
89
+ return o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt"), ee(n, r, {
90
+ coords: i,
91
+ data: a,
92
+ visibleBounds: c
93
93
  }, ({ datum: e, points: n }) => {
94
- let [r, o, s, l] = n;
94
+ let [r, i, a, s] = n;
95
95
  if (t.countOnly) return;
96
- let u = m(e);
97
- if (a.shape == "arc" && i !== !1 && i[0] > 0 && i[1] > 0 && !me(e, p)) {
96
+ let c = d(e), l = u(e);
97
+ if (l) {
98
98
  let e = t.getLinkArcFadeMaskUrl({
99
99
  p1: r,
100
- p4: l,
101
- distances: i
100
+ p4: s,
101
+ distances: l
102
102
  });
103
- e && (u.mask = e);
103
+ e && (c.mask = e);
104
104
  }
105
- c.appendChild(N("path", {
106
- d: `M ${I(r)} C ${I(o)} ${I(s)} ${I(l)}`,
107
- ...u
105
+ o.appendChild(P("path", {
106
+ d: `M ${L(r)} C ${L(i)} ${L(a)} ${L(s)}`,
107
+ ...c
108
108
  }));
109
109
  });
110
110
  }
111
- function pe(t, r) {
112
- let i = new Set(Object.values(r).flatMap((e) => e.branches).map((e) => e.predicate?.param).filter((e) => e));
113
- return Array.from(i).map((e) => t.unitView.paramRuntime.findValue(e)).filter((t) => t && (e(t) || n(t)));
114
- }
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));
118
- }
119
- function I(e) {
120
- return e.map(j).join(" ");
111
+ function L(e) {
112
+ return e.map(M).join(" ");
121
113
  }
122
114
  //#endregion
123
115
  //#region ../core/src/rendering/svg/renderers/point.js
124
- function he(e, t) {
116
+ function fe(e, t) {
125
117
  let n = e;
126
118
  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.");
127
- let r = x(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = P(a, {
119
+ let r = x(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = F(a, {
128
120
  fill: {
129
121
  encoder: s.fill,
130
122
  transform: f
@@ -143,47 +135,47 @@ function he(e, t) {
143
135
  },
144
136
  "stroke-width": {
145
137
  encoder: s.strokeWidth,
146
- transform: (e) => j(+e)
138
+ transform: (e) => M(+e)
147
139
  }
148
140
  }), l = R();
149
141
  return S(n, r, t, (e) => {
150
142
  if (t.countOnly) return;
151
143
  let { datum: n, shape: r, x: u, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
152
144
  ...c(n),
153
- ...i && !h ? { "stroke-width": j(m) } : {},
154
- ...h ? ge(s, n, o) : {}
155
- }, _ = L(r, u, d, f, g, l);
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", {
157
- cx: j(u),
158
- cy: j(d),
159
- r: j(f),
145
+ ...i && !h ? { "stroke-width": M(m) } : {},
146
+ ...h ? z(s, n, o) : {}
147
+ }, _ = pe(r, u, d, f, g, l);
148
+ _ ? (p && _.setAttribute("transform", `rotate(${M(p)} ${M(u)} ${M(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(P("circle", {
149
+ cx: M(u),
150
+ cy: M(d),
151
+ r: M(f),
160
152
  ...g
161
153
  })));
162
154
  });
163
155
  }
164
- function L(e, t, n, r, i, a) {
165
- let o = j(t), s = j(n), c = j(r);
166
- if (e == "circle") return N("circle", {
156
+ function pe(e, t, n, r, i, a) {
157
+ let o = M(t), s = M(n), c = M(r);
158
+ if (e == "circle") return P("circle", {
167
159
  cx: o,
168
160
  cy: s,
169
161
  r: c,
170
162
  ...i
171
163
  });
172
- if (e == "square") return N("rect", {
173
- x: j(t - r),
174
- y: j(n - r),
175
- width: j(r * 2),
176
- height: j(r * 2),
164
+ if (e == "square") return P("rect", {
165
+ x: M(t - r),
166
+ y: M(n - r),
167
+ width: M(r * 2),
168
+ height: M(r * 2),
177
169
  ...i
178
170
  });
179
171
  let l = a.build(e, t, n, r);
180
- return l ? N("path", {
172
+ return l ? P("path", {
181
173
  d: l,
182
174
  ...i
183
175
  }) : void 0;
184
176
  }
185
177
  function R() {
186
- let e = "", t = (e, t) => `${j(e)} ${j(t)}`, n = {
178
+ let e = "", t = (e, t) => `${M(e)} ${M(t)}`, n = {
187
179
  moveTo(n, r) {
188
180
  e += `${e ? " M" : "M"} ${t(n, r)}`;
189
181
  },
@@ -195,23 +187,23 @@ function R() {
195
187
  }
196
188
  };
197
189
  return { build(t, r, i, a) {
198
- return e = "", oe(t, r, i, a, n) ? e : void 0;
190
+ return e = "", ae(t, r, i, a, n) ? e : void 0;
199
191
  } };
200
192
  }
201
- function ge(e, t, n) {
202
- let r = e.stroke(t), i = k(e.strokeOpacity, t), a = r == null || i <= 0;
193
+ function z(e, t, n) {
194
+ let r = e.stroke(t), i = h(e.strokeOpacity, t), a = r == null || i <= 0;
203
195
  return {
204
196
  fill: "none",
205
197
  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)),
198
+ "stroke-opacity": (a ? h(e.fillOpacity, t) : i) * n,
199
+ "stroke-width": M(h(e.strokeWidth, t)),
208
200
  "stroke-linecap": "butt"
209
201
  };
210
202
  }
211
203
  //#endregion
212
204
  //#region ../core/src/rendering/svg/renderers/rect.js
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, {
205
+ function B(e, t) {
206
+ let n = e, r = b(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = F(o, {
215
207
  fill: {
216
208
  encoder: c.fill,
217
209
  transform: f
@@ -230,90 +222,90 @@ function _e(e, t) {
230
222
  },
231
223
  "stroke-width": {
232
224
  encoder: c.strokeWidth,
233
- transform: (e) => j(+e)
225
+ transform: (e) => M(+e)
234
226
  }
235
227
  }), u = i.opacity > 0 ? {
236
228
  fill: i.color,
237
229
  "fill-opacity": 1,
238
230
  stroke: i.color,
239
231
  "stroke-opacity": 1,
240
- opacity: A(i.opacity * s),
232
+ opacity: j(i.opacity * s),
241
233
  filter: t.getShadowFilterUrl(i)
242
234
  } : null;
243
- return E(n, r, t, (e) => {
235
+ return O(n, r, t, (e) => {
244
236
  if (t.countOnly) return;
245
- let { datum: n, x: r, y: i, width: d, height: p, radii: m, opacityFactor: h, strokeWidth: g, fill: _, fillOpacity: v } = e, y = {
237
+ let { datum: n, x: r, y: i, width: d, height: p, radii: m, opacityFactor: g, strokeWidth: _, fill: v, fillOpacity: y } = e, b = {
246
238
  ...l(n),
247
- ...h == 1 ? {} : { opacity: A(h) }
239
+ ...g == 1 ? {} : { opacity: j(g) }
248
240
  };
249
- if (a != "none" && g > 0 && (y.fill = t.getRectHatchPatternUrl({
241
+ if (a != "none" && _ > 0 && (b.fill = t.getRectHatchPatternUrl({
250
242
  type: a,
251
243
  fill: f(c.fill(n)),
252
- fillOpacity: k(c.fillOpacity, n) * s,
244
+ fillOpacity: h(c.fillOpacity, n) * s,
253
245
  stroke: f(c.stroke(n)),
254
- strokeOpacity: k(c.strokeOpacity, n) * s,
255
- strokeWidth: g
256
- }), y["fill-opacity"] = 1), u) {
257
- let e = z(r, i, d, p, m, {
246
+ strokeOpacity: h(c.strokeOpacity, n) * s,
247
+ strokeWidth: _
248
+ }), b["fill-opacity"] = 1), u) {
249
+ let e = V(r, i, d, p, m, {
258
250
  ...u,
259
- "stroke-width": j(g)
251
+ "stroke-width": M(_)
260
252
  });
261
- if (a == "none" && _ != "none" && v == 1 && h == 1) o.appendChild(e);
253
+ if (a == "none" && v != "none" && y == 1 && g == 1) o.appendChild(e);
262
254
  else {
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) });
255
+ let n = _ / 2, a = Object.fromEntries(Object.entries(m).map(([e, t]) => [e, t + n])), s = H(r - n, i - n, d + n * 2, p + n * 2, a), c = P("g", { "clip-path": t.getShadowClipPathUrl(s) });
264
256
  c.appendChild(e), o.appendChild(c);
265
257
  }
266
258
  }
267
- o.appendChild(z(r, i, d, p, m, y));
259
+ o.appendChild(V(r, i, d, p, m, b));
268
260
  });
269
261
  }
270
- function z(e, t, n, r, i, a) {
271
- if (ve(i)) {
272
- let o = i.topLeft, s = j(e), c = j(t), l = j(e + n), u = j(t + r);
273
- return N("rect", {
262
+ function V(e, t, n, r, i, a) {
263
+ if (me(i)) {
264
+ let o = i.topLeft, s = M(e), c = M(t), l = M(e + n), u = M(t + r);
265
+ return P("rect", {
274
266
  x: s,
275
267
  y: c,
276
- width: j(l - s),
277
- height: j(u - c),
268
+ width: M(l - s),
269
+ height: M(u - c),
278
270
  ...o ? {
279
- rx: j(o),
280
- ry: j(o)
271
+ rx: M(o),
272
+ ry: M(o)
281
273
  } : {},
282
274
  ...a
283
275
  });
284
- } else return N("path", {
285
- d: B(e, t, n, r, i),
276
+ } else return P("path", {
277
+ d: H(e, t, n, r, i),
286
278
  ...a
287
279
  });
288
280
  }
289
- function ve(e) {
281
+ function me(e) {
290
282
  return Object.values(e).every((t) => t == e.topLeft);
291
283
  }
292
- function B(e, t, n, r, i) {
284
+ function H(e, t, n, r, i) {
293
285
  let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
294
286
  return [
295
- `M ${H(e + s, t)}`,
296
- `H ${j(a - c)}`,
297
- V(c, a, t + c, a, t),
298
- `V ${j(o - l)}`,
299
- V(l, a - l, o, a, o),
300
- `H ${j(e + u)}`,
301
- V(u, e, o - u, e, o),
302
- `V ${j(t + s)}`,
303
- V(s, e + s, t, e, t),
287
+ `M ${W(e + s, t)}`,
288
+ `H ${M(a - c)}`,
289
+ U(c, a, t + c, a, t),
290
+ `V ${M(o - l)}`,
291
+ U(l, a - l, o, a, o),
292
+ `H ${M(e + u)}`,
293
+ U(u, e, o - u, e, o),
294
+ `V ${M(t + s)}`,
295
+ U(s, e + s, t, e, t),
304
296
  "Z"
305
297
  ].join(" ");
306
298
  }
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)}`;
299
+ function U(e, t, n, r, i) {
300
+ return e ? `A ${M(e)} ${M(e)} 0 0 1 ${W(t, n)}` : `L ${W(r, i)}`;
309
301
  }
310
- function H(e, t) {
311
- return `${j(e)} ${j(t)}`;
302
+ function W(e, t) {
303
+ return `${M(e)} ${M(t)}`;
312
304
  }
313
305
  //#endregion
314
306
  //#region ../core/src/rendering/svg/renderers/rule.js
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, {
307
+ function G(e, t) {
308
+ let n = e, r = A(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = n.properties.strokeDash, d = F(o, {
317
309
  stroke: {
318
310
  encoder: l.color,
319
311
  transform: f
@@ -324,27 +316,27 @@ function U(e, t) {
324
316
  },
325
317
  "stroke-width": {
326
318
  encoder: l.size,
327
- transform: (e) => j(+e)
319
+ transform: (e) => M(+e)
328
320
  }
329
321
  });
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, {
322
+ return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), u && (o.setAttribute("stroke-dasharray", u.map(M).join(" ")), o.setAttribute("stroke-dashoffset", "" + M(n.properties.strokeDashOffset))), re(n, r, {
331
323
  coords: i,
332
324
  data: a,
333
325
  visibleBounds: c
334
326
  }, (e) => {
335
- t.countOnly || o.appendChild(N("line", {
336
- x1: j(e.x1),
337
- y1: j(e.y1),
338
- x2: j(e.x2),
339
- y2: j(e.y2),
327
+ t.countOnly || o.appendChild(P("line", {
328
+ x1: M(e.x1),
329
+ y1: M(e.y1),
330
+ x2: M(e.x2),
331
+ y2: M(e.y2),
340
332
  ...d(e.datum)
341
333
  }));
342
334
  });
343
335
  }
344
336
  //#endregion
345
337
  //#region ../core/src/rendering/svg/renderers/text.js
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, {
338
+ function he(e, t) {
339
+ let n = e, r = n.properties, i = T(n), { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l, anchorCullBounds: u } = t, d = n.encoders, p = F(s, {
348
340
  fill: {
349
341
  encoder: d.color,
350
342
  transform: f
@@ -355,10 +347,10 @@ function ye(e, t) {
355
347
  },
356
348
  "font-size": {
357
349
  encoder: d.size,
358
- transform: (e) => j(+e)
350
+ transform: (e) => M(+e)
359
351
  }
360
352
  });
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]);
353
+ s.setAttribute("font-family", ie(r.font)), s.setAttribute("font-style", r.fontStyle ?? "normal"), s.setAttribute("font-weight", "" + ne(r.fontWeight ?? "normal")), s.setAttribute("text-anchor", ge[i.align]);
362
354
  let m = {
363
355
  top: {
364
356
  width: g(n, r.viewportEdgeFadeWidthTop),
@@ -376,7 +368,7 @@ function ye(e, t) {
376
368
  width: g(n, r.viewportEdgeFadeWidthLeft),
377
369
  distance: g(n, r.viewportEdgeFadeDistanceLeft)
378
370
  }
379
- }, h = y(n, i, {
371
+ }, h = v(n, i, {
380
372
  coords: a,
381
373
  data: o,
382
374
  visibleBounds: l,
@@ -385,12 +377,12 @@ function ye(e, t) {
385
377
  if (t.countOnly) return;
386
378
  if (e.logoScale) {
387
379
  e.multiCharacterLogo && t.warn("SVG export stretches multi-character logo text as a single glyph cell.");
388
- let n = [`translate(${j(e.x)} ${j(e.y)})`];
389
- e.angle && n.push(`rotate(${j(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${j(e.dx)} ${j(e.dy)})`), n.push(`scale(${j(e.logoScale.width)} ${j(e.logoScale.heightScale)})`);
390
- let r = N("text", {
380
+ let n = [`translate(${M(e.x)} ${M(e.y)})`];
381
+ e.angle && n.push(`rotate(${M(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${M(e.dx)} ${M(e.dy)})`), n.push(`scale(${M(e.logoScale.width)} ${M(e.logoScale.heightScale)})`);
382
+ let r = P("text", {
391
383
  x: 0,
392
384
  y: 0,
393
- dy: O("middle", 1),
385
+ dy: k("middle", 1),
394
386
  "text-anchor": "middle",
395
387
  lengthAdjust: "spacingAndGlyphs",
396
388
  textLength: 1,
@@ -401,18 +393,18 @@ function ye(e, t) {
401
393
  r.textContent = e.text, s.appendChild(r);
402
394
  return;
403
395
  }
404
- let n = j(e.x), r = j(e.y), a = N("text", {
396
+ let n = M(e.x), r = M(e.y), a = P("text", {
405
397
  x: n,
406
398
  y: r,
407
- dx: j(e.dx),
408
- dy: j(e.dy + O(i.baseline, e.size)),
399
+ dx: M(e.dx),
400
+ dy: M(e.dy + k(i.baseline, e.size)),
409
401
  lengthAdjust: "spacingAndGlyphs",
410
- textLength: j(e.width),
402
+ textLength: M(e.width),
411
403
  ...p(e.datum),
412
- ...e.scale == 1 ? {} : { "font-size": j(e.size) },
413
- ...e.fadeOpacity == 1 ? {} : { opacity: A(e.fadeOpacity) }
404
+ ...e.scale == 1 ? {} : { "font-size": M(e.size) },
405
+ ...e.fadeOpacity == 1 ? {} : { opacity: j(e.fadeOpacity) }
414
406
  });
415
- a.textContent = e.text, e.angle && a.setAttribute("transform", `rotate(${j(e.angle)} ${n} ${r})`), s.appendChild(a);
407
+ a.textContent = e.text, e.angle && a.setAttribute("transform", `rotate(${M(e.angle)} ${n} ${r})`), s.appendChild(a);
416
408
  });
417
409
  if (!t.countOnly && s.childElementCount > 0) {
418
410
  let e = t.getViewportEdgeFadeMaskUrl(m);
@@ -420,58 +412,58 @@ function ye(e, t) {
420
412
  }
421
413
  return h;
422
414
  }
423
- var W = {
415
+ var ge = {
424
416
  left: "start",
425
417
  center: "middle",
426
418
  right: "end"
427
- }, G = 64;
428
- function be(e, t) {
429
- let n = Se(e.unitView);
419
+ }, K = 64;
420
+ function _e(e, t) {
421
+ let n = ye(e.unitView);
430
422
  if (!n) return;
431
- let r = e.unitView.getScaleResolution(n.channel)?.getScale();
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), {
423
+ let i = e.unitView.getScaleResolution(n.channel)?.getScale();
424
+ if (!i || !r(i.type)) return;
425
+ let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
426
+ if (!o.length) return 0;
427
+ let p = e.encoders, m = n.channel == "stroke" ? p.stroke : p.fill, h = be(e.unitView.spec.encoding.x), g = Infinity, _ = Infinity, v = -Infinity, y = -Infinity, b = o.map((e) => {
428
+ let [t, n] = u(a, p, e), [r, i] = se(a, p, e);
429
+ return g = Math.min(g, t, n), _ = Math.min(_, r, i), v = Math.max(v, t, n), y = Math.max(y, r, i), {
438
430
  offset: Number(e.position),
439
- color: f(d(e))
431
+ color: f(m(e))
440
432
  };
441
433
  }).sort((e, t) => e.offset - t.offset);
442
- if (!p(l, h, g, _, v)) return 0;
443
- if (t.countOnly) return a.length;
444
- let b = xe(y), x = [
434
+ if (!l(d, g, _, v, y)) return 0;
435
+ if (t.countOnly) return o.length;
436
+ let x = ve(b), S = [
445
437
  {
446
438
  offset: 0,
447
- color: b[0].color
439
+ color: x[0].color
448
440
  },
449
- ...b,
441
+ ...x,
450
442
  {
451
443
  offset: 1,
452
- color: b.at(-1).color
444
+ color: x.at(-1).color
453
445
  }
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),
446
+ ], C = t.getLegendGradientUrl({
447
+ x1: g,
448
+ y1: h ? _ : y,
449
+ x2: h ? v : g,
450
+ y2: _,
451
+ stops: S
452
+ }), w = M(g), T = M(_), E = M(v), D = M(y), O = Number(p.fillOpacity(o[0])) * c;
453
+ return s.appendChild(P("rect", {
454
+ x: w,
455
+ y: T,
456
+ width: M(E - w),
457
+ height: M(D - T),
458
+ fill: C,
459
+ "fill-opacity": j(O),
468
460
  stroke: "none"
469
- })), a.length;
461
+ })), o.length;
470
462
  }
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))]);
463
+ function ve(e) {
464
+ return e.length <= K ? e : Array.from({ length: K }, (t, n) => e[Math.round(n * (e.length - 1) / (K - 1))]);
473
465
  }
474
- function Se(e) {
466
+ function ye(e) {
475
467
  let t = e;
476
468
  for (; t;) {
477
469
  let e = t.spec.data;
@@ -479,32 +471,32 @@ function Se(e) {
479
471
  t = t.dataParent;
480
472
  }
481
473
  }
482
- function Ce(e) {
474
+ function be(e) {
483
475
  return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
484
476
  }
485
477
  //#endregion
486
478
  //#region ../core/src/rendering/svg/renderers/index.js
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]
479
+ var xe = /* @__PURE__ */ new Map([
480
+ ["arrow", ce],
481
+ ["link", de],
482
+ ["point", fe],
483
+ ["rect", B],
484
+ ["rule", G],
485
+ ["text", he],
486
+ ["tick", G]
495
487
  ]);
496
- function Te(e, t) {
488
+ function Se(e, t) {
497
489
  if (e.getType() == "rect") {
498
- let n = be(e, t);
490
+ let n = _e(e, t);
499
491
  if (n !== void 0) return n;
500
492
  }
501
- let n = we.get(e.getType());
493
+ let n = xe.get(e.getType());
502
494
  if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
503
495
  return n(e, t);
504
496
  }
505
497
  //#endregion
506
498
  //#region ../core/src/rendering/svg/rectHatchPattern.js
507
- function Ee(e, t) {
499
+ function Ce(e, t) {
508
500
  let n = t.strokeWidth, r = [
509
501
  "dots",
510
502
  "rings",
@@ -517,31 +509,31 @@ function Ee(e, t) {
517
509
  "vertical",
518
510
  "horizontal",
519
511
  "grid"
520
- ].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = N("pattern", {
512
+ ].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = P("pattern", {
521
513
  id: e,
522
514
  x: 0,
523
515
  y: 0,
524
- width: j(c),
525
- height: j(l),
516
+ width: M(c),
517
+ height: M(l),
526
518
  patternUnits: "userSpaceOnUse"
527
519
  });
528
- u.appendChild(N("rect", {
529
- width: j(c),
530
- height: j(l),
520
+ u.appendChild(P("rect", {
521
+ width: M(c),
522
+ height: M(l),
531
523
  fill: t.fill,
532
- "fill-opacity": A(t.fillOpacity)
524
+ "fill-opacity": j(t.fillOpacity)
533
525
  }));
534
- let d = N("g", {
526
+ let d = P("g", {
535
527
  fill: "none",
536
528
  stroke: t.stroke,
537
- "stroke-opacity": A(t.strokeOpacity),
538
- "stroke-width": j(s),
529
+ "stroke-opacity": j(t.strokeOpacity),
530
+ "stroke-width": M(s),
539
531
  "stroke-linecap": "square"
540
532
  });
541
- return De(d, t.type, o, s), u.appendChild(d), u;
533
+ return we(d, t.type, o, s), u.appendChild(d), u;
542
534
  }
543
- function De(e, t, n, r) {
544
- let i = (t) => e.appendChild(N("path", { d: t })), a = (e) => j(e), o = (e) => {
535
+ function we(e, t, n, r) {
536
+ let i = (t) => e.appendChild(P("path", { d: t })), a = (e) => M(e), o = (e) => {
545
537
  for (let t of [
546
538
  -n,
547
539
  0,
@@ -570,10 +562,10 @@ function De(e, t, n, r) {
570
562
  case "dots":
571
563
  case "rings":
572
564
  case "ringsLarge": {
573
- let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(N("circle", {
574
- cx: j(t),
575
- cy: j(n),
576
- r: j(r)
565
+ let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(P("circle", {
566
+ cx: M(t),
567
+ cy: M(n),
568
+ r: M(r)
577
569
  }));
578
570
  i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
579
571
  break;
@@ -583,85 +575,47 @@ function De(e, t, n, r) {
583
575
  }
584
576
  //#endregion
585
577
  //#region ../core/src/rendering/svg/linkArcFadeMask.js
586
- var K = 4;
587
- function Oe(e, t, n) {
588
- let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
589
- if (a == 0) return;
590
- let o = -i / a, s = r / a;
591
- (o < 0 || o == 0 && s < 0) && (o = -o, s = -s);
592
- let c = o * e[0] + s * e[1], [l, u] = n, d = JSON.stringify([
593
- q(o, 6),
594
- q(s, 6),
595
- q(c, 1),
596
- q(l, 1),
597
- q(u, 1)
598
- ]);
599
- return {
600
- normalX: o,
601
- normalY: s,
602
- offset: c,
603
- start: l,
604
- end: u,
605
- key: d
606
- };
607
- }
608
- function ke(e, t, n, r) {
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", {
578
+ function Te(e, t, n, r) {
579
+ let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = P("linearGradient", {
610
580
  id: d,
611
581
  gradientUnits: "userSpaceOnUse",
612
- x1: j(l - i * c),
613
- y1: j(u - a * c),
614
- x2: j(l + i * c),
615
- y2: j(u + a * c),
582
+ x1: M(l - i * c),
583
+ y1: M(u - a * c),
584
+ x2: M(l + i * c),
585
+ y2: M(u + a * c),
616
586
  spreadMethod: "pad"
617
587
  });
618
- for (let { offset: e, opacity: t } of Ae(s, c)) f.appendChild(N("stop", {
588
+ for (let { offset: e, opacity: t } of w(s, c)) f.appendChild(P("stop", {
619
589
  offset: q(e, 3),
620
590
  "stop-color": "white",
621
591
  "stop-opacity": q(t, 3)
622
592
  }));
623
- let p = N("mask", {
593
+ let p = P("mask", {
624
594
  id: e,
625
595
  x: 0,
626
596
  y: 0,
627
- width: j(t),
628
- height: j(n),
597
+ width: M(t),
598
+ height: M(n),
629
599
  maskUnits: "userSpaceOnUse",
630
600
  maskContentUnits: "userSpaceOnUse",
631
601
  "mask-type": "luminance"
632
602
  });
633
- return p.appendChild(N("rect", {
634
- width: j(t),
635
- height: j(n),
603
+ return p.appendChild(P("rect", {
604
+ width: M(t),
605
+ height: M(n),
636
606
  fill: `url(#${d})`
637
607
  })), {
638
608
  gradient: f,
639
609
  mask: p
640
610
  };
641
611
  }
642
- function Ae(e, t) {
643
- let n = [], r = (r) => {
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);
646
- n.push({
647
- offset: s,
648
- opacity: 1 - je(c)
649
- });
650
- }
651
- };
652
- return r(!0), r(!1), n;
653
- }
654
- function je(e) {
655
- let t = Math.max(0, Math.min(1, e));
656
- return t * t * (3 - 2 * t);
657
- }
658
612
  function q(e, t) {
659
613
  let n = 10 ** t;
660
614
  return Math.round(e * n) / n;
661
615
  }
662
616
  //#endregion
663
617
  //#region ../core/src/rendering/svg/svgViewRenderingContext.js
664
- var J = class extends u {
618
+ var J = class extends s {
665
619
  #e;
666
620
  #t;
667
621
  #n = [];
@@ -674,8 +628,8 @@ var J = class extends u {
674
628
  #l = /* @__PURE__ */ new Set();
675
629
  #u = !1;
676
630
  #d = /* @__PURE__ */ new Map();
677
- #f = new h();
678
- #p = N("g");
631
+ #f = new E();
632
+ #p = P("g");
679
633
  #m;
680
634
  #h;
681
635
  #g = [];
@@ -689,13 +643,13 @@ var J = class extends u {
689
643
  #w = 0;
690
644
  constructor(e, t) {
691
645
  super(e), this.width = t.width, this.height = t.height, this.#h = t.maxVectorInstances;
692
- let n = j(t.width), r = j(t.height);
693
- this.#e = N("svg", {
694
- xmlns: M,
646
+ let n = M(t.width), r = M(t.height);
647
+ this.#e = P("svg", {
648
+ xmlns: N,
695
649
  width: n,
696
650
  height: r,
697
651
  viewBox: `0 0 ${n} ${r}`
698
- }), this.#t = N("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(N("rect", {
652
+ }), this.#t = P("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(P("rect", {
699
653
  width: n,
700
654
  height: r,
701
655
  fill: t.background,
@@ -736,69 +690,69 @@ var J = class extends u {
736
690
  for (let t of e.markGroupElements) t.childElementCount || t.remove();
737
691
  this.#m = void 0;
738
692
  }
739
- pushView(e, t) {
740
- let n = e.getPathString();
741
- if (i(this.#n)?.exportExcluded || o(e) && e.name.startsWith("scrollbar-")) {
693
+ pushView(t, n) {
694
+ let r = t.getPathString();
695
+ if (e(this.#n)?.exportExcluded || i(t) && t.name.startsWith("scrollbar-")) {
742
696
  this.#n.push({
743
- view: e,
697
+ view: t,
744
698
  node: this.currentNode,
745
- coords: t,
699
+ coords: n,
746
700
  exportExcluded: !0
747
701
  });
748
702
  return;
749
703
  }
750
704
  if (this.#u) {
751
705
  this.#n.push({
752
- view: e,
706
+ view: t,
753
707
  node: this.currentNode,
754
- coords: t,
708
+ coords: n,
755
709
  exportExcluded: !1
756
710
  });
757
711
  return;
758
712
  }
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}`);
713
+ let a = this.#m, o = a?.viewGroups.get(t);
714
+ if (o) {
715
+ if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${r}`);
762
716
  } else {
763
- a = N("g", {
764
- id: Me(e.name, this.#v++),
765
- "data-name": e.name,
766
- "data-view-path": n
717
+ o = P("g", {
718
+ id: Ee(t.name, this.#v++),
719
+ "data-name": t.name,
720
+ "data-view-path": r
767
721
  });
768
- let t = N("title");
769
- t.textContent = n, a.appendChild(t), this.currentNode.appendChild(a), r?.viewGroups.set(e, a);
722
+ let e = P("title");
723
+ e.textContent = r, o.appendChild(e), this.currentNode.appendChild(o), a?.viewGroups.set(t, o);
770
724
  }
771
725
  this.#n.push({
772
- view: e,
773
- node: a,
774
- coords: t,
726
+ view: t,
727
+ node: o,
728
+ coords: n,
775
729
  exportExcluded: !1
776
730
  });
777
731
  }
778
732
  popView(e) {
779
733
  if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
780
734
  }
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;
785
- let c = this.getVisibleInstanceCount(e);
735
+ renderMark(r, i) {
736
+ if (e(this.#n)?.exportExcluded || r.unitView.getEffectiveOpacity() <= 0) return;
737
+ let a = t(i), o = n(a, r.properties.clip, this.currentCoords), s = m(this.width, this.height, o);
738
+ if (!D(s)) return;
739
+ let c = this.getVisibleInstanceCount(r);
786
740
  if (!this.#u && this.#h != null && c == 0) return;
787
741
  if (!this.#u && this.#h != null && c > this.#h) {
788
- this.#T(e, s);
742
+ this.#T(r, s);
789
743
  return;
790
744
  }
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, {
796
- coords: t,
797
- data: n,
798
- group: f,
745
+ let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, f = l ? this.#m.markGroups.get(r)?.get(u ?? "") : void 0;
746
+ !this.#u && !f && this.#E();
747
+ let h = this.#u ? this.#p : this.#O(r, u), g = d(this.currentCoords, a, r.properties.cullByVisibleRange);
748
+ if (p(r, i, this.currentCoords, this.#f, (e, t) => {
749
+ let n = Se(r, {
750
+ coords: e,
751
+ data: t,
752
+ group: h,
799
753
  visibleBounds: s,
800
- anchorCullBounds: p,
801
- viewOpacity: e.unitView.getEffectiveOpacity(),
754
+ anchorCullBounds: g,
755
+ viewOpacity: r.unitView.getEffectiveOpacity(),
802
756
  countOnly: this.#u,
803
757
  getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
804
758
  getShadowFilterUrl: (e) => this.#u ? "" : this.getShadowFilterUrl(e),
@@ -806,14 +760,14 @@ var J = class extends u {
806
760
  getRectHatchPatternUrl: (e) => this.#u ? "" : this.getRectHatchPatternUrl(e),
807
761
  getLinkArcFadeMaskUrl: (e) => this.#u ? void 0 : this.getLinkArcFadeMaskUrl(e),
808
762
  getLegendGradientUrl: (e) => this.#u ? "" : this.getLegendGradientUrl(e),
809
- warn: (t) => {
810
- this.#u || this.#l.add(`${t} View: ${e.unitView.getPathString()}`);
763
+ warn: (e) => {
764
+ this.#u || this.#l.add(`${e} View: ${r.unitView.getPathString()}`);
811
765
  }
812
766
  });
813
- this.#u && this.#d.set(e, this.getVisibleInstanceCount(e) + r);
814
- }, (t) => this.#l.add(`SVG export could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`)), !this.#u && !l && f.childElementCount > 0) {
767
+ this.#u && this.#d.set(r, this.getVisibleInstanceCount(r) + n);
768
+ }, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${r.unitView.getPathString()}`)), !this.#u && !l && h.childElementCount > 0) {
815
769
  let e = this.getClipPathUrl(o);
816
- e && f.setAttribute("clip-path", e), this.currentNode.appendChild(f);
770
+ e && h.setAttribute("clip-path", e), this.currentNode.appendChild(h);
817
771
  }
818
772
  }
819
773
  #T(e, t) {
@@ -845,26 +799,26 @@ var J = class extends u {
845
799
  e && (this.#g.push(e), this.#_ = void 0);
846
800
  }
847
801
  #D(e) {
848
- let t = Ne(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = N("g", {
802
+ let t = De(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = P("g", {
849
803
  id: `rasterized-${n.join("-")}-${this.#w++}`,
850
804
  "data-name": `Rasterized ${n.join(", ")}`,
851
805
  "data-rasterized": ""
852
- }), i = N("image", { preserveAspectRatio: "none" });
806
+ }), i = P("image", { preserveAspectRatio: "none" });
853
807
  r.appendChild(i);
854
808
  let a = e.anchor.parentNode;
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);
809
+ t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Oe(a, t)), e.anchor.remove();
810
+ for (let n of e.viewNodes) ke(n, t);
857
811
  e.image = i;
858
812
  }
859
813
  #O(e, t) {
860
814
  let n = this.#m;
861
- if (!n) return N("g", { "data-mark-type": e.getType() });
815
+ if (!n) return P("g", { "data-mark-type": e.getType() });
862
816
  let r = n.markGroups.get(e);
863
817
  r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
864
818
  let i = t ?? "", a = r.get(i);
865
819
  if (a) {
866
820
  if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
867
- } else a = N("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
821
+ } else a = P("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
868
822
  return a;
869
823
  }
870
824
  getClipPathUrl(e) {
@@ -874,14 +828,14 @@ var J = class extends u {
874
828
  e.clipY ? t.y : 0,
875
829
  e.clipX ? t.width : this.width,
876
830
  e.clipY ? t.height : this.height
877
- ].map(j), r = n.join(","), i = this.#r.get(r);
831
+ ].map(M), r = n.join(","), i = this.#r.get(r);
878
832
  if (!i) {
879
833
  i = "clip-" + this.#y++;
880
- let e = N("clipPath", {
834
+ let e = P("clipPath", {
881
835
  id: i,
882
836
  clipPathUnits: "userSpaceOnUse"
883
837
  });
884
- e.appendChild(N("rect", {
838
+ e.appendChild(P("rect", {
885
839
  x: n[0],
886
840
  y: n[1],
887
841
  width: n[2],
@@ -891,28 +845,28 @@ var J = class extends u {
891
845
  return `url(#${i})`;
892
846
  }
893
847
  getShadowFilterUrl(e) {
894
- let t = j(Math.max(e.blur / 2.5, .25)), n = j(e.offsetX), r = j(e.offsetY), i = [
848
+ let t = M(Math.max(e.blur / 2.5, .25)), n = M(e.offsetX), r = M(e.offsetY), i = [
895
849
  t,
896
850
  n,
897
851
  r
898
852
  ].join(","), a = this.#a.get(i);
899
853
  if (!a) {
900
854
  a = "shadow-" + this.#x++;
901
- let e = N("filter", {
855
+ let e = P("filter", {
902
856
  id: a,
903
857
  x: 0,
904
858
  y: 0,
905
- width: j(this.width),
906
- height: j(this.height),
859
+ width: M(this.width),
860
+ height: M(this.height),
907
861
  filterUnits: "userSpaceOnUse",
908
862
  primitiveUnits: "userSpaceOnUse",
909
863
  "color-interpolation-filters": "sRGB"
910
864
  });
911
- e.appendChild(N("feGaussianBlur", {
865
+ e.appendChild(P("feGaussianBlur", {
912
866
  in: "SourceGraphic",
913
867
  stdDeviation: t,
914
868
  result: "blur"
915
- })), e.appendChild(N("feOffset", {
869
+ })), e.appendChild(P("feOffset", {
916
870
  in: "blur",
917
871
  dx: n,
918
872
  dy: r,
@@ -925,12 +879,12 @@ var J = class extends u {
925
879
  let t = this.#o.get(e);
926
880
  if (!t) {
927
881
  t = "shadow-clip-" + this.#y++;
928
- let n = N("clipPath", {
882
+ let n = P("clipPath", {
929
883
  id: t,
930
884
  clipPathUnits: "userSpaceOnUse"
931
885
  });
932
- n.appendChild(N("path", {
933
- d: `M 0 0 V ${j(this.height)} H ${j(this.width)} V 0 Z ${e}`,
886
+ n.appendChild(P("path", {
887
+ d: `M 0 0 V ${M(this.height)} H ${M(this.width)} V 0 Z ${e}`,
934
888
  "clip-rule": "evenodd",
935
889
  "fill-rule": "evenodd"
936
890
  })), this.#t.appendChild(n), this.#o.set(e, t);
@@ -941,73 +895,73 @@ var J = class extends u {
941
895
  let t = JSON.stringify([
942
896
  e.type,
943
897
  e.fill,
944
- A(e.fillOpacity),
898
+ j(e.fillOpacity),
945
899
  e.stroke,
946
- A(e.strokeOpacity),
947
- A(e.strokeWidth)
900
+ j(e.strokeOpacity),
901
+ j(e.strokeWidth)
948
902
  ]), n = this.#s.get(t);
949
- return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Ee(n, e)), this.#s.set(t, n)), `url(#${n})`;
903
+ return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Ce(n, e)), this.#s.set(t, n)), `url(#${n})`;
950
904
  }
951
905
  getLegendGradientUrl(e) {
952
- let t = "legend-gradient-" + this.#C++, n = N("linearGradient", {
906
+ let t = "legend-gradient-" + this.#C++, n = P("linearGradient", {
953
907
  id: t,
954
908
  gradientUnits: "userSpaceOnUse",
955
- x1: j(e.x1),
956
- y1: j(e.y1),
957
- x2: j(e.x2),
958
- y2: j(e.y2)
909
+ x1: M(e.x1),
910
+ y1: M(e.y1),
911
+ x2: M(e.x2),
912
+ y2: M(e.y2)
959
913
  });
960
- for (let t of e.stops) n.appendChild(N("stop", {
961
- offset: A(t.offset),
914
+ for (let t of e.stops) n.appendChild(P("stop", {
915
+ offset: j(t.offset),
962
916
  "stop-color": t.color
963
917
  }));
964
918
  return this.#t.appendChild(n), `url(#${t})`;
965
919
  }
966
920
  getLinkArcFadeMaskUrl(e) {
967
- let t = Oe(e.p1, e.p4, e.distances);
921
+ let t = _(e.p1, e.p4, e.distances);
968
922
  if (!t) return;
969
923
  let n = this.#c.get(t.key);
970
924
  if (!n) {
971
925
  n = "link-arc-fade-" + this.#b++;
972
- let { gradient: e, mask: r } = ke(n, this.width, this.height, t);
926
+ let { gradient: e, mask: r } = Te(n, this.width, this.height, t);
973
927
  this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
974
928
  }
975
929
  return `url(#${n})`;
976
930
  }
977
- getViewportEdgeFadeMaskUrl(e) {
978
- let t = Object.entries(e).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
979
- if (!t.length) return;
980
- let n = i(this.#n);
981
- if (!n) throw Error("No current view in SVG rendering context.");
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,
931
+ getViewportEdgeFadeMaskUrl(t) {
932
+ let n = Object.entries(t).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
933
+ if (!n.length) return;
934
+ let r = e(this.#n);
935
+ if (!r) throw Error("No current view in SVG rendering context.");
936
+ let i = this.#i.get(r.view);
937
+ if (!i) {
938
+ i = "edge-fade-" + this.#b++;
939
+ let e = M(this.width), t = M(this.height), a = P("mask", {
940
+ id: i,
987
941
  x: 0,
988
942
  y: 0,
989
943
  width: e,
990
- height: i,
944
+ height: t,
991
945
  maskUnits: "userSpaceOnUse",
992
946
  maskContentUnits: "userSpaceOnUse",
993
947
  "mask-type": "luminance"
994
948
  });
995
- a.appendChild(N("rect", {
949
+ a.appendChild(P("rect", {
996
950
  width: e,
997
- height: i,
951
+ height: t,
998
952
  fill: "white"
999
953
  }));
1000
- for (let [o, s] of t) {
1001
- let t = r + "-" + o, c = Ie(t, o, s, n.coords);
1002
- this.#t.appendChild(c), a.appendChild(N("rect", {
954
+ for (let [o, s] of n) {
955
+ let n = i + "-" + o, c = Ae(n, o, s, r.coords);
956
+ this.#t.appendChild(c), a.appendChild(P("rect", {
1003
957
  width: e,
1004
- height: i,
1005
- fill: `url(#${t})`
958
+ height: t,
959
+ fill: `url(#${n})`
1006
960
  }));
1007
961
  }
1008
- this.#t.appendChild(a), this.#i.set(n.view, r);
962
+ this.#t.appendChild(a), this.#i.set(r.view, i);
1009
963
  }
1010
- return `url(#${r})`;
964
+ return `url(#${i})`;
1011
965
  }
1012
966
  getSvg() {
1013
967
  return this.#e;
@@ -1016,52 +970,52 @@ var J = class extends u {
1016
970
  return Array.from(this.#l);
1017
971
  }
1018
972
  get currentNode() {
1019
- return i(this.#n)?.node ?? this.#e;
973
+ return e(this.#n)?.node ?? this.#e;
1020
974
  }
1021
975
  get currentCoords() {
1022
- let e = i(this.#n);
1023
- if (!e) throw Error("No current view in SVG rendering context.");
1024
- return e.coords;
976
+ let t = e(this.#n);
977
+ if (!t) throw Error("No current view in SVG rendering context.");
978
+ return t.coords;
1025
979
  }
1026
980
  };
1027
- function Me(e, t) {
981
+ function Ee(e, t) {
1028
982
  let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
1029
983
  return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
1030
984
  }
1031
985
  function Y(e, t) {
1032
986
  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);
1033
987
  }
1034
- function Ne(e) {
988
+ function De(e) {
1035
989
  let [t, ...n] = Array.from(e), r = t;
1036
990
  for (; n.some((e) => !r.contains(e));) r = r.parentNode;
1037
991
  return r;
1038
992
  }
1039
- function Pe(e, t) {
993
+ function Oe(e, t) {
1040
994
  let n = e;
1041
995
  for (; n.parentNode != t;) n = n.parentNode;
1042
996
  return n;
1043
997
  }
1044
- function Fe(e, t) {
998
+ function ke(e, t) {
1045
999
  let n = e;
1046
1000
  for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
1047
1001
  let e = n.parentNode;
1048
1002
  n.remove(), n = e;
1049
1003
  }
1050
1004
  }
1051
- function Ie(e, t, n, r) {
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", {
1005
+ function Ae(e, t, n, r) {
1006
+ 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 = P("linearGradient", {
1053
1007
  id: e,
1054
1008
  gradientUnits: "userSpaceOnUse",
1055
- x1: j(a ? i : 0),
1056
- y1: j(a ? 0 : i),
1057
- x2: j(a ? o : 0),
1058
- y2: j(a ? 0 : o)
1009
+ x1: M(a ? i : 0),
1010
+ y1: M(a ? 0 : i),
1011
+ x2: M(a ? o : 0),
1012
+ y2: M(a ? 0 : o)
1059
1013
  });
1060
- return s.appendChild(N("stop", {
1014
+ return s.appendChild(P("stop", {
1061
1015
  offset: 0,
1062
1016
  "stop-color": "black",
1063
1017
  "stop-opacity": 1
1064
- })), s.appendChild(N("stop", {
1018
+ })), s.appendChild(P("stop", {
1065
1019
  offset: 1,
1066
1020
  "stop-color": "black",
1067
1021
  "stop-opacity": 0
@@ -1075,18 +1029,18 @@ function X({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "wh
1075
1029
  height: n,
1076
1030
  background: r
1077
1031
  });
1078
- return d(e, l.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(i), {
1032
+ return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(i), {
1079
1033
  svg: i.getSvg(),
1080
1034
  warnings: i.getWarnings()
1081
1035
  };
1082
1036
  }
1083
- function Le({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1037
+ function je({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1084
1038
  let r = new J({ picking: !1 }, {
1085
1039
  width: t,
1086
1040
  height: n,
1087
1041
  background: null
1088
1042
  });
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]) => ({
1043
+ return r.beginInstanceCounting(), c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(r), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
1090
1044
  viewName: e.unitView.name,
1091
1045
  viewTitle: e.unitView.getTitleText(),
1092
1046
  viewPath: e.unitView.getPathString(),
@@ -1094,7 +1048,7 @@ function Le({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1094
1048
  instanceCount: t
1095
1049
  })).filter((e) => e.instanceCount > 0) };
1096
1050
  }
1097
- async function Re(e) {
1051
+ async function Me(e) {
1098
1052
  let t = e.rasterization;
1099
1053
  return t ? ($(t), e.rasterizeSvgRuns ? Z({
1100
1054
  ...e,
@@ -1106,30 +1060,30 @@ async function Re(e) {
1106
1060
  rasterized: []
1107
1061
  };
1108
1062
  }
1109
- async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: a, pixelRatio: o = 2 }) {
1063
+ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: s, pixelRatio: l = 2 }) {
1110
1064
  $({
1111
- maxVectorInstances: a,
1112
- pixelRatio: o
1065
+ maxVectorInstances: s,
1066
+ pixelRatio: l
1113
1067
  });
1114
- let s = new J({ picking: !1 }, {
1068
+ let u = new J({ picking: !1 }, {
1115
1069
  width: n,
1116
1070
  height: r,
1117
1071
  background: i,
1118
- maxVectorInstances: a
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();
1072
+ maxVectorInstances: s
1073
+ }), d = c(e, o.create(0, 0, n, r), { renderingOptions: { firstFacet: !0 } });
1074
+ u.beginInstanceCounting(), d.collectRenderCommands(u), u.endInstanceCounting(), d.collectRenderCommands(u);
1075
+ let f = u.getRasterRuns();
1122
1076
  if (f.length) try {
1123
1077
  await t({
1124
1078
  runs: f,
1125
1079
  viewRoot: e,
1126
- layoutResult: u,
1080
+ layoutResult: d,
1127
1081
  logicalWidth: n,
1128
1082
  logicalHeight: r,
1129
- pixelRatio: o
1083
+ pixelRatio: l
1130
1084
  });
1131
1085
  } catch (t) {
1132
- if (t instanceof c) return Q({
1086
+ if (t instanceof a) return Q({
1133
1087
  viewRoot: e,
1134
1088
  logicalWidth: n,
1135
1089
  logicalHeight: r,
@@ -1138,16 +1092,16 @@ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
1138
1092
  throw t;
1139
1093
  }
1140
1094
  return {
1141
- svg: s.getSvg(),
1142
- warnings: s.getWarnings(),
1095
+ svg: u.getSvg(),
1096
+ warnings: u.getWarnings(),
1143
1097
  rasterized: f.map((e) => ({
1144
1098
  targets: e.targets.map((e) => ({
1145
1099
  markType: e.mark.getType(),
1146
1100
  instanceCount: e.instanceCount
1147
1101
  })),
1148
1102
  reason: "instance-threshold",
1149
- maxVectorInstances: a,
1150
- pixelRatio: o
1103
+ maxVectorInstances: s,
1104
+ pixelRatio: l
1151
1105
  }))
1152
1106
  };
1153
1107
  }
@@ -1164,4 +1118,4 @@ function $(e) {
1164
1118
  if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
1165
1119
  }
1166
1120
  //#endregion
1167
- export { Le as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Re as createSvgExport };
1121
+ export { je as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Me as createSvgExport };