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