@genome-spy/app 1.2.0 → 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 (87) 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-8hMSlqAQ.js → agentApi-BclFF9zB.js} +7130 -7509
  4. package/dist/agentApi.es.js +4344 -4015
  5. package/dist/agentShared.es.js +431 -458
  6. package/dist/arrayUtils-Bm7QnzhN.js +1306 -0
  7. package/dist/{blosc-JROzDOnd.js → blosc-C-W97QwH.js} +3 -3
  8. package/dist/{canvas2d-Bd8H8MMo.js → canvas2d-8MSf70d4.js} +78 -86
  9. package/dist/{canvas2d-D6VYooRf.js → canvas2d-BwGNI_Rx.js} +83 -91
  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/{containerView-aEVmYmkA.js → containerView-BItRtKqu.js} +5 -1
  16. package/dist/{containerView-CRJSc4bM.js → containerView-CWa6ZIJW.js} +5 -1
  17. package/dist/{debug-CQ0agCrd.js → debug-23s-jja_.js} +3 -2
  18. package/dist/{debug-DkIMiGdW.js → debug-CWRxvAss.js} +2 -3
  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 +4756 -5528
  39. package/dist/index.js +707 -547
  40. package/dist/inflate-BdC5KvHn.js +886 -0
  41. package/dist/{lz4-CUYSbVey.js → lz4-BLPgBOlE.js} +1 -1
  42. package/dist/{markUtils-CvLDz744.js → markUtils-RaatLEa-.js} +9 -6
  43. package/dist/metadataUtils-DxEPe0vj.js +879 -0
  44. package/dist/{order-BVvkjDRT.js → order-BnKzKjt4.js} +383 -347
  45. package/dist/{order-DmMoZsi1.js → order-BpJnq_nV.js} +375 -339
  46. package/dist/{parquetRead-0hFIa3Cc.js → parquetRead-D-yY8njE.js} +3 -11
  47. package/dist/{rasterExport-jeRVq6kY.js → rasterExport-B-WrX1pa.js} +5 -5
  48. package/dist/{rasterExport-DxvowWjH.js → rasterExport-C_vx4Jwd.js} +3 -3
  49. package/dist/{rasterization-DFj3Cvx4.js → rasterization-QktH8Sn2.js} +1 -1
  50. package/dist/{rectangle-Dl4Dy0hS.js → rectangle-BAdoDPXu.js} +34 -31
  51. package/dist/{renderCanvas2D-Bfm1NHFu.js → renderCanvas2D-CsRO78Pq.js} +88 -87
  52. package/dist/{renderCanvas2D-DVjhp834.js → renderCanvas2D-Y7pkRzbC.js} +93 -92
  53. package/dist/{rolldown-runtime-DF993M8W.js → rolldown-runtime-DeIk2rA4.js} +1 -1
  54. package/dist/{indexer-DOYMJ-Md.js → scaleNull-CVzag4z8.js} +2 -12
  55. package/dist/{indexer-DDC0YRGn.js → scaleNull-Pbz7QGnl.js} +2 -12
  56. package/dist/{scalePosition-0aeqp_kz.js → scalePosition-CRXa0rCC.js} +1 -1
  57. package/dist/schema.json +3801 -816
  58. package/dist/{svg-Bm2zxBPu.js → svg-BBMtLgtM.js} +369 -285
  59. package/dist/{svg-CkfuhONt.js → svg-JjWL6U-T.js} +371 -287
  60. package/dist/{svgRasterizer-DoRQEqFA.js → svgRasterizer-6OcftuoI.js} +2 -2
  61. package/dist/{svgRasterizer-raDDhBF-.js → svgRasterizer-DkNRaCPs.js} +4 -4
  62. package/dist/tableMetadataSourceAdapter-CUNwLsdi.js +291 -0
  63. package/dist/tableMetadataSourceAdapter-DQrEXCo6.js +1283 -0
  64. package/dist/url-DeOdSRrv.js +183 -0
  65. package/dist/{viewError-BkJeVYXA.js → viewError-B0TMfOpB.js} +1 -1
  66. package/dist/{viewError-IYqyluc7.js → viewError-D9aO90cI.js} +1 -1
  67. package/dist/{viewSelectors-7LyasQN-.js → viewSelectors-DkFvo33d.js} +832 -734
  68. package/dist/{viewSelectors-CbmkSQRT.js → viewSelectors-lM93fHAq.js} +900 -802
  69. package/dist/{viewUtils-DuddMNNw.js → viewUtils-0SJOewM6.js} +1861 -2459
  70. package/dist/webgl-CXIO3OQz.js +5782 -0
  71. package/dist/webgl-Pdvfhio5.js +5783 -0
  72. package/package.json +7 -5
  73. package/src/agentApi/index.d.ts +3 -2
  74. package/src/agentShared/index.d.ts +2 -0
  75. package/src/appTypes.d.ts +1 -6
  76. package/src/embedTypes.d.ts +36 -1
  77. package/src/index.d.ts +6 -0
  78. package/src/spec/sampleView.d.ts +68 -13
  79. package/src/state/paramProvenanceTypes.d.ts +25 -2
  80. package/src/state.d.ts +14 -52
  81. package/dist/clipOptions-DElJ8dTZ.js +0 -3097
  82. package/dist/clipOptions-D_wBNhzs.js +0 -3087
  83. package/dist/esm-Dndm-NaA.js +0 -1193
  84. package/dist/vega-scale-BoGHANI7.js +0 -2446
  85. package/dist/vega-scale-o9TRyzYH.js +0 -2443
  86. package/dist/webgl-CQfvgnxo.js +0 -5633
  87. package/dist/webgl-DVYkXtiZ.js +0 -5632
@@ -1,10 +1,10 @@
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
- import { n as s, t as c } from "./layoutResult-D50MSHXR.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";
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
8
  import { n as N, t as P } from "./svgNumber-DNxESJQB.js";
9
9
  //#region ../core/src/rendering/svg/svgElement.js
10
10
  var F = "http://www.w3.org/2000/svg";
@@ -25,11 +25,11 @@ function R(e, t) {
25
25
  }
26
26
  //#endregion
27
27
  //#region ../core/src/rendering/svg/renderers/arrow.js
28
- function le(e, t) {
28
+ function ue(e, t) {
29
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: O
32
+ transform: h
33
33
  },
34
34
  "fill-opacity": {
35
35
  encoder: c.fillOpacity,
@@ -37,7 +37,7 @@ function le(e, t) {
37
37
  },
38
38
  stroke: {
39
39
  encoder: c.stroke,
40
- transform: O
40
+ transform: h
41
41
  },
42
42
  "stroke-opacity": {
43
43
  encoder: c.strokeOpacity,
@@ -50,7 +50,7 @@ function le(e, t) {
50
50
  });
51
51
  a.setAttribute("stroke-linejoin", "miter");
52
52
  let d = u(n);
53
- return y(n, d, {
53
+ return b(n, d, {
54
54
  coords: r,
55
55
  data: i,
56
56
  visibleBounds: s,
@@ -58,26 +58,26 @@ function le(e, t) {
58
58
  countOnly: t.countOnly
59
59
  }, (e) => {
60
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(" "),
61
+ d: e.boundaryLoops.map(de).join(" "),
62
62
  ...l(e.datum)
63
63
  })));
64
64
  });
65
65
  }
66
- function ue(e) {
67
- return `M ${e.map(de).join(" L ")} Z`;
68
- }
69
66
  function de(e) {
67
+ return `M ${e.map(fe).join(" L ")} Z`;
68
+ }
69
+ function fe(e) {
70
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 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));
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
76
  p && o.setAttribute("stroke-opacity", "" + m({}));
77
- let h = L(o, {
77
+ let g = L(o, {
78
78
  stroke: {
79
79
  encoder: l.color,
80
- transform: O
80
+ transform: h
81
81
  },
82
82
  "stroke-width": {
83
83
  encoder: l.size,
@@ -85,21 +85,21 @@ function fe(e, t) {
85
85
  }
86
86
  });
87
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, {
88
+ let _ = o, v;
89
+ return le(n, r, {
90
90
  coords: i,
91
91
  data: a,
92
92
  visibleBounds: c
93
93
  }, ({ datum: e, geometry: n }) => {
94
94
  if (t.countOnly) return;
95
- let r = h(e);
95
+ let r = g(e);
96
96
  p || (r["stroke-opacity"] = m(e));
97
97
  let i = u && n.type == "cubic" ? t.getLinkArcFadeMaskUrl({
98
98
  p1: n.points[0],
99
99
  p4: n.points[3],
100
100
  distances: u
101
101
  }) : void 0;
102
- i !== _ && (_ = i, g = i ? I("g", { mask: i }) : o, i && o.appendChild(g)), g.appendChild(I("path", {
102
+ i !== v && (v = i, _ = i ? I("g", { mask: i }) : o, i && o.appendChild(_)), _.appendChild(I("path", {
103
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
104
  ...r
105
105
  }));
@@ -110,13 +110,13 @@ function z(e) {
110
110
  }
111
111
  //#endregion
112
112
  //#region ../core/src/rendering/svg/renderers/point.js
113
- function pe(e, t) {
113
+ function me(e, t) {
114
114
  let n = e;
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, {
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.");
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, {
117
117
  fill: {
118
118
  encoder: s.fill,
119
- transform: O
119
+ transform: h
120
120
  },
121
121
  "fill-opacity": {
122
122
  encoder: s.fillOpacity,
@@ -124,7 +124,7 @@ function pe(e, t) {
124
124
  },
125
125
  stroke: {
126
126
  encoder: s.stroke,
127
- transform: O
127
+ transform: h
128
128
  },
129
129
  "stroke-opacity": {
130
130
  encoder: s.strokeOpacity,
@@ -134,42 +134,48 @@ function pe(e, t) {
134
134
  encoder: s.strokeWidth,
135
135
  transform: (e) => P(+e)
136
136
  }
137
- }), u = he();
138
- return b(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) => {
139
139
  if (t.countOnly) return;
140
- let { datum: n, shape: r, x: l, y: d, geometryRadius: f, angle: p, strokeWidth: m, lineShape: h } = e, g = {
141
- ...c(n),
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),
149
- ...g
150
- })));
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));
151
149
  });
152
150
  }
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", {
156
- cx: o,
157
- cy: s,
158
- r: c,
159
- ...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
160
158
  });
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),
166
- ...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
167
165
  });
168
- let l = a.build(e, t, n, r);
169
- return l ? I("path", {
170
- d: l,
171
- ...i
172
- }) : 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;
173
179
  }
174
180
  function he() {
175
181
  let e = "", t = (e, t) => `${P(e)} ${P(t)}`, n = {
@@ -184,15 +190,15 @@ function he() {
184
190
  }
185
191
  };
186
192
  return { build(t, r, i, a) {
187
- return e = "", E(t, r, i, a, n) ? e : void 0;
193
+ return e = "", D(t, r, i, a, n) ? e : void 0;
188
194
  } };
189
195
  }
190
- function ge(e, t, n) {
191
- 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;
192
198
  return {
193
199
  fill: "none",
194
- stroke: O(a ? e.fill(t) : r),
195
- "stroke-opacity": (a ? d(e.fillOpacity, t) : i) * n,
200
+ stroke: h(o ? e.fill(t) : i),
201
+ "stroke-opacity": (o ? d(e.fillOpacity, t) : a) * n,
196
202
  "stroke-width": P(d(e.strokeWidth, t)),
197
203
  "stroke-linecap": "butt"
198
204
  };
@@ -200,10 +206,10 @@ function ge(e, t, n) {
200
206
  //#endregion
201
207
  //#region ../core/src/rendering/svg/renderers/rect.js
202
208
  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, {
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, {
204
210
  fill: {
205
211
  encoder: c.fill,
206
- transform: O
212
+ transform: h
207
213
  },
208
214
  "fill-opacity": {
209
215
  encoder: c.fillOpacity,
@@ -211,7 +217,7 @@ function _e(e, t) {
211
217
  },
212
218
  stroke: {
213
219
  encoder: c.stroke,
214
- transform: O
220
+ transform: h
215
221
  },
216
222
  "stroke-opacity": {
217
223
  encoder: c.strokeOpacity,
@@ -221,7 +227,7 @@ function _e(e, t) {
221
227
  encoder: c.strokeWidth,
222
228
  transform: (e) => P(+e)
223
229
  }
224
- }), u = i.opacity > 0 ? {
230
+ }), f = i.opacity > 0 ? {
225
231
  fill: i.color,
226
232
  "fill-opacity": 1,
227
233
  stroke: i.color,
@@ -229,34 +235,34 @@ function _e(e, t) {
229
235
  opacity: N(i.opacity * s),
230
236
  filter: t.getShadowFilterUrl(i)
231
237
  } : null;
232
- return j(n, r, t, (e) => {
238
+ return M(n, r, t, (e) => {
233
239
  if (t.countOnly) return;
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) }
240
+ let { datum: n, x: r, y: i, width: p, height: m, radii: g, opacityFactor: _, strokeWidth: v, fill: y, fillOpacity: b } = e, x = {
241
+ ...u(n),
242
+ ..._ == 1 ? {} : { opacity: N(_) }
237
243
  };
238
- if (a != "none" && g > 0 && (y.fill = t.getRectHatchPatternUrl({
244
+ if (a != "none" && v > 0 && (x.fill = t.getRectHatchPatternUrl({
239
245
  type: a,
240
- fill: O(c.fill(n)),
246
+ fill: h(c.fill(n)),
241
247
  fillOpacity: d(c.fillOpacity, n) * s,
242
- stroke: O(c.stroke(n)),
248
+ stroke: h(c.stroke(n)),
243
249
  strokeOpacity: d(c.strokeOpacity, n) * s,
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
+ strokeWidth: v
251
+ }), x["fill-opacity"] = 1), f) {
252
+ let e = V(r, i, p, m, g, {
253
+ ...f,
254
+ "stroke-width": P(v)
249
255
  });
250
- if (a == "none" && _ != "none" && v == 1 && h == 1) o.appendChild(e);
256
+ if (a == "none" && y != "none" && b * l(y) == 1 && _ == 1) o.appendChild(e);
251
257
  else {
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) });
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) });
253
259
  c.appendChild(e), o.appendChild(c);
254
260
  }
255
261
  }
256
- o.appendChild(B(r, i, f, p, m, y));
262
+ o.appendChild(V(r, i, p, m, g, x));
257
263
  });
258
264
  }
259
- function B(e, t, n, r, i, a) {
265
+ function V(e, t, n, r, i, a) {
260
266
  if (ve(i)) {
261
267
  let o = i.topLeft, s = P(e), c = P(t), l = P(e + n), u = P(t + r);
262
268
  return I("rect", {
@@ -272,105 +278,160 @@ function B(e, t, n, r, i, a) {
272
278
  });
273
279
  }
274
280
  return I("path", {
275
- d: V(e, t, n, r, i),
281
+ d: H(e, t, n, r, i),
276
282
  ...a
277
283
  });
278
284
  }
279
285
  function ve(e) {
280
286
  return Object.values(e).every((t) => t == e.topLeft);
281
287
  }
282
- function V(e, t, n, r, i) {
288
+ function H(e, t, n, r, i) {
283
289
  let a = e + n, o = t + r, { topLeft: s, topRight: c, bottomRight: l, bottomLeft: u } = i;
284
290
  return [
285
- `M ${U(e + s, t)}`,
291
+ `M ${W(e + s, t)}`,
286
292
  `H ${P(a - c)}`,
287
- H(c, a, t + c, a, t),
293
+ U(c, a, t + c, a, t),
288
294
  `V ${P(o - l)}`,
289
- H(l, a - l, o, a, o),
295
+ U(l, a - l, o, a, o),
290
296
  `H ${P(e + u)}`,
291
- H(u, e, o - u, e, o),
297
+ U(u, e, o - u, e, o),
292
298
  `V ${P(t + s)}`,
293
- H(s, e + s, t, e, t),
299
+ U(s, e + s, t, e, t),
294
300
  "Z"
295
301
  ].join(" ");
296
302
  }
297
- function H(e, t, n, r, i) {
298
- return e ? `A ${P(e)} ${P(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)}`;
299
305
  }
300
- function U(e, t) {
306
+ function W(e, t) {
301
307
  return `${P(e)} ${P(t)}`;
302
308
  }
303
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;
344
+ }
345
+ //#endregion
304
346
  //#region ../core/src/rendering/svg/renderers/rule.js
305
- function W(e, t) {
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, {
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, {
307
349
  stroke: {
308
- encoder: l.color,
309
- transform: O
310
- },
311
- "stroke-opacity": {
312
- encoder: l.opacity,
313
- transform: (e) => +e * s
350
+ encoder: u.fill,
351
+ transform: h
314
352
  },
315
353
  "stroke-width": {
316
- encoder: l.size,
354
+ encoder: u.size,
317
355
  transform: (e) => P(+e)
318
356
  }
319
357
  });
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, {
321
- coords: i,
322
- data: a,
323
- 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
324
362
  }, (e) => {
325
- t.countOnly || o.appendChild(I("line", {
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", {
326
386
  x1: P(e.x1),
327
387
  y1: P(e.y1),
328
388
  x2: P(e.x2),
329
389
  y2: P(e.y2),
330
- ...d(e.datum)
390
+ ...g(e.datum),
391
+ "stroke-opacity": n * a
331
392
  }));
332
393
  });
333
394
  }
334
395
  //#endregion
335
396
  //#region ../core/src/rendering/svg/renderers/text.js
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, {
397
+ function be(e, t) {
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, {
338
399
  fill: {
339
- encoder: h.color,
340
- transform: O
400
+ encoder: m.color,
401
+ transform: h
341
402
  },
342
403
  "fill-opacity": {
343
- encoder: h.opacity,
344
- transform: (e) => +e * f
404
+ encoder: m.opacity,
405
+ transform: (e) => +e * d
345
406
  },
346
407
  "font-size": {
347
- encoder: h.size,
408
+ encoder: m.size,
348
409
  transform: (e) => P(+e)
349
410
  }
350
411
  });
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]);
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]);
352
413
  let _ = {
353
414
  top: {
354
- width: l(n, r.viewportEdgeFadeWidthTop),
355
- distance: l(n, r.viewportEdgeFadeDistanceTop)
415
+ width: k(n, r.viewportEdgeFadeWidthTop),
416
+ distance: k(n, r.viewportEdgeFadeDistanceTop)
356
417
  },
357
418
  right: {
358
- width: l(n, r.viewportEdgeFadeWidthRight),
359
- distance: l(n, r.viewportEdgeFadeDistanceRight)
419
+ width: k(n, r.viewportEdgeFadeWidthRight),
420
+ distance: k(n, r.viewportEdgeFadeDistanceRight)
360
421
  },
361
422
  bottom: {
362
- width: l(n, r.viewportEdgeFadeWidthBottom),
363
- distance: l(n, r.viewportEdgeFadeDistanceBottom)
423
+ width: k(n, r.viewportEdgeFadeWidthBottom),
424
+ distance: k(n, r.viewportEdgeFadeDistanceBottom)
364
425
  },
365
426
  left: {
366
- width: l(n, r.viewportEdgeFadeWidthLeft),
367
- distance: l(n, r.viewportEdgeFadeDistanceLeft)
427
+ width: k(n, r.viewportEdgeFadeWidthLeft),
428
+ distance: k(n, r.viewportEdgeFadeDistanceLeft)
368
429
  }
369
- }, v = A(n, s, {
430
+ }, v = j(n, s, {
370
431
  coords: c,
371
- data: u,
372
- visibleBounds: p,
373
- anchorCullBounds: m,
432
+ data: l,
433
+ visibleBounds: f,
434
+ anchorCullBounds: p,
374
435
  fontMeasurement: a,
375
436
  measureLogoInkBounds: o
376
437
  }, (e) => {
@@ -387,7 +448,7 @@ function ye(e, t) {
387
448
  ...g(e.datum),
388
449
  "font-size": e.size
389
450
  });
390
- r.textContent = e.text, d.appendChild(r);
451
+ r.textContent = e.text, u.appendChild(r);
391
452
  return;
392
453
  }
393
454
  let n = [`translate(${P(e.x)} ${P(e.y)})`];
@@ -395,71 +456,71 @@ function ye(e, t) {
395
456
  let r = I("text", {
396
457
  x: 0,
397
458
  y: 0,
398
- dy: P(ee(s.baseline, e.size)),
459
+ dy: P(te(s.baseline, e.size)),
399
460
  ...g(e.datum),
400
461
  ...e.fadeOpacity == 1 ? {} : { opacity: N(e.fadeOpacity) },
401
462
  transform: n.join(" ")
402
463
  });
403
- r.textContent = e.text, d.appendChild(r);
464
+ r.textContent = e.text, u.appendChild(r);
404
465
  });
405
- if (!t.countOnly && d.childElementCount > 0) {
466
+ if (!t.countOnly && u.childElementCount > 0) {
406
467
  let e = t.getViewportEdgeFadeMaskUrl(_);
407
- e && d.setAttribute("mask", e);
468
+ e && u.setAttribute("mask", e);
408
469
  }
409
470
  return v;
410
471
  }
411
- var be = {
472
+ var xe = {
412
473
  left: "start",
413
474
  center: "middle",
414
475
  right: "end"
415
- }, G = 64;
416
- function xe(e, t) {
417
- let n = Ce(e.unitView);
418
- if (!n) return;
419
- let i = e.unitView.getScaleResolution(n.channel)?.getScale();
420
- if (!i || !r(i.type)) return;
421
- let { coords: a, data: o, group: s, viewOpacity: c, visibleBounds: l } = 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;
422
483
  if (!o.length) return 0;
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), {
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), {
426
487
  offset: Number(e.position),
427
- color: O(d(e))
488
+ color: h(f(e))
428
489
  };
429
490
  }).sort((e, t) => e.offset - t.offset);
430
- if (!f(l, m, h, g, _)) return 0;
431
- if (t.countOnly) return o.length;
432
- let C = Se(S), w = [
491
+ if (!p(u, g, _, v, y)) return 0;
492
+ if (n.countOnly) return o.length;
493
+ let T = Ce(w), E = [
433
494
  {
434
495
  offset: 0,
435
- color: C[0].color
496
+ color: T[0].color
436
497
  },
437
- ...C,
498
+ ...T,
438
499
  {
439
500
  offset: 1,
440
- color: C.at(-1).color
501
+ color: T.at(-1).color
441
502
  }
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;
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;
449
510
  return s.appendChild(I("rect", {
450
- x: E,
451
- y: D,
452
- width: P(A - E),
453
- height: P(j - D),
454
- fill: T,
511
+ x: O,
512
+ y: k,
513
+ width: P(A - O),
514
+ height: P(j - k),
515
+ fill: D,
455
516
  "fill-opacity": N(M),
456
517
  stroke: "none"
457
518
  })), o.length;
458
519
  }
459
- function Se(e) {
460
- return e.length <= G ? e : Array.from({ length: G }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
461
- }
462
520
  function Ce(e) {
521
+ return e.length <= K ? e : Array.from({ length: K }, (t, n) => e[Math.round(n * (e.length - 1) / 63)]);
522
+ }
523
+ function we(e) {
463
524
  let t = e;
464
525
  for (; t;) {
465
526
  let e = t.spec.data;
@@ -467,32 +528,32 @@ function Ce(e) {
467
528
  t = t.dataParent;
468
529
  }
469
530
  }
470
- function we(e) {
531
+ function Te(e) {
471
532
  return e != null && "field" in e && (e.field == "position0" || e.field == "position1");
472
533
  }
473
534
  //#endregion
474
535
  //#region ../core/src/rendering/svg/renderers/index.js
475
- var Te = /* @__PURE__ */ new Map([
476
- ["arrow", le],
477
- ["link", fe],
478
- ["point", pe],
536
+ var Ee = /* @__PURE__ */ new Map([
537
+ ["arrow", ue],
538
+ ["link", pe],
539
+ ["point", me],
479
540
  ["rect", _e],
480
- ["rule", W],
481
- ["text", ye],
482
- ["tick", W]
541
+ ["rule", G],
542
+ ["text", be],
543
+ ["tick", G]
483
544
  ]);
484
- function Ee(e, t) {
545
+ function De(e, t) {
485
546
  if (e.getType() == "rect") {
486
- let n = xe(e, t);
547
+ let n = Se(e, t);
487
548
  if (n !== void 0) return n;
488
549
  }
489
- let n = Te.get(e.getType());
550
+ let n = Ee.get(e.getType());
490
551
  if (!n) throw Error(`SVG rendering is not implemented for mark type "${e.getType()}". View: ${e.unitView.getPathString()}`);
491
552
  return n(e, t);
492
553
  }
493
554
  //#endregion
494
555
  //#region ../core/src/rendering/svg/rectHatchPattern.js
495
- function De(e, t) {
556
+ function Oe(e, t) {
496
557
  let n = t.strokeWidth, r = [
497
558
  "dots",
498
559
  "rings",
@@ -526,9 +587,9 @@ function De(e, t) {
526
587
  "stroke-width": P(s),
527
588
  "stroke-linecap": "square"
528
589
  });
529
- return Oe(d, t.type, o, s), u.appendChild(d), u;
590
+ return ke(d, t.type, o, s), u.appendChild(d), u;
530
591
  }
531
- function Oe(e, t, n, r) {
592
+ function ke(e, t, n, r) {
532
593
  let i = (t) => e.appendChild(I("path", { d: t })), a = (e) => P(e), o = (e) => {
533
594
  for (let t of [
534
595
  -n,
@@ -571,7 +632,7 @@ function Oe(e, t, n, r) {
571
632
  }
572
633
  //#endregion
573
634
  //#region ../core/src/rendering/svg/linkArcFadeMask.js
574
- function ke(e, t, n, r) {
635
+ function Ae(e, t, n, r) {
575
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", {
576
637
  id: d,
577
638
  gradientUnits: "userSpaceOnUse",
@@ -581,10 +642,10 @@ function ke(e, t, n, r) {
581
642
  y2: P(u + a * c),
582
643
  spreadMethod: "pad"
583
644
  });
584
- for (let { offset: e, opacity: t } of S(s, c)) f.appendChild(I("stop", {
585
- offset: K(e, 3),
645
+ for (let { offset: e, opacity: t } of C(s, c)) f.appendChild(I("stop", {
646
+ offset: q(e, 3),
586
647
  "stop-color": "white",
587
- "stop-opacity": K(t, 3)
648
+ "stop-opacity": q(t, 3)
588
649
  }));
589
650
  let p = I("mask", {
590
651
  id: e,
@@ -605,13 +666,13 @@ function ke(e, t, n, r) {
605
666
  mask: p
606
667
  };
607
668
  }
608
- function K(e, t) {
669
+ function q(e, t) {
609
670
  let n = 10 ** t;
610
671
  return Math.round(e * n) / n;
611
672
  }
612
673
  //#endregion
613
674
  //#region ../core/src/rendering/svg/svgViewRenderingContext.js
614
- var q = class extends s {
675
+ var J = class extends c {
615
676
  #e;
616
677
  #t;
617
678
  #n = [];
@@ -624,7 +685,7 @@ var q = class extends s {
624
685
  #l = /* @__PURE__ */ new Set();
625
686
  #u = !1;
626
687
  #d = /* @__PURE__ */ new Map();
627
- #f = new p();
688
+ #f = new m();
628
689
  #p = I("g");
629
690
  #m;
630
691
  #h;
@@ -686,104 +747,105 @@ var q = class extends s {
686
747
  for (let t of e.markGroupElements) t.childElementCount || t.remove();
687
748
  this.#m = void 0;
688
749
  }
689
- pushView(t, n) {
690
- let r = t.getPathString();
691
- 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-")) {
692
753
  this.#n.push({
693
- view: t,
754
+ view: e,
694
755
  node: this.currentNode,
695
- coords: n,
756
+ coords: t,
696
757
  exportExcluded: !0
697
758
  });
698
759
  return;
699
760
  }
700
761
  if (this.#u) {
701
762
  this.#n.push({
702
- view: t,
763
+ view: e,
703
764
  node: this.currentNode,
704
- coords: n,
765
+ coords: t,
705
766
  exportExcluded: !1
706
767
  });
707
768
  return;
708
769
  }
709
- let a = this.#m, o = a?.viewGroups.get(t);
770
+ let a = this.#m, o = a?.viewGroups.get(e);
710
771
  if (o) {
711
- 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}`);
712
773
  } else {
713
774
  o = I("g", {
714
- id: Ae(t.name, this.#v++),
715
- "data-name": t.name,
716
- "data-view-path": r
775
+ id: je(e.name, this.#v++),
776
+ "data-name": e.name,
777
+ "data-view-path": n
717
778
  });
718
- let e = I("title");
719
- 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);
720
781
  }
721
782
  this.#n.push({
722
- view: t,
783
+ view: e,
723
784
  node: o,
724
- coords: n,
785
+ coords: t,
725
786
  exportExcluded: !1
726
787
  });
727
788
  }
728
789
  popView(e) {
729
790
  if (this.#n.pop()?.view !== e) throw Error("Unbalanced SVG view rendering context stack.");
730
791
  }
731
- renderMark(r, i) {
732
- if (e(this.#n)?.exportExcluded || r.unitView.getEffectiveOpacity() <= 0) 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;
735
- 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);
736
797
  if (!this.#u && this.#h != null && c == 0) return;
737
798
  if (!this.#u && this.#h != null && c > this.#h) {
738
- this.#T(r, s);
799
+ this.#T(e, s);
739
800
  return;
740
801
  }
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;
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;
742
803
  !this.#u && !d && this.#E();
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) => {
745
- let n = (t, n = !1) => {
746
- let i = Ee(r, {
747
- coords: e,
748
- data: t,
749
- 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,
750
811
  visibleBounds: s,
751
- anchorCullBounds: p,
752
- viewOpacity: r.unitView.getEffectiveOpacity(),
812
+ anchorCullBounds: m,
813
+ viewOpacity: e.unitView.getEffectiveOpacity(),
753
814
  textMetrics: this.textMetrics,
754
- secondOrderPass: n,
815
+ secondOrderPass: r,
755
816
  countOnly: this.#u,
756
817
  getViewportEdgeFadeMaskUrl: (e) => this.#u ? void 0 : this.getViewportEdgeFadeMaskUrl(e),
757
818
  getShadowFilterUrl: (e) => this.#u ? "" : this.getShadowFilterUrl(e),
819
+ getRuleStrokeMaskUrl: (e, t, n, r, i) => this.getRuleStrokeMaskUrl(e, t, n, r, i),
758
820
  getShadowClipPathUrl: (e) => this.#u ? "" : this.getShadowClipPathUrl(e),
759
821
  getRectHatchPatternUrl: (e) => this.#u ? "" : this.getRectHatchPatternUrl(e),
760
822
  getLinkArcFadeMaskUrl: (e) => this.#u ? void 0 : this.getLinkArcFadeMaskUrl(e),
761
823
  getLegendGradientUrl: (e) => this.#u ? "" : this.getLegendGradientUrl(e),
762
- warn: (e) => {
763
- this.#u || this.#l.add(`${e} View: ${r.unitView.getPathString()}`);
824
+ warn: (t) => {
825
+ this.#u || this.#l.add(`${t} View: ${e.unitView.getPathString()}`);
764
826
  }
765
827
  });
766
- this.#u && this.#d.set(r, this.getVisibleInstanceCount(r) + i);
828
+ this.#u && this.#d.set(e, this.getVisibleInstanceCount(e) + i);
767
829
  };
768
830
  if (!y) {
769
- n(t);
831
+ r(n);
770
832
  return;
771
833
  }
772
- let i = ie(t, 0, t.length, v.predicate, v.passes);
773
- for (let [e, t] of i.entries()) t.length !== 0 && n(t, e === 1);
774
- }, (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) {
775
837
  let e = this.getClipPathUrl(o);
776
- e && f.setAttribute("clip-path", e), this.currentNode.appendChild(f);
838
+ e && p.setAttribute("clip-path", e), this.currentNode.appendChild(p);
777
839
  }
778
840
  }
779
841
  #T(e, t) {
780
842
  let n = this.#m?.rasterRuns.get(e);
781
843
  if (n) {
782
- J(n.bounds, t), n.viewNodes.add(this.currentNode);
844
+ Y(n.bounds, t), n.viewNodes.add(this.currentNode);
783
845
  return;
784
846
  }
785
847
  let r = this.#_;
786
- if (r) J(r.bounds, t);
848
+ if (r) Y(r.bounds, t);
787
849
  else {
788
850
  let e = document.createComment("raster-run");
789
851
  this.currentNode.appendChild(e), r = {
@@ -805,15 +867,15 @@ var q = class extends s {
805
867
  e && (this.#g.push(e), this.#_ = void 0);
806
868
  }
807
869
  #D(e) {
808
- let t = je(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = I("g", {
870
+ let t = Me(e.viewNodes), n = e.targets.map((e) => e.mark.getType()), r = I("g", {
809
871
  id: `rasterized-${n.join("-")}-${this.#w++}`,
810
872
  "data-name": `Rasterized ${n.join(", ")}`,
811
873
  "data-rasterized": ""
812
874
  }), i = I("image", { preserveAspectRatio: "none" });
813
875
  r.appendChild(i);
814
876
  let a = e.anchor.parentNode;
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);
877
+ t == a ? t.insertBefore(r, e.anchor) : t.insertBefore(r, Ne(a, t)), e.anchor.remove();
878
+ for (let n of e.viewNodes) Pe(n, t);
817
879
  e.image = i;
818
880
  }
819
881
  #O(e, t) {
@@ -881,6 +943,28 @@ var q = class extends s {
881
943
  }
882
944
  return `url(#${a})`;
883
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
+ }
884
968
  getShadowClipPathUrl(e) {
885
969
  let t = this.#o.get(e);
886
970
  if (!t) {
@@ -906,7 +990,7 @@ var q = class extends s {
906
990
  N(e.strokeOpacity),
907
991
  N(e.strokeWidth)
908
992
  ]), n = this.#s.get(t);
909
- return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(De(n, e)), this.#s.set(t, n)), `url(#${n})`;
993
+ return n || (n = "rect-hatch-" + this.#S++, this.#t.appendChild(Oe(n, e)), this.#s.set(t, n)), `url(#${n})`;
910
994
  }
911
995
  getLegendGradientUrl(e) {
912
996
  let t = "legend-gradient-" + this.#C++, n = I("linearGradient", {
@@ -924,48 +1008,48 @@ var q = class extends s {
924
1008
  return this.#t.appendChild(n), `url(#${t})`;
925
1009
  }
926
1010
  getLinkArcFadeMaskUrl(e) {
927
- let t = se(e.p1, e.p4, e.distances);
1011
+ let t = ce(e.p1, e.p4, e.distances);
928
1012
  if (!t) return;
929
1013
  let n = this.#c.get(t.key);
930
1014
  if (!n) {
931
1015
  n = "link-arc-fade-" + this.#b++;
932
- let { gradient: e, mask: r } = ke(n, this.width, this.height, t);
1016
+ let { gradient: e, mask: r } = Ae(n, this.width, this.height, t);
933
1017
  this.#t.appendChild(e), this.#t.appendChild(r), this.#c.set(t.key, n);
934
1018
  }
935
1019
  return `url(#${n})`;
936
1020
  }
937
- getViewportEdgeFadeMaskUrl(t) {
938
- let n = Object.entries(t).filter(([, e]) => e.width > 0 && Number.isFinite(e.distance));
939
- if (!n.length) return;
940
- let r = e(this.#n);
941
- if (!r) throw Error("No current view in SVG rendering context.");
942
- 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);
943
1027
  if (!i) {
944
1028
  i = "edge-fade-" + this.#b++;
945
- let e = P(this.width), t = P(this.height), a = I("mask", {
1029
+ let e = P(this.width), r = P(this.height), a = I("mask", {
946
1030
  id: i,
947
1031
  x: 0,
948
1032
  y: 0,
949
1033
  width: e,
950
- height: t,
1034
+ height: r,
951
1035
  maskUnits: "userSpaceOnUse",
952
1036
  maskContentUnits: "userSpaceOnUse",
953
1037
  "mask-type": "luminance"
954
1038
  });
955
1039
  a.appendChild(I("rect", {
956
1040
  width: e,
957
- height: t,
1041
+ height: r,
958
1042
  fill: "white"
959
1043
  }));
960
- for (let [o, s] of n) {
961
- let n = i + "-" + o, c = Pe(n, o, s, r.coords);
1044
+ for (let [o, s] of t) {
1045
+ let t = i + "-" + o, c = Fe(t, o, s, n.coords);
962
1046
  this.#t.appendChild(c), a.appendChild(I("rect", {
963
1047
  width: e,
964
- height: t,
965
- fill: `url(#${n})`
1048
+ height: r,
1049
+ fill: `url(#${t})`
966
1050
  }));
967
1051
  }
968
- this.#t.appendChild(a), this.#i.set(r.view, i);
1052
+ this.#t.appendChild(a), this.#i.set(n.view, i);
969
1053
  }
970
1054
  return `url(#${i})`;
971
1055
  }
@@ -976,39 +1060,39 @@ var q = class extends s {
976
1060
  return Array.from(this.#l);
977
1061
  }
978
1062
  get currentNode() {
979
- return e(this.#n)?.node ?? this.#e;
1063
+ return r(this.#n)?.node ?? this.#e;
980
1064
  }
981
1065
  get currentCoords() {
982
- let t = e(this.#n);
983
- if (!t) throw Error("No current view in SVG rendering context.");
984
- 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;
985
1069
  }
986
1070
  };
987
- function Ae(e, t) {
1071
+ function je(e, t) {
988
1072
  let n = e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
989
1073
  return `${/^[A-Za-z_]/.test(n) ? n : n ? "view-" + n : "view"}-${t}`;
990
1074
  }
991
- function J(e, t) {
1075
+ function Y(e, t) {
992
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);
993
1077
  }
994
- function je(e) {
1078
+ function Me(e) {
995
1079
  let [t, ...n] = Array.from(e), r = t;
996
1080
  for (; n.some((e) => !r.contains(e));) r = r.parentNode;
997
1081
  return r;
998
1082
  }
999
- function Me(e, t) {
1083
+ function Ne(e, t) {
1000
1084
  let n = e;
1001
1085
  for (; n.parentNode != t;) n = n.parentNode;
1002
1086
  return n;
1003
1087
  }
1004
- function Ne(e, t) {
1088
+ function Pe(e, t) {
1005
1089
  let n = e;
1006
1090
  for (; n != t && n.matches("g[data-view-path]") && Array.from(n.children).every((e) => e.tagName == "title");) {
1007
1091
  let e = n.parentNode;
1008
1092
  n.remove(), n = e;
1009
1093
  }
1010
1094
  }
1011
- function Pe(e, t, n, r) {
1095
+ function Fe(e, t, n, r) {
1012
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", {
1013
1097
  id: e,
1014
1098
  gradientUnits: "userSpaceOnUse",
@@ -1029,26 +1113,26 @@ function Pe(e, t, n, r) {
1029
1113
  }
1030
1114
  //#endregion
1031
1115
  //#region ../core/src/rendering/svg/index.js
1032
- function Y({ viewRoot: e, logicalWidth: t, logicalHeight: n, background: r = "white", textMetrics: i = e.context.textMetrics }) {
1033
- 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 }, {
1034
1118
  width: t,
1035
1119
  height: n,
1036
1120
  background: r,
1037
1121
  textMetrics: i
1038
1122
  });
1039
- 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), {
1040
1124
  svg: a.getSvg(),
1041
1125
  warnings: a.getWarnings()
1042
1126
  };
1043
1127
  }
1044
- async function Fe({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1045
- let r = new q({ picking: !1 }, {
1128
+ async function Ie({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1129
+ let r = new J({ picking: !1 }, {
1046
1130
  width: t,
1047
1131
  height: n,
1048
1132
  background: null,
1049
- textMetrics: await Z(e)
1133
+ textMetrics: await Q(e)
1050
1134
  });
1051
- 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]) => ({
1052
1136
  viewName: e.unitView.name,
1053
1137
  viewTitle: e.unitView.getTitleText(),
1054
1138
  viewPath: e.unitView.getPathString(),
@@ -1056,33 +1140,33 @@ async function Fe({ viewRoot: e, logicalWidth: t, logicalHeight: n }) {
1056
1140
  instanceCount: t
1057
1141
  })).filter((e) => e.instanceCount > 0) };
1058
1142
  }
1059
- async function Ie(e) {
1060
- let t = await Z(e.viewRoot), n = {
1143
+ async function Le(e) {
1144
+ let t = await Q(e.viewRoot), n = {
1061
1145
  ...e,
1062
1146
  textMetrics: t
1063
1147
  }, r = e.rasterization;
1064
- return r ? ($(r), e.rasterizeSvgRuns ? X({
1148
+ return r ? ($(r), e.rasterizeSvgRuns ? Z({
1065
1149
  ...n,
1066
1150
  rasterizeSvgRuns: e.rasterizeSvgRuns,
1067
1151
  maxVectorInstances: r.maxVectorInstances,
1068
1152
  pixelRatio: r.pixelRatio
1069
- }) : Q(n)) : {
1070
- ...Y(n),
1153
+ }) : Re(n)) : {
1154
+ ...X(n),
1071
1155
  rasterized: []
1072
1156
  };
1073
1157
  }
1074
- async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHeight: r, background: i = "white", maxVectorInstances: s, pixelRatio: l = 2, textMetrics: u }) {
1075
- u ??= await Z(e), $({
1076
- 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,
1077
1161
  pixelRatio: l
1078
1162
  });
1079
- let d = new q({ picking: !1 }, {
1163
+ let d = new J({ picking: !1 }, {
1080
1164
  width: n,
1081
1165
  height: r,
1082
1166
  background: i,
1083
- maxVectorInstances: s,
1167
+ maxVectorInstances: c,
1084
1168
  textMetrics: u
1085
- }), 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 } });
1086
1170
  d.beginInstanceCounting(), p.collectRenderCommands(d), d.endInstanceCounting(), p.collectRenderCommands(d);
1087
1171
  let m = d.getRasterRuns();
1088
1172
  if (m.length) try {
@@ -1096,7 +1180,7 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
1096
1180
  pixelRatio: l
1097
1181
  });
1098
1182
  } catch (t) {
1099
- if (t instanceof a) return Q({
1183
+ if (t instanceof a) return Re({
1100
1184
  viewRoot: e,
1101
1185
  logicalWidth: n,
1102
1186
  logicalHeight: r,
@@ -1114,18 +1198,18 @@ async function X({ viewRoot: e, rasterizeSvgRuns: t, logicalWidth: n, logicalHei
1114
1198
  instanceCount: e.instanceCount
1115
1199
  })),
1116
1200
  reason: "instance-threshold",
1117
- maxVectorInstances: s,
1201
+ maxVectorInstances: c,
1118
1202
  pixelRatio: l
1119
1203
  }))
1120
1204
  };
1121
1205
  }
1122
- async function Z(e) {
1206
+ async function Q(e) {
1123
1207
  if (!document.fonts) return e.context.textMetrics;
1124
- let t = M(document);
1125
- return await ne(t, e), t;
1208
+ let t = ee(document);
1209
+ return await re(t, e), t;
1126
1210
  }
1127
- function Q(e) {
1128
- let t = Y(e);
1211
+ function Re(e) {
1212
+ let t = X(e);
1129
1213
  return {
1130
1214
  ...t,
1131
1215
  warnings: [...t.warnings, "SVG rasterization was requested but no raster rendering backend is available; exported all marks as vectors."],
@@ -1137,4 +1221,4 @@ function $(e) {
1137
1221
  if (e.pixelRatio != null && (!Number.isFinite(e.pixelRatio) || e.pixelRatio <= 0)) throw RangeError("SVG raster pixelRatio must be positive.");
1138
1222
  }
1139
1223
  //#endregion
1140
- export { Fe as analyzeSvgExport, X as createRasterizedSvg, Y as createSvg, Ie as createSvgExport };
1224
+ export { Ie as analyzeSvgExport, Z as createRasterizedSvg, X as createSvg, Le as createSvgExport };