@genome-spy/app 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/{SharedReadCache-Ey5QIiPM.js → SharedReadCache-9sT2aIxW.js} +6 -12
  2. package/dist/__vite-browser-external-Dgu_Ldik.js +7 -0
  3. package/dist/{agentApi-sPuuT0KS.js → agentApi-BclFF9zB.js} +9981 -8914
  4. package/dist/agentApi.es.js +6783 -5135
  5. package/dist/agentShared.es.js +433 -460
  6. package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
  7. package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
  8. package/dist/{canvas2d-iDK4BC5j.js → canvas2d-8MSf70d4.js} +141 -134
  9. package/dist/{canvas2d-MXaFeZnP.js → canvas2d-BwGNI_Rx.js} +147 -141
  10. package/dist/clipOptions-SrrxeAEU.js +4316 -0
  11. package/dist/clipOptions-clBEbkjv.js +4326 -0
  12. package/dist/{layoutResult-D50MSHXR.js → color-jETn8xK_.js} +29 -10
  13. package/dist/color-uTRRsy8i.js +116 -0
  14. package/dist/{componentStyles-DGtQXvwc.js → componentStyles-C7FbjS-a.js} +1 -1
  15. package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-BItRtKqu.js} +28 -31
  16. package/dist/{viewIdentityRegistry-BDKkEjXl.js → containerView-CWa6ZIJW.js} +28 -31
  17. package/dist/{debug-DbigmdrK.js → debug-23s-jja_.js} +10 -9
  18. package/dist/{debug-BlqDxTw3.js → debug-CWRxvAss.js} +9 -10
  19. package/dist/dialog.es.js +1 -1
  20. package/dist/dist-CmY6iewb.js +1501 -0
  21. package/dist/dist-D6xbz5Ks.js +1501 -0
  22. package/dist/{esm-CjkeZi__.js → esm-BFwBAnbO.js} +25 -25
  23. package/dist/esm-BUkWqSr2.js +299 -0
  24. package/dist/{esm-C-6g-SkZ.js → esm-C0xXMLsR.js} +37 -41
  25. package/dist/{esm-CJeszW-t.js → esm-C2xhhXs0.js} +7 -7
  26. package/dist/esm-C6erfjPM.js +252 -0
  27. package/dist/{esm-DFHFX1sH.js → esm-CVjC7qA4.js} +34 -38
  28. package/dist/esm-CqY5ezGz.js +1249 -0
  29. package/dist/esm-DfMIJ_N2.js +1522 -0
  30. package/dist/esm-Dls41IbZ.js +787 -0
  31. package/dist/{esm-Bv7Frz7C.js → esm-DzQDfrsZ.js} +7 -10
  32. package/dist/esm-aGLCvYRP.js +238 -0
  33. package/dist/{esm-VFJeyk9i.js → esm-nzwgJFGz.js} +40 -36
  34. package/dist/figWigMetadataSourceAdapter-8Kf_vZRf.js +36 -0
  35. package/dist/figWigMetadataSourceAdapter-DdDMZpYO.js +36 -0
  36. package/dist/flowNode-BSjy0Wz3.js +1306 -0
  37. package/dist/flowOutput-D5qpxWe0.js +183 -0
  38. package/dist/index.es.js +4766 -5522
  39. package/dist/index.js +1089 -685
  40. package/dist/inflate-BdC5KvHn.js +886 -0
  41. package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
  42. package/dist/markUtils-RaatLEa-.js +78 -0
  43. package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
  44. package/dist/metadataUtils-DxEPe0vj.js +879 -0
  45. package/dist/order-BnKzKjt4.js +1151 -0
  46. package/dist/order-BpJnq_nV.js +1150 -0
  47. package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
  48. package/dist/{rasterExport-B62RmAK1.js → rasterExport-B-WrX1pa.js} +5 -5
  49. package/dist/{rasterExport-DQH3hVg_.js → rasterExport-C_vx4Jwd.js} +4 -4
  50. package/dist/{rasterization-B05bDo5e.js → rasterization-QktH8Sn2.js} +26 -19
  51. package/dist/rectangle-BAdoDPXu.js +194 -0
  52. package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
  53. package/dist/renderCanvas2D-CsRO78Pq.js +291 -0
  54. package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Y7pkRzbC.js} +98 -92
  55. package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
  56. package/dist/{indexer-DbFTKGlm.js → scaleNull-CVzag4z8.js} +2 -12
  57. package/dist/{indexer-En7gpvLN.js → scaleNull-Pbz7QGnl.js} +2 -12
  58. package/dist/{scalePosition-ByvlXaML.js → scalePosition-CRXa0rCC.js} +8 -1
  59. package/dist/schema.json +33403 -16929
  60. package/dist/style.css +1 -1
  61. package/dist/{svg-N3tj05-e.js → svg-BBMtLgtM.js} +445 -362
  62. package/dist/{svg-DHsq1RpV.js → svg-JjWL6U-T.js} +464 -381
  63. package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-6OcftuoI.js} +3 -3
  64. package/dist/{svgRasterizer-CvCBlxLj.js → svgRasterizer-DkNRaCPs.js} +4 -4
  65. package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
  66. package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
  67. package/dist/url-DeOdSRrv.js +183 -0
  68. package/dist/viewError-B0TMfOpB.js +33 -0
  69. package/dist/viewError-D9aO90cI.js +33 -0
  70. package/dist/{viewSelectors-DDLW-byr.js → viewSelectors-DkFvo33d.js} +914 -752
  71. package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-lM93fHAq.js} +942 -780
  72. package/dist/viewUtils-0SJOewM6.js +6195 -0
  73. package/dist/webgl-CXIO3OQz.js +5782 -0
  74. package/dist/webgl-Pdvfhio5.js +5783 -0
  75. package/package.json +7 -5
  76. package/src/agentApi/index.d.ts +3 -2
  77. package/src/agentShared/index.d.ts +2 -0
  78. package/src/appTypes.d.ts +1 -6
  79. package/src/embedTypes.d.ts +36 -1
  80. package/src/index.d.ts +6 -0
  81. package/src/spec/sampleView.d.ts +68 -13
  82. package/src/spec/view.d.ts +44 -5
  83. package/src/state/paramProvenanceTypes.d.ts +25 -2
  84. package/src/state.d.ts +14 -52
  85. package/dist/clipOptions-B5PibDq3.js +0 -2923
  86. package/dist/clipOptions-Cba4I0AO.js +0 -2903
  87. package/dist/esm-Dndm-NaA.js +0 -1193
  88. package/dist/order-B4uR9Q04.js +0 -1062
  89. package/dist/order-BSPy5DI8.js +0 -1062
  90. package/dist/renderCanvas2D-ChdoHGrU.js +0 -285
  91. package/dist/vega-scale-Byaw1K8O.js +0 -2446
  92. package/dist/vega-scale-Ctz_wa3z.js +0 -2443
  93. package/dist/viewError-BiR9VCgL.js +0 -29
  94. package/dist/viewUtils-JX6CMEYH.js +0 -6664
  95. package/dist/webgl-DdmOwEH0.js +0 -5544
  96. package/dist/webgl-Dw8xqZpX.js +0 -5544
@@ -1,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-DDLW-byr.js";
4
- import { t as a } from "./rasterization-B05bDo5e.js";
5
- import { t as o } from "./rectangle-DE98gIxF.js";
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-BSPy5DI8.js";
8
- import { n as M, t as N } from "./svgNumber-DNxESJQB.js";
1
+ import { ln as e, o as t, s as n } from "./clipOptions-clBEbkjv.js";
2
+ import { s as r } from "./flowNode-BSjy0Wz3.js";
3
+ import { S as i } from "./viewSelectors-lM93fHAq.js";
4
+ import { t as a } from "./rasterization-QktH8Sn2.js";
5
+ import { t as o } from "./rectangle-BAdoDPXu.js";
6
+ import { n as s, r as c } from "./color-uTRRsy8i.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 _, R as v, S as y, T as b, _ as x, a as S, b as C, c as w, d as T, g as E, h as D, i as O, j as k, k as A, l as j, m as M, n as ee, o as te, p as ne, r as re, s as ie, t as ae, u as oe, v as se, x as ce, y as le } from "./order-BpJnq_nV.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 ue(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: h
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: h
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 b(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(de).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 de(e) {
67
+ return `M ${e.map(fe).join(" L ")} Z`;
68
68
  }
69
- function pe(e) {
70
- return `${N(e.x)} ${N(e.y)}`;
69
+ function fe(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, f = le(n, r.shape, t.secondOrderPass), p = .5, m = u.opacity.constant && u.size.constant, h = (e) => d(u.opacity, e) * s * Math.max(0, Math.min(d(u.size, e) / p, 1));
76
- m && o.setAttribute("stroke-opacity", "" + h({}));
77
- let g = I(o, {
74
+ function pe(e, t) {
75
+ let n = e, r = se(n), { coords: i, data: a, group: o, viewOpacity: s, visibleBounds: c } = t, l = n.encoders, u = y(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 g = L(o, {
78
78
  stroke: {
79
- encoder: u.color,
80
- transform: l
79
+ encoder: l.color,
80
+ transform: h
81
81
  },
82
82
  "stroke-width": {
83
- encoder: u.size,
84
- transform: (e) => N(Math.max(+e, p))
83
+ encoder: l.size,
84
+ transform: (e) => P(Math.max(+e, f))
85
85
  }
86
86
  });
87
- o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt");
87
+ o.setAttribute("fill", "none"), o.setAttribute("stroke-linecap", "butt"), o.setAttribute("stroke-linejoin", "miter"), o.setAttribute("stroke-miterlimit", "2");
88
88
  let _ = o, v;
89
- return se(n, r, {
89
+ return le(n, r, {
90
90
  coords: i,
91
91
  data: a,
92
92
  visibleBounds: c
93
- }, ({ datum: e, points: n }) => {
94
- let [r, i, a, s] = n;
93
+ }, ({ datum: e, geometry: n }) => {
95
94
  if (t.countOnly) return;
96
- let c = g(e);
97
- m || (c["stroke-opacity"] = h(e));
98
- let l = f ? t.getLinkArcFadeMaskUrl({
99
- p1: r,
100
- p4: s,
101
- distances: f
95
+ let r = g(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 !== v && (v = l, _ = l ? F("g", { mask: l }) : o, l && o.appendChild(_)), _.appendChild(F("path", {
104
- d: `M ${R(r)} C ${R(i)} ${R(a)} ${R(s)}`,
105
- ...c
102
+ i !== v && (v = i, _ = i ? I("g", { mask: i }) : o, i && o.appendChild(_)), _.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 me(e, t) {
115
114
  let n = e;
116
115
  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, {
116
+ let r = E(n), { inwardStroke: i } = r, { group: a, viewOpacity: o } = t, s = n.encoders, c = A(s.fill), l = A(s.stroke), u = L(a, {
118
117
  fill: {
119
118
  encoder: s.fill,
120
- transform: l
119
+ transform: h
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: h
129
128
  },
130
129
  "stroke-opacity": {
131
130
  encoder: s.strokeOpacity,
@@ -133,47 +132,53 @@ 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
+ }), d = a.getAttribute("fill"), f = a.getAttribute("fill-opacity"), p = a.getAttribute("stroke"), m = a.getAttribute("stroke-opacity"), g = he();
138
+ return x(n, r, t, (e) => {
140
139
  if (t.countOnly) return;
141
- let { datum: n, shape: r, x: l, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
142
- ...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),
150
- ...g
151
- })));
140
+ let { datum: n, radius: r, geometryRadius: h, strokeWidth: _, lineShape: v } = e, y = {
141
+ ...u(n),
142
+ ...i && !v ? { "stroke-width": P(_) } : {},
143
+ ...v ? ge(s, n, o, l) : {}
144
+ }, b = r == h ? 0 : +(y["stroke-opacity"] ?? m) * l(String(y.stroke ?? p)), x = b > 0, S = !v && r != h && (!x || b < 1) && +(y["fill-opacity"] ?? f) * c(String(y.fill ?? d)) > 0;
145
+ S && (a.appendChild(B(e, r, {
146
+ ...y,
147
+ stroke: "none"
148
+ }, g, t.warn)), y.fill = "none"), (!S || x) && a.appendChild(B(e, h, y, g, t.warn));
152
149
  });
153
150
  }
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", {
157
- cx: o,
158
- cy: s,
159
- r: c,
160
- ...i
151
+ function B(e, t, n, r, i) {
152
+ let { shape: a, x: o, y: s, angle: c } = e, l = P(o), u = P(s), d = P(t), f;
153
+ if (a == "circle") f = I("circle", {
154
+ cx: l,
155
+ cy: u,
156
+ r: d,
157
+ ...n
161
158
  });
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),
167
- ...i
159
+ else if (a == "square") f = I("rect", {
160
+ x: P(o - t),
161
+ y: P(s - t),
162
+ width: P(t * 2),
163
+ height: P(t * 2),
164
+ ...n
168
165
  });
169
- let l = a.build(e, t, n, r);
170
- return l ? F("path", {
171
- d: l,
172
- ...i
173
- }) : void 0;
166
+ else {
167
+ let e = r.build(a, o, s, t);
168
+ e ? f = I("path", {
169
+ d: e,
170
+ ...n
171
+ }) : (i(`SVG export rendered unsupported point shape "${a}" as a circle.`), f = I("circle", {
172
+ cx: l,
173
+ cy: u,
174
+ r: d,
175
+ ...n
176
+ }));
177
+ }
178
+ return c && f.setAttribute("transform", `rotate(${P(c)} ${l} ${u})`), f;
174
179
  }
175
- function ge() {
176
- let e = "", t = (e, t) => `${N(e)} ${N(t)}`, n = {
180
+ function he() {
181
+ let e = "", t = (e, t) => `${P(e)} ${P(t)}`, n = {
177
182
  moveTo(n, r) {
178
183
  e += `${e ? " M" : "M"} ${t(n, r)}`;
179
184
  },
@@ -185,26 +190,26 @@ function ge() {
185
190
  }
186
191
  };
187
192
  return { build(t, r, i, a) {
188
- return e = "", ee(t, r, i, a, n) ? e : void 0;
193
+ return e = "", D(t, r, i, a, n) ? e : void 0;
189
194
  } };
190
195
  }
191
- function _e(e, t, n) {
192
- let r = e.stroke(t), i = d(e.strokeOpacity, t), a = r == null || i <= 0;
196
+ function ge(e, t, n, r) {
197
+ let i = h(e.stroke(t)), a = d(e.strokeOpacity, t), o = a * r(i) <= 0;
193
198
  return {
194
199
  fill: "none",
195
- stroke: l(a ? e.fill(t) : r),
196
- "stroke-opacity": (a ? d(e.fillOpacity, t) : i) * n,
197
- "stroke-width": N(d(e.strokeWidth, t)),
200
+ stroke: h(o ? e.fill(t) : i),
201
+ "stroke-opacity": (o ? d(e.fillOpacity, t) : a) * n,
202
+ "stroke-width": P(d(e.strokeWidth, t)),
198
203
  "stroke-linecap": "butt"
199
204
  };
200
205
  }
201
206
  //#endregion
202
207
  //#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, {
208
+ function _e(e, t) {
209
+ let n = e, r = ne(n), { shadow: i, hatch: a } = r, { group: o, viewOpacity: s } = t, c = n.encoders, l = A(c.fill), u = L(o, {
205
210
  fill: {
206
211
  encoder: c.fill,
207
- transform: l
212
+ transform: h
208
213
  },
209
214
  "fill-opacity": {
210
215
  encoder: c.fillOpacity,
@@ -212,7 +217,7 @@ function ve(e, t) {
212
217
  },
213
218
  stroke: {
214
219
  encoder: c.stroke,
215
- transform: l
220
+ transform: h
216
221
  },
217
222
  "stroke-opacity": {
218
223
  encoder: c.strokeOpacity,
@@ -220,136 +225,191 @@ function ve(e, t) {
220
225
  },
221
226
  "stroke-width": {
222
227
  encoder: c.strokeWidth,
223
- transform: (e) => N(+e)
228
+ transform: (e) => P(+e)
224
229
  }
225
230
  }), f = i.opacity > 0 ? {
226
231
  fill: i.color,
227
232
  "fill-opacity": 1,
228
233
  stroke: i.color,
229
234
  "stroke-opacity": 1,
230
- opacity: M(i.opacity * s),
235
+ opacity: N(i.opacity * s),
231
236
  filter: t.getShadowFilterUrl(i)
232
237
  } : null;
233
- return j(n, r, t, (e) => {
238
+ return M(n, r, t, (e) => {
234
239
  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 = {
240
+ let { datum: n, x: r, y: i, width: p, height: m, radii: g, opacityFactor: _, strokeWidth: v, fill: y, fillOpacity: b } = e, x = {
236
241
  ...u(n),
237
- ...g == 1 ? {} : { opacity: M(g) }
242
+ ..._ == 1 ? {} : { opacity: N(_) }
238
243
  };
239
- if (a != "none" && _ > 0 && (b.fill = t.getRectHatchPatternUrl({
244
+ if (a != "none" && v > 0 && (x.fill = t.getRectHatchPatternUrl({
240
245
  type: a,
241
- fill: l(c.fill(n)),
246
+ fill: h(c.fill(n)),
242
247
  fillOpacity: d(c.fillOpacity, n) * s,
243
- stroke: l(c.stroke(n)),
248
+ stroke: h(c.stroke(n)),
244
249
  strokeOpacity: d(c.strokeOpacity, n) * s,
245
- strokeWidth: _
246
- }), b["fill-opacity"] = 1), f) {
247
- let e = B(r, i, p, m, h, {
250
+ strokeWidth: v
251
+ }), x["fill-opacity"] = 1), f) {
252
+ let e = V(r, i, p, m, g, {
248
253
  ...f,
249
- "stroke-width": N(_)
254
+ "stroke-width": P(v)
250
255
  });
251
- if (a == "none" && v != "none" && y == 1 && g == 1) o.appendChild(e);
256
+ if (a == "none" && y != "none" && b * l(y) == 1 && _ == 1) o.appendChild(e);
252
257
  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) });
258
+ let n = v / 2, a = Object.fromEntries(Object.entries(g).map(([e, t]) => [e, t + n])), s = H(r - n, i - n, p + n * 2, m + n * 2, a), c = I("g", { "clip-path": t.getShadowClipPathUrl(s) });
254
259
  c.appendChild(e), o.appendChild(c);
255
260
  }
256
261
  }
257
- o.appendChild(B(r, i, p, m, h, b));
262
+ o.appendChild(V(r, i, p, m, g, x));
258
263
  });
259
264
  }
260
- 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", {
265
+ function V(e, t, n, r, i, a) {
266
+ if (ve(i)) {
267
+ let o = i.topLeft, s = P(e), c = P(t), l = P(e + n), u = P(t + r);
268
+ return I("rect", {
264
269
  x: s,
265
270
  y: c,
266
- width: N(l - s),
267
- height: N(u - c),
271
+ width: P(l - s),
272
+ height: P(u - c),
268
273
  ...o ? {
269
- rx: N(o),
270
- ry: N(o)
274
+ rx: P(o),
275
+ ry: P(o)
271
276
  } : {},
272
277
  ...a
273
278
  });
274
279
  }
275
- return F("path", {
276
- d: V(e, t, n, r, i),
280
+ return I("path", {
281
+ d: H(e, t, n, r, i),
277
282
  ...a
278
283
  });
279
284
  }
280
- function ye(e) {
285
+ function ve(e) {
281
286
  return Object.values(e).every((t) => t == e.topLeft);
282
287
  }
283
- function V(e, t, n, r, i) {
288
+ function H(e, t, n, r, i) {
284
289
  let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
285
290
  return [
286
- `M ${U(e + s, t)}`,
287
- `H ${N(a - c)}`,
288
- H(c, a, t + c, a, t),
289
- `V ${N(o - l)}`,
290
- H(l, a - l, o, a, o),
291
- `H ${N(e + u)}`,
292
- H(u, e, o - u, e, o),
293
- `V ${N(t + s)}`,
294
- H(s, e + s, t, e, t),
291
+ `M ${W(e + s, t)}`,
292
+ `H ${P(a - c)}`,
293
+ U(c, a, t + c, a, t),
294
+ `V ${P(o - l)}`,
295
+ U(l, a - l, o, a, o),
296
+ `H ${P(e + u)}`,
297
+ U(u, e, o - u, e, o),
298
+ `V ${P(t + s)}`,
299
+ U(s, e + s, t, e, t),
295
300
  "Z"
296
301
  ].join(" ");
297
302
  }
298
- 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)}`;
303
+ function U(e, t, n, r, i) {
304
+ return e ? `A ${P(e)} ${P(e)} 0 0 1 ${W(t, n)}` : `L ${W(r, i)}`;
300
305
  }
301
- function U(e, t) {
302
- return `${N(e)} ${N(t)}`;
306
+ function W(e, t) {
307
+ return `${P(e)} ${P(t)}`;
308
+ }
309
+ //#endregion
310
+ //#region ../core/src/rendering/svg/rulePath.js
311
+ function ye(e, t, n, r, i) {
312
+ if (r?.some((e) => e < 0 || !Number.isFinite(e))) throw Error("Invalid stroke dash pattern: " + JSON.stringify(r));
313
+ let a = t / 2, o = [], s = (e, t) => {
314
+ if (e === t && n === "butt") return;
315
+ n === "square" && (e -= a, t += a);
316
+ let r = o.at(-1);
317
+ r && e <= r[1] ? r[1] = Math.max(r[1], t) : o.push([e, t]);
318
+ }, c = r?.length ?? 0, l = (r?.reduce((e, t) => e + t, 0) ?? 0) * (c % 2 ? 2 : 1);
319
+ if (l === 0) s(0, e);
320
+ else {
321
+ let t = -((i % l + l) % l);
322
+ for (let n = 0; t <= e; n++) {
323
+ let i = t + r[n % c];
324
+ n % 2 == 0 && i >= 0 && s(Math.max(0, t), Math.min(e, i)), t = i;
325
+ }
326
+ }
327
+ let u = "", d = (e, t) => `A${a} ${a} 0 0 1 ${e} ${t}`;
328
+ for (let e = 0; e < o.length;) {
329
+ let r = e;
330
+ if (n === "round") for (; r + 1 < o.length && o[r + 1][0] - o[r][1] < t;) r++;
331
+ u += `M${o[e][0]} ${-a}H${o[e][1]}`;
332
+ for (let t = e; t < r; t++) {
333
+ let e = o[t][1], n = o[t + 1][0], r = (e + n) / 2, i = Math.sqrt(Math.max(0, a * a - ((n - e) / 2) ** 2));
334
+ u += d(r, -i) + d(n, -a) + `H${o[t + 1][1]}`;
335
+ }
336
+ u += n === "round" ? d(o[r][1], a) : `V${a}`, u += `H${o[r][0]}`;
337
+ for (let t = r; t > e; t--) {
338
+ let e = o[t - 1][1], n = o[t][0], r = (e + n) / 2, i = Math.sqrt(Math.max(0, a * a - ((n - e) / 2) ** 2));
339
+ u += d(r, i) + d(e, a) + `H${o[t - 1][0]}`;
340
+ }
341
+ n === "round" && (u += d(o[e][0], -a)), u += "Z", e = r + 1;
342
+ }
343
+ return u;
303
344
  }
304
345
  //#endregion
305
346
  //#region ../core/src/rendering/svg/renderers/rule.js
306
- 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, {
347
+ function G(e, t) {
348
+ let n = e, r = oe(n), i = r.strokeAlign, { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l } = t, u = n.encoders, f = n.getType() === "rule", p = k(n, n.properties.strokeDash), m = k(n, n.properties.strokeDashOffset), g = L(s, {
308
349
  stroke: {
309
- encoder: u.color,
310
- transform: l
311
- },
312
- "stroke-opacity": {
313
- encoder: u.opacity,
314
- transform: (e) => +e * s
350
+ encoder: u.fill,
351
+ transform: h
315
352
  },
316
353
  "stroke-width": {
317
354
  encoder: u.size,
318
- transform: (e) => N(+e)
355
+ transform: (e) => P(+e)
319
356
  }
320
357
  });
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, {
322
- coords: i,
323
- data: a,
324
- visibleBounds: c
358
+ return s.setAttribute("stroke-linecap", r.strokeCap), p && (s.setAttribute("stroke-dasharray", p.map(P).join(" ")), s.setAttribute("stroke-dashoffset", "" + P(m))), T(n, r, {
359
+ coords: a,
360
+ data: o,
361
+ visibleBounds: l
325
362
  }, (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)
363
+ if (t.countOnly) return;
364
+ let n = d(u.opacity, e.datum) * c, a = f ? d(u.fillOpacity, e.datum) : 1;
365
+ if (e.strokeWidth > 0) {
366
+ let o = e.x2 - e.x1, c = e.y2 - e.y1, l = Math.hypot(o, c), d = Math.atan2(c, o) * 180 / Math.PI, f = ye(l, P(e.size), r.strokeCap, p, m), g = I("g", {
367
+ transform: `translate(${P(e.x1)} ${P(e.y1)}) rotate(${d})`,
368
+ opacity: n,
369
+ "stroke-dasharray": "none"
370
+ });
371
+ g.append(I("path", {
372
+ d: f,
373
+ fill: "none",
374
+ stroke: e.stroke,
375
+ "stroke-width": (i === "center" ? 1 : 2) * e.strokeWidth,
376
+ ...i === "center" ? {} : { mask: t.getRuleStrokeMaskUrl(f, l, e.size / 2, e.strokeWidth + 1, i === "inside") },
377
+ "stroke-opacity": e.strokeOpacity,
378
+ "stroke-linejoin": "round"
379
+ }), I("path", {
380
+ d: f,
381
+ fill: h(u.fill(e.datum)),
382
+ "fill-opacity": a,
383
+ stroke: "none"
384
+ })), i !== "outside" && g.insertBefore(g.lastChild, g.firstChild), s.appendChild(g);
385
+ } else s.appendChild(I("line", {
386
+ x1: P(e.x1),
387
+ y1: P(e.y1),
388
+ x2: P(e.x2),
389
+ y2: P(e.y2),
390
+ ...g(e.datum),
391
+ "stroke-opacity": n * a
332
392
  }));
333
393
  });
334
394
  }
335
395
  //#endregion
336
396
  //#region ../core/src/rendering/svg/renderers/text.js
337
397
  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, {
398
+ let n = e, r = n.properties, i = t.textMetrics ?? n.unitView.context.textMetrics, a = i.requestFont(r), o = O(i, r), s = w(n), { coords: c, data: l, group: u, viewOpacity: d, visibleBounds: f, anchorCullBounds: p } = t, m = n.encoders, g = L(u, {
339
399
  fill: {
340
- encoder: h.color,
341
- transform: l
400
+ encoder: m.color,
401
+ transform: h
342
402
  },
343
403
  "fill-opacity": {
344
- encoder: h.opacity,
345
- transform: (e) => +e * f
404
+ encoder: m.opacity,
405
+ transform: (e) => +e * d
346
406
  },
347
407
  "font-size": {
348
- encoder: h.size,
349
- transform: (e) => N(+e)
408
+ encoder: m.size,
409
+ transform: (e) => P(+e)
350
410
  }
351
411
  });
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]);
412
+ u.setAttribute("font-family", S(r.font)), u.setAttribute("font-style", r.fontStyle ?? "normal"), u.setAttribute("font-weight", "" + ie(r.fontWeight ?? "normal")), u.setAttribute("text-anchor", xe[s.align]);
353
413
  let _ = {
354
414
  top: {
355
415
  width: k(n, r.viewportEdgeFadeWidthTop),
@@ -367,20 +427,20 @@ function be(e, t) {
367
427
  width: k(n, r.viewportEdgeFadeWidthLeft),
368
428
  distance: k(n, r.viewportEdgeFadeDistanceLeft)
369
429
  }
370
- }, v = A(n, s, {
430
+ }, v = j(n, s, {
371
431
  coords: c,
372
- data: u,
373
- visibleBounds: p,
374
- anchorCullBounds: m,
432
+ data: l,
433
+ visibleBounds: f,
434
+ anchorCullBounds: p,
375
435
  fontMeasurement: a,
376
436
  measureLogoInkBounds: o
377
437
  }, (e) => {
378
438
  if (t.countOnly) return;
379
439
  if (e.logoTransform) {
380
440
  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", {
441
+ let n = [`translate(${P(e.x)} ${P(e.y)})`];
442
+ 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)})`);
443
+ let r = I("text", {
384
444
  x: 0,
385
445
  y: 0,
386
446
  "text-anchor": "start",
@@ -388,24 +448,24 @@ function be(e, t) {
388
448
  ...g(e.datum),
389
449
  "font-size": e.size
390
450
  });
391
- r.textContent = e.text, d.appendChild(r);
451
+ r.textContent = e.text, u.appendChild(r);
392
452
  return;
393
453
  }
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", {
454
+ let n = [`translate(${P(e.x)} ${P(e.y)})`];
455
+ 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)})`);
456
+ let r = I("text", {
397
457
  x: 0,
398
458
  y: 0,
399
- dy: N(ne(s.baseline, e.size)),
459
+ dy: P(te(s.baseline, e.size)),
400
460
  ...g(e.datum),
401
- ...e.fadeOpacity == 1 ? {} : { opacity: M(e.fadeOpacity) },
461
+ ...e.fadeOpacity == 1 ? {} : { opacity: N(e.fadeOpacity) },
402
462
  transform: n.join(" ")
403
463
  });
404
- r.textContent = e.text, d.appendChild(r);
464
+ r.textContent = e.text, u.appendChild(r);
405
465
  });
406
- if (!t.countOnly && d.childElementCount > 0) {
466
+ if (!t.countOnly && u.childElementCount > 0) {
407
467
  let e = t.getViewportEdgeFadeMaskUrl(_);
408
- e && d.setAttribute("mask", e);
468
+ e && u.setAttribute("mask", e);
409
469
  }
410
470
  return v;
411
471
  }
@@ -413,52 +473,52 @@ var xe = {
413
473
  left: "start",
414
474
  center: "middle",
415
475
  right: "end"
416
- }, G = 64;
417
- function Se(e, t) {
418
- let n = we(e.unitView);
419
- if (!n) return;
420
- let i = e.unitView.getScaleResolution(n.channel)?.getScale();
421
- if (!i || !r(i.type)) return;
422
- let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: d } = t;
476
+ }, K = 64;
477
+ function Se(t, n) {
478
+ let r = we(t.unitView);
479
+ if (!r) return;
480
+ let i = t.unitView.getScaleResolution(r.channel)?.getScale();
481
+ if (!i || !e(i.type)) return;
482
+ let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: u } = n;
423
483
  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), {
484
+ let d = t.encoders, f = r.channel == "stroke" ? d.stroke : d.fill, m = Te(t.unitView.spec.encoding.x), g = Infinity, _ = Infinity, v = -Infinity, y = -Infinity, b = l(a, d, "x", o[0]), x = l(a, d, "y", o[0]), S = [0, 0], C = [0, 0], w = o.map((e) => {
485
+ let [t, n] = b(e, S), [r, i] = x(e, C);
486
+ return g = Math.min(g, t, n), _ = Math.min(_, r, i), v = Math.max(v, t, n), y = Math.max(y, r, i), {
427
487
  offset: Number(e.position),
428
- color: l(p(e))
488
+ color: h(f(e))
429
489
  };
430
490
  }).sort((e, t) => e.offset - t.offset);
431
- if (!_(d, h, v, y, b)) return 0;
432
- if (t.countOnly) return o.length;
433
- let S = Ce(x), C = [
491
+ if (!p(u, g, _, v, y)) return 0;
492
+ if (n.countOnly) return o.length;
493
+ let T = Ce(w), E = [
434
494
  {
435
495
  offset: 0,
436
- color: S[0].color
496
+ color: T[0].color
437
497
  },
438
- ...S,
498
+ ...T,
439
499
  {
440
500
  offset: 1,
441
- color: S.at(-1).color
501
+ color: T.at(-1).color
442
502
  }
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),
503
+ ], D = n.getLegendGradientUrl({
504
+ x1: g,
505
+ y1: m ? _ : y,
506
+ x2: m ? v : g,
507
+ y2: _,
508
+ stops: E
509
+ }), O = P(g), k = P(_), A = P(v), j = P(y), M = Number(d.fillOpacity(o[0])) * c;
510
+ return s.appendChild(I("rect", {
511
+ x: O,
512
+ y: k,
513
+ width: P(A - O),
514
+ height: P(j - k),
515
+ fill: D,
516
+ "fill-opacity": N(M),
457
517
  stroke: "none"
458
518
  })), o.length;
459
519
  }
460
520
  function Ce(e) {
461
- return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
521
+ return e.length <= K ? e : Array.from({ length: K }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
462
522
  }
463
523
  function we(e) {
464
524
  let t = e;
@@ -474,13 +534,13 @@ function Te(e) {
474
534
  //#endregion
475
535
  //#region ../core/src/rendering/svg/renderers/index.js
476
536
  var Ee = /* @__PURE__ */ new Map([
477
- ["arrow", de],
478
- ["link", me],
479
- ["point", z],
480
- ["rect", ve],
481
- ["rule", W],
537
+ ["arrow", ue],
538
+ ["link", pe],
539
+ ["point", me],
540
+ ["rect", _e],
541
+ ["rule", G],
482
542
  ["text", be],
483
- ["tick", W]
543
+ ["tick", G]
484
544
  ]);
485
545
  function De(e, t) {
486
546
  if (e.getType() == "rect") {
@@ -506,31 +566,31 @@ function Oe(e, t) {
506
566
  "vertical",
507
567
  "horizontal",
508
568
  "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", {
569
+ ].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
570
  id: e,
511
571
  x: 0,
512
572
  y: 0,
513
- width: N(c),
514
- height: N(l),
573
+ width: P(c),
574
+ height: P(l),
515
575
  patternUnits: "userSpaceOnUse"
516
576
  });
517
- u.appendChild(F("rect", {
518
- width: N(c),
519
- height: N(l),
577
+ u.appendChild(I("rect", {
578
+ width: P(c),
579
+ height: P(l),
520
580
  fill: t.fill,
521
- "fill-opacity": M(t.fillOpacity)
581
+ "fill-opacity": N(t.fillOpacity)
522
582
  }));
523
- let d = F("g", {
583
+ let d = I("g", {
524
584
  fill: "none",
525
585
  stroke: t.stroke,
526
- "stroke-opacity": M(t.strokeOpacity),
527
- "stroke-width": N(s),
586
+ "stroke-opacity": N(t.strokeOpacity),
587
+ "stroke-width": P(s),
528
588
  "stroke-linecap": "square"
529
589
  });
530
590
  return ke(d, t.type, o, s), u.appendChild(d), u;
531
591
  }
532
592
  function ke(e, t, n, r) {
533
- let i = (t) => e.appendChild(F("path", { d: t })), a = (e) => N(e), o = (e) => {
593
+ let i = (t) => e.appendChild(I("path", { d: t })), a = (e) => P(e), o = (e) => {
534
594
  for (let t of [
535
595
  -n,
536
596
  0,
@@ -559,10 +619,10 @@ function ke(e, t, n, r) {
559
619
  case "dots":
560
620
  case "rings":
561
621
  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)
622
+ let r = n * (t == "dots" ? .07 : t == "rings" ? .2 : .35), i = (t, n) => e.appendChild(I("circle", {
623
+ cx: P(t),
624
+ cy: P(n),
625
+ r: P(r)
566
626
  }));
567
627
  i(n / 2, 0), i(n / 2, n * 2), i(0, n), i(n, n);
568
628
  break;
@@ -573,46 +633,46 @@ function ke(e, t, n, r) {
573
633
  //#endregion
574
634
  //#region ../core/src/rendering/svg/linkArcFadeMask.js
575
635
  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", {
636
+ 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
637
  id: d,
578
638
  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),
639
+ x1: P(l - i * c),
640
+ y1: P(u - a * c),
641
+ x2: P(l + i * c),
642
+ y2: P(u + a * c),
583
643
  spreadMethod: "pad"
584
644
  });
585
- for (let { offset: e, opacity: t } of ue(s, c)) f.appendChild(F("stop", {
586
- offset: K(e, 3),
645
+ for (let { offset: e, opacity: t } of C(s, c)) f.appendChild(I("stop", {
646
+ offset: q(e, 3),
587
647
  "stop-color": "white",
588
- "stop-opacity": K(t, 3)
648
+ "stop-opacity": q(t, 3)
589
649
  }));
590
- let p = F("mask", {
650
+ let p = I("mask", {
591
651
  id: e,
592
652
  x: 0,
593
653
  y: 0,
594
- width: N(t),
595
- height: N(n),
654
+ width: P(t),
655
+ height: P(n),
596
656
  maskUnits: "userSpaceOnUse",
597
657
  maskContentUnits: "userSpaceOnUse",
598
658
  "mask-type": "luminance"
599
659
  });
600
- return p.appendChild(F("rect", {
601
- width: N(t),
602
- height: N(n),
660
+ return p.appendChild(I("rect", {
661
+ width: P(t),
662
+ height: P(n),
603
663
  fill: `url(#${d})`
604
664
  })), {
605
665
  gradient: f,
606
666
  mask: p
607
667
  };
608
668
  }
609
- function K(e, t) {
669
+ function q(e, t) {
610
670
  let n = 10 ** t;
611
671
  return Math.round(e * n) / n;
612
672
  }
613
673
  //#endregion
614
674
  //#region ../core/src/rendering/svg/svgViewRenderingContext.js
615
- var q = class extends s {
675
+ var J = class extends c {
616
676
  #e;
617
677
  #t;
618
678
  #n = [];
@@ -625,8 +685,8 @@ var q = class extends s {
625
685
  #l = /* @__PURE__ */ new Set();
626
686
  #u = !1;
627
687
  #d = /* @__PURE__ */ new Map();
628
- #f = new f();
629
- #p = F("g");
688
+ #f = new m();
689
+ #p = I("g");
630
690
  #m;
631
691
  #h;
632
692
  #g = [];
@@ -640,13 +700,13 @@ var q = class extends s {
640
700
  #w = 0;
641
701
  constructor(e, t) {
642
702
  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,
703
+ let n = P(t.width), r = P(t.height);
704
+ this.#e = I("svg", {
705
+ xmlns: F,
646
706
  width: n,
647
707
  height: r,
648
708
  viewBox: `0 0 ${n} ${r}`
649
- }), this.#t = F("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(F("rect", {
709
+ }), this.#t = I("defs"), this.#e.appendChild(this.#t), t.background != null && this.#e.appendChild(I("rect", {
650
710
  width: n,
651
711
  height: r,
652
712
  fill: t.background,
@@ -687,104 +747,105 @@ var q = class extends s {
687
747
  for (let t of e.markGroupElements) t.childElementCount || t.remove();
688
748
  this.#m = void 0;
689
749
  }
690
- pushView(t, n) {
691
- let r = t.getPathString();
692
- if (e(this.#n)?.exportExcluded || i(t) && t.name.startsWith("scrollbar-")) {
750
+ pushView(e, t) {
751
+ let n = e.getPathString();
752
+ if (r(this.#n)?.exportExcluded || i(e) && e.name.startsWith("scrollbar-")) {
693
753
  this.#n.push({
694
- view: t,
754
+ view: e,
695
755
  node: this.currentNode,
696
- coords: n,
756
+ coords: t,
697
757
  exportExcluded: !0
698
758
  });
699
759
  return;
700
760
  }
701
761
  if (this.#u) {
702
762
  this.#n.push({
703
- view: t,
763
+ view: e,
704
764
  node: this.currentNode,
705
- coords: n,
765
+ coords: t,
706
766
  exportExcluded: !1
707
767
  });
708
768
  return;
709
769
  }
710
- let a = this.#m, o = a?.viewGroups.get(t);
770
+ let a = this.#m, o = a?.viewGroups.get(e);
711
771
  if (o) {
712
- if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${r}`);
772
+ if (o.parentNode !== this.currentNode) throw Error(`Sample-faceted view was rendered under multiple parents: ${n}`);
713
773
  } else {
714
- o = F("g", {
715
- id: je(t.name, this.#v++),
716
- "data-name": t.name,
717
- "data-view-path": r
774
+ o = I("g", {
775
+ id: je(e.name, this.#v++),
776
+ "data-name": e.name,
777
+ "data-view-path": n
718
778
  });
719
- let e = F("title");
720
- e.textContent = r, o.appendChild(e), this.currentNode.appendChild(o), a?.viewGroups.set(t, o);
779
+ let t = I("title");
780
+ t.textContent = n, o.appendChild(t), this.currentNode.appendChild(o), a?.viewGroups.set(e, o);
721
781
  }
722
782
  this.#n.push({
723
- view: t,
783
+ view: e,
724
784
  node: o,
725
- coords: n,
785
+ coords: t,
726
786
  exportExcluded: !1
727
787
  });
728
788
  }
729
789
  popView(e) {
730
790
  if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
731
791
  }
732
- renderMark(r, i) {
733
- 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;
736
- let c = this.getVisibleInstanceCount(r);
792
+ renderMark(e, i) {
793
+ if (r(this.#n)?.exportExcluded || e.unitView.getEffectiveOpacity() <= 0) return;
794
+ let a = t(i), o = n(a, e.properties.clip, this.currentCoords), s = _(this.width, this.height, o);
795
+ if (!f(s)) return;
796
+ let c = this.getVisibleInstanceCount(e);
737
797
  if (!this.#u && this.#h != null && c == 0) return;
738
798
  if (!this.#u && this.#h != null && c > this.#h) {
739
- this.#T(r, s);
799
+ this.#T(e, s);
740
800
  return;
741
801
  }
742
- 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;
802
+ let l = !this.#u && this.#m != null, u = l ? this.getClipPathUrl(o) : void 0, d = l ? this.#m.markGroups.get(e)?.get(u ?? "") : void 0;
743
803
  !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) => {
746
- let n = (t, n = !1) => {
747
- let i = De(r, {
748
- coords: e,
749
- data: t,
750
- group: f,
804
+ let p = this.#u ? this.#p : this.#O(e, u), m = g(this.currentCoords, a, e.properties.cullByVisibleRange), h = e.getOrder?.(), y = !this.#u && h && h.isActive();
805
+ if (v(e, i, this.currentCoords, this.#f, (t, n) => {
806
+ let r = (n, r = !1) => {
807
+ let i = De(e, {
808
+ coords: t,
809
+ data: n,
810
+ group: p,
751
811
  visibleBounds: s,
752
- anchorCullBounds: g,
753
- viewOpacity: r.unitView.getEffectiveOpacity(),
812
+ anchorCullBounds: m,
813
+ viewOpacity: e.unitView.getEffectiveOpacity(),
754
814
  textMetrics: this.textMetrics,
755
- secondOrderPass: n,
815
+ secondOrderPass: r,
756
816
  countOnly: this.#u,
757
817
  getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
758
818
  getShadowFilterUrl: (e) => this.#u ? "" : this.getShadowFilterUrl(e),
819
+ getRuleStrokeMaskUrl: (e, t, n, r, i) => this.getRuleStrokeMaskUrl(e, t, n, r, i),
759
820
  getShadowClipPathUrl: (e) => this.#u ? "" : this.getShadowClipPathUrl(e),
760
821
  getRectHatchPatternUrl: (e) => this.#u ? "" : this.getRectHatchPatternUrl(e),
761
822
  getLinkArcFadeMaskUrl: (e) => this.#u ? void 0 : this.getLinkArcFadeMaskUrl(e),
762
823
  getLegendGradientUrl: (e) => this.#u ? "" : this.getLegendGradientUrl(e),
763
- warn: (e) => {
764
- this.#u || this.#l.add(`${e} View: ${r.unitView.getPathString()}`);
824
+ warn: (t) => {
825
+ this.#u || this.#l.add(`${t} View: ${e.unitView.getPathString()}`);
765
826
  }
766
827
  });
767
- this.#u && this.#d.set(r, this.getVisibleInstanceCount(r) + i);
828
+ this.#u && this.#d.set(e, this.getVisibleInstanceCount(e) + i);
768
829
  };
769
- if (!v) {
770
- n(t);
830
+ if (!y) {
831
+ r(n);
771
832
  return;
772
833
  }
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 && !l && f.childElementCount > 0) {
834
+ let i = ae(n, 0, n.length, h.predicate, h.passes);
835
+ for (let [e, t] of i.entries()) t.length !== 0 && r(t, e === 1);
836
+ }, (t) => this.#l.add(`SVG export could not resolve sample facet index ${t}. View: ${e.unitView.getPathString()}`)), !this.#u && !l && p.childElementCount > 0) {
776
837
  let e = this.getClipPathUrl(o);
777
- e && f.setAttribute("clip-path", e), this.currentNode.appendChild(f);
838
+ e && p.setAttribute("clip-path", e), this.currentNode.appendChild(p);
778
839
  }
779
840
  }
780
841
  #T(e, t) {
781
842
  let n = this.#m?.rasterRuns.get(e);
782
843
  if (n) {
783
- J(n.bounds, t), n.viewNodes.add(this.currentNode);
844
+ Y(n.bounds, t), n.viewNodes.add(this.currentNode);
784
845
  return;
785
846
  }
786
847
  let r = this.#_;
787
- if (r) J(r.bounds, t);
848
+ if (r) Y(r.bounds, t);
788
849
  else {
789
850
  let e = document.createComment("raster-run");
790
851
  this.currentNode.appendChild(e), r = {
@@ -806,11 +867,11 @@ var q = class extends s {
806
867
  e && (this.#g.push(e), this.#_ = void 0);
807
868
  }
808
869
  #D(e) {
809
- let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = F("g", {
870
+ let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = I("g", {
810
871
  id: `rasterized-${n.join("-")}-${this.#w++}`,
811
872
  "data-name": `Rasterized ${n.join(", ")}`,
812
873
  "data-rasterized": ""
813
- }), i = F("image", { preserveAspectRatio: "none" });
874
+ }), i = I("image", { preserveAspectRatio: "none" });
814
875
  r.appendChild(i);
815
876
  let a = e.anchor.parentNode;
816
877
  t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
@@ -819,13 +880,13 @@ var q = class extends s {
819
880
  }
820
881
  #O(e, t) {
821
882
  let n = this.#m;
822
- if (!n) return F("g", { "data-mark-type": e.getType() });
883
+ if (!n) return I("g", { "data-mark-type": e.getType() });
823
884
  let r = n.markGroups.get(e);
824
885
  r || (r = /* @__PURE__ */ new Map(), n.markGroups.set(e, r));
825
886
  let i = t ?? "", a = r.get(i);
826
887
  if (a) {
827
888
  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);
889
+ } 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
890
  return a;
830
891
  }
831
892
  getClipPathUrl(e) {
@@ -835,14 +896,14 @@ var q = class extends s {
835
896
  e.clipY ? t.y : 0,
836
897
  e.clipX ? t.width : this.width,
837
898
  e.clipY ? t.height : this.height
838
- ].map(N), r = n.join(","), i = this.#r.get(r);
899
+ ].map(P), r = n.join(","), i = this.#r.get(r);
839
900
  if (!i) {
840
901
  i = "clip-" + this.#y++;
841
- let e = F("clipPath", {
902
+ let e = I("clipPath", {
842
903
  id: i,
843
904
  clipPathUnits: "userSpaceOnUse"
844
905
  });
845
- e.appendChild(F("rect", {
906
+ e.appendChild(I("rect", {
846
907
  x: n[0],
847
908
  y: n[1],
848
909
  width: n[2],
@@ -852,28 +913,28 @@ var q = class extends s {
852
913
  return `url(#${i})`;
853
914
  }
854
915
  getShadowFilterUrl(e) {
855
- let t = N(Math.max(e.blur / 2.5, .25)), n = N(e.offsetX), r = N(e.offsetY), i = [
916
+ let t = P(Math.max(e.blur / 2.5, .25)), n = P(e.offsetX), r = P(e.offsetY), i = [
856
917
  t,
857
918
  n,
858
919
  r
859
920
  ].join(","), a = this.#a.get(i);
860
921
  if (!a) {
861
922
  a = "shadow-" + this.#x++;
862
- let e = F("filter", {
923
+ let e = I("filter", {
863
924
  id: a,
864
925
  x: 0,
865
926
  y: 0,
866
- width: N(this.width),
867
- height: N(this.height),
927
+ width: P(this.width),
928
+ height: P(this.height),
868
929
  filterUnits: "userSpaceOnUse",
869
930
  primitiveUnits: "userSpaceOnUse",
870
931
  "color-interpolation-filters": "sRGB"
871
932
  });
872
- e.appendChild(F("feGaussianBlur", {
933
+ e.appendChild(I("feGaussianBlur", {
873
934
  in: "SourceGraphic",
874
935
  stdDeviation: t,
875
936
  result: "blur"
876
- })), e.appendChild(F("feOffset", {
937
+ })), e.appendChild(I("feOffset", {
877
938
  in: "blur",
878
939
  dx: n,
879
940
  dy: r,
@@ -882,16 +943,38 @@ var q = class extends s {
882
943
  }
883
944
  return `url(#${a})`;
884
945
  }
946
+ getRuleStrokeMaskUrl(e, t, n, r, i = !1) {
947
+ let a = "rule-stroke-" + this.#y++, o = {
948
+ x: -n - r,
949
+ y: -n - r,
950
+ width: t + 2 * (n + r),
951
+ height: 2 * (n + r)
952
+ }, s = I("mask", {
953
+ id: a,
954
+ ...o,
955
+ maskUnits: "userSpaceOnUse",
956
+ maskContentUnits: "userSpaceOnUse",
957
+ "mask-type": "luminance"
958
+ });
959
+ return s.append(I("rect", {
960
+ ...o,
961
+ fill: i ? "black" : "white"
962
+ }), I("path", {
963
+ d: e,
964
+ fill: i ? "white" : "black",
965
+ stroke: "none"
966
+ })), this.#t.appendChild(s), `url(#${a})`;
967
+ }
885
968
  getShadowClipPathUrl(e) {
886
969
  let t = this.#o.get(e);
887
970
  if (!t) {
888
971
  t = "shadow-clip-" + this.#y++;
889
- let n = F("clipPath", {
972
+ let n = I("clipPath", {
890
973
  id: t,
891
974
  clipPathUnits: "userSpaceOnUse"
892
975
  });
893
- n.appendChild(F("path", {
894
- d: `M 0 0 V ${N(this.height)} H ${N(this.width)} V 0 Z ${e}`,
976
+ n.appendChild(I("path", {
977
+ d: `M 0 0 V ${P(this.height)} H ${P(this.width)} V 0 Z ${e}`,
895
978
  "clip-rule": "evenodd",
896
979
  "fill-rule": "evenodd"
897
980
  })), this.#t.appendChild(n), this.#o.set(e, t);
@@ -902,30 +985,30 @@ var q = class extends s {
902
985
  let t = JSON.stringify([
903
986
  e.type,
904
987
  e.fill,
905
- M(e.fillOpacity),
988
+ N(e.fillOpacity),
906
989
  e.stroke,
907
- M(e.strokeOpacity),
908
- M(e.strokeWidth)
990
+ N(e.strokeOpacity),
991
+ N(e.strokeWidth)
909
992
  ]), n = this.#s.get(t);
910
993
  return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Oe(n, e)), this.#s.set(t, n)), `url(#${n})`;
911
994
  }
912
995
  getLegendGradientUrl(e) {
913
- let t = "legend-gradient-" + this.#C++, n = F("linearGradient", {
996
+ let t = "legend-gradient-" + this.#C++, n = I("linearGradient", {
914
997
  id: t,
915
998
  gradientUnits: "userSpaceOnUse",
916
- x1: N(e.x1),
917
- y1: N(e.y1),
918
- x2: N(e.x2),
919
- y2: N(e.y2)
999
+ x1: P(e.x1),
1000
+ y1: P(e.y1),
1001
+ x2: P(e.x2),
1002
+ y2: P(e.y2)
920
1003
  });
921
- for (let t of e.stops) n.appendChild(F("stop", {
922
- offset: M(t.offset),
1004
+ for (let t of e.stops) n.appendChild(I("stop", {
1005
+ offset: N(t.offset),
923
1006
  "stop-color": t.color
924
1007
  }));
925
1008
  return this.#t.appendChild(n), `url(#${t})`;
926
1009
  }
927
1010
  getLinkArcFadeMaskUrl(e) {
928
- let t = x(e.p1, e.p4, e.distances);
1011
+ let t = ce(e.p1, e.p4, e.distances);
929
1012
  if (!t) return;
930
1013
  let n = this.#c.get(t.key);
931
1014
  if (!n) {
@@ -935,38 +1018,38 @@ var q = class extends s {
935
1018
  }
936
1019
  return `url(#${n})`;
937
1020
  }
938
- getViewportEdgeFadeMaskUrl(t) {
939
- let n = Object.entries(t).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
940
- if (!n.length) return;
941
- let r = e(this.#n);
942
- if (!r) throw Error("No current view in SVG rendering context.");
943
- let i = this.#i.get(r.view);
1021
+ getViewportEdgeFadeMaskUrl(e) {
1022
+ let t = Object.entries(e).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
1023
+ if (!t.length) return;
1024
+ let n = r(this.#n);
1025
+ if (!n) throw Error("No current view in SVG rendering context.");
1026
+ let i = this.#i.get(n.view);
944
1027
  if (!i) {
945
1028
  i = "edge-fade-" + this.#b++;
946
- let e = N(this.width), t = N(this.height), a = F("mask", {
1029
+ let e = P(this.width), r = P(this.height), a = I("mask", {
947
1030
  id: i,
948
1031
  x: 0,
949
1032
  y: 0,
950
1033
  width: e,
951
- height: t,
1034
+ height: r,
952
1035
  maskUnits: "userSpaceOnUse",
953
1036
  maskContentUnits: "userSpaceOnUse",
954
1037
  "mask-type": "luminance"
955
1038
  });
956
- a.appendChild(F("rect", {
1039
+ a.appendChild(I("rect", {
957
1040
  width: e,
958
- height: t,
1041
+ height: r,
959
1042
  fill: "white"
960
1043
  }));
961
- 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", {
1044
+ for (let [o, s] of t) {
1045
+ let t = i + "-" + o, c = Fe(t, o, s, n.coords);
1046
+ this.#t.appendChild(c), a.appendChild(I("rect", {
964
1047
  width: e,
965
- height: t,
966
- fill: `url(#${n})`
1048
+ height: r,
1049
+ fill: `url(#${t})`
967
1050
  }));
968
1051
  }
969
- this.#t.appendChild(a), this.#i.set(r.view, i);
1052
+ this.#t.appendChild(a), this.#i.set(n.view, i);
970
1053
  }
971
1054
  return `url(#${i})`;
972
1055
  }
@@ -977,19 +1060,19 @@ var q = class extends s {
977
1060
  return Array.from(this.#l);
978
1061
  }
979
1062
  get currentNode() {
980
- return e(this.#n)?.node ?? this.#e;
1063
+ return r(this.#n)?.node ?? this.#e;
981
1064
  }
982
1065
  get currentCoords() {
983
- let t = e(this.#n);
984
- if (!t) throw Error("No current view in SVG rendering context.");
985
- return t.coords;
1066
+ let e = r(this.#n);
1067
+ if (!e) throw Error("No current view in SVG rendering context.");
1068
+ return e.coords;
986
1069
  }
987
1070
  };
988
1071
  function je(e, t) {
989
1072
  let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
990
1073
  return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
991
1074
  }
992
- function J(e, t) {
1075
+ function Y(e, t) {
993
1076
  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
1077
  }
995
1078
  function Me(e) {
@@ -1010,19 +1093,19 @@ function Pe(e, t) {
1010
1093
  }
1011
1094
  }
1012
1095
  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", {
1096
+ 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
1097
  id: e,
1015
1098
  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)
1099
+ x1: P(a ? i : 0),
1100
+ y1: P(a ? 0 : i),
1101
+ x2: P(a ? o : 0),
1102
+ y2: P(a ? 0 : o)
1020
1103
  });
1021
- return s.appendChild(F("stop", {
1104
+ return s.appendChild(I("stop", {
1022
1105
  offset: 0,
1023
1106
  "stop-color": "black",
1024
1107
  "stop-opacity": 1
1025
- })), s.appendChild(F("stop", {
1108
+ })), s.appendChild(I("stop", {
1026
1109
  offset: 1,
1027
1110
  "stop-color": "black",
1028
1111
  "stop-opacity": 0
@@ -1030,26 +1113,26 @@ function Fe(e, t, n, r) {
1030
1113
  }
1031
1114
  //#endregion
1032
1115
  //#region ../core/src/rendering/svg/index.js
1033
- function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
1034
- let a = new q({ picking: !1 }, {
1116
+ function X({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
1117
+ let a = new J({ picking: !1 }, {
1035
1118
  width: t,
1036
1119
  height: n,
1037
1120
  background: r,
1038
1121
  textMetrics: i
1039
1122
  });
1040
- return c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(a), {
1123
+ return s(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(a), {
1041
1124
  svg: a.getSvg(),
1042
1125
  warnings: a.getWarnings()
1043
1126
  };
1044
1127
  }
1045
1128
  async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1046
- let r = new q({ picking: !1 }, {
1129
+ let r = new J({ picking: !1 }, {
1047
1130
  width: t,
1048
1131
  height: n,
1049
1132
  background: null,
1050
- textMetrics: await Z(e)
1133
+ textMetrics: await Q(e)
1051
1134
  });
1052
- return r.beginInstanceCounting(), c(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(r), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
1135
+ return r.beginInstanceCounting(), s(e, o.create(0, 0, t, n), { renderingOptions: { firstFacet: !0 } }).collectRenderCommands(r), r.endInstanceCounting(), { layers: Array.from(r.getVisibleInstanceCounts(), ([e, t]) => ({
1053
1136
  viewName: e.unitView.name,
1054
1137
  viewTitle: e.unitView.getTitleText(),
1055
1138
  viewPath: e.unitView.getPathString(),
@@ -1058,32 +1141,32 @@ async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1058
1141
  })).filter((e) => e.instanceCount > 0) };
1059
1142
  }
1060
1143
  async function Le(e) {
1061
- let t = await Z(e.viewRoot), n = {
1144
+ let t = await Q(e.viewRoot), n = {
1062
1145
  ...e,
1063
1146
  textMetrics: t
1064
1147
  }, r = e.rasterization;
1065
- return r ? ($(r), e.rasterizeSvgRuns ? X({
1148
+ return r ? ($(r), e.rasterizeSvgRuns ? Z({
1066
1149
  ...n,
1067
1150
  rasterizeSvgRuns: e.rasterizeSvgRuns,
1068
1151
  maxVectorInstances: r.maxVectorInstances,
1069
1152
  pixelRatio: r.pixelRatio
1070
- }) : Q(n)) : {
1071
- ...Y(n),
1153
+ }) : Re(n)) : {
1154
+ ...X(n),
1072
1155
  rasterized: []
1073
1156
  };
1074
1157
  }
1075
- async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: s, pixelRatio: l = 2, textMetrics: u }) {
1076
- u ??= await Z(e), $({
1077
- maxVectorInstances: s,
1158
+ async function Z({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: c, pixelRatio: l = 2, textMetrics: u }) {
1159
+ u ??= await Q(e), $({
1160
+ maxVectorInstances: c,
1078
1161
  pixelRatio: l
1079
1162
  });
1080
- let d = new q({ picking: !1 }, {
1163
+ let d = new J({ picking: !1 }, {
1081
1164
  width: n,
1082
1165
  height: r,
1083
1166
  background: i,
1084
- maxVectorInstances: s,
1167
+ maxVectorInstances: c,
1085
1168
  textMetrics: u
1086
- }), f = o.create(0, 0, n, r), p = c(e, f, { renderingOptions: { firstFacet: !0 } });
1169
+ }), f = o.create(0, 0, n, r), p = s(e, f, { renderingOptions: { firstFacet: !0 } });
1087
1170
  d.beginInstanceCounting(), p.collectRenderCommands(d), d.endInstanceCounting(), p.collectRenderCommands(d);
1088
1171
  let m = d.getRasterRuns();
1089
1172
  if (m.length) try {
@@ -1097,7 +1180,7 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
1097
1180
  pixelRatio: l
1098
1181
  });
1099
1182
  } catch (t) {
1100
- if (t instanceof a) return Q({
1183
+ if (t instanceof a) return Re({
1101
1184
  viewRoot: e,
1102
1185
  logicalWidth: n,
1103
1186
  logicalHeight: r,
@@ -1115,18 +1198,18 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
1115
1198
  instanceCount: e.instanceCount
1116
1199
  })),
1117
1200
  reason: "instance-threshold",
1118
- maxVectorInstances: s,
1201
+ maxVectorInstances: c,
1119
1202
  pixelRatio: l
1120
1203
  }))
1121
1204
  };
1122
1205
  }
1123
- async function Z(e) {
1206
+ async function Q(e) {
1124
1207
  if (!document.fonts) return e.context.textMetrics;
1125
- let t = te(document);
1208
+ let t = ee(document);
1126
1209
  return await re(t, e), t;
1127
1210
  }
1128
- function Q(e) {
1129
- let t = Y(e);
1211
+ function Re(e) {
1212
+ let t = X(e);
1130
1213
  return {
1131
1214
  ...t,
1132
1215
  warnings: [...t.warnings, "SVG rasterization was requested but no raster rendering backend is available; exported all marks as vectors."],
@@ -1138,4 +1221,4 @@ function $(e) {
1138
1221
  if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
1139
1222
  }
1140
1223
  //#endregion
1141
- export { Ie as analyzeSvgExport, X as createRasterizedSvg, Y as createSvg, Le as createSvgExport };
1224
+ export { Ie as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Le as createSvgExport };