@genome-spy/app 1.1.1 → 1.2.0

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