@genome-spy/app 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{agentApi-BgZUOeB-.js → agentApi-8hMSlqAQ.js} +8459 -6960
  2. package/dist/agentApi.es.js +5609 -4236
  3. package/dist/agentShared.es.js +9 -9
  4. package/dist/{canvas2d-DiPQvNtZ.js → canvas2d-Bd8H8MMo.js} +149 -134
  5. package/dist/{canvas2d-t_N10CeW.js → canvas2d-D6VYooRf.js} +136 -122
  6. package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
  7. package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
  8. package/dist/{viewIdentityRegistry-BW415b3o.js → containerView-CRJSc4bM.js} +24 -31
  9. package/dist/{viewIdentityRegistry-_F0E7nkA.js → containerView-aEVmYmkA.js} +24 -31
  10. package/dist/{debug-DP4WzTNo.js → debug-CQ0agCrd.js} +9 -9
  11. package/dist/{debug-CVAlrcZt.js → debug-DkIMiGdW.js} +10 -10
  12. package/dist/index.es.js +1133 -1115
  13. package/dist/index.js +757 -513
  14. package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
  15. package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
  16. package/dist/markUtils-CvLDz744.js +75 -0
  17. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  18. package/dist/{order-R043xTpC.js → order-BVvkjDRT.js} +369 -316
  19. package/dist/{order-BkYCnwD7.js → order-DmMoZsi1.js} +360 -308
  20. package/dist/{rasterExport-C_FcNBkC.js → rasterExport-DxvowWjH.js} +4 -4
  21. package/dist/{rasterExport-Z7gs5346.js → rasterExport-jeRVq6kY.js} +4 -4
  22. package/dist/rasterization-CFogVB3B.js +50 -0
  23. package/dist/rasterization-DFj3Cvx4.js +67 -0
  24. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  25. package/dist/rectangle-Dl4Dy0hS.js +191 -0
  26. package/dist/{renderCanvas2D-DK1c9TFK.js → renderCanvas2D-Bfm1NHFu.js} +99 -94
  27. package/dist/{renderCanvas2D-IM-A9DYG.js → renderCanvas2D-DVjhp834.js} +101 -96
  28. package/dist/scalePosition-0aeqp_kz.js +18 -0
  29. package/dist/schema.json +27198 -13709
  30. package/dist/style.css +1 -1
  31. package/dist/{svg-DW3tfUmm.js → svg-Bm2zxBPu.js} +316 -317
  32. package/dist/{svg-PabUdcDi.js → svg-CkfuhONt.js} +290 -291
  33. package/dist/{svgRasterizer-B6YtWLJs.js → svgRasterizer-DoRQEqFA.js} +3 -3
  34. package/dist/{svgRasterizer-BEVDyyS3.js → svgRasterizer-raDDhBF-.js} +3 -3
  35. package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
  36. package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
  37. package/dist/viewError-BkJeVYXA.js +33 -0
  38. package/dist/viewError-IYqyluc7.js +33 -0
  39. package/dist/{viewSelectors-KtD-QSN0.js → viewSelectors-7LyasQN-.js} +572 -478
  40. package/dist/{viewSelectors-DYz-PhTO.js → viewSelectors-CbmkSQRT.js} +624 -530
  41. package/dist/{viewUtils-BZGPseMx.js → viewUtils-DuddMNNw.js} +2146 -2016
  42. package/dist/{webgl-tdKf9SlZ.js → webgl-CQfvgnxo.js} +1247 -1137
  43. package/dist/{webgl-BKSGqHaz.js → webgl-DVYkXtiZ.js} +1495 -1386
  44. package/package.json +4 -4
  45. package/src/spec/view.d.ts +44 -5
  46. package/dist/rasterization-_-9JmSas.js +0 -63
  47. package/dist/viewError-BiR9VCgL.js +0 -29
@@ -1,35 +1,35 @@
1
- import { Kt as e, o as t, s as n } from "./clipOptions-B5PibDq3.js";
2
- import { v as r } from "./vega-scale-Ctz_wa3z.js";
3
- import { x as i } from "./viewSelectors-KtD-QSN0.js";
4
- import { t as a } from "./rasterization-_-9JmSas.js";
5
- import { t as o } from "./rectangle-DE98gIxF.js";
1
+ import { in as e, o as t, s as n } from "./clipOptions-DElJ8dTZ.js";
2
+ import { v as r } from "./vega-scale-o9TRyzYH.js";
3
+ import { x as i } from "./viewSelectors-7LyasQN-.js";
4
+ import { t as a } from "./rasterization-DFj3Cvx4.js";
5
+ import { t as o } from "./rectangle-Dl4Dy0hS.js";
6
6
  import { n as s, t as c } from "./layoutResult-D50MSHXR.js";
7
- import { A as l, D as u, E as d, F as f, I as p, M as m, N as h, O as g, P as _, S as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as ee, n as te, o as ne, p as j, r as re, s as ie, t as ae, u as oe, v as se, w as ce, x as le, y as ue } from "./order-BkYCnwD7.js";
8
- import { n as M, t as N } from "./svgNumber-DNxESJQB.js";
7
+ import { A as l, C as u, D as d, F as f, I as p, L as m, M as h, N as g, P as _, S as v, T as y, _ as b, a as x, b as S, c as C, d as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as ee, p as te, r as ne, s as re, t as ie, u as ae, v as oe, x as se, y as ce } from "./order-DmMoZsi1.js";
8
+ import { n as N, t as P } from "./svgNumber-DNxESJQB.js";
9
9
  //#region ../core/src/rendering/svg/svgElement.js
10
- var P = "http://www.w3.org/2000/svg";
11
- function F(e, t) {
12
- let n = document.createElementNS(P, e);
10
+ var F = "http://www.w3.org/2000/svg";
11
+ function I(e, t) {
12
+ let n = document.createElementNS(F, 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 I(e, t) {
19
- let n = Object.entries(t).filter(([t, n]) => !n.encoder.constant || (e.setAttribute(t, "" + L(n, {})), !1));
20
- return (e) => Object.fromEntries(n.map(([t, n]) => [t, L(n, e)]));
21
- }
22
18
  function L(e, t) {
19
+ let n = Object.entries(t).filter(([t, n]) => !n.encoder.constant || (e.setAttribute(t, "" + R(n, {})), !1));
20
+ return (e) => Object.fromEntries(n.map(([t, n]) => [t, R(n, e)]));
21
+ }
22
+ function R(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 de(e, t) {
29
- let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, u = I(a, {
28
+ function le(e, t) {
29
+ let n = e, { coords: r, data: i, group: a, viewOpacity: o, visibleBounds: s } = t, c = n.encoders, l = L(a, {
30
30
  fill: {
31
31
  encoder: c.fill,
32
- transform: l
32
+ transform: O
33
33
  },
34
34
  "fill-opacity": {
35
35
  encoder: c.fillOpacity,
@@ -37,7 +37,7 @@ function de(e, t) {
37
37
  },
38
38
  stroke: {
39
39
  encoder: c.stroke,
40
- transform: l
40
+ transform: O
41
41
  },
42
42
  "stroke-opacity": {
43
43
  encoder: c.strokeOpacity,
@@ -45,79 +45,78 @@ function de(e, t) {
45
45
  },
46
46
  "stroke-width": {
47
47
  encoder: c.strokeWidth,
48
- transform: (e) => N(+e)
48
+ transform: (e) => P(+e)
49
49
  }
50
50
  });
51
51
  a.setAttribute("stroke-linejoin", "miter");
52
- let d = v(n);
53
- return ce(n, d, {
52
+ let d = u(n);
53
+ return y(n, d, {
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 "${d.headShape}" as a triangle.`), a.appendChild(F("path", {
61
- d: e.boundaryLoops.map(fe).join(" "),
62
- ...u(e.datum)
60
+ t.countOnly || (e.headShapeFallback && t.warn(`SVG export rendered unsupported arrow headShape "${d.headShape}" as a triangle.`), a.appendChild(I("path", {
61
+ d: e.boundaryLoops.map(ue).join(" "),
62
+ ...l(e.datum)
63
63
  })));
64
64
  });
65
65
  }
66
- function fe(e) {
67
- return `M ${e.map(pe).join(" L ")} Z`;
66
+ function ue(e) {
67
+ return `M ${e.map(de).join(" L ")} Z`;
68
68
  }
69
- function pe(e) {
70
- return `${N(e.x)} ${N(e.y)}`;
69
+ function de(e) {
70
+ return `${P(e.x)} ${P(e.y)}`;
71
71
  }
72
72
  //#endregion
73
73
  //#region ../core/src/rendering/svg/renderers/link.js
74
- function me(e, t) {
75
- let n = e, r = y(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d = le(n, r.shape, t.secondOrderPass), f = I(o, {
74
+ function fe(e, t) {
75
+ let n = e, r = oe(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = v(n, r.shape, t.secondOrderPass), f = .5, p = l.opacity.constant && l.size.constant, m = (e) => d(l.opacity, e) * s * Math.max(0, Math.min(d(l.size, e) / f, 1));
76
+ p && o.setAttribute("stroke-opacity", "" + m({}));
77
+ let h = L(o, {
76
78
  stroke: {
77
- encoder: u.color,
78
- transform: l
79
- },
80
- "stroke-opacity": {
81
- encoder: u.opacity,
82
- transform: (e) => +e * s
79
+ encoder: l.color,
80
+ transform: O
83
81
  },
84
82
  "stroke-width": {
85
- encoder: u.size,
86
- transform: (e) => N(+e)
83
+ encoder: l.size,
84
+ transform: (e) => P(Math.max(+e, f))
87
85
  }
88
86
  });
89
- o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt");
90
- let p = o, m;
91
- return se(n, r, {
87
+ o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt"), o.setAttribute("stroke-linejoin", "miter"), o.setAttribute("stroke-miterlimit", "2");
88
+ let g = o, _;
89
+ return ce(n, r, {
92
90
  coords: i,
93
91
  data: a,
94
92
  visibleBounds: c
95
- }, ({ datum: e, points: n }) => {
96
- let [r, i, a, s] = n;
93
+ }, ({ datum: e, geometry: n }) => {
97
94
  if (t.countOnly) return;
98
- let c = f(e), l = d ? t.getLinkArcFadeMaskUrl({
99
- p1: r,
100
- p4: s,
101
- distances: d
95
+ let r = h(e);
96
+ p || (r["stroke-opacity"] = m(e));
97
+ let i = u && n.type == "cubic" ? t.getLinkArcFadeMaskUrl({
98
+ p1: n.points[0],
99
+ p4: n.points[3],
100
+ distances: u
102
101
  }) : void 0;
103
- l !== m && (m = l, p = l ? F("g", { mask: l }) : o, l && o.appendChild(p)), p.appendChild(F("path", {
104
- d: `M ${R(r)} C ${R(i)} ${R(a)} ${R(s)}`,
105
- ...c
102
+ i !== _ && (_ = i, g = i ? I("g", { mask: i }) : o, i && o.appendChild(g)), g.appendChild(I("path", {
103
+ d: n.type == "orthogonal" ? `M ${z(n.points[0])} L ${z(n.points[1])} L ${z(n.points[2])}` : `M ${z(n.points[0])} C ${n.points.slice(1).map(z).join(" ")}`,
104
+ ...r
106
105
  }));
107
106
  });
108
107
  }
109
- function R(e) {
110
- return e.map(N).join(" ");
108
+ function z(e) {
109
+ return e.map(P).join(" ");
111
110
  }
112
111
  //#endregion
113
112
  //#region ../core/src/rendering/svg/renderers/point.js
114
- function z(e, t) {
113
+ function pe(e, t) {
115
114
  let n = e;
116
- k(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 = E(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = I(a, {
115
+ l(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.");
116
+ let r = T(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = L(a, {
118
117
  fill: {
119
118
  encoder: s.fill,
120
- transform: l
119
+ transform: O
121
120
  },
122
121
  "fill-opacity": {
123
122
  encoder: s.fillOpacity,
@@ -125,7 +124,7 @@ function z(e, t) {
125
124
  },
126
125
  stroke: {
127
126
  encoder: s.stroke,
128
- transform: l
127
+ transform: O
129
128
  },
130
129
  "stroke-opacity": {
131
130
  encoder: s.strokeOpacity,
@@ -133,47 +132,47 @@ function z(e, t) {
133
132
  },
134
133
  "stroke-width": {
135
134
  encoder: s.strokeWidth,
136
- transform: (e) => N(+e)
135
+ transform: (e) => P(+e)
137
136
  }
138
- }), u = ge();
139
- return T(n, r, t, (e) => {
137
+ }), u = he();
138
+ return b(n, r, t, (e) => {
140
139
  if (t.countOnly) return;
141
140
  let { datum: n, shape: r, x: l, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
142
141
  ...c(n),
143
- ...i && !h ? { "stroke-width": N(m) } : {},
144
- ...h ? _e(s, n, o) : {}
145
- }, _ = he(r, l, d, f, g, u);
146
- _ ? (p && _.setAttribute("transform", `rotate(${N(p)} ${N(l)} ${N(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(F("circle", {
147
- cx: N(l),
148
- cy: N(d),
149
- r: N(f),
142
+ ...i && !h ? { "stroke-width": P(m) } : {},
143
+ ...h ? ge(s, n, o) : {}
144
+ }, _ = me(r, l, d, f, g, u);
145
+ _ ? (p && _.setAttribute("transform", `rotate(${P(p)} ${P(l)} ${P(d)})`), a.appendChild(_)) : (t.warn(`SVG export rendered unsupported point shape "${r}" as a circle.`), a.appendChild(I("circle", {
146
+ cx: P(l),
147
+ cy: P(d),
148
+ r: P(f),
150
149
  ...g
151
150
  })));
152
151
  });
153
152
  }
154
- function he(e, t, n, r, i, a) {
155
- let o = N(t), s = N(n), c = N(r);
156
- if (e == "circle") return F("circle", {
153
+ function me(e, t, n, r, i, a) {
154
+ let o = P(t), s = P(n), c = P(r);
155
+ if (e == "circle") return I("circle", {
157
156
  cx: o,
158
157
  cy: s,
159
158
  r: c,
160
159
  ...i
161
160
  });
162
- if (e == "square") return F("rect", {
163
- x: N(t - r),
164
- y: N(n - r),
165
- width: N(r * 2),
166
- height: N(r * 2),
161
+ if (e == "square") return I("rect", {
162
+ x: P(t - r),
163
+ y: P(n - r),
164
+ width: P(r * 2),
165
+ height: P(r * 2),
167
166
  ...i
168
167
  });
169
168
  let l = a.build(e, t, n, r);
170
- return l ? F("path", {
169
+ return l ? I("path", {
171
170
  d: l,
172
171
  ...i
173
172
  }) : void 0;
174
173
  }
175
- function ge() {
176
- let e = "", t = (e, t) => `${N(e)} ${N(t)}`, n = {
174
+ function he() {
175
+ let e = "", t = (e, t) => `${P(e)} ${P(t)}`, n = {
177
176
  moveTo(n, r) {
178
177
  e += `${e ? " M" : "M"} ${t(n, r)}`;
179
178
  },
@@ -185,26 +184,26 @@ function ge() {
185
184
  }
186
185
  };
187
186
  return { build(t, r, i, a) {
188
- return e = "", ee(t, r, i, a, n) ? e : void 0;
187
+ return e = "", E(t, r, i, a, n) ? e : void 0;
189
188
  } };
190
189
  }
191
- function _e(e, t, n) {
190
+ function ge(e, t, n) {
192
191
  let r = e.stroke(t), i = d(e.strokeOpacity, t), a = r == null || i <= 0;
193
192
  return {
194
193
  fill: "none",
195
- stroke: l(a ? e.fill(t) : r),
194
+ stroke: O(a ? e.fill(t) : r),
196
195
  "stroke-opacity": (a ? d(e.fillOpacity, t) : i) * n,
197
- "stroke-width": N(d(e.strokeWidth, t)),
196
+ "stroke-width": P(d(e.strokeWidth, t)),
198
197
  "stroke-linecap": "butt"
199
198
  };
200
199
  }
201
200
  //#endregion
202
201
  //#region ../core/src/rendering/svg/renderers/rect.js
203
- function ve(e, t) {
204
- let n = e, r = w(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, u = I(o, {
202
+ function _e(e, t) {
203
+ let n = e, r = te(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = L(o, {
205
204
  fill: {
206
205
  encoder: c.fill,
207
- transform: l
206
+ transform: O
208
207
  },
209
208
  "fill-opacity": {
210
209
  encoder: c.fillOpacity,
@@ -212,7 +211,7 @@ function ve(e, t) {
212
211
  },
213
212
  stroke: {
214
213
  encoder: c.stroke,
215
- transform: l
214
+ transform: O
216
215
  },
217
216
  "stroke-opacity": {
218
217
  encoder: c.strokeOpacity,
@@ -220,125 +219,125 @@ function ve(e, t) {
220
219
  },
221
220
  "stroke-width": {
222
221
  encoder: c.strokeWidth,
223
- transform: (e) => N(+e)
222
+ transform: (e) => P(+e)
224
223
  }
225
- }), f = i.opacity > 0 ? {
224
+ }), u = i.opacity > 0 ? {
226
225
  fill: i.color,
227
226
  "fill-opacity": 1,
228
227
  stroke: i.color,
229
228
  "stroke-opacity": 1,
230
- opacity: M(i.opacity * s),
229
+ opacity: N(i.opacity * s),
231
230
  filter: t.getShadowFilterUrl(i)
232
231
  } : null;
233
232
  return j(n, r, t, (e) => {
234
233
  if (t.countOnly) return;
235
- let { datum: n, x: r, y: i, width: p, height: m, radii: h, opacityFactor: g, strokeWidth: _, fill: v, fillOpacity: y } = e, b = {
236
- ...u(n),
237
- ...g == 1 ? {} : { opacity: M(g) }
234
+ let { datum: n, x: r, y: i, width: f, height: p, radii: m, opacityFactor: h, strokeWidth: g, fill: _, fillOpacity: v } = e, y = {
235
+ ...l(n),
236
+ ...h == 1 ? {} : { opacity: N(h) }
238
237
  };
239
- if (a != "none" && _ > 0 && (b.fill = t.getRectHatchPatternUrl({
238
+ if (a != "none" && g > 0 && (y.fill = t.getRectHatchPatternUrl({
240
239
  type: a,
241
- fill: l(c.fill(n)),
240
+ fill: O(c.fill(n)),
242
241
  fillOpacity: d(c.fillOpacity, n) * s,
243
- stroke: l(c.stroke(n)),
242
+ stroke: O(c.stroke(n)),
244
243
  strokeOpacity: d(c.strokeOpacity, n) * s,
245
- strokeWidth: _
246
- }), b["fill-opacity"] = 1), f) {
247
- let e = B(r, i, p, m, h, {
248
- ...f,
249
- "stroke-width": N(_)
244
+ strokeWidth: g
245
+ }), y["fill-opacity"] = 1), u) {
246
+ let e = B(r, i, f, p, m, {
247
+ ...u,
248
+ "stroke-width": P(g)
250
249
  });
251
- if (a == "none" && v != "none" && y == 1 && g == 1) o.appendChild(e);
250
+ if (a == "none" && _ != "none" && v == 1 && h == 1) o.appendChild(e);
252
251
  else {
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 = F("g", { "clip-path": t.getShadowClipPathUrl(s) });
252
+ let n = g / 2, a = Object.fromEntries(Object.entries(m).map(([e, t]) => [e, t + n])), s = V(r - n, i - n, f + n * 2, p + n * 2, a), c = I("g", { "clip-path": t.getShadowClipPathUrl(s) });
254
253
  c.appendChild(e), o.appendChild(c);
255
254
  }
256
255
  }
257
- o.appendChild(B(r, i, p, m, h, b));
256
+ o.appendChild(B(r, i, f, p, m, y));
258
257
  });
259
258
  }
260
259
  function B(e, t, n, r, i, a) {
261
- if (ye(i)) {
262
- let o = i.topLeft, s = N(e), c = N(t), l = N(e + n), u = N(t + r);
263
- return F("rect", {
260
+ if (ve(i)) {
261
+ let o = i.topLeft, s = P(e), c = P(t), l = P(e + n), u = P(t + r);
262
+ return I("rect", {
264
263
  x: s,
265
264
  y: c,
266
- width: N(l - s),
267
- height: N(u - c),
265
+ width: P(l - s),
266
+ height: P(u - c),
268
267
  ...o ? {
269
- rx: N(o),
270
- ry: N(o)
268
+ rx: P(o),
269
+ ry: P(o)
271
270
  } : {},
272
271
  ...a
273
272
  });
274
273
  }
275
- return F("path", {
274
+ return I("path", {
276
275
  d: V(e, t, n, r, i),
277
276
  ...a
278
277
  });
279
278
  }
280
- function ye(e) {
279
+ function ve(e) {
281
280
  return Object.values(e).every((t) => t == e.topLeft);
282
281
  }
283
282
  function V(e, t, n, r, i) {
284
283
  let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
285
284
  return [
286
285
  `M ${U(e + s, t)}`,
287
- `H ${N(a - c)}`,
286
+ `H ${P(a - c)}`,
288
287
  H(c, a, t + c, a, t),
289
- `V ${N(o - l)}`,
288
+ `V ${P(o - l)}`,
290
289
  H(l, a - l, o, a, o),
291
- `H ${N(e + u)}`,
290
+ `H ${P(e + u)}`,
292
291
  H(u, e, o - u, e, o),
293
- `V ${N(t + s)}`,
292
+ `V ${P(t + s)}`,
294
293
  H(s, e + s, t, e, t),
295
294
  "Z"
296
295
  ].join(" ");
297
296
  }
298
297
  function H(e, t, n, r, i) {
299
- return e ? `A ${N(e)} ${N(e)} 0 0 1 ${U(t, n)}` : `L ${U(r, i)}`;
298
+ return e ? `A ${P(e)} ${P(e)} 0 0 1 ${U(t, n)}` : `L ${U(r, i)}`;
300
299
  }
301
300
  function U(e, t) {
302
- return `${N(e)} ${N(t)}`;
301
+ return `${P(e)} ${P(t)}`;
303
302
  }
304
303
  //#endregion
305
304
  //#region ../core/src/rendering/svg/renderers/rule.js
306
305
  function W(e, t) {
307
- let n = e, r = oe(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, u = n.encoders, d = n.properties.strokeDash, f = I(o, {
306
+ let n = e, r = ae(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = n.properties.strokeDash, d = L(o, {
308
307
  stroke: {
309
- encoder: u.color,
310
- transform: l
308
+ encoder: l.color,
309
+ transform: O
311
310
  },
312
311
  "stroke-opacity": {
313
- encoder: u.opacity,
312
+ encoder: l.opacity,
314
313
  transform: (e) => +e * s
315
314
  },
316
315
  "stroke-width": {
317
- encoder: u.size,
318
- transform: (e) => N(+e)
316
+ encoder: l.size,
317
+ transform: (e) => P(+e)
319
318
  }
320
319
  });
321
- return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), d && (o.setAttribute("stroke-dasharray", d.map(N).join(" ")), o.setAttribute("stroke-dashoffset", "" + N(n.properties.strokeDashOffset))), C(n, r, {
320
+ return o.setAttribute("stroke-linecap", "" + n.properties.strokeCap), u && (o.setAttribute("stroke-dasharray", u.map(P).join(" ")), o.setAttribute("stroke-dashoffset", "" + P(n.properties.strokeDashOffset))), w(n, r, {
322
321
  coords: i,
323
322
  data: a,
324
323
  visibleBounds: c
325
324
  }, (e) => {
326
- t.countOnly || o.appendChild(F("line", {
327
- x1: N(e.x1),
328
- y1: N(e.y1),
329
- x2: N(e.x2),
330
- y2: N(e.y2),
331
- ...f(e.datum)
325
+ t.countOnly || o.appendChild(I("line", {
326
+ x1: P(e.x1),
327
+ y1: P(e.y1),
328
+ x2: P(e.x2),
329
+ y2: P(e.y2),
330
+ ...d(e.datum)
332
331
  }));
333
332
  });
334
333
  }
335
334
  //#endregion
336
335
  //#region ../core/src/rendering/svg/renderers/text.js
337
- function be(e, t) {
338
- let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = D(i, r), s = S(n), { coords: c, data: u, group: d, viewOpacity: f, visibleBounds: p, anchorCullBounds: m } = t, h = n.encoders, g = I(d, {
336
+ function ye(e, t) {
337
+ let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = D(i, r), s = C(n), { coords: c, data: u, group: d, viewOpacity: f, visibleBounds: p, anchorCullBounds: m } = t, h = n.encoders, g = L(d, {
339
338
  fill: {
340
339
  encoder: h.color,
341
- transform: l
340
+ transform: O
342
341
  },
343
342
  "fill-opacity": {
344
343
  encoder: h.opacity,
@@ -346,26 +345,26 @@ function be(e, t) {
346
345
  },
347
346
  "font-size": {
348
347
  encoder: h.size,
349
- transform: (e) => N(+e)
348
+ transform: (e) => P(+e)
350
349
  }
351
350
  });
352
- d.setAttribute("font-family", b(r.font)), d.setAttribute("font-style", r.fontStyle ?? "normal"), d.setAttribute("font-weight", "" + ie(r.fontWeight ?? "normal")), d.setAttribute("text-anchor", xe[s.align]);
351
+ d.setAttribute("font-family", x(r.font)), d.setAttribute("font-style", r.fontStyle ?? "normal"), d.setAttribute("font-weight", "" + re(r.fontWeight ?? "normal")), d.setAttribute("text-anchor", be[s.align]);
353
352
  let _ = {
354
353
  top: {
355
- width: k(n, r.viewportEdgeFadeWidthTop),
356
- distance: k(n, r.viewportEdgeFadeDistanceTop)
354
+ width: l(n, r.viewportEdgeFadeWidthTop),
355
+ distance: l(n, r.viewportEdgeFadeDistanceTop)
357
356
  },
358
357
  right: {
359
- width: k(n, r.viewportEdgeFadeWidthRight),
360
- distance: k(n, r.viewportEdgeFadeDistanceRight)
358
+ width: l(n, r.viewportEdgeFadeWidthRight),
359
+ distance: l(n, r.viewportEdgeFadeDistanceRight)
361
360
  },
362
361
  bottom: {
363
- width: k(n, r.viewportEdgeFadeWidthBottom),
364
- distance: k(n, r.viewportEdgeFadeDistanceBottom)
362
+ width: l(n, r.viewportEdgeFadeWidthBottom),
363
+ distance: l(n, r.viewportEdgeFadeDistanceBottom)
365
364
  },
366
365
  left: {
367
- width: k(n, r.viewportEdgeFadeWidthLeft),
368
- distance: k(n, r.viewportEdgeFadeDistanceLeft)
366
+ width: l(n, r.viewportEdgeFadeWidthLeft),
367
+ distance: l(n, r.viewportEdgeFadeDistanceLeft)
369
368
  }
370
369
  }, v = A(n, s, {
371
370
  coords: c,
@@ -378,9 +377,9 @@ function be(e, t) {
378
377
  if (t.countOnly) return;
379
378
  if (e.logoTransform) {
380
379
  e.multiCharacterLogo && t.warn("SVG export stretches multi-character logo text as a single glyph cell.");
381
- let n = [`translate(${N(e.x)} ${N(e.y)})`];
382
- e.angle && n.push(`rotate(${N(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${N(e.dx)} ${N(e.dy)})`), n.push(`scale(${N(e.logoTransform.scaleX)} ${N(e.logoTransform.scaleY)})`), n.push(`translate(${N(-e.logoTransform.originX)} ${N(-e.logoTransform.originY)})`);
383
- let r = F("text", {
380
+ let n = [`translate(${P(e.x)} ${P(e.y)})`];
381
+ e.angle && n.push(`rotate(${P(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${P(e.dx)} ${P(e.dy)})`), n.push(`scale(${P(e.logoTransform.scaleX)} ${P(e.logoTransform.scaleY)})`), n.push(`translate(${P(-e.logoTransform.originX)} ${P(-e.logoTransform.originY)})`);
382
+ let r = I("text", {
384
383
  x: 0,
385
384
  y: 0,
386
385
  "text-anchor": "start",
@@ -391,14 +390,14 @@ function be(e, t) {
391
390
  r.textContent = e.text, d.appendChild(r);
392
391
  return;
393
392
  }
394
- let n = [`translate(${N(e.x)} ${N(e.y)})`];
395
- e.angle && n.push(`rotate(${N(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${N(e.dx)} ${N(e.dy)})`), e.scale != 1 && n.push(`scale(${N(e.scale)})`);
396
- let r = F("text", {
393
+ let n = [`translate(${P(e.x)} ${P(e.y)})`];
394
+ e.angle && n.push(`rotate(${P(e.angle)})`), (e.dx || e.dy) && n.push(`translate(${P(e.dx)} ${P(e.dy)})`), e.scale != 1 && n.push(`scale(${P(e.scale)})`);
395
+ let r = I("text", {
397
396
  x: 0,
398
397
  y: 0,
399
- dy: N(ne(s.baseline, e.size)),
398
+ dy: P(ee(s.baseline, e.size)),
400
399
  ...g(e.datum),
401
- ...e.fadeOpacity == 1 ? {} : { opacity: M(e.fadeOpacity) },
400
+ ...e.fadeOpacity == 1 ? {} : { opacity: N(e.fadeOpacity) },
402
401
  transform: n.join(" ")
403
402
  });
404
403
  r.textContent = e.text, d.appendChild(r);
@@ -409,58 +408,58 @@ function be(e, t) {
409
408
  }
410
409
  return v;
411
410
  }
412
- var xe = {
411
+ var be = {
413
412
  left: "start",
414
413
  center: "middle",
415
414
  right: "end"
416
415
  }, G = 64;
417
- function Se(e, t) {
418
- let n = we(e.unitView);
416
+ function xe(e, t) {
417
+ let n = Ce(e.unitView);
419
418
  if (!n) return;
420
419
  let i = e.unitView.getScaleResolution(n.channel)?.getScale();
421
420
  if (!i || !r(i.type)) return;
422
- let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
421
+ let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l } = t;
423
422
  if (!o.length) return 0;
424
- let f = e.encoders, p = n.channel == "stroke" ? f.stroke : f.fill, m = Te(e.unitView.spec.encoding.x), h = Infinity, v = Infinity, y = -Infinity, b = -Infinity, x = o.map((e) => {
425
- let [t, n] = u(a, f, e), [r, i] = g(a, f, e);
426
- return h = Math.min(h, t, n), v = Math.min(v, r, i), y = Math.max(y, t, n), b = Math.max(b, r, i), {
423
+ let u = e.encoders, d = n.channel == "stroke" ? u.stroke : u.fill, p = we(e.unitView.spec.encoding.x), m = Infinity, h = Infinity, g = -Infinity, _ = -Infinity, v = k(a, u, "x", o[0]), y = k(a, u, "y", o[0]), b = [0, 0], x = [0, 0], S = o.map((e) => {
424
+ let [t, n] = v(e, b), [r, i] = y(e, x);
425
+ return m = Math.min(m, t, n), h = Math.min(h, r, i), g = Math.max(g, t, n), _ = Math.max(_, r, i), {
427
426
  offset: Number(e.position),
428
- color: l(p(e))
427
+ color: O(d(e))
429
428
  };
430
429
  }).sort((e, t) => e.offset - t.offset);
431
- if (!_(d, h, v, y, b)) return 0;
430
+ if (!f(l, m, h, g, _)) return 0;
432
431
  if (t.countOnly) return o.length;
433
- let S = Ce(x), C = [
432
+ let C = Se(S), w = [
434
433
  {
435
434
  offset: 0,
436
- color: S[0].color
435
+ color: C[0].color
437
436
  },
438
- ...S,
437
+ ...C,
439
438
  {
440
439
  offset: 1,
441
- color: S.at(-1).color
440
+ color: C.at(-1).color
442
441
  }
443
- ], w = t.getLegendGradientUrl({
444
- x1: h,
445
- y1: m ? v : b,
446
- x2: m ? y : h,
447
- y2: v,
448
- stops: C
449
- }), T = N(h), E = N(v), D = N(y), O = N(b), k = Number(f.fillOpacity(o[0])) * c;
450
- return s.appendChild(F("rect", {
451
- x: T,
452
- y: E,
453
- width: N(D - T),
454
- height: N(O - E),
455
- fill: w,
456
- "fill-opacity": M(k),
442
+ ], T = t.getLegendGradientUrl({
443
+ x1: m,
444
+ y1: p ? h : _,
445
+ x2: p ? g : m,
446
+ y2: h,
447
+ stops: w
448
+ }), E = P(m), D = P(h), A = P(g), j = P(_), M = Number(u.fillOpacity(o[0])) * c;
449
+ return s.appendChild(I("rect", {
450
+ x: E,
451
+ y: D,
452
+ width: P(A - E),
453
+ height: P(j - D),
454
+ fill: T,
455
+ "fill-opacity": N(M),
457
456
  stroke: "none"
458
457
  })), o.length;
459
458
  }
460
- function Ce(e) {
459
+ function Se(e) {
461
460
  return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
462
461
  }
463
- function we(e) {
462
+ function Ce(e) {
464
463
  let t = e;
465
464
  for (; t;) {
466
465
  let e = t.spec.data;
@@ -468,32 +467,32 @@ function we(e) {
468
467
  t = t.dataParent;
469
468
  }
470
469
  }
471
- function Te(e) {
470
+ function we(e) {
472
471
  return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
473
472
  }
474
473
  //#endregion
475
474
  //#region ../core/src/rendering/svg/renderers/index.js
476
- var Ee = /* @__PURE__ */ new Map([
477
- ["arrow", de],
478
- ["link", me],
479
- ["point", z],
480
- ["rect", ve],
475
+ var Te = /* @__PURE__ */ new Map([
476
+ ["arrow", le],
477
+ ["link", fe],
478
+ ["point", pe],
479
+ ["rect", _e],
481
480
  ["rule", W],
482
- ["text", be],
481
+ ["text", ye],
483
482
  ["tick", W]
484
483
  ]);
485
- function De(e, t) {
484
+ function Ee(e, t) {
486
485
  if (e.getType() == "rect") {
487
- let n = Se(e, t);
486
+ let n = xe(e, t);
488
487
  if (n !== void 0) return n;
489
488
  }
490
- let n = Ee.get(e.getType());
489
+ let n = Te.get(e.getType());
491
490
  if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
492
491
  return n(e, t);
493
492
  }
494
493
  //#endregion
495
494
  //#region ../core/src/rendering/svg/rectHatchPattern.js
496
- function Oe(e, t) {
495
+ function De(e, t) {
497
496
  let n = t.strokeWidth, r = [
498
497
  "dots",
499
498
  "rings",
@@ -506,31 +505,31 @@ function Oe(e, t) {
506
505
  "vertical",
507
506
  "horizontal",
508
507
  "grid"
509
- ].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = F("pattern", {
508
+ ].includes(t.type), o = r ? n * 7 : n * (i ? 6 : 4), s = a ? n * 2 : n, c = o, l = r ? o * 2 : o, u = I("pattern", {
510
509
  id: e,
511
510
  x: 0,
512
511
  y: 0,
513
- width: N(c),
514
- height: N(l),
512
+ width: P(c),
513
+ height: P(l),
515
514
  patternUnits: "userSpaceOnUse"
516
515
  });
517
- u.appendChild(F("rect", {
518
- width: N(c),
519
- height: N(l),
516
+ u.appendChild(I("rect", {
517
+ width: P(c),
518
+ height: P(l),
520
519
  fill: t.fill,
521
- "fill-opacity": M(t.fillOpacity)
520
+ "fill-opacity": N(t.fillOpacity)
522
521
  }));
523
- let d = F("g", {
522
+ let d = I("g", {
524
523
  fill: "none",
525
524
  stroke: t.stroke,
526
- "stroke-opacity": M(t.strokeOpacity),
527
- "stroke-width": N(s),
525
+ "stroke-opacity": N(t.strokeOpacity),
526
+ "stroke-width": P(s),
528
527
  "stroke-linecap": "square"
529
528
  });
530
- return ke(d, t.type, o, s), u.appendChild(d), u;
529
+ return Oe(d, t.type, o, s), u.appendChild(d), u;
531
530
  }
532
- function ke(e, t, n, r) {
533
- let i = (t) => e.appendChild(F("path", { d: t })), a = (e) => N(e), o = (e) => {
531
+ function Oe(e, t, n, r) {
532
+ let i = (t) => e.appendChild(I("path", { d: t })), a = (e) => P(e), o = (e) => {
534
533
  for (let t of [
535
534
  -n,
536
535
  0,
@@ -559,10 +558,10 @@ function ke(e, t, n, r) {
559
558
  case "dots":
560
559
  case "rings":
561
560
  case "ringsLarge": {
562
- let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(F("circle", {
563
- cx: N(t),
564
- cy: N(n),
565
- r: N(r)
561
+ let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(I("circle", {
562
+ cx: P(t),
563
+ cy: P(n),
564
+ r: P(r)
566
565
  }));
567
566
  i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
568
567
  break;
@@ -572,34 +571,34 @@ function ke(e, t, n, r) {
572
571
  }
573
572
  //#endregion
574
573
  //#region ../core/src/rendering/svg/linkArcFadeMask.js
575
- function Ae(e, t, n, r) {
576
- let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = F("linearGradient", {
574
+ function ke(e, t, n, r) {
575
+ let { normalX: i, normalY: a, offset: o, start: s, end: c } = r, l = i * o, u = a * o, d = e + "-gradient", f = I("linearGradient", {
577
576
  id: d,
578
577
  gradientUnits: "userSpaceOnUse",
579
- x1: N(l - i * c),
580
- y1: N(u - a * c),
581
- x2: N(l + i * c),
582
- y2: N(u + a * c),
578
+ x1: P(l - i * c),
579
+ y1: P(u - a * c),
580
+ x2: P(l + i * c),
581
+ y2: P(u + a * c),
583
582
  spreadMethod: "pad"
584
583
  });
585
- for (let { offset: e, opacity: t } of ue(s, c)) f.appendChild(F("stop", {
584
+ for (let { offset: e, opacity: t } of S(s, c)) f.appendChild(I("stop", {
586
585
  offset: K(e, 3),
587
586
  "stop-color": "white",
588
587
  "stop-opacity": K(t, 3)
589
588
  }));
590
- let p = F("mask", {
589
+ let p = I("mask", {
591
590
  id: e,
592
591
  x: 0,
593
592
  y: 0,
594
- width: N(t),
595
- height: N(n),
593
+ width: P(t),
594
+ height: P(n),
596
595
  maskUnits: "userSpaceOnUse",
597
596
  maskContentUnits: "userSpaceOnUse",
598
597
  "mask-type": "luminance"
599
598
  });
600
- return p.appendChild(F("rect", {
601
- width: N(t),
602
- height: N(n),
599
+ return p.appendChild(I("rect", {
600
+ width: P(t),
601
+ height: P(n),
603
602
  fill: `url(#${d})`
604
603
  })), {
605
604
  gradient: f,
@@ -625,8 +624,8 @@ var q = class extends s {
625
624
  #l = /* @__PURE__ */ new Set();
626
625
  #u = !1;
627
626
  #d = /* @__PURE__ */ new Map();
628
- #f = new f();
629
- #p = F("g");
627
+ #f = new p();
628
+ #p = I("g");
630
629
  #m;
631
630
  #h;
632
631
  #g = [];
@@ -640,13 +639,13 @@ var q = class extends s {
640
639
  #w = 0;
641
640
  constructor(e, t) {
642
641
  super(e), this.width = t.width, this.height = t.height, this.textMetrics = t.textMetrics, this.#h = t.maxVectorInstances;
643
- let n = N(t.width), r = N(t.height);
644
- this.#e = F("svg", {
645
- xmlns: P,
642
+ let n = P(t.width), r = P(t.height);
643
+ this.#e = I("svg", {
644
+ xmlns: F,
646
645
  width: n,
647
646
  height: r,
648
647
  viewBox: `0 0 ${n} ${r}`
649
- }), this.#t = F("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(F("rect", {
648
+ }), this.#t = I("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(I("rect", {
650
649
  width: n,
651
650
  height: r,
652
651
  fill: t.background,
@@ -711,12 +710,12 @@ var q = class extends s {
711
710
  if (o) {
712
711
  if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${r}`);
713
712
  } else {
714
- o = F("g", {
715
- id: je(t.name, this.#v++),
713
+ o = I("g", {
714
+ id: Ae(t.name, this.#v++),
716
715
  "data-name": t.name,
717
716
  "data-view-path": r
718
717
  });
719
- let e = F("title");
718
+ let e = I("title");
720
719
  e.textContent = r, o.appendChild(e), this.currentNode.appendChild(o), a?.viewGroups.set(t, o);
721
720
  }
722
721
  this.#n.push({
@@ -731,8 +730,8 @@ var q = class extends s {
731
730
  }
732
731
  renderMark(r, i) {
733
732
  if (e(this.#n)?.exportExcluded || r.unitView.getEffectiveOpacity() <= 0) return;
734
- let a = t(i), o = n(a, r.properties.clip, this.currentCoords), s = m(this.width, this.height, o);
735
- if (!h(s)) return;
733
+ let a = t(i), o = n(a, r.properties.clip, this.currentCoords), s = g(this.width, this.height, o);
734
+ if (!_(s)) return;
736
735
  let c = this.getVisibleInstanceCount(r);
737
736
  if (!this.#u && this.#h != null && c == 0) return;
738
737
  if (!this.#u && this.#h != null && c > this.#h) {
@@ -741,15 +740,15 @@ var q = class extends s {
741
740
  }
742
741
  let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, d = l ? this.#m.markGroups.get(r)?.get(u ?? "") : void 0;
743
742
  !this.#u && !d && this.#E();
744
- let f = this.#u ? this.#p : this.#O(r, u), g = O(this.currentCoords, a, r.properties.cullByVisibleRange), _ = r.getOrder?.(), v = !this.#u && _ && _.isActive();
745
- if (p(r, i, this.currentCoords, this.#f, (e, t) => {
743
+ let f = this.#u ? this.#p : this.#O(r, u), p = h(this.currentCoords, a, r.properties.cullByVisibleRange), v = r.getOrder?.(), y = !this.#u && v && v.isActive();
744
+ if (m(r, i, this.currentCoords, this.#f, (e, t) => {
746
745
  let n = (t, n = !1) => {
747
- let i = De(r, {
746
+ let i = Ee(r, {
748
747
  coords: e,
749
748
  data: t,
750
749
  group: f,
751
750
  visibleBounds: s,
752
- anchorCullBounds: g,
751
+ anchorCullBounds: p,
753
752
  viewOpacity: r.unitView.getEffectiveOpacity(),
754
753
  textMetrics: this.textMetrics,
755
754
  secondOrderPass: n,
@@ -766,11 +765,11 @@ var q = class extends s {
766
765
  });
767
766
  this.#u && this.#d.set(r, this.getVisibleInstanceCount(r) + i);
768
767
  };
769
- if (!v) {
768
+ if (!y) {
770
769
  n(t);
771
770
  return;
772
771
  }
773
- let i = ae(t, 0, t.length, _.predicate, _.passes);
772
+ let i = ie(t, 0, t.length, v.predicate, v.passes);
774
773
  for (let [e, t] of i.entries()) t.length !== 0 && n(t, e === 1);
775
774
  }, (e) => this.#l.add(`SVG export could not resolve sample facet index ${e}. View: ${r.unitView.getPathString()}`)), !this.#u && !l && f.childElementCount > 0) {
776
775
  let e = this.getClipPathUrl(o);
@@ -806,26 +805,26 @@ var q = class extends s {
806
805
  e && (this.#g.push(e), this.#_ = void 0);
807
806
  }
808
807
  #D(e) {
809
- let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = F("g", {
808
+ let t = je(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = I("g", {
810
809
  id: `rasterized-${n.join("-")}-${this.#w++}`,
811
810
  "data-name": `Rasterized ${n.join(", ")}`,
812
811
  "data-rasterized": ""
813
- }), i = F("image", { preserveAspectRatio: "none" });
812
+ }), i = I("image", { preserveAspectRatio: "none" });
814
813
  r.appendChild(i);
815
814
  let a = e.anchor.parentNode;
816
- t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
817
- for (let n of e.viewNodes) Pe(n, t);
815
+ t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Me(a, t)), e.anchor.remove();
816
+ for (let n of e.viewNodes) Ne(n, t);
818
817
  e.image = i;
819
818
  }
820
819
  #O(e, t) {
821
820
  let n = this.#m;
822
- if (!n) return F("g", { "data-mark-type": e.getType() });
821
+ if (!n) return I("g", { "data-mark-type": e.getType() });
823
822
  let r = n.markGroups.get(e);
824
823
  r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
825
824
  let i = t ?? "", a = r.get(i);
826
825
  if (a) {
827
826
  if (a.parentNode !== this.currentNode) throw Error(`Sample-faceted mark was rendered under multiple parents: ${e.unitView.getPathString()}`);
828
- } else a = F("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
827
+ } else a = I("g", { "data-mark-type": e.getType() }), t && a.setAttribute("clip-path", t), this.currentNode.appendChild(a), r.set(i, a), n.markGroupElements.add(a);
829
828
  return a;
830
829
  }
831
830
  getClipPathUrl(e) {
@@ -835,14 +834,14 @@ var q = class extends s {
835
834
  e.clipY ? t.y : 0,
836
835
  e.clipX ? t.width : this.width,
837
836
  e.clipY ? t.height : this.height
838
- ].map(N), r = n.join(","), i = this.#r.get(r);
837
+ ].map(P), r = n.join(","), i = this.#r.get(r);
839
838
  if (!i) {
840
839
  i = "clip-" + this.#y++;
841
- let e = F("clipPath", {
840
+ let e = I("clipPath", {
842
841
  id: i,
843
842
  clipPathUnits: "userSpaceOnUse"
844
843
  });
845
- e.appendChild(F("rect", {
844
+ e.appendChild(I("rect", {
846
845
  x: n[0],
847
846
  y: n[1],
848
847
  width: n[2],
@@ -852,28 +851,28 @@ var q = class extends s {
852
851
  return `url(#${i})`;
853
852
  }
854
853
  getShadowFilterUrl(e) {
855
- let t = N(Math.max(e.blur / 2.5, .25)), n = N(e.offsetX), r = N(e.offsetY), i = [
854
+ let t = P(Math.max(e.blur / 2.5, .25)), n = P(e.offsetX), r = P(e.offsetY), i = [
856
855
  t,
857
856
  n,
858
857
  r
859
858
  ].join(","), a = this.#a.get(i);
860
859
  if (!a) {
861
860
  a = "shadow-" + this.#x++;
862
- let e = F("filter", {
861
+ let e = I("filter", {
863
862
  id: a,
864
863
  x: 0,
865
864
  y: 0,
866
- width: N(this.width),
867
- height: N(this.height),
865
+ width: P(this.width),
866
+ height: P(this.height),
868
867
  filterUnits: "userSpaceOnUse",
869
868
  primitiveUnits: "userSpaceOnUse",
870
869
  "color-interpolation-filters": "sRGB"
871
870
  });
872
- e.appendChild(F("feGaussianBlur", {
871
+ e.appendChild(I("feGaussianBlur", {
873
872
  in: "SourceGraphic",
874
873
  stdDeviation: t,
875
874
  result: "blur"
876
- })), e.appendChild(F("feOffset", {
875
+ })), e.appendChild(I("feOffset", {
877
876
  in: "blur",
878
877
  dx: n,
879
878
  dy: r,
@@ -886,12 +885,12 @@ var q = class extends s {
886
885
  let t = this.#o.get(e);
887
886
  if (!t) {
888
887
  t = "shadow-clip-" + this.#y++;
889
- let n = F("clipPath", {
888
+ let n = I("clipPath", {
890
889
  id: t,
891
890
  clipPathUnits: "userSpaceOnUse"
892
891
  });
893
- n.appendChild(F("path", {
894
- d: `M 0 0 V ${N(this.height)} H ${N(this.width)} V 0 Z ${e}`,
892
+ n.appendChild(I("path", {
893
+ d: `M 0 0 V ${P(this.height)} H ${P(this.width)} V 0 Z ${e}`,
895
894
  "clip-rule": "evenodd",
896
895
  "fill-rule": "evenodd"
897
896
  })), this.#t.appendChild(n), this.#o.set(e, t);
@@ -902,35 +901,35 @@ var q = class extends s {
902
901
  let t = JSON.stringify([
903
902
  e.type,
904
903
  e.fill,
905
- M(e.fillOpacity),
904
+ N(e.fillOpacity),
906
905
  e.stroke,
907
- M(e.strokeOpacity),
908
- M(e.strokeWidth)
906
+ N(e.strokeOpacity),
907
+ N(e.strokeWidth)
909
908
  ]), n = this.#s.get(t);
910
- return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Oe(n, e)), this.#s.set(t, n)), `url(#${n})`;
909
+ return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(De(n, e)), this.#s.set(t, n)), `url(#${n})`;
911
910
  }
912
911
  getLegendGradientUrl(e) {
913
- let t = "legend-gradient-" + this.#C++, n = F("linearGradient", {
912
+ let t = "legend-gradient-" + this.#C++, n = I("linearGradient", {
914
913
  id: t,
915
914
  gradientUnits: "userSpaceOnUse",
916
- x1: N(e.x1),
917
- y1: N(e.y1),
918
- x2: N(e.x2),
919
- y2: N(e.y2)
915
+ x1: P(e.x1),
916
+ y1: P(e.y1),
917
+ x2: P(e.x2),
918
+ y2: P(e.y2)
920
919
  });
921
- for (let t of e.stops) n.appendChild(F("stop", {
922
- offset: M(t.offset),
920
+ for (let t of e.stops) n.appendChild(I("stop", {
921
+ offset: N(t.offset),
923
922
  "stop-color": t.color
924
923
  }));
925
924
  return this.#t.appendChild(n), `url(#${t})`;
926
925
  }
927
926
  getLinkArcFadeMaskUrl(e) {
928
- let t = x(e.p1, e.p4, e.distances);
927
+ let t = se(e.p1, e.p4, e.distances);
929
928
  if (!t) return;
930
929
  let n = this.#c.get(t.key);
931
930
  if (!n) {
932
931
  n = "link-arc-fade-" + this.#b++;
933
- let { gradient: e, mask: r } = Ae(n, this.width, this.height, t);
932
+ let { gradient: e, mask: r } = ke(n, this.width, this.height, t);
934
933
  this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
935
934
  }
936
935
  return `url(#${n})`;
@@ -943,7 +942,7 @@ var q = class extends s {
943
942
  let i = this.#i.get(r.view);
944
943
  if (!i) {
945
944
  i = "edge-fade-" + this.#b++;
946
- let e = N(this.width), t = N(this.height), a = F("mask", {
945
+ let e = P(this.width), t = P(this.height), a = I("mask", {
947
946
  id: i,
948
947
  x: 0,
949
948
  y: 0,
@@ -953,14 +952,14 @@ var q = class extends s {
953
952
  maskContentUnits: "userSpaceOnUse",
954
953
  "mask-type": "luminance"
955
954
  });
956
- a.appendChild(F("rect", {
955
+ a.appendChild(I("rect", {
957
956
  width: e,
958
957
  height: t,
959
958
  fill: "white"
960
959
  }));
961
960
  for (let [o, s] of n) {
962
- let n = i + "-" + o, c = Fe(n, o, s, r.coords);
963
- this.#t.appendChild(c), a.appendChild(F("rect", {
961
+ let n = i + "-" + o, c = Pe(n, o, s, r.coords);
962
+ this.#t.appendChild(c), a.appendChild(I("rect", {
964
963
  width: e,
965
964
  height: t,
966
965
  fill: `url(#${n})`
@@ -985,44 +984,44 @@ var q = class extends s {
985
984
  return t.coords;
986
985
  }
987
986
  };
988
- function je(e, t) {
987
+ function Ae(e, t) {
989
988
  let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
990
989
  return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
991
990
  }
992
991
  function J(e, t) {
993
992
  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);
994
993
  }
995
- function Me(e) {
994
+ function je(e) {
996
995
  let [t, ...n] = Array.from(e), r = t;
997
996
  for (; n.some((e) => !r.contains(e));) r = r.parentNode;
998
997
  return r;
999
998
  }
1000
- function Ne(e, t) {
999
+ function Me(e, t) {
1001
1000
  let n = e;
1002
1001
  for (; n.parentNode != t;) n = n.parentNode;
1003
1002
  return n;
1004
1003
  }
1005
- function Pe(e, t) {
1004
+ function Ne(e, t) {
1006
1005
  let n = e;
1007
1006
  for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
1008
1007
  let e = n.parentNode;
1009
1008
  n.remove(), n = e;
1010
1009
  }
1011
1010
  }
1012
- function Fe(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 = F("linearGradient", {
1011
+ function Pe(e, t, n, r) {
1012
+ 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 = I("linearGradient", {
1014
1013
  id: e,
1015
1014
  gradientUnits: "userSpaceOnUse",
1016
- x1: N(a ? i : 0),
1017
- y1: N(a ? 0 : i),
1018
- x2: N(a ? o : 0),
1019
- y2: N(a ? 0 : o)
1015
+ x1: P(a ? i : 0),
1016
+ y1: P(a ? 0 : i),
1017
+ x2: P(a ? o : 0),
1018
+ y2: P(a ? 0 : o)
1020
1019
  });
1021
- return s.appendChild(F("stop", {
1020
+ return s.appendChild(I("stop", {
1022
1021
  offset: 0,
1023
1022
  "stop-color": "black",
1024
1023
  "stop-opacity": 1
1025
- })), s.appendChild(F("stop", {
1024
+ })), s.appendChild(I("stop", {
1026
1025
  offset: 1,
1027
1026
  "stop-color": "black",
1028
1027
  "stop-opacity": 0
@@ -1042,7 +1041,7 @@ function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "wh
1042
1041
  warnings: a.getWarnings()
1043
1042
  };
1044
1043
  }
1045
- async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1044
+ async function Fe({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1046
1045
  let r = new q({ picking: !1 }, {
1047
1046
  width: t,
1048
1047
  height: n,
@@ -1057,7 +1056,7 @@ async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1057
1056
  instanceCount: t
1058
1057
  })).filter((e) => e.instanceCount > 0) };
1059
1058
  }
1060
- async function Le(e) {
1059
+ async function Ie(e) {
1061
1060
  let t = await Z(e.viewRoot), n = {
1062
1061
  ...e,
1063
1062
  textMetrics: t
@@ -1122,8 +1121,8 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
1122
1121
  }
1123
1122
  async function Z(e) {
1124
1123
  if (!document.fonts) return e.context.textMetrics;
1125
- let t = te(document);
1126
- return await re(t, e), t;
1124
+ let t = M(document);
1125
+ return await ne(t, e), t;
1127
1126
  }
1128
1127
  function Q(e) {
1129
1128
  let t = Y(e);
@@ -1138,4 +1137,4 @@ function $(e) {
1138
1137
  if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
1139
1138
  }
1140
1139
  //#endregion
1141
- export { Ie as analyzeSvgExport, X as createRasterizedSvg, Y as createSvg, Le as createSvgExport };
1140
+ export { Fe as analyzeSvgExport, X as createRasterizedSvg, Y as createSvg, Ie as createSvgExport };