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