@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,8 +1,10 @@
1
- import { $ as e, Tn as t, et as n, mn as r, on as i, p as a } from "./clipOptions-DElJ8dTZ.js";
2
- import { a as o } from "./rasterization-DFj3Cvx4.js";
3
- import { c as s, l as c, t as l } from "./rectangle-Dl4Dy0hS.js";
1
+ import { Fn as e, Yn as t, at as n, jt as r, m as i, ot as a } from "./clipOptions-clBEbkjv.js";
2
+ import { X as o } from "./flowNode-BSjy0Wz3.js";
3
+ import { a as s } from "./rasterization-QktH8Sn2.js";
4
+ import { l as c, t as l, u } from "./rectangle-BAdoDPXu.js";
5
+ import { t as d } from "./color-uTRRsy8i.js";
4
6
  //#region ../core/src/rendering/immediate/markData.js
5
- var u = [], d = ["x", "y"], f = class {
7
+ var f = [], p = ["x", "y"], m = class {
6
8
  #e = {
7
9
  x: 0,
8
10
  y: 0,
@@ -33,26 +35,26 @@ var u = [], d = ["x", "y"], f = class {
33
35
  this.#e.y = this.#r + e * n * this.#i, this.#e.height = t * n * this.#i;
34
36
  }
35
37
  };
36
- function p(e, t) {
38
+ function h(e, t) {
37
39
  let n = e.unitView.getCollector();
38
40
  if (!n) throw Error(`Cannot render an uninitialized mark. View: ${e.unitView.getPathString()}`);
39
41
  let r = n.facetBatches.get(void 0);
40
- return r?.length ? r : n.facetBatches.get(t.facetId) ?? u;
42
+ return r?.length ? r : n.facetBatches.get(t.facetId) ?? f;
41
43
  }
42
- function m(e, t, n, r, i, a) {
43
- let o = p(e, t);
44
+ function g(e, t, n, r, i, a) {
45
+ let o = h(e, t);
44
46
  if (t.sampleFacetRenderingOptions) {
45
47
  let a = r.resolveFacet(n, t.sampleFacetRenderingOptions);
46
- h(e, a) && i(a, o);
47
- } else if (e.encoders.facetIndex) for (let [s, c] of g(e.encoders.facetIndex, o)) {
48
+ _(e, a) && i(a, o);
49
+ } else if (e.encoders.facetIndex) for (let [s, c] of v(e.encoders.facetIndex, o)) {
48
50
  let o = r.resolvePlacement(n, t.placement?.source, s);
49
- o ? h(e, o) && i(o, c) : a(s);
51
+ o ? _(e, o) && i(o, c) : a(s);
50
52
  }
51
- else h(e, n) && i(n, o);
53
+ else _(e, n) && i(n, o);
52
54
  }
53
- function h(e, t) {
55
+ function _(e, t) {
54
56
  if (e.properties.clamp && t.height <= 0) return !1;
55
- for (let n of d) {
57
+ for (let n of p) {
56
58
  let r = e.encoders[n]?.scale;
57
59
  if (r && "gapMapping" in r) {
58
60
  let e = n === "x" ? t.width : t.height;
@@ -61,7 +63,7 @@ function h(e, t) {
61
63
  }
62
64
  return !0;
63
65
  }
64
- function g(e, t) {
66
+ function v(e, t) {
65
67
  let n = /* @__PURE__ */ new Map();
66
68
  for (let r of t) {
67
69
  let t = +e(r), i = n.get(t);
@@ -71,7 +73,7 @@ function g(e, t) {
71
73
  }
72
74
  //#endregion
73
75
  //#region ../core/src/rendering/immediate/bounds.js
74
- function _(e, t, n) {
76
+ function y(e, t, n) {
75
77
  return {
76
78
  x1: n?.clipX ? Math.max(0, n.rect.x) : 0,
77
79
  y1: n?.clipY ? Math.max(0, n.rect.y) : 0,
@@ -79,7 +81,7 @@ function _(e, t, n) {
79
81
  y2: n?.clipY ? Math.min(t, n.rect.y2) : t
80
82
  };
81
83
  }
82
- function v(e, t, n) {
84
+ function b(e, t, n) {
83
85
  let r = n === !0 || n === "x", i = n === !0 || n === "y";
84
86
  return {
85
87
  x1: r ? t?.clipX ? t.rect.x : e.x : -Infinity,
@@ -88,19 +90,19 @@ function v(e, t, n) {
88
90
  y2: i ? t?.clipY ? t.rect.y2 : e.y2 : Infinity
89
91
  };
90
92
  }
91
- function y(e) {
93
+ function x(e) {
92
94
  return e.x1 <= e.x2 && e.y1 <= e.y2;
93
95
  }
94
- function b(e, t, n) {
96
+ function S(e, t, n) {
95
97
  return t < e.x1 || t > e.x2 || n < e.y1 || n > e.y2;
96
98
  }
97
- function x(e, t, n, r, i, a = 0) {
99
+ function C(e, t, n, r, i, a = 0) {
98
100
  return !(Math.max(t, r) + a < e.x1 || Math.min(t, r) - a > e.x2 || Math.max(n, i) + a < e.y1 || Math.min(n, i) - a > e.y2);
99
101
  }
100
102
  //#endregion
101
103
  //#region ../core/src/rendering/immediate/geometry/polygonUnion.js
102
- var S = 1e-8;
103
- function C(e) {
104
+ var w = 1e-8;
105
+ function T(e) {
104
106
  let t = e.flatMap((e, t) => e.map((n, r) => ({
105
107
  a: n,
106
108
  b: e[(r + 1) % e.length],
@@ -108,55 +110,55 @@ function C(e) {
108
110
  }))), n = [];
109
111
  for (let r of t) {
110
112
  let i = [0, 1];
111
- for (let e of t) r.polygonIndex != e.polygonIndex && w(r, e, i);
113
+ for (let e of t) r.polygonIndex != e.polygonIndex && E(r, e, i);
112
114
  i.sort((e, t) => e - t);
113
115
  for (let t = 0; t < i.length - 1; t++) {
114
116
  let a = i[t], o = i[t + 1];
115
- if (o - a <= S) continue;
116
- let s = A(r.a, r.b, a), c = A(r.a, r.b, o), l = A(s, c, .5);
117
- e.some((e, t) => t != r.polygonIndex && O(l, e)) || n.push({
117
+ if (o - a <= w) continue;
118
+ let s = M(r.a, r.b, a), c = M(r.a, r.b, o), l = M(s, c, .5);
119
+ e.some((e, t) => t != r.polygonIndex && A(l, e)) || n.push({
118
120
  a: s,
119
121
  b: c,
120
122
  polygonIndex: r.polygonIndex
121
123
  });
122
124
  }
123
125
  }
124
- return D(E(n));
126
+ return k(O(n));
125
127
  }
126
- function w(e, t, n) {
127
- let r = M(e.b, e.a), i = M(t.b, t.a), a = M(t.a, e.a), o = P(r, i);
128
- if (Math.abs(o) > S) {
129
- let e = P(a, i) / o, t = P(a, r) / o;
130
- e > S && e < .99999999 && t >= -1e-8 && t <= 1.00000001 && n.push(e);
131
- } else Math.abs(P(a, r)) <= S && (T(e, t.a, n), T(e, t.b, n));
128
+ function E(e, t, n) {
129
+ let r = P(e.b, e.a), i = P(t.b, t.a), a = P(t.a, e.a), o = I(r, i);
130
+ if (Math.abs(o) > w) {
131
+ let e = I(a, i) / o, t = I(a, r) / o;
132
+ e > w && e < .99999999 && t >= -1e-8 && t <= 1.00000001 && n.push(e);
133
+ } else Math.abs(I(a, r)) <= w && (D(e, t.a, n), D(e, t.b, n));
132
134
  }
133
- function T(e, t, n) {
134
- let r = M(e.b, e.a), i = N(r, r), a = N(M(t, e.a), r) / i;
135
- a > S && a < .99999999 && n.push(a);
135
+ function D(e, t, n) {
136
+ let r = P(e.b, e.a), i = F(r, r), a = F(P(t, e.a), r) / i;
137
+ a > w && a < .99999999 && n.push(a);
136
138
  }
137
- function E(e) {
139
+ function O(e) {
138
140
  let t = /* @__PURE__ */ new Map();
139
141
  for (let n of e) {
140
- let e = j(n.a) + ":" + j(n.b), r = j(n.b) + ":" + j(n.a);
142
+ let e = N(n.a) + ":" + N(n.b), r = N(n.b) + ":" + N(n.a);
141
143
  t.has(r) ? t.delete(r) : t.has(e) || t.set(e, n);
142
144
  }
143
145
  return Array.from(t.values());
144
146
  }
145
- function D(e) {
147
+ function k(e) {
146
148
  let t = /* @__PURE__ */ new Map();
147
149
  for (let n of e) {
148
- let e = j(n.a), r = t.get(e) ?? [];
150
+ let e = N(n.a), r = t.get(e) ?? [];
149
151
  r.push(n), t.set(e, r);
150
152
  }
151
153
  let n = new Set(e), r = [];
152
154
  for (; n.size;) {
153
155
  let e = n.values().next().value, i = [e.a], a = e;
154
156
  for (;;) {
155
- if (n.delete(a), i.push(a.b), j(a.b) == j(i[0])) {
157
+ if (n.delete(a), i.push(a.b), N(a.b) == N(i[0])) {
156
158
  i.pop();
157
159
  break;
158
160
  }
159
- let e = (t.get(j(a.b)) ?? []).find((e) => n.has(e));
161
+ let e = (t.get(N(a.b)) ?? []).find((e) => n.has(e));
160
162
  if (!e) throw Error("Cannot chain SVG polygon union boundary.");
161
163
  a = e;
162
164
  }
@@ -164,133 +166,155 @@ function D(e) {
164
166
  }
165
167
  return r;
166
168
  }
167
- function O(e, t) {
169
+ function A(e, t) {
168
170
  let n = !1;
169
171
  for (let r = 0, i = t.length - 1; r < t.length; i = r++) {
170
172
  let a = t[i], o = t[r];
171
- if (k(e, a, o)) return !1;
173
+ if (j(e, a, o)) return !1;
172
174
  a.y > e.y != o.y > e.y && e.x < (o.x - a.x) * (e.y - a.y) / (o.y - a.y) + a.x && (n = !n);
173
175
  }
174
176
  return n;
175
177
  }
176
- function k(e, t, n) {
177
- return Math.abs(P(M(e, t), M(n, t))) <= S && N(M(e, t), M(e, n)) <= S;
178
+ function j(e, t, n) {
179
+ return Math.abs(I(P(e, t), P(n, t))) <= w && F(P(e, t), P(e, n)) <= w;
178
180
  }
179
- function A(e, t, n) {
181
+ function M(e, t, n) {
180
182
  return {
181
183
  x: e.x + (t.x - e.x) * n,
182
184
  y: e.y + (t.y - e.y) * n
183
185
  };
184
186
  }
185
- function j(e) {
186
- return `${Math.round(e.x / S)},${Math.round(e.y / S)}`;
187
+ function N(e) {
188
+ return `${Math.round(e.x / w)},${Math.round(e.y / w)}`;
187
189
  }
188
- function M(e, t) {
190
+ function P(e, t) {
189
191
  return {
190
192
  x: e.x - t.x,
191
193
  y: e.y - t.y
192
194
  };
193
195
  }
194
- function N(e, t) {
196
+ function F(e, t) {
195
197
  return e.x * t.x + e.y * t.y;
196
198
  }
197
- function P(e, t) {
199
+ function I(e, t) {
198
200
  return e.x * t.y - e.y * t.x;
199
201
  }
200
202
  //#endregion
201
203
  //#region ../core/src/rendering/immediate/markEncoding.js
202
- function F(e, t, r, i, a = !1) {
203
- let o = t[r], s = t[r + "2"], c = t[r + "Offset"], l = t[r + "2Offset"], u = r == "x" ? e.width : e.height, d = r == "x" ? e.x : e.y + u, f = r == "x" ? u : -u, p = r == "x" ? e.x : e.y, m = p + u, h = R(o), g = s ? R(s) : 0, _ = R(c), v = l ? R(l) : 0, y = L(o, u, s), b = s && L(s, u, o), x = o.constant && !y ? I(o, i) + h : 0, S = s?.constant && !b ? I(s, i) + g : 0, C = c.constant ? I(c, i) + _ : 0, w = s && l?.constant ? I(l, i) + v : 0;
204
+ var L = /* @__PURE__ */ new WeakMap();
205
+ function R(e) {
206
+ let t = L.get(e);
207
+ if (!t) {
208
+ let n = /* @__PURE__ */ new Map([["none", 0]]), r = "none", i = 0;
209
+ t = (e) => {
210
+ if (e !== r) {
211
+ let t = n.get(e);
212
+ t === void 0 && (t = d(e)[3], n.set(e, t)), r = e, i = t;
213
+ }
214
+ return i;
215
+ }, L.set(e, t);
216
+ }
217
+ return t;
218
+ }
219
+ function z(e, t, n, r, i = !1) {
220
+ let o = t[n], s = t[n + "2"], c = t[n + "Offset"], l = t[n + "2Offset"], u = n == "x" ? e.width : e.height, d = n == "x" ? e.x : e.y + u, f = n == "x" ? u : -u, p = n == "x" ? e.x : e.y, m = p + u, h = H(o), g = s ? H(s) : 0, _ = H(c), v = l ? H(l) : 0, y = V(o, u, s), b = s && V(s, u, o), x = o.constant && !y ? B(o, r) + h : 0, S = s?.constant && !b ? B(s, r) + g : 0, C = c.constant ? B(c, r) + _ : 0, w = s && l?.constant ? B(l, r) + v : 0;
204
221
  return (e, t) => {
205
- let r = c.constant ? C : I(c, e) + _, i = y ? y(e) : o.constant ? x : I(o, e) + h, u = d + i * f + r, T = u;
222
+ let n = c.constant ? C : B(c, e) + _, r = y ? y(e) : o.constant ? x : B(o, e) + h, u = d + r * f + n, T = u;
206
223
  if (s) {
207
- let t = b ? b(e) : s.constant ? S : I(s, e) + g, n = l ? l.constant ? w : I(l, e) + v : r;
208
- T = d + t * f + n;
224
+ let t = b ? b(e) : s.constant ? S : B(s, e) + g, r = l ? l.constant ? w : B(l, e) + v : n;
225
+ T = d + t * f + r;
209
226
  }
210
- return t[0] = a ? n(u, p, m) : u, t[1] = a ? n(T, p, m) : T, t;
227
+ return t[0] = i ? a(u, p, m) : u, t[1] = i ? a(T, p, m) : T, t;
211
228
  };
212
229
  }
213
- function I(e, t) {
230
+ function B(e, t) {
214
231
  return e(t);
215
232
  }
216
- function L(e, t, n) {
217
- let r = e.scale;
218
- if (!r || !("gapMapping" in r)) return;
219
- let i = r.gapMapping(t);
220
- if (!i) return;
221
- let a = e.branches[0].accessor, o = a.channelDef, c = n && s(e.channelDef) && n.branches[0].accessor, l = c ? 0 : .5, u = "band" in o ? o.band ?? l : l;
222
- return (e) => {
223
- let t = Number(a(e)), n = !!c && t > Number(c(e));
224
- return i.position(t, u, n);
233
+ function V(e, t, n) {
234
+ let i = e.scale;
235
+ if (!i || !("gapMapping" in i)) return;
236
+ let a = i.gapMapping(t);
237
+ if (!a) return;
238
+ let o = n && (i.type === "index" || i.type === "locus") && c(e.channelDef) && n.branches[0].accessor, s = o ? 0 : .5, l = e.branches.map(({ accessor: e }) => {
239
+ let t = e.channelDef;
240
+ if (r(t)) return e.asNumberAccessor();
241
+ let n = "band" in t ? t.band ?? s : s;
242
+ return (t) => {
243
+ let r = e(t), i = !!o && Number(r) > Number(o(t));
244
+ return a.position(r, n, i);
245
+ };
246
+ });
247
+ return (t) => {
248
+ for (let n = 0; n < l.length; n++) if (e.branches[n].predicate(t)) return l[n](t);
225
249
  };
226
250
  }
227
- function R(e) {
251
+ function H(e) {
228
252
  let t = e.scale;
229
253
  if (!t) return 0;
230
254
  let n = e.channelDef, r = n && "band" in n ? n.band ?? .5 : .5;
231
- return o(t, r);
255
+ return s(t, r);
232
256
  }
233
- function z(e, t) {
234
- return H(e(t));
257
+ function U(e, t) {
258
+ return K(e(t));
235
259
  }
236
- function B(e, t) {
260
+ function W(e, t) {
237
261
  let n = t.start ?? 0;
238
262
  if (!e.constant || n === (t.end ?? t.data.length)) return;
239
- let r = e.branches[0].accessor, i = r.channelDef, o = "value" in i ? i.value : "datum" in i ? i.datum : i;
240
- if (a(o)) {
263
+ let r = e.branches[0].accessor, a = r.channelDef, o = "value" in a ? a.value : "datum" in a ? a.datum : a;
264
+ if (i(o)) {
241
265
  let e = r;
242
266
  if (!/^[$A-Z_a-z][$\w]*(?:\s*\.\s*[$A-Z_a-z][$\w]*)*(?:\s*\|\|\s*(?:"(?:[^"\\]|\\.)*"|null))?$/.test(o.expr.trim()) || !e.dependencies?.every((e) => e.batchStable)) return;
243
267
  }
244
- return H(e(t.data[n]));
268
+ return K(e(t.data[n]));
245
269
  }
246
- function V(e, t) {
247
- return a(t) ? e.unitView.paramRuntime.evaluateAndGet(t) : t;
270
+ function G(e, t) {
271
+ return i(t) ? e.unitView.paramRuntime.evaluateAndGet(t) : t;
248
272
  }
249
- function H(e) {
273
+ function K(e) {
250
274
  return e == null ? "none" : "" + e;
251
275
  }
252
276
  //#endregion
253
277
  //#region ../core/src/rendering/immediate/marks/arrow.js
254
278
  function ee(e) {
255
- let t = e.properties, n = V(e, t.headSpacing);
279
+ let t = e.properties, n = G(e, t.headSpacing);
256
280
  return {
257
- configuredRHeadSlope: le(V(e, t.headAngle)),
258
- configuredRHeadNotchSlope: le(V(e, t.headNotchAngle)),
259
- headShape: V(e, t.headShape),
260
- headWidth: V(e, t.headWidth),
261
- minSize: V(e, t.minSize),
262
- stem: V(e, t.stem),
263
- startNotch: V(e, t.startNotch),
264
- minStemLength: V(e, t.minStemLength),
281
+ configuredRHeadSlope: de(G(e, t.headAngle)),
282
+ configuredRHeadNotchSlope: de(G(e, t.headNotchAngle)),
283
+ headShape: G(e, t.headShape),
284
+ headWidth: G(e, t.headWidth),
285
+ minSize: G(e, t.minSize),
286
+ stem: G(e, t.stem),
287
+ startNotch: G(e, t.startNotch),
288
+ minStemLength: G(e, t.minStemLength),
265
289
  headSpacing: n,
266
290
  repeatHeads: n != null && n >= 0,
267
- headPlacement: V(e, t.headPlacement)
291
+ headPlacement: G(e, t.headPlacement)
268
292
  };
269
293
  }
270
- function U(e, t, n, r, i) {
271
- let { viewOpacity: a } = n, o = e.encoders;
272
- return W(e, t, n, (e) => {
273
- let n = t.stem ? ie(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch && !e.bidirectional, e.bidirectional) : null, s = n ? [n] : [];
274
- ne(e, (t, n, r, i) => {
294
+ function te(e, t, n, r, i) {
295
+ let { viewOpacity: a } = n, o = e.encoders, s = R(o.stroke);
296
+ return ne(e, t, n, (e) => {
297
+ let n = t.stem ? oe(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch && !e.bidirectional, e.bidirectional) : null, c = n ? [n] : [];
298
+ ie(e, (t, n, r, i) => {
275
299
  let a = {
276
300
  x: t,
277
301
  y: n
278
302
  };
279
- s.push(e.renderedHeadShape == "open" ? ae(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : re(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
303
+ c.push(e.renderedHeadShape == "open" ? se(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : ae(a, r, i, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
280
304
  });
281
- let c = (i ?? H(o.stroke(e.datum))) != "none" && I(o.strokeOpacity, e.datum) * a > 0 && e.strokeWidth > 0;
305
+ let l = i ?? K(o.stroke(e.datum)), u = B(o.strokeOpacity, e.datum) * s(l) * a > 0 && e.strokeWidth > 0;
282
306
  r({
283
307
  datum: e.datum,
284
- boundaryLoops: s.length == 1 || !c ? s : C(s),
308
+ boundaryLoops: c.length == 1 || !u ? c : T(c),
285
309
  strokeWidth: e.strokeWidth,
286
310
  headShapeFallback: e.headShapeFallback
287
311
  });
288
312
  });
289
313
  }
290
- function W(e, t, n, r) {
291
- let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, l = e.encoders;
314
+ function ne(e, t, n, r) {
315
+ let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, c = e.encoders;
292
316
  if (a.length == 0) return 0;
293
- let u = F(i, l, "x", a[0], c(e, "x")), d = F(i, l, "y", a[0], c(e, "y")), f = [0, 0], p = [0, 0], m = {
317
+ let l = z(i, c, "x", a[0], u(e, "x")), d = z(i, c, "y", a[0], u(e, "y")), f = [0, 0], p = [0, 0], m = {
294
318
  datum: {},
295
319
  tail: {
296
320
  x: 0,
@@ -332,11 +356,11 @@ function W(e, t, n, r) {
332
356
  headShapeFallback: !1
333
357
  }, h = 0;
334
358
  for (let e of a) {
335
- u(e, f), d(e, p);
336
- let n = te(l.direction, e), i = n == "reverse", a = n == "both", c = i ? f[1] : f[0], g = i ? p[1] : p[0], _ = i ? f[0] : f[1], v = i ? p[0] : p[1], y = _ - c, b = v - g, S = Math.hypot(y, b);
337
- if (S == 0) continue;
338
- let C = y / S, w = b / S, T = Math.max(I(l.size, e), t.minSize), E = T / 2, D = Math.max(t.headWidth * T, 0) / 2, O = oe({
339
- segmentLength: S,
359
+ l(e, f), d(e, p);
360
+ let n = re(c.direction, e), i = n == "reverse", a = n == "both", u = i ? f[1] : f[0], g = i ? p[1] : p[0], _ = i ? f[0] : f[1], v = i ? p[0] : p[1], y = _ - u, b = v - g, x = Math.hypot(y, b);
361
+ if (x == 0) continue;
362
+ let S = y / x, w = b / x, T = Math.max(B(c.size, e), t.minSize), E = T / 2, D = Math.max(t.headWidth * T, 0) / 2, O = ce({
363
+ segmentLength: x,
340
364
  headHalfWidth: D,
341
365
  stemHalfWidth: t.stem ? E : -E,
342
366
  configuredRHeadSlope: t.configuredRHeadSlope,
@@ -347,17 +371,17 @@ function W(e, t, n, r) {
347
371
  minStemLength: t.minStemLength,
348
372
  headShape: t.headShape,
349
373
  bidirectional: a
350
- }), k = t.headShape == "open" ? O : Math.min(t.configuredRHeadNotchSlope, O), A = t.headShape == "open" ? T : 0, j = t.headPlacement == "outside" ? ce(D, O, k, A) : 0, M = _ + C * j, N = v + w * j;
351
- a && (c -= C * j, g -= w * j);
352
- let P = D * O, F = Math.hypot(D, P), L = t.headShape == "open" && F > 0 ? T * D / F : 0, R = M - C * (P + L), z = N - w * (P + L), B = a ? c + C * (P + L) : c, V = a ? g + w * (P + L) : g, H = I(l.strokeWidth, e), ee = Math.max(t.stem ? E : 0, D) + H * 2;
353
- if (!x(o, Math.min(c, M, R, B), Math.min(g, N, z, V), Math.max(c, M, R, B), Math.max(g, N, z, V), ee) || (h++, s)) continue;
354
- let U = t.headShape == "triangle" || t.headShape == "open" ? t.headShape : "triangle", W = P + A / Math.hypot(O, 1) + H, ne = !t.repeatHeads || a ? Infinity : Math.max((t.headSpacing ?? 0) * T, W);
355
- m.datum = e, q(m.tail, c, g), q(m.tip, M, N), q(m.tangent, C, w), q(m.normal, -w, C), q(m.reverseTangent, -C, -w), q(m.reverseNormal, w, -C), m.size = T, m.stemHalfWidth = E, m.headHalfWidth = D, m.headAxisLength = P, m.rHeadSlope = O, m.rHeadNotchSlope = k, m.strokeWidth = H, m.repeatSpacing = ne, m.headRepeatFootprint = W, m.geometryLength = Math.hypot(M - c, N - g), m.bidirectional = a, m.stemContainsHead = t.stem && U == "triangle" && (!t.repeatHeads || a) && D <= E, m.renderedHeadShape = U, m.headShapeFallback = U != t.headShape, r(m);
374
+ }), k = t.headShape == "open" ? O : Math.min(t.configuredRHeadNotchSlope, O), A = t.headShape == "open" ? T : 0, j = t.headPlacement == "outside" ? ue(D, O, k, A) : 0, M = _ + S * j, N = v + w * j;
375
+ a && (u -= S * j, g -= w * j);
376
+ let P = D * O, F = Math.hypot(D, P), I = t.headShape == "open" && F > 0 ? T * D / F : 0, L = M - S * (P + I), R = N - w * (P + I), z = a ? u + S * (P + I) : u, V = a ? g + w * (P + I) : g, H = B(c.strokeWidth, e), U = Math.max(t.stem ? E : 0, D) + H * 2;
377
+ if (!C(o, Math.min(u, M, L, z), Math.min(g, N, R, V), Math.max(u, M, L, z), Math.max(g, N, R, V), U) || (h++, s)) continue;
378
+ let W = t.headShape == "triangle" || t.headShape == "open" ? t.headShape : "triangle", G = P + A / Math.hypot(O, 1) + H, K = !t.repeatHeads || a ? Infinity : Math.max((t.headSpacing ?? 0) * T, G);
379
+ m.datum = e, Y(m.tail, u, g), Y(m.tip, M, N), Y(m.tangent, S, w), Y(m.normal, -w, S), Y(m.reverseTangent, -S, -w), Y(m.reverseNormal, w, -S), m.size = T, m.stemHalfWidth = E, m.headHalfWidth = D, m.headAxisLength = P, m.rHeadSlope = O, m.rHeadNotchSlope = k, m.strokeWidth = H, m.repeatSpacing = K, m.headRepeatFootprint = G, m.geometryLength = Math.hypot(M - u, N - g), m.bidirectional = a, m.stemContainsHead = t.stem && W == "triangle" && (!t.repeatHeads || a) && D <= E, m.renderedHeadShape = W, m.headShapeFallback = W != t.headShape, r(m);
356
380
  }
357
381
  return h;
358
382
  }
359
- function te(e, t) {
360
- let n = z(e, t);
383
+ function re(e, t) {
384
+ let n = U(e, t);
361
385
  switch (n) {
362
386
  case "forward":
363
387
  case "reverse":
@@ -365,99 +389,99 @@ function te(e, t) {
365
389
  default: throw Error(`Invalid value for "direction" channel: ${n}`);
366
390
  }
367
391
  }
368
- function ne(e, t) {
392
+ function ie(e, t) {
369
393
  e.bidirectional && !e.stemContainsHead && t(e.tail.x, e.tail.y, e.reverseTangent, e.reverseNormal);
370
394
  for (let n = 0; !e.stemContainsHead && !(n > 0 && n + e.headRepeatFootprint - e.strokeWidth / 2 > e.geometryLength || (t(e.tip.x - e.tangent.x * n, e.tip.y - e.tangent.y * n, e.tangent, e.normal), !(e.repeatSpacing > 0) || !Number.isFinite(e.repeatSpacing))); n += e.repeatSpacing);
371
395
  }
372
- function re(e, t, n, r, i, a) {
373
- let o = r * i, s = o - r * a, c = G(G(e, K(t, -o)), K(n, r)), l = G(G(e, K(t, -o)), K(n, -r));
396
+ function ae(e, t, n, r, i, a) {
397
+ let o = r * i, s = o - r * a, c = q(q(e, J(t, -o)), J(n, r)), l = q(q(e, J(t, -o)), J(n, -r));
374
398
  return [
375
399
  e,
376
400
  c,
377
- G(e, K(t, -s)),
401
+ q(e, J(t, -s)),
378
402
  l
379
403
  ];
380
404
  }
381
- function ie(e, t, n, r, i, a, o, s) {
382
- let c = i * a, l = G(G(t, K(n, -c)), K(r, i)), u = G(G(t, K(n, -c)), K(r, -i)), d = G(e, K(r, i)), f = G(e, K(r, -i));
405
+ function oe(e, t, n, r, i, a, o, s) {
406
+ let c = i * a, l = q(q(t, J(n, -c)), J(r, i)), u = q(q(t, J(n, -c)), J(r, -i)), d = q(e, J(r, i)), f = q(e, J(r, -i));
383
407
  return s ? [
384
408
  t,
385
409
  l,
386
- G(G(e, K(n, c)), K(r, i)),
410
+ q(q(e, J(n, c)), J(r, i)),
387
411
  e,
388
- G(G(e, K(n, c)), K(r, -i)),
412
+ q(q(e, J(n, c)), J(r, -i)),
389
413
  u
390
414
  ] : [
391
415
  t,
392
416
  l,
393
417
  d,
394
- ...o ? [G(e, K(n, i * a))] : [],
418
+ ...o ? [q(e, J(n, i * a))] : [],
395
419
  f,
396
420
  u
397
421
  ];
398
422
  }
399
- function ae(e, t, n, r, i, a, o) {
400
- let s = r * i, c = G(G(e, K(t, -s)), K(n, r)), l = G(G(e, K(t, -s)), K(n, -r)), u = Math.hypot(r, s), d = u > 0 ? o * r / u : 0, f = u > 0 ? o * s / u : 0, p = G(G(c, K(t, -d)), K(n, -f)), m = G(G(l, K(t, -d)), K(n, f));
423
+ function se(e, t, n, r, i, a, o) {
424
+ let s = r * i, c = q(q(e, J(t, -s)), J(n, r)), l = q(q(e, J(t, -s)), J(n, -r)), u = Math.hypot(r, s), d = u > 0 ? o * r / u : 0, f = u > 0 ? o * s / u : 0, p = q(q(c, J(t, -d)), J(n, -f)), m = q(q(l, J(t, -d)), J(n, f));
401
425
  return [
402
426
  e,
403
427
  c,
404
428
  p,
405
- G(e, K(t, -(s + d - (r - f) * a))),
429
+ q(e, J(t, -(s + d - (r - f) * a))),
406
430
  m,
407
431
  l
408
432
  ];
409
433
  }
410
- function oe({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l, bidirectional: u }) {
434
+ function ce({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l, bidirectional: u }) {
411
435
  if (a || n < 0) return r;
412
436
  if (o == "outside") return !s || n <= 0 ? r : Math.min(r, Math.max(e - c, 0) / n);
413
437
  if (l != "triangle") return r;
414
438
  let d = Math.max(e - c, 0) / (u ? 2 : 1);
415
- return se(n, t, r, i) <= d ? r : d < n * i ? n > 0 ? ue(d / n, 0, r) : 0 : ue((d + (t - n) * i) / t, 0, r);
439
+ return le(n, t, r, i) <= d ? r : d < n * i ? n > 0 ? fe(d / n, 0, r) : 0 : fe((d + (t - n) * i) / t, 0, r);
416
440
  }
417
- function se(e, t, n, r) {
441
+ function le(e, t, n, r) {
418
442
  return t * n - (t - e) * Math.min(r, n);
419
443
  }
420
- function ce(e, t, n, r) {
444
+ function ue(e, t, n, r) {
421
445
  if (e <= 0) return 0;
422
446
  let i = e * t, a = Math.hypot(e, i);
423
447
  return i + r * e / a - (e - r * i / a) * n;
424
448
  }
425
- function le(e) {
426
- let t = ue(e, 1, 90) * Math.PI / 180;
449
+ function de(e) {
450
+ let t = fe(e, 1, 90) * Math.PI / 180;
427
451
  return 1 / Math.max(Math.tan(t), 1e-6);
428
452
  }
429
- function G(e, t) {
453
+ function q(e, t) {
430
454
  return {
431
455
  x: e.x + t.x,
432
456
  y: e.y + t.y
433
457
  };
434
458
  }
435
- function K(e, t) {
459
+ function J(e, t) {
436
460
  return {
437
461
  x: e.x * t,
438
462
  y: e.y * t
439
463
  };
440
464
  }
441
- function q(e, t, n) {
465
+ function Y(e, t, n) {
442
466
  e.x = t, e.y = n;
443
467
  }
444
- function ue(e, t, n) {
468
+ function fe(e, t, n) {
445
469
  return Math.min(Math.max(e, t), n);
446
470
  }
447
471
  //#endregion
448
472
  //#region ../core/src/rendering/immediate/linkFading.js
449
- var de = 4;
450
- function fe(e, t, n) {
473
+ var pe = 4;
474
+ function me(e, t, n) {
451
475
  let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
452
476
  if (a == 0) return;
453
477
  let o = -i / a, s = r / a;
454
478
  (o < 0 || o == 0 && s < 0) && (o = -o, s = -s);
455
479
  let c = o * e[0] + s * e[1], [l, u] = n, d = JSON.stringify([
456
- J(o, 6),
457
- J(s, 6),
458
- J(c, 1),
459
- J(l, 1),
460
- J(u, 1)
480
+ X(o, 6),
481
+ X(s, 6),
482
+ X(c, 1),
483
+ X(l, 1),
484
+ X(u, 1)
461
485
  ]);
462
486
  return {
463
487
  normalX: o,
@@ -468,33 +492,33 @@ function fe(e, t, n) {
468
492
  key: d
469
493
  };
470
494
  }
471
- function pe(e, t, n = !1) {
472
- let r = V(e, e.properties.arcFadingDistance);
473
- return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n && V(e, e.properties.noFadingOnSecondPass) ? !1 : r;
495
+ function he(e, t, n = !1) {
496
+ let r = G(e, e.properties.arcFadingDistance);
497
+ return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n && G(e, e.properties.noFadingOnSecondPass) ? !1 : r;
474
498
  }
475
- function me(e, t) {
499
+ function ge(e, t) {
476
500
  let n = [], r = (r) => {
477
- for (let i = 0; i <= de; i++) {
478
- let a = i / de, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
501
+ for (let i = 0; i <= pe; i++) {
502
+ let a = i / pe, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
479
503
  n.push({
480
504
  offset: s,
481
- opacity: 1 - he(c)
505
+ opacity: 1 - _e(c)
482
506
  });
483
507
  }
484
508
  };
485
509
  return r(!0), r(!1), n;
486
510
  }
487
- function he(e) {
511
+ function _e(e) {
488
512
  let t = Math.max(0, Math.min(1, e));
489
513
  return t * t * (3 - 2 * t);
490
514
  }
491
- function J(e, t) {
515
+ function X(e, t) {
492
516
  let n = 10 ** t;
493
517
  return Math.round(e * n) / n;
494
518
  }
495
519
  //#endregion
496
520
  //#region ../core/src/rendering/immediate/geometry/linkGeometry.js
497
- function ge(e, t, n, r) {
521
+ function ve(e, t, n, r) {
498
522
  return r.shape == "orthogonal" ? {
499
523
  type: "orthogonal",
500
524
  points: [
@@ -504,38 +528,38 @@ function ge(e, t, n, r) {
504
528
  ]
505
529
  } : {
506
530
  type: "cubic",
507
- points: _e(e, t, n, r)
531
+ points: ye(e, t, n, r)
508
532
  };
509
533
  }
510
- function _e(e, t, n, r) {
534
+ function ye(e, t, n, r) {
511
535
  if (r.shape == "arc") {
512
- let i = [...e], a = [...t], o = X(a, i), s = xe(o);
536
+ let i = [...e], a = [...t], o = Ce(a, i), s = we(o);
513
537
  if (s == 0) return [
514
538
  i,
515
539
  i,
516
540
  a,
517
541
  a
518
542
  ];
519
- let c = Z(o, 1 / s), l = [-c[1], c[0]];
520
- s = ve(i, a, s, r.maxChordLength, n);
521
- let u = Z(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
543
+ let c = Q(o, 1 / s), l = [-c[1], c[0]];
544
+ s = be(i, a, s, r.maxChordLength, n);
545
+ let u = Q(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
522
546
  return [
523
547
  i,
524
- Y(i, u),
525
- Y(a, u),
548
+ Z(i, u),
549
+ Z(a, u),
526
550
  a
527
551
  ];
528
552
  }
529
553
  if (r.shape == "dome") {
530
554
  let i, a, o;
531
555
  r.orient == "vertical" ? (i = [Math.min(e[0], t[0]), t[1]], a = [Math.max(e[0], t[0]), t[1]], o = [0, e[1] - t[1]]) : (i = [t[0], Math.min(e[1], t[1])], a = [t[0], Math.max(e[1], t[1])], o = [e[0] - t[0], 0]);
532
- let s = xe(X(a, i));
533
- ve(i, a, s, r.maxChordLength, n), r.clampApex && ye(i, a, r.orient, n);
534
- let c = Z(o, 1 / .75);
556
+ let s = we(Ce(a, i));
557
+ be(i, a, s, r.maxChordLength, n), r.clampApex && xe(i, a, r.orient, n);
558
+ let c = Q(o, 1 / .75);
535
559
  return [
536
560
  i,
537
- Y(i, c),
538
- Y(a, c),
561
+ Z(i, c),
562
+ Z(a, c),
539
563
  a
540
564
  ];
541
565
  }
@@ -560,7 +584,7 @@ function _e(e, t, n, r) {
560
584
  }
561
585
  }
562
586
  if (r.shape == "line") {
563
- let n = Z(Y(e, t), .5);
587
+ let n = Q(Z(e, t), .5);
564
588
  return [
565
589
  e,
566
590
  n,
@@ -570,58 +594,58 @@ function _e(e, t, n, r) {
570
594
  }
571
595
  throw Error(`Unsupported link shape: ${r.shape}`);
572
596
  }
573
- function ve(e, t, n, r, i) {
597
+ function be(e, t, n, r, i) {
574
598
  if (n <= r) return n;
575
- let a = Z(X(t, e), 1 / n);
576
- return be(e, i, 2) ? (Se(t, Y(e, Z(a, r))), r) : be(t, i, 2) ? (Se(e, X(t, Z(a, r))), r) : n;
599
+ let a = Q(Ce(t, e), 1 / n);
600
+ return Se(e, i, 2) ? (Te(t, Z(e, Q(a, r))), r) : Se(t, i, 2) ? (Te(e, Ce(t, Q(a, r))), r) : n;
577
601
  }
578
- function ye(e, t, n, r) {
602
+ function xe(e, t, n, r) {
579
603
  n == "vertical" ? (t[0] > 0 && (e[0] = Math.max(e[0], -t[0])), e[0] < r.width && (t[0] = Math.min(t[0], 2 * r.width - e[0]))) : (t[1] > 0 && (e[1] = Math.max(e[1], -t[1])), e[1] < r.height && (t[1] = Math.min(t[1], 2 * r.height - e[1])));
580
604
  }
581
- function be(e, t, n) {
605
+ function Se(e, t, n) {
582
606
  return e[0] >= -t.width * n && e[0] <= t.width * (1 + n) && e[1] >= -t.height * n && e[1] <= t.height * (1 + n);
583
607
  }
584
- function Y(e, t) {
608
+ function Z(e, t) {
585
609
  return [e[0] + t[0], e[1] + t[1]];
586
610
  }
587
- function X(e, t) {
611
+ function Ce(e, t) {
588
612
  return [e[0] - t[0], e[1] - t[1]];
589
613
  }
590
- function Z(e, t) {
614
+ function Q(e, t) {
591
615
  return [e[0] * t, e[1] * t];
592
616
  }
593
- function xe(e) {
617
+ function we(e) {
594
618
  return Math.hypot(e[0], e[1]);
595
619
  }
596
- function Se(e, t) {
620
+ function Te(e, t) {
597
621
  e[0] = t[0], e[1] = t[1];
598
622
  }
599
623
  //#endregion
600
624
  //#region ../core/src/rendering/immediate/marks/link.js
601
- function Ce(e) {
625
+ function Ee(e) {
602
626
  let t = e.properties;
603
627
  return {
604
- shape: V(e, t.linkShape),
605
- orient: V(e, t.orient),
606
- arcHeightFactor: V(e, t.arcHeightFactor),
607
- minArcHeight: V(e, t.minArcHeight),
608
- maxChordLength: V(e, t.maxChordLength),
609
- clampApex: V(e, t.clampApex)
628
+ shape: G(e, t.linkShape),
629
+ orient: G(e, t.orient),
630
+ arcHeightFactor: G(e, t.arcHeightFactor),
631
+ minArcHeight: G(e, t.minArcHeight),
632
+ maxChordLength: G(e, t.maxChordLength),
633
+ clampApex: G(e, t.clampApex)
610
634
  };
611
635
  }
612
- function we(e, t, n, r) {
636
+ function De(e, t, n, r) {
613
637
  let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
614
638
  if (a.length == 0) return 0;
615
- let l = F(i, s, "x", a[0], c(e, "x")), u = F(i, s, "y", a[0], c(e, "y")), d = [0, 0], f = [0, 0], p = i.x, m = i.y, h = {
639
+ let c = z(i, s, "x", a[0], u(e, "x")), l = z(i, s, "y", a[0], u(e, "y")), d = [0, 0], f = [0, 0], p = i.x, m = i.y, h = {
616
640
  width: i.width,
617
641
  height: i.height
618
- }, g = m + h.height, _ = c(e, "x") || c(e, "y"), v = 0;
642
+ }, g = m + h.height, _ = u(e, "x") || u(e, "y"), v = 0;
619
643
  for (let e of a) {
620
- if (l(e, d), u(e, f), (_ || t.shape == "orthogonal") && d[0] === d[1] && f[0] === f[1]) continue;
621
- let [i, a] = d, [c, m] = f, y = ge([i - p, g - c], [a - p, g - m], h, t), b = Infinity, S = Infinity, C = -Infinity, w = -Infinity;
622
- for (let e of y.points) e[0] += p, e[1] = g - e[1], b = Math.min(b, e[0]), S = Math.min(S, e[1]), C = Math.max(C, e[0]), w = Math.max(w, e[1]);
623
- let T = I(s.size, e);
624
- x(o, b, S, C, w, Math.max(T, n.minPickingSize ?? 0) / 2) && (v++, r({
644
+ if (c(e, d), l(e, f), (_ || t.shape == "orthogonal") && d[0] === d[1] && f[0] === f[1]) continue;
645
+ let [i, a] = d, [u, m] = f, y = ve([i - p, g - u], [a - p, g - m], h, t), b = Infinity, x = Infinity, S = -Infinity, w = -Infinity;
646
+ for (let e of y.points) e[0] += p, e[1] = g - e[1], b = Math.min(b, e[0]), x = Math.min(x, e[1]), S = Math.max(S, e[0]), w = Math.max(w, e[1]);
647
+ let T = B(s.size, e);
648
+ C(o, b, x, S, w, Math.max(T, n.minPickingSize ?? 0) / 2) && (v++, r({
625
649
  datum: e,
626
650
  geometry: y,
627
651
  strokeWidth: T
@@ -631,39 +655,40 @@ function we(e, t, n, r) {
631
655
  }
632
656
  //#endregion
633
657
  //#region ../core/src/rendering/immediate/marks/point.js
634
- function Te(e) {
635
- return { inwardStroke: V(e, e.properties.inwardStroke) };
658
+ function Oe(e) {
659
+ return { inwardStroke: G(e, e.properties.inwardStroke) };
636
660
  }
637
- function Ee(e, t, r, i) {
638
- let { coords: a, data: o, visibleBounds: s, anchorCullBounds: l } = r, u = r.start ?? 0, d = r.end ?? o.length, f = e.encoders;
639
- if (u === d) return 0;
640
- let p = F(a, f, "x", o[u]), m = F(a, f, "y", o[u]), h = [0, 0], g = [0, 0], _ = e.getSemanticThreshold(), v = {
661
+ function ke(e, t, n, r) {
662
+ let { coords: i, data: o, visibleBounds: s, anchorCullBounds: c } = n, l = n.start ?? 0, d = n.end ?? o.length, f = e.encoders;
663
+ if (l === d) return 0;
664
+ let p = z(i, f, "x", o[l]), m = z(i, f, "y", o[l]), h = [0, 0], g = [0, 0], _ = e.getSemanticThreshold(), v = {
641
665
  datum: {},
642
666
  shape: "circle",
643
667
  x: 0,
644
668
  y: 0,
669
+ radius: 0,
645
670
  geometryRadius: 0,
646
671
  boundsRadius: 0,
647
672
  angle: 0,
648
673
  strokeWidth: 0,
649
674
  lineShape: !1
650
- }, y = c(e, "x"), S = c(e, "y"), C = 0;
651
- for (let e = u; e < d; e++) {
652
- let r = o[e];
653
- if (I(f.semanticScore, r) < _) continue;
654
- p(r, h), m(r, g);
655
- let c = h[0] + I(f.dx, r), u = g[0] - I(f.dy, r);
656
- if (y && (c = n(c, a.x, a.x2)), S && (u = n(u, a.y, a.y2)), b(l, c, u)) continue;
657
- let d = Math.sqrt(I(f.size, r)) / 2;
658
- if (t.inwardStroke && d <= 0) continue;
659
- let w = z(f.shape, r), T = I(f.strokeWidth, r), E = w == "x" || w == "+", D = t.inwardStroke && !E ? Math.min(T, d) : T, O = t.inwardStroke && !E ? d - D / 2 : d, k = t.inwardStroke ? 0 : T / 2, A = d * Math.SQRT2 + k;
660
- x(s, c - A, u - A, c + A, u + A) && (C++, v.datum = r, v.shape = w, v.x = c, v.y = u, v.geometryRadius = O, v.boundsRadius = A, v.angle = I(f.angle, r), v.strokeWidth = D, v.lineShape = E, i(v));
675
+ }, y = u(e, "x"), b = u(e, "y"), x = 0;
676
+ for (let n = l; n < d; n++) {
677
+ let l = o[n];
678
+ if (B(f.semanticScore, l) < _ && !e.isPreservedBySelection(l)) continue;
679
+ p(l, h), m(l, g);
680
+ let u = h[0] + B(f.dx, l), d = g[0] - B(f.dy, l);
681
+ if (y && (u = a(u, i.x, i.x2)), b && (d = a(d, i.y, i.y2)), S(c, u, d)) continue;
682
+ let w = Math.sqrt(B(f.size, l)) / 2;
683
+ if (t.inwardStroke && w <= 0) continue;
684
+ let T = U(f.shape, l), E = B(f.strokeWidth, l), D = T == "x" || T == "+", O = t.inwardStroke && !D ? Math.min(E, w) : E, k = t.inwardStroke && !D ? w - O / 2 : w, A = t.inwardStroke ? 0 : E / 2, j = w * Math.SQRT2 + A;
685
+ C(s, u - j, d - j, u + j, d + j) && (x++, v.datum = l, v.shape = T, v.x = u, v.y = d, v.radius = w, v.geometryRadius = k, v.boundsRadius = j, v.angle = B(f.angle, l), v.strokeWidth = O, v.lineShape = D, r(v));
661
686
  }
662
- return C;
687
+ return x;
663
688
  }
664
689
  //#endregion
665
690
  //#region ../core/src/rendering/immediate/geometry/pointPath.js
666
- function De(e, t, n, r, i) {
691
+ function Ae(e, t, n, r, i) {
667
692
  let a = r * .4, o = r * .15, s = Math.sqrt(3) * r / 2;
668
693
  switch (e) {
669
694
  case "diamond": return i.moveTo(t, n - r), i.lineTo(t + r, n), i.lineTo(t, n + r), i.lineTo(t - r, n), i.closePath(), !0;
@@ -672,49 +697,49 @@ function De(e, t, n, r, i) {
672
697
  case "triangle-right": return i.moveTo(t + s, n), i.lineTo(t - s, n + r), i.lineTo(t - s, n - r), i.closePath(), !0;
673
698
  case "triangle-down": return i.moveTo(t, n + s), i.lineTo(t - r, n - s), i.lineTo(t + r, n - s), i.closePath(), !0;
674
699
  case "triangle-left": return i.moveTo(t - s, n), i.lineTo(t + s, n - r), i.lineTo(t + s, n + r), i.closePath(), !0;
675
- case "tick-up": return Q(i, t - o, n - r, t + o, n), !0;
676
- case "tick-right": return Q(i, t, n - o, t + r, n + o), !0;
677
- case "tick-down": return Q(i, t - o, n, t + o, n + r), !0;
678
- case "tick-left": return Q(i, t - r, n - o, t, n + o), !0;
700
+ case "tick-up": return je(i, t - o, n - r, t + o, n), !0;
701
+ case "tick-right": return je(i, t, n - o, t + r, n + o), !0;
702
+ case "tick-down": return je(i, t - o, n, t + o, n + r), !0;
703
+ case "tick-left": return je(i, t - r, n - o, t, n + o), !0;
679
704
  case "+": return i.moveTo(t - r, n), i.lineTo(t + r, n), i.moveTo(t, n - r), i.lineTo(t, n + r), !0;
680
705
  case "x": return i.moveTo(t - r, n - r), i.lineTo(t + r, n + r), i.moveTo(t + r, n - r), i.lineTo(t - r, n + r), !0;
681
706
  default: return !1;
682
707
  }
683
708
  }
684
- function Q(e, t, n, r, i) {
709
+ function je(e, t, n, r, i) {
685
710
  e.moveTo(t, n), e.lineTo(r, n), e.lineTo(r, i), e.lineTo(t, i), e.closePath();
686
711
  }
687
712
  //#endregion
688
713
  //#region ../core/src/rendering/immediate/marks/rect.js
689
- var Oe = .1;
690
- function ke(e) {
691
- let t = e.properties, n = V(e, t.cornerRadius), r = {
692
- topLeft: V(e, t.cornerRadiusTopLeft ?? n),
693
- topRight: V(e, t.cornerRadiusTopRight ?? n),
694
- bottomRight: V(e, t.cornerRadiusBottomRight ?? n),
695
- bottomLeft: V(e, t.cornerRadiusBottomLeft ?? n)
714
+ var Me = .1;
715
+ function Ne(e) {
716
+ let t = e.properties, n = G(e, t.cornerRadius), r = {
717
+ topLeft: G(e, t.cornerRadiusTopLeft ?? n),
718
+ topRight: G(e, t.cornerRadiusTopRight ?? n),
719
+ bottomRight: G(e, t.cornerRadiusBottomRight ?? n),
720
+ bottomLeft: G(e, t.cornerRadiusBottomLeft ?? n)
696
721
  }, i = {
697
- blur: V(e, t.shadowBlur ?? 0),
698
- color: V(e, t.shadowColor ?? "black"),
699
- offsetX: V(e, t.shadowOffsetX ?? 0),
700
- offsetY: V(e, t.shadowOffsetY ?? 0),
701
- opacity: V(e, t.shadowOpacity ?? 0)
702
- }, a = V(e, t.hatch ?? "none"), o = !Ne(r);
722
+ blur: G(e, t.shadowBlur ?? 0),
723
+ color: G(e, t.shadowColor ?? "black"),
724
+ offsetX: G(e, t.shadowOffsetX ?? 0),
725
+ offsetY: G(e, t.shadowOffsetY ?? 0),
726
+ opacity: G(e, t.shadowOpacity ?? 0)
727
+ }, a = G(e, t.hatch ?? "none"), o = !Le(r);
703
728
  return {
704
729
  cornerRadii: r,
705
- minWidth: V(e, t.minWidth),
706
- minHeight: V(e, t.minHeight),
707
- minOpacity: V(e, t.minOpacity),
730
+ minWidth: G(e, t.minWidth),
731
+ minHeight: G(e, t.minHeight),
732
+ minOpacity: G(e, t.minOpacity),
708
733
  shadow: i,
709
734
  hatch: a,
710
735
  hasCornerRadii: o,
711
736
  canPadSeams: a == "none" && i.opacity == 0 && !o
712
737
  };
713
738
  }
714
- function Ae(e, t, n, r) {
715
- let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, l = n.start ?? 0, u = n.end ?? a.length, d = e.encoders;
716
- if (l === u) return 0;
717
- let f = d.strokeWidth.constant, p = d.fillOpacity.constant, m = f ? I(d.strokeWidth, a[l]) : 0, h = p ? I(d.fillOpacity, a[l]) : 0, g = B(d.fill, n), _ = t.shadow.opacity > 0 ? t.shadow.blur + Math.max(Math.abs(t.shadow.offsetX), Math.abs(t.shadow.offsetY)) : 0, v = F(i, d, "x", a[l], c(e, "x")), y = F(i, d, "y", a[l], c(e, "y")), b = [0, 0], S = [0, 0], C = c(e, "x"), w = c(e, "y"), T = {
739
+ function Pe(e, t, n, r) {
740
+ let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = n.start ?? 0, l = n.end ?? a.length, d = e.encoders;
741
+ if (c === l) return 0;
742
+ let f = R(d.fill), p = d.strokeWidth.constant, m = d.fillOpacity.constant, h = p ? B(d.strokeWidth, a[c]) : 0, g = m ? B(d.fillOpacity, a[c]) : 0, _ = W(d.fill, n), v = t.shadow.opacity > 0 ? t.shadow.blur + Math.max(Math.abs(t.shadow.offsetX), Math.abs(t.shadow.offsetY)) : 0, y = z(i, d, "x", a[c], u(e, "x")), b = z(i, d, "y", a[c], u(e, "y")), x = [0, 0], S = [0, 0], w = u(e, "x"), T = u(e, "y"), E = {
718
743
  datum: {},
719
744
  x: 0,
720
745
  y: 0,
@@ -730,30 +755,30 @@ function Ae(e, t, n, r) {
730
755
  strokeWidth: 0,
731
756
  fill: "none",
732
757
  fillOpacity: 0
733
- }, E = 0;
734
- for (let e = l; e < u; e++) {
758
+ }, D = 0;
759
+ for (let e = c; e < l; e++) {
735
760
  let n = a[e];
736
- if (v(n, b), y(n, S), C && b[0] === b[1] || w && S[0] === S[1]) continue;
737
- let i = Math.min(b[0], b[1]), c = Math.min(S[0], S[1]), l = Math.abs(b[1] - b[0]), u = Math.abs(S[1] - S[0]), D = je(l, t.minWidth), O = je(u, t.minHeight), k = Math.max(t.minOpacity, D * O);
761
+ if (y(n, x), b(n, S), w && x[0] === x[1] || T && S[0] === S[1]) continue;
762
+ let i = Math.min(x[0], x[1]), c = Math.min(S[0], S[1]), l = Math.abs(x[1] - x[0]), u = Math.abs(S[1] - S[0]), O = Fe(l, t.minWidth), k = Fe(u, t.minHeight), A = Math.max(t.minOpacity, O * k);
738
763
  l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth), u < t.minHeight && (c -= (t.minHeight - u) / 2, u = t.minHeight);
739
- let A = f ? m : I(d.strokeWidth, n), j = g ?? H(d.fill(n)), M = (p ? h : I(d.fillOpacity, n)) * s, N = A == 0 && M == 1 && k == 1 && t.canPadSeams && j != "none" ? Oe : 0;
740
- N && (i -= N, c -= N, l += N * 2, u += N * 2), x(o, i, c, i + l, c + u, A / 2 + _) && (E++, T.datum = n, T.x = i, T.y = c, T.width = l, T.height = u, T.opacityFactor = k, T.strokeWidth = A, T.fill = j, T.fillOpacity = M, t.hasCornerRadii && Me(t.cornerRadii, l, u, T.radii), r(T));
764
+ let j = p ? h : B(d.strokeWidth, n), M = _ ?? K(d.fill(n)), N = (m ? g : B(d.fillOpacity, n)) * s, P = j == 0 && N * f(M) == 1 && A == 1 && t.canPadSeams && M != "none" ? Me : 0;
765
+ P && (i -= P, c -= P, l += P * 2, u += P * 2), C(o, i, c, i + l, c + u, j / 2 + v) && (D++, E.datum = n, E.x = i, E.y = c, E.width = l, E.height = u, E.opacityFactor = A, E.strokeWidth = j, E.fill = M, E.fillOpacity = N, t.hasCornerRadii && Ie(t.cornerRadii, l, u, E.radii), r(E));
741
766
  }
742
- return E;
767
+ return D;
743
768
  }
744
- function je(e, t) {
769
+ function Fe(e, t) {
745
770
  return t > 0 && e < t ? e / t : 1;
746
771
  }
747
- function Me(e, t, n, r) {
772
+ function Ie(e, t, n, r) {
748
773
  let i = Math.min(t, n) / 2;
749
774
  r.topLeft = Math.max(0, Math.min(e.topLeft, i)), r.topRight = Math.max(0, Math.min(e.topRight, i)), r.bottomRight = Math.max(0, Math.min(e.bottomRight, i)), r.bottomLeft = Math.max(0, Math.min(e.bottomLeft, i));
750
775
  }
751
- function Ne(e) {
776
+ function Le(e) {
752
777
  return e.topLeft == 0 && e.topRight == 0 && e.bottomRight == 0 && e.bottomLeft == 0;
753
778
  }
754
779
  //#endregion
755
780
  //#region ../core/src/utils/clipSegment.js
756
- function Pe(e, t, n, r, i, a, o, s, c) {
781
+ function Re(e, t, n, r, i, a, o, s, c) {
757
782
  if (!Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r)) return !1;
758
783
  let l = n - e, u = r - t, d = 0, f = 1;
759
784
  if (l == 0) {
@@ -772,59 +797,70 @@ function Pe(e, t, n, r, i, a, o, s, c) {
772
797
  }
773
798
  //#endregion
774
799
  //#region ../core/src/rendering/immediate/marks/rule.js
775
- function Fe(e) {
776
- return { minLength: V(e, e.properties.minLength) };
800
+ function ze(e) {
801
+ let t = "strokeAlign" in e.properties ? G(e, e.properties.strokeAlign) : "outside";
802
+ return {
803
+ strokeAlign: t === "inside" || t === "center" ? t : "outside",
804
+ minLength: G(e, e.properties.minLength),
805
+ strokeCap: G(e, e.properties.strokeCap)
806
+ };
777
807
  }
778
- function Ie(e, t, n, r) {
779
- let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
780
- if (a.length == 0) return 0;
781
- let l = F(i, s, "x", a[0]), u = F(i, s, "y", a[0]), d = [0, 0], f = [0, 0], p = {
808
+ function Be(e, t, n, r) {
809
+ let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders, c = n.start ?? 0, l = n.end ?? a.length;
810
+ if (c === l) return 0;
811
+ let d = z(i, s, "x", a[c]), f = z(i, s, "y", a[c]), p = [0, 0], m = [0, 0], h = {
782
812
  datum: {},
783
813
  x1: 0,
784
814
  y1: 0,
785
815
  x2: 0,
786
816
  y2: 0,
787
- strokeWidth: 0
788
- }, m = c(e, "x"), h = c(e, "y"), g = [
817
+ size: 0,
818
+ strokeWidth: 0,
819
+ stroke: "none",
820
+ strokeOpacity: 0
821
+ }, g = u(e, "x"), _ = u(e, "y"), v = [
789
822
  0,
790
823
  0,
791
824
  0,
792
825
  0
793
- ], _ = 0;
794
- for (let e of a) {
795
- l(e, d), u(e, f);
796
- let [n, a] = d, [c, v] = f, y = I(s.size, e), b = y + t.minLength + 1, S = Math.max(o.x2 - o.x1, b), C = Math.max(o.y2 - o.y1, b);
797
- if (!Pe(n, c, a, v, m ? i.x : o.x1 - S, h ? i.y : o.y1 - C, m ? i.x2 : o.x2 + S, h ? i.y2 : o.y2 + C, g) || ([n, c, a, v] = g, n === a && c === v)) continue;
798
- let w = a - n, T = v - c, E = Math.hypot(w, T);
799
- if (E > 0 && E < t.minLength) {
800
- let e = (t.minLength - E) / 2, r = w / E, i = T / E;
801
- n -= r * e, c -= i * e, a += r * e, v += i * e;
826
+ ], y = 0, b = e.getType() === "rule", x = b ? W(s.stroke, n) : "none", S = b ? R(s.stroke) : () => 0;
827
+ for (let e = c; e < l; e++) {
828
+ let n = a[e];
829
+ d(n, p), f(n, m);
830
+ let [c, l] = p, [u, w] = m, T = B(s.size, n);
831
+ if (T <= 0) continue;
832
+ let E = x ?? K(s.stroke(n)), D = b ? B(s.strokeOpacity, n) : 0, O = b && D * S(E) > 0 ? Math.max(0, B(s.strokeWidth, n)) : 0, k = T + 2 * O + t.minLength + 1, A = Math.max(o.x2 - o.x1, k), j = Math.max(o.y2 - o.y1, k);
833
+ if (!Re(c, u, l, w, g ? i.x : o.x1 - A, _ ? i.y : o.y1 - j, g ? i.x2 : o.x2 + A, _ ? i.y2 : o.y2 + j, v) || ([c, u, l, w] = v, c === l && u === w)) continue;
834
+ let M = l - c, N = w - u, P = Math.hypot(M, N);
835
+ if (P > 0 && P < t.minLength) {
836
+ let e = (t.minLength - P) / 2, n = M / P, r = N / P;
837
+ c -= n * e, u -= r * e, l += n * e, w += r * e;
802
838
  }
803
- x(o, n, c, a, v, y / 2) && (_++, p.datum = e, p.x1 = n, p.y1 = c, p.x2 = a, p.y2 = v, p.strokeWidth = y, r(p));
839
+ C(o, c, u, l, w, (T / 2 + O) * (t.strokeCap === "square" ? Math.SQRT2 : 1)) && (y++, h.datum = n, h.x1 = c, h.y1 = u, h.x2 = l, h.y2 = w, h.size = T, h.strokeWidth = O, h.stroke = E, h.strokeOpacity = D, r(h));
804
840
  }
805
- return _;
841
+ return y;
806
842
  }
807
843
  //#endregion
808
844
  //#region ../core/src/rendering/immediate/marks/text.js
809
- function Le(e) {
845
+ function Ve(e) {
810
846
  let t = e.properties;
811
847
  return {
812
- align: V(e, t.align),
813
- baseline: V(e, t.baseline),
814
- logoLetters: V(e, t.logoLetters),
815
- paddingX: V(e, t.paddingX),
816
- paddingY: V(e, t.paddingY),
817
- flushX: V(e, t.flushX),
818
- flushY: V(e, t.flushY),
819
- squeeze: V(e, t.squeeze),
820
- dx: V(e, t.dx),
821
- dy: V(e, t.dy)
848
+ align: G(e, t.align),
849
+ baseline: G(e, t.baseline),
850
+ logoLetters: G(e, t.logoLetters),
851
+ paddingX: G(e, t.paddingX),
852
+ paddingY: G(e, t.paddingY),
853
+ flushX: G(e, t.flushX),
854
+ flushY: G(e, t.flushY),
855
+ squeeze: G(e, t.squeeze),
856
+ dx: G(e, t.dx),
857
+ dy: G(e, t.dy)
822
858
  };
823
859
  }
824
- function Re(n, r, a, o) {
825
- let { coords: s, data: l, visibleBounds: u, anchorCullBounds: d } = a, { align: f, baseline: p } = r, m = n.encoders;
826
- if (l.length == 0) return 0;
827
- let h = m.size.constant ? I(m.size, l[0]) : 0, g = m.angle.constant ? I(m.angle, l[0]) : 0, _ = F(s, m, "x", l[0], c(n, "x")), v = F(s, m, "y", l[0], c(n, "y")), y = n.encoding.text, x = "format" in y ? i(y.format) : (e) => e, S = [0, 0], C = [0, 0], w = {
860
+ function He(e, r, i, a) {
861
+ let { coords: s, data: c, visibleBounds: l, anchorCullBounds: d } = i, { align: f, baseline: p } = r, m = e.encoders;
862
+ if (c.length == 0) return 0;
863
+ let h = m.size.constant ? B(m.size, c[0]) : 0, g = m.angle.constant ? B(m.angle, c[0]) : 0, _ = z(s, m, "x", c[0], u(e, "x")), v = z(s, m, "y", c[0], u(e, "y")), y = e.encoding.text, b = "format" in y ? o(y.format) : (e) => e, x = [0, 0], C = [0, 0], w = {
828
864
  width: 0,
829
865
  height: 0
830
866
  }, T = {
@@ -853,48 +889,48 @@ function Re(n, r, a, o) {
853
889
  logoTransform: void 0,
854
890
  multiCharacterLogo: !1,
855
891
  boundsQuad: O
856
- }, A = !!m.x2, j = !!m.y2, M = A && c(n, "x"), N = j && c(n, "y"), P = 0;
857
- for (let n of l) {
858
- let i = x(m.text(n)), c = t(i) ? i : i === null ? "" : "" + i;
859
- if (!c || (_(n, S), v(n, C), M && S[0] === S[1] || N && C[0] === C[1])) continue;
860
- let [l, y] = S, [F, L] = C, R = m.size.constant ? h : I(m.size, n), z = m.angle.constant ? g : I(m.angle, n);
892
+ }, A = !!m.x2, j = !!m.y2, M = A && u(e, "x"), N = j && u(e, "y"), P = 0;
893
+ for (let e of c) {
894
+ let o = b(m.text(e)), c = t(o) ? o : o === null ? "" : "" + o;
895
+ if (!c || (_(e, x), v(e, C), M && x[0] === x[1] || N && C[0] === C[1])) continue;
896
+ let [u, y] = x, [F, I] = C, L = m.size.constant ? h : B(m.size, e), R = m.angle.constant ? g : B(m.angle, e);
861
897
  if (r.logoLetters) {
862
- let e = R, t = R;
863
- if (A && (e = y - l, l = (l + y) / 2), j && (t = F - L, F = (F + L) / 2), ze(O, l, F, Math.abs(e), Math.abs(t), "center", "middle", z, r.dx, r.dy), !e || !t || b(d, l, F) || !Be(u, O)) continue;
864
- let i = a.measureLogoInkBounds(c);
865
- if (!i) continue;
866
- P++, k.datum = n, k.text = c, k.x = l, k.y = F, k.size = 100, k.width = i.xMax - i.xMin, k.angle = z, k.fadeOpacity = 1, k.scale = 1, D.scaleX = e / k.width, D.scaleY = t / (i.yMax - i.yMin), D.originX = (i.xMin + i.xMax) / 2, D.originY = (i.yMin + i.yMax) / 2, k.logoTransform = D, k.multiCharacterLogo = c.length > 1, o(k);
898
+ let t = L, n = L;
899
+ if (A && (t = y - u, u = (u + y) / 2), j && (n = F - I, F = (F + I) / 2), Ue(O, u, F, Math.abs(t), Math.abs(n), "center", "middle", R, r.dx, r.dy), !t || !n || S(d, u, F) || !We(l, O)) continue;
900
+ let o = i.measureLogoInkBounds(c);
901
+ if (!o) continue;
902
+ P++, k.datum = e, k.text = c, k.x = u, k.y = F, k.size = 100, k.width = o.xMax - o.xMin, k.angle = R, k.fadeOpacity = 1, k.scale = 1, D.scaleX = t / k.width, D.scaleY = n / (o.yMax - o.yMin), D.originX = (o.xMin + o.xMax) / 2, D.originY = (o.yMin + o.yMax) / 2, k.logoTransform = D, k.multiCharacterLogo = c.length > 1, a(k);
867
903
  continue;
868
904
  }
869
- let B = a.fontMeasurement.measureWidth(c, R);
870
- Ve(B, R, z, w), A || j ? Ue(f, p, z, T) : (T.x = We[f], T.y = Ge[p]);
905
+ let z = i.fontMeasurement.measureWidth(c, L);
906
+ Ge(z, L, R, w), A || j ? qe(f, p, R, T) : (T.x = Je[f], T.y = Ye[p]);
871
907
  let V = 1;
872
- if (A && (He(Math.min(l, y), Math.max(l, y), w.width, r.paddingX, T.x, r.flushX, s.x, s.x2, E), l = E.position, V *= E.scale), j && (He(Math.min(F, L), Math.max(F, L), w.height * V, r.paddingY, T.y, r.flushY, s.y, s.y2, E), F = E.position, V *= E.scale), b(d, l, F)) continue;
908
+ if (A && (Ke(Math.min(u, y), Math.max(u, y), w.width, r.paddingX, T.x, r.flushX, s.x, s.x2, E), u = E.position, V *= E.scale), j && (Ke(Math.min(F, I), Math.max(F, I), w.height * V, r.paddingY, T.y, r.flushY, s.y, s.y2, E), F = E.position, V *= E.scale), S(d, u, F)) continue;
873
909
  let H = 1;
874
910
  if (V < 1) {
875
- if (!r.squeeze || V < 3 / R) continue;
876
- H = e(3 / R, 6 / R, V);
911
+ if (!r.squeeze || V < 3 / L) continue;
912
+ H = n(3 / L, 6 / L, V);
877
913
  }
878
- let ee = R * V, U = B * V;
879
- ze(O, l, F, U, ee, f, p, z, r.dx, r.dy), Be(u, O) && (P++, k.datum = n, k.text = c, k.x = l, k.y = F, k.size = R, k.width = U, k.angle = z, k.fadeOpacity = H, k.scale = V, k.logoTransform = void 0, k.multiCharacterLogo = !1, o(k));
914
+ let U = L * V, W = z * V;
915
+ Ue(O, u, F, W, U, f, p, R, r.dx, r.dy), We(l, O) && (P++, k.datum = e, k.text = c, k.x = u, k.y = F, k.size = L, k.width = W, k.angle = R, k.fadeOpacity = H, k.scale = V, k.logoTransform = void 0, k.multiCharacterLogo = !1, a(k));
880
916
  }
881
917
  return P;
882
918
  }
883
- function ze(e, t, n, r, i, a, o, s, c, l) {
884
- let u = t + c - (We[a] + 1) / 2 * r, d = n + l - (Ge[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
919
+ function Ue(e, t, n, r, i, a, o, s, c, l) {
920
+ let u = t + c - (Je[a] + 1) / 2 * r, d = n + l - (Ye[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
885
921
  return $(e, 0, t, n, u, d, h, g), $(e, 2, t, n, f, d, h, g), $(e, 4, t, n, f, p, h, g), $(e, 6, t, n, u, p, h, g), e;
886
922
  }
887
- function Be(e, t) {
888
- return x(e, Math.min(t[0], t[2], t[4], t[6]), Math.min(t[1], t[3], t[5], t[7]), Math.max(t[0], t[2], t[4], t[6]), Math.max(t[1], t[3], t[5], t[7]), 1);
923
+ function We(e, t) {
924
+ return C(e, Math.min(t[0], t[2], t[4], t[6]), Math.min(t[1], t[3], t[5], t[7]), Math.max(t[0], t[2], t[4], t[6]), Math.max(t[1], t[3], t[5], t[7]), 1);
889
925
  }
890
926
  function $(e, t, n, r, i, a, o, s) {
891
927
  e[t] = n + (i - n) * s - (a - r) * o, e[t + 1] = r + (i - n) * o + (a - r) * s;
892
928
  }
893
- function Ve(e, t, n, r) {
929
+ function Ge(e, t, n, r) {
894
930
  let i = n * Math.PI / 180, a = Math.abs(Math.sin(i)), o = Math.abs(Math.cos(i));
895
931
  r.width = e * o + t * a, r.height = e * a + t * o;
896
932
  }
897
- function He(e, t, n, r, i, a, o, s, c) {
933
+ function Ke(e, t, n, r, i, a, o, s, c) {
898
934
  let l = t - e, u = n + 2 * r;
899
935
  if (e > s || t < o) {
900
936
  c.position = 0, c.scale = 0;
@@ -919,21 +955,21 @@ function He(e, t, n, r, i, a, o, s, c) {
919
955
  }
920
956
  c.position = f, c.scale = Math.max(0, Math.min(1, (l - r) / u));
921
957
  }
922
- function Ue(e, t, n, r) {
923
- let i = We[e], a = -Ge[t], o = ((n + 45) % 360 + 360) % 360, s, c;
958
+ function qe(e, t, n, r) {
959
+ let i = Je[e], a = -Ye[t], o = ((n + 45) % 360 + 360) % 360, s, c;
924
960
  o < 90 ? (s = i, c = a) : o < 180 ? (s = a, c = -i) : o < 270 ? (s = -i, c = a) : (s = -a, c = i), r.x = s, r.y = -c;
925
961
  }
926
- var We = {
962
+ var Je = {
927
963
  left: -1,
928
964
  center: 0,
929
965
  right: 1
930
- }, Ge = {
966
+ }, Ye = {
931
967
  top: -1,
932
968
  middle: 0,
933
969
  bottom: 1,
934
970
  alphabetic: 1,
935
971
  baseline: 1
936
- }, Ke = [
972
+ }, Xe = [
937
973
  "Lato",
938
974
  "Avenir Next",
939
975
  "Avenir",
@@ -944,7 +980,7 @@ var We = {
944
980
  "Helvetica",
945
981
  "Arial",
946
982
  "sans-serif"
947
- ], qe = /* @__PURE__ */ new Set([
983
+ ], Ze = /* @__PURE__ */ new Set([
948
984
  "serif",
949
985
  "sans-serif",
950
986
  "monospace",
@@ -958,7 +994,7 @@ var We = {
958
994
  "emoji",
959
995
  "math",
960
996
  "fangsong"
961
- ]), Je = {
997
+ ]), Qe = {
962
998
  thin: 100,
963
999
  light: 300,
964
1000
  regular: 400,
@@ -967,24 +1003,24 @@ var We = {
967
1003
  bold: 700,
968
1004
  black: 900
969
1005
  };
970
- function Ye(e) {
1006
+ function $e(e) {
971
1007
  let t = e ?? "Lato";
972
- return [t, ...Ke.filter((e) => e.toLowerCase() != t.toLowerCase())].map($e).join(", ");
1008
+ return [t, ...Xe.filter((e) => e.toLowerCase() != t.toLowerCase())].map(rt).join(", ");
973
1009
  }
974
- function Xe(e) {
1010
+ function et(e) {
975
1011
  if (typeof e == "number") return e;
976
- let t = Je[e];
1012
+ let t = Qe[e];
977
1013
  if (t === void 0) throw Error("Unknown font weight: " + e);
978
1014
  return t;
979
1015
  }
980
- function Ze(e) {
1016
+ function tt(e) {
981
1017
  return {
982
1018
  style: e.fontStyle ?? "normal",
983
- weight: Xe(e.fontWeight ?? "normal"),
984
- family: Ye(e.font)
1019
+ weight: et(e.fontWeight ?? "normal"),
1020
+ family: $e(e.font)
985
1021
  };
986
1022
  }
987
- function Qe(e, t) {
1023
+ function nt(e, t) {
988
1024
  switch (e) {
989
1025
  case "top": return .79 * t;
990
1026
  case "middle": return .35 * t;
@@ -994,26 +1030,26 @@ function Qe(e, t) {
994
1030
  default: throw Error(`Unknown text baseline: ${e}`);
995
1031
  }
996
1032
  }
997
- function $e(e) {
1033
+ function rt(e) {
998
1034
  let t = e.toLowerCase();
999
- return qe.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
1035
+ return Ze.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
1000
1036
  }
1001
1037
  //#endregion
1002
1038
  //#region ../core/src/rendering/nativeTextMetrics.js
1003
- var et = "Mg", tt = 100, nt = class {
1039
+ var it = "Mg", at = 100, ot = class {
1004
1040
  #e;
1005
1041
  #t;
1006
- #n = new r([], JSON.stringify);
1042
+ #n = new e([], JSON.stringify);
1007
1043
  #r = [];
1008
1044
  #i;
1009
1045
  constructor(e, t) {
1010
1046
  this.#e = e, this.#t = t, e.fontKerning = "normal", e.direction = "ltr", e.textAlign = "left", e.textBaseline = "alphabetic";
1011
1047
  }
1012
1048
  requestFont(e) {
1013
- let t = Ze(e), n = this.#n.get(t);
1049
+ let t = tt(e), n = this.#n.get(t);
1014
1050
  if (!n) {
1015
- n = new rt((e, n) => this.#a(t, e, n)), this.#n.set(t, n);
1016
- let e = this.#t?.load(ot(t, 16));
1051
+ n = new st((e, n) => this.#a(t, e, n)), this.#n.set(t, n);
1052
+ let e = this.#t?.load(ut(t, 16));
1017
1053
  e && this.#r.push(e.then(() => n.invalidateCache()));
1018
1054
  }
1019
1055
  return n;
@@ -1022,10 +1058,10 @@ var et = "Mg", tt = 100, nt = class {
1022
1058
  await Promise.all(this.#r);
1023
1059
  }
1024
1060
  #a(e, t, n) {
1025
- let r = ot(e, n);
1061
+ let r = ut(e, n);
1026
1062
  return r != this.#i && (this.#e.font = r, this.#i = r), this.#e.measureText(t);
1027
1063
  }
1028
- }, rt = class {
1064
+ }, st = class {
1029
1065
  #e;
1030
1066
  #t = NaN;
1031
1067
  #n = /* @__PURE__ */ new Float64Array(128);
@@ -1047,7 +1083,7 @@ var et = "Mg", tt = 100, nt = class {
1047
1083
  }
1048
1084
  getHeight(e) {
1049
1085
  if (this.#a(e), Number.isNaN(this.#r)) {
1050
- let t = this.#e(et, e);
1086
+ let t = this.#e(it, e);
1051
1087
  this.#r = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent;
1052
1088
  }
1053
1089
  return this.#r;
@@ -1055,7 +1091,7 @@ var et = "Mg", tt = 100, nt = class {
1055
1091
  measureInkBounds(e) {
1056
1092
  let t = e.length == 1 ? e.charCodeAt(0) : 128;
1057
1093
  if (t < 128 && this.#i[t] !== void 0) return this.#i[t];
1058
- let n = it(this.#e(e, tt));
1094
+ let n = ct(this.#e(e, at));
1059
1095
  return t < 128 && (this.#i[t] = n), n;
1060
1096
  }
1061
1097
  invalidateCache() {
@@ -1065,7 +1101,7 @@ var et = "Mg", tt = 100, nt = class {
1065
1101
  e != this.#t && (this.#t = e, this.#n.fill(NaN), this.#r = NaN);
1066
1102
  }
1067
1103
  };
1068
- function it(e) {
1104
+ function ct(e) {
1069
1105
  let t = {
1070
1106
  xMin: -e.actualBoundingBoxLeft,
1071
1107
  xMax: e.actualBoundingBoxRight,
@@ -1074,10 +1110,10 @@ function it(e) {
1074
1110
  };
1075
1111
  return t.xMax > t.xMin && t.yMax > t.yMin ? t : null;
1076
1112
  }
1077
- function at(e, t) {
1113
+ function lt(e, t) {
1078
1114
  let n = e.requestFont(t);
1079
- return n instanceof rt ? (e) => n.measureInkBounds(e) : (e) => {
1080
- let t = n.measureWidth(e, tt), r = n.getHeight(tt);
1115
+ return n instanceof st ? (e) => n.measureInkBounds(e) : (e) => {
1116
+ let t = n.measureWidth(e, at), r = n.getHeight(at);
1081
1117
  return t > 0 && r > 0 ? {
1082
1118
  xMin: 0,
1083
1119
  xMax: t,
@@ -1086,15 +1122,15 @@ function at(e, t) {
1086
1122
  } : null;
1087
1123
  };
1088
1124
  }
1089
- function ot(e, t) {
1125
+ function ut(e, t) {
1090
1126
  return `${e.style} ${e.weight} ${t}px ${e.family}`;
1091
1127
  }
1092
- function st(e) {
1128
+ function dt(e) {
1093
1129
  let t = e.createElement("canvas").getContext("2d");
1094
1130
  if (!t) throw Error("Canvas2D text measurement is unavailable.");
1095
- return new nt(t, e.fonts);
1131
+ return new ot(t, e.fonts);
1096
1132
  }
1097
- async function ct(e, t) {
1133
+ async function ft(e, t) {
1098
1134
  t.visit((t) => {
1099
1135
  let n = t.mark;
1100
1136
  n?.getType() == "text" && e.requestFont(n.properties);
@@ -1102,7 +1138,7 @@ async function ct(e, t) {
1102
1138
  }
1103
1139
  //#endregion
1104
1140
  //#region ../core/src/rendering/immediate/order.js
1105
- function lt(e, t, n, r, i) {
1141
+ function pt(e, t, n, r, i) {
1106
1142
  let a = [], o = [];
1107
1143
  for (let i = t; i < n; i++) {
1108
1144
  let t = e[i];
@@ -1111,4 +1147,4 @@ function lt(e, t, n, r, i) {
1111
1147
  return i.map((e) => e === "matching" ? a : o);
1112
1148
  }
1113
1149
  //#endregion
1114
- export { V as A, ee as C, I as D, W as E, x as F, f as I, m as L, v as M, _ as N, B as O, y as P, pe as S, U as T, Ee as _, Ye as a, me as b, Le as c, Ie as d, Pe as f, Te as g, De as h, at as i, H as j, F as k, Re as l, Ae as m, st as n, Qe as o, ke as p, ct as r, Xe as s, lt as t, Fe as u, Ce as v, ne as w, fe as x, we as y };
1150
+ export { z as A, ee as C, B as D, ne as E, x as F, C as I, m as L, K as M, b as N, W as O, y as P, g as R, he as S, te as T, ke as _, $e as a, ge as b, Ve as c, Be as d, Re as f, Oe as g, Ae as h, lt as i, G as j, R as k, He as l, Pe as m, dt as n, nt as o, Ne as p, ft as r, et as s, pt as t, ze as u, Ee as v, ie as w, me as x, De as y };