@genome-spy/app 0.88.1 → 0.90.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 (65) hide show
  1. package/dist/{agentApi-BIpg3JKh.js → agentApi-Z65dw-sD.js} +5976 -6711
  2. package/dist/agentApi.es.js +3580 -4470
  3. package/dist/agentShared.es.js +742 -683
  4. package/dist/{canvas2d-BVQ7-2eJ.js → canvas2d-DiPQvNtZ.js} +122 -109
  5. package/dist/{canvas2d-D7SZK3xv.js → canvas2d-t_N10CeW.js} +114 -101
  6. package/dist/{canvasSizeHelper-7h_8rOcx.js → canvasSizeHelper-foL2YvGL.js} +15 -8
  7. package/dist/{clipOptions-DTMcB_9z.js → clipOptions-B5PibDq3.js} +1610 -1342
  8. package/dist/{clipOptions-BWHr3aTa.js → clipOptions-Cba4I0AO.js} +1872 -1644
  9. package/dist/{componentStyles-FsNmIb22.js → componentStyles-DGtQXvwc.js} +17 -15
  10. package/dist/{debug-CVpoEOWx.js → debug-CVAlrcZt.js} +2 -2
  11. package/dist/{debug-DYAMZZKl.js → debug-DP4WzTNo.js} +2 -2
  12. package/dist/dialog.es.js +4 -3
  13. package/dist/esm-BiqrFjMh.js +443 -0
  14. package/dist/{esm-lwYrRdbg.js → esm-Bv7Frz7C.js} +142 -79
  15. package/dist/{esm-VvpZ9hsq.js → esm-C3A-AuRi.js} +1 -1
  16. package/dist/esm-CvpR1OcU.js +322 -0
  17. package/dist/esm-DFHFX1sH.js +1526 -0
  18. package/dist/esm-Dndm-NaA.js +1193 -0
  19. package/dist/{esm-CcDLRSvC.js → esm-DtNElqRr.js} +64 -63
  20. package/dist/esm-L53qjcYH.js +1155 -0
  21. package/dist/esm-VFJeyk9i.js +249 -0
  22. package/dist/{esm-BdLYkz-m.js → esm-_xCtpDwm.js} +1 -1
  23. package/dist/index.es.js +4203 -3910
  24. package/dist/index.js +971 -482
  25. package/dist/{indexer-CXjZDo2Q.js → indexer-DbFTKGlm.js} +1 -1
  26. package/dist/{indexer-DAH_ruVn.js → indexer-En7gpvLN.js} +1 -1
  27. package/dist/{lit-ByuJ0FJ4.js → lit-CoXp9NFX.js} +12 -10
  28. package/dist/order-BkYCnwD7.js +1062 -0
  29. package/dist/order-R043xTpC.js +1062 -0
  30. package/dist/{parquetRead-Cs2xRrvz.js → parquetRead-0hFIa3Cc.js} +532 -350
  31. package/dist/rasterExport-C_FcNBkC.js +52 -0
  32. package/dist/rasterExport-Z7gs5346.js +52 -0
  33. package/dist/rasterization-_-9JmSas.js +63 -0
  34. package/dist/rectangle-DE98gIxF.js +108 -0
  35. package/dist/{renderCanvas2D-DxturTEW.js → renderCanvas2D-DK1c9TFK.js} +68 -67
  36. package/dist/{renderCanvas2D-DtcJjqpB.js → renderCanvas2D-IM-A9DYG.js} +57 -56
  37. package/dist/schema.json +599 -116
  38. package/dist/{src-DjOlFqSn.js → src-DJtvThVC.js} +3 -5
  39. package/dist/style.css +1 -1
  40. package/dist/{svg-SDJMzL--.js → svg-DW3tfUmm.js} +339 -326
  41. package/dist/{svg-CyrLfa9e.js → svg-PabUdcDi.js} +365 -352
  42. package/dist/{svgRasterizer-f7DJ3UO0.js → svgRasterizer-B6YtWLJs.js} +6 -5
  43. package/dist/{svgRasterizer-mWK7HTkx.js → svgRasterizer-BEVDyyS3.js} +6 -5
  44. package/dist/{vega-scale-DLKCwWRs.js → vega-scale-Byaw1K8O.js} +823 -780
  45. package/dist/{vega-scale-CypF85iS.js → vega-scale-Ctz_wa3z.js} +963 -923
  46. package/dist/{viewIdentityRegistry-Dl-vMN9I.js → viewIdentityRegistry-BW415b3o.js} +1 -1
  47. package/dist/{viewIdentityRegistry-DIDo44XQ.js → viewIdentityRegistry-_F0E7nkA.js} +1 -1
  48. package/dist/{viewSelectors-CymbZyE6.js → viewSelectors-DYz-PhTO.js} +407 -340
  49. package/dist/{viewSelectors-DNiDip5e.js → viewSelectors-KtD-QSN0.js} +349 -282
  50. package/dist/{viewUtils-BrJLIj2o.js → viewUtils-BZGPseMx.js} +2052 -1871
  51. package/dist/{webgl-tZfZ8y3q.js → webgl-BKSGqHaz.js} +2144 -784
  52. package/dist/{webgl-CTJt7jQd.js → webgl-tdKf9SlZ.js} +2386 -1026
  53. package/package.json +5 -5
  54. package/dist/esm-80V4xF_D.js +0 -1098
  55. package/dist/esm-BA6yMcc-.js +0 -1222
  56. package/dist/esm-BdT7qUL-.js +0 -157
  57. package/dist/esm-CfYZhLHN.js +0 -1367
  58. package/dist/esm-D-iG_TIX.js +0 -441
  59. package/dist/esm-JAiZmFIS.js +0 -128
  60. package/dist/order-C5CzA37O.js +0 -918
  61. package/dist/order-DvY7KNcu.js +0 -918
  62. package/dist/rasterExport-BgZ98e6U.js +0 -44
  63. package/dist/rasterExport-DEr8fOLm.js +0 -44
  64. package/dist/rasterization-CFogVB3B.js +0 -50
  65. package/dist/rectangle-DKnrAmKs.js +0 -142
@@ -1,918 +0,0 @@
1
- import { $ as e, Yt as t, b as n, fn as r } from "./clipOptions-BWHr3aTa.js";
2
- import { t as i } from "./rectangle-DKnrAmKs.js";
3
- //#region ../core/src/rendering/immediate/markData.js
4
- var a = [], o = class {
5
- #e = {
6
- x: 0,
7
- y: 0,
8
- width: 0,
9
- height: 0
10
- };
11
- #t = new i(() => this.#e.x, () => this.#e.y, () => this.#e.width, () => this.#e.height);
12
- #n;
13
- #r = 0;
14
- #i = 0;
15
- #a = NaN;
16
- #o = NaN;
17
- #s = NaN;
18
- resolveFacet(e, t) {
19
- this.#c(e);
20
- let n = t.locSize.location, r = t.locSize.size;
21
- return (this.#a !== n || this.#o !== r || this.#s !== t.pixelToUnit) && (this.#l(n, r, t.pixelToUnit), this.#a = n, this.#o = r, this.#s = t.pixelToUnit), this.#t;
22
- }
23
- resolvePlacement(e, t, n) {
24
- if (!t) return;
25
- let r = t.getSnapshot().rectangles, i = n * 4;
26
- if (!(i + 3 >= r.length)) return this.#c(e), this.#l(r[i + 1], r[i + 3], 1), this.#a = NaN, this.#o = NaN, this.#s = NaN, this.#t;
27
- }
28
- #c(e) {
29
- this.#n !== e && (this.#e.x = e.x, this.#r = e.y, this.#e.width = e.width, this.#i = e.height, this.#n = e, this.#a = NaN, this.#o = NaN, this.#s = NaN);
30
- }
31
- #l(e, t, n) {
32
- this.#e.y = this.#r + e * n * this.#i, this.#e.height = t * n * this.#i;
33
- }
34
- };
35
- function s(e, t) {
36
- let n = e.unitView.getCollector();
37
- if (!n) throw Error(`Cannot render an uninitialized mark. View: ${e.unitView.getPathString()}`);
38
- let r = n.facetBatches.get(void 0);
39
- return r?.length ? r : n.facetBatches.get(t.facetId) ?? a;
40
- }
41
- function c(e, t, n, r, i, a) {
42
- let o = s(e, t);
43
- if (t.sampleFacetRenderingOptions) i(r.resolveFacet(n, t.sampleFacetRenderingOptions), o);
44
- else if (e.encoders.facetIndex) for (let [s, c] of l(e.encoders.facetIndex, o)) {
45
- let e = r.resolvePlacement(n, t.placement?.source, s);
46
- e ? i(e, c) : a(s);
47
- }
48
- else i(n, o);
49
- }
50
- function l(e, t) {
51
- let n = /* @__PURE__ */ new Map();
52
- for (let r of t) {
53
- let t = +e(r), i = n.get(t);
54
- i || (i = [], n.set(t, i)), i.push(r);
55
- }
56
- return n;
57
- }
58
- //#endregion
59
- //#region ../core/src/rendering/immediate/bounds.js
60
- function u(e, t, n) {
61
- return {
62
- x1: n?.clipX ? Math.max(0, n.rect.x) : 0,
63
- y1: n?.clipY ? Math.max(0, n.rect.y) : 0,
64
- x2: n?.clipX ? Math.min(e, n.rect.x2) : e,
65
- y2: n?.clipY ? Math.min(t, n.rect.y2) : t
66
- };
67
- }
68
- function d(e, t, n) {
69
- let r = n === !0 || n === "x", i = n === !0 || n === "y";
70
- return {
71
- x1: r ? t?.clipX ? t.rect.x : e.x : -Infinity,
72
- y1: i ? t?.clipY ? t.rect.y : e.y : -Infinity,
73
- x2: r ? t?.clipX ? t.rect.x2 : e.x2 : Infinity,
74
- y2: i ? t?.clipY ? t.rect.y2 : e.y2 : Infinity
75
- };
76
- }
77
- function f(e) {
78
- return e.x1 <= e.x2 && e.y1 <= e.y2;
79
- }
80
- function p(e, t, n) {
81
- return t < e.x1 || t > e.x2 || n < e.y1 || n > e.y2;
82
- }
83
- function m(e, t, n, r, i, a = 0) {
84
- 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);
85
- }
86
- //#endregion
87
- //#region ../core/src/rendering/immediate/geometry/polygonUnion.js
88
- var h = 1e-8;
89
- function g(e) {
90
- let t = e.flatMap((e, t) => e.map((n, r) => ({
91
- a: n,
92
- b: e[(r + 1) % e.length],
93
- polygonIndex: t
94
- }))), n = [];
95
- for (let r of t) {
96
- let i = [0, 1];
97
- for (let e of t) r.polygonIndex != e.polygonIndex && _(r, e, i);
98
- i.sort((e, t) => e - t);
99
- for (let t = 0; t < i.length - 1; t++) {
100
- let a = i[t], o = i[t + 1];
101
- if (o - a <= h) continue;
102
- let s = C(r.a, r.b, a), c = C(r.a, r.b, o), l = C(s, c, .5);
103
- e.some((e, t) => t != r.polygonIndex && x(l, e)) || n.push({
104
- a: s,
105
- b: c,
106
- polygonIndex: r.polygonIndex
107
- });
108
- }
109
- }
110
- return b(y(n));
111
- }
112
- function _(e, t, n) {
113
- let r = T(e.b, e.a), i = T(t.b, t.a), a = T(t.a, e.a), o = D(r, i);
114
- if (Math.abs(o) > h) {
115
- let e = D(a, i) / o, t = D(a, r) / o;
116
- e > h && e < 1 - h && t >= -1e-8 && t <= 1.00000001 && n.push(e);
117
- } else Math.abs(D(a, r)) <= h && (v(e, t.a, n), v(e, t.b, n));
118
- }
119
- function v(e, t, n) {
120
- let r = T(e.b, e.a), i = E(r, r), a = E(T(t, e.a), r) / i;
121
- a > h && a < 1 - h && n.push(a);
122
- }
123
- function y(e) {
124
- let t = /* @__PURE__ */ new Map();
125
- for (let n of e) {
126
- let e = w(n.a) + ":" + w(n.b), r = w(n.b) + ":" + w(n.a);
127
- t.has(r) ? t.delete(r) : t.has(e) || t.set(e, n);
128
- }
129
- return Array.from(t.values());
130
- }
131
- function b(e) {
132
- let t = /* @__PURE__ */ new Map();
133
- for (let n of e) {
134
- let e = w(n.a), r = t.get(e) ?? [];
135
- r.push(n), t.set(e, r);
136
- }
137
- let n = new Set(e), r = [];
138
- for (; n.size;) {
139
- let e = n.values().next().value, i = [e.a], a = e;
140
- for (;;) {
141
- if (n.delete(a), i.push(a.b), w(a.b) == w(i[0])) {
142
- i.pop();
143
- break;
144
- }
145
- let e = (t.get(w(a.b)) ?? []).find((e) => n.has(e));
146
- if (!e) throw Error("Cannot chain SVG polygon union boundary.");
147
- a = e;
148
- }
149
- r.push(i);
150
- }
151
- return r;
152
- }
153
- function x(e, t) {
154
- let n = !1;
155
- for (let r = 0, i = t.length - 1; r < t.length; i = r++) {
156
- let a = t[i], o = t[r];
157
- if (S(e, a, o)) return !1;
158
- 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);
159
- }
160
- return n;
161
- }
162
- function S(e, t, n) {
163
- return Math.abs(D(T(e, t), T(n, t))) <= h && E(T(e, t), T(e, n)) <= h;
164
- }
165
- function C(e, t, n) {
166
- return {
167
- x: e.x + (t.x - e.x) * n,
168
- y: e.y + (t.y - e.y) * n
169
- };
170
- }
171
- function w(e) {
172
- return `${Math.round(e.x / h)},${Math.round(e.y / h)}`;
173
- }
174
- function T(e, t) {
175
- return {
176
- x: e.x - t.x,
177
- y: e.y - t.y
178
- };
179
- }
180
- function E(e, t) {
181
- return e.x * t.x + e.y * t.y;
182
- }
183
- function D(e, t) {
184
- return e.x * t.y - e.y * t.x;
185
- }
186
- //#endregion
187
- //#region ../core/src/rendering/immediate/markEncoding.js
188
- function O(e, t, n) {
189
- return e.x + t * e.width + n;
190
- }
191
- function k(e, t, n) {
192
- return e.y + (1 - t) * e.height + n;
193
- }
194
- function A(e, t, n, r = [0, 0]) {
195
- return N(e, t.x, t.x2, t.xOffset, t.x2Offset, n, O, r);
196
- }
197
- function j(e, t, n, r = [0, 0]) {
198
- return N(e, t.y, t.y2, t.yOffset, t.y2Offset, n, k, r);
199
- }
200
- function M(e, t, n, r) {
201
- 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 = I(i), f = a ? I(a) : 0, p = i.constant ? P(i, r) + d : 0, m = a?.constant ? P(a, r) + f : 0, h = o.constant ? P(o, r) : 0, g = a && s?.constant ? P(s, r) : 0;
202
- return (e, t) => {
203
- let n = o.constant ? h : P(o, e), r = i.constant ? p : P(i, e) + d, c = l + r * u + n, _ = c;
204
- if (a) {
205
- let t = a.constant ? m : P(a, e) + f, r = s ? s.constant ? g : P(s, e) : n;
206
- _ = l + t * u + r;
207
- }
208
- return t[0] = c, t[1] = _, t;
209
- };
210
- }
211
- function N(e, t, n, r, i, a, o, s) {
212
- let c = P(r, a), l = o(e, F(t, a), c), u = n ? o(e, F(n, a), i ? P(i, a) : c) : l;
213
- return s[0] = l, s[1] = u, s;
214
- }
215
- function P(e, t) {
216
- return e(t);
217
- }
218
- function F(e, t) {
219
- return P(e, t) + I(e);
220
- }
221
- function I(e) {
222
- let t = e.scale;
223
- if (!t) return 0;
224
- let n = e.channelDef, r = n && "band" in n ? n.band ?? .5 : .5;
225
- if (t.type == "band" || t.type == "point") return t.bandwidth() * r;
226
- if (t.type == "index" || t.type == "locus") {
227
- let e = t;
228
- return Math.sign(e.step()) * e.bandwidth() * (r - e.align());
229
- } else return 0;
230
- }
231
- function L(e, t) {
232
- return z(e(t));
233
- }
234
- function R(e, t) {
235
- return n(t) ? e.unitView.paramRuntime.evaluateAndGet(t.expr) : t;
236
- }
237
- function z(e) {
238
- return e == null ? "none" : "" + e;
239
- }
240
- //#endregion
241
- //#region ../core/src/rendering/immediate/marks/arrow.js
242
- function B(e) {
243
- let t = e.properties, n = R(e, t.headSpacing);
244
- return {
245
- configuredRHeadSlope: oe(R(e, t.headAngle)),
246
- configuredRHeadNotchSlope: oe(R(e, t.headNotchAngle)),
247
- headShape: R(e, t.headShape),
248
- headWidth: R(e, t.headWidth),
249
- minSize: R(e, t.minSize),
250
- stem: R(e, t.stem),
251
- startNotch: R(e, t.startNotch),
252
- minStemLength: R(e, t.minStemLength),
253
- headSpacing: n,
254
- repeatHeads: n != null && n >= 0,
255
- headPlacement: R(e, t.headPlacement)
256
- };
257
- }
258
- function V(e, t, n, r) {
259
- let { viewOpacity: i } = n, a = e.encoders;
260
- return H(e, t, n, (e) => {
261
- let n = t.stem ? te(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch) : null, o = n ? [n] : [];
262
- U(e, (t, n) => {
263
- let r = {
264
- x: t,
265
- y: n
266
- };
267
- o.push(e.renderedHeadShape == "open" ? ne(r, e.tangent, e.normal, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : ee(r, e.tangent, e.normal, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
268
- });
269
- let s = z(a.stroke(e.datum)) != "none" && P(a.strokeOpacity, e.datum) * i > 0 && e.strokeWidth > 0;
270
- r({
271
- datum: e.datum,
272
- boundaryLoops: o.length == 1 || !s ? o : g(o),
273
- strokeWidth: e.strokeWidth,
274
- headShapeFallback: e.headShapeFallback
275
- });
276
- });
277
- }
278
- function H(e, t, n, r) {
279
- let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, c = e.encoders;
280
- if (a.length == 0) return 0;
281
- let l = M(i, c, "x", a[0]), u = M(i, c, "y", a[0]), d = [0, 0], f = [0, 0], p = {
282
- datum: {},
283
- tail: {
284
- x: 0,
285
- y: 0
286
- },
287
- tip: {
288
- x: 0,
289
- y: 0
290
- },
291
- tangent: {
292
- x: 0,
293
- y: 0
294
- },
295
- normal: {
296
- x: 0,
297
- y: 0
298
- },
299
- size: 0,
300
- stemHalfWidth: 0,
301
- headHalfWidth: 0,
302
- headAxisLength: 0,
303
- rHeadSlope: 0,
304
- rHeadNotchSlope: 0,
305
- strokeWidth: 0,
306
- repeatSpacing: Infinity,
307
- headRepeatFootprint: 0,
308
- geometryLength: 0,
309
- stemContainsHead: !1,
310
- renderedHeadShape: "triangle",
311
- headShapeFallback: !1
312
- }, h = 0;
313
- for (let e of a) {
314
- l(e, d), u(e, f);
315
- let n = L(c.direction, e) == "reverse", i = n ? d[1] : d[0], a = n ? f[1] : f[0], g = n ? d[0] : d[1], _ = n ? f[0] : f[1], v = g - i, y = _ - a, b = Math.hypot(v, y);
316
- if (b == 0) continue;
317
- let x = v / b, S = y / b, C = Math.max(P(c.size, e), t.minSize), w = C / 2, T = Math.max(t.headWidth * C, 0) / 2, E = re({
318
- segmentLength: b,
319
- headHalfWidth: T,
320
- stemHalfWidth: t.stem ? w : -w,
321
- configuredRHeadSlope: t.configuredRHeadSlope,
322
- configuredRHeadNotchSlope: t.configuredRHeadNotchSlope,
323
- headRepeat: t.repeatHeads,
324
- headPlacement: t.headPlacement,
325
- startNotch: t.startNotch,
326
- minStemLength: t.minStemLength,
327
- headShape: t.headShape
328
- }), D = t.headShape == "open" ? E : Math.min(t.configuredRHeadNotchSlope, E), O = t.headShape == "open" ? C : 0, k = t.headPlacement == "outside" ? ae(T, E, D, O) : 0, A = g + x * k, j = _ + S * k, M = T * E, N = Math.hypot(T, M), F = t.headShape == "open" && N > 0 ? C * T / N : 0, I = A - x * (M + F), R = j - S * (M + F), z = P(c.strokeWidth, e), B = Math.max(t.stem ? w : 0, T) + z * 2;
329
- if (!m(o, Math.min(i, A, I), Math.min(a, j, R), Math.max(i, A, I), Math.max(a, j, R), B) || (h++, s)) continue;
330
- let V = t.headShape == "triangle" || t.headShape == "open" ? t.headShape : "triangle", H = M + O / Math.hypot(E, 1) + z, U = t.repeatHeads ? Math.max((t.headSpacing ?? 0) * C, H) : Infinity;
331
- p.datum = e, K(p.tail, i, a), K(p.tip, A, j), K(p.tangent, x, S), K(p.normal, -S, x), p.size = C, p.stemHalfWidth = w, p.headHalfWidth = T, p.headAxisLength = M, p.rHeadSlope = E, p.rHeadNotchSlope = D, p.strokeWidth = z, p.repeatSpacing = U, p.headRepeatFootprint = H, p.geometryLength = Math.hypot(A - i, j - a), p.stemContainsHead = t.stem && V == "triangle" && !t.repeatHeads && T <= w, p.renderedHeadShape = V, p.headShapeFallback = V != t.headShape, r(p);
332
- }
333
- return h;
334
- }
335
- function U(e, t) {
336
- 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.repeatSpacing > 0) || !Number.isFinite(e.repeatSpacing))); n += e.repeatSpacing);
337
- }
338
- function ee(e, t, n, r, i, a) {
339
- let o = r * i, s = o - r * a, c = W(W(e, G(t, -o)), G(n, r)), l = W(W(e, G(t, -o)), G(n, -r));
340
- return [
341
- e,
342
- c,
343
- W(e, G(t, -s)),
344
- l
345
- ];
346
- }
347
- function te(e, t, n, r, i, a, o) {
348
- let s = i * a, c = W(W(t, G(n, -s)), G(r, i)), l = W(W(t, G(n, -s)), G(r, -i)), u = W(e, G(r, i)), d = W(e, G(r, -i));
349
- return [
350
- t,
351
- c,
352
- u,
353
- ...o ? [W(e, G(n, i * a))] : [],
354
- d,
355
- l
356
- ];
357
- }
358
- function ne(e, t, n, r, i, a, o) {
359
- let s = r * i, c = W(W(e, G(t, -s)), G(n, r)), l = W(W(e, G(t, -s)), G(n, -r)), u = Math.hypot(r, s), d = o * r / u, f = o * s / u, p = W(W(c, G(t, -d)), G(n, -f)), m = W(W(l, G(t, -d)), G(n, f));
360
- return [
361
- e,
362
- c,
363
- p,
364
- W(e, G(t, -(s + d - (r - f) * a))),
365
- m,
366
- l
367
- ];
368
- }
369
- function re({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l }) {
370
- if (a || n < 0) return r;
371
- if (o == "outside") return !s || n <= 0 ? r : Math.min(r, Math.max(e - c, 0) / n);
372
- if (l != "triangle") return r;
373
- let u = Math.max(e - c, 0);
374
- return ie(n, t, r, i) <= u ? r : u < n * i ? n > 0 ? q(u / n, 0, r) : 0 : q((u + (t - n) * i) / t, 0, r);
375
- }
376
- function ie(e, t, n, r) {
377
- return t * n - (t - e) * Math.min(r, n);
378
- }
379
- function ae(e, t, n, r) {
380
- if (e <= 0) return 0;
381
- let i = e * t, a = Math.hypot(e, i);
382
- return i + r * e / a - (e - r * i / a) * n;
383
- }
384
- function oe(e) {
385
- let t = q(e, 1, 90) * Math.PI / 180;
386
- return 1 / Math.max(Math.tan(t), 1e-6);
387
- }
388
- function W(e, t) {
389
- return {
390
- x: e.x + t.x,
391
- y: e.y + t.y
392
- };
393
- }
394
- function G(e, t) {
395
- return {
396
- x: e.x * t,
397
- y: e.y * t
398
- };
399
- }
400
- function K(e, t, n) {
401
- e.x = t, e.y = n;
402
- }
403
- function q(e, t, n) {
404
- return Math.min(Math.max(e, t), n);
405
- }
406
- //#endregion
407
- //#region ../core/src/rendering/immediate/linkFading.js
408
- var se = 4;
409
- function ce(e, t, n) {
410
- let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
411
- if (a == 0) return;
412
- let o = -i / a, s = r / a;
413
- (o < 0 || o == 0 && s < 0) && (o = -o, s = -s);
414
- let c = o * e[0] + s * e[1], [l, u] = n, d = JSON.stringify([
415
- J(o, 6),
416
- J(s, 6),
417
- J(c, 1),
418
- J(l, 1),
419
- J(u, 1)
420
- ]);
421
- return {
422
- normalX: o,
423
- normalY: s,
424
- offset: c,
425
- start: l,
426
- end: u,
427
- key: d
428
- };
429
- }
430
- function le(e, t, n = !1) {
431
- let r = R(e, e.properties.arcFadingDistance);
432
- return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n && R(e, e.properties.noFadingOnSecondPass) ? !1 : r;
433
- }
434
- function ue(e, t) {
435
- let n = [], r = (r) => {
436
- for (let i = 0; i <= se; i++) {
437
- let a = i / se, 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);
438
- n.push({
439
- offset: s,
440
- opacity: 1 - de(c)
441
- });
442
- }
443
- };
444
- return r(!0), r(!1), n;
445
- }
446
- function de(e) {
447
- let t = Math.max(0, Math.min(1, e));
448
- return t * t * (3 - 2 * t);
449
- }
450
- function J(e, t) {
451
- let n = 10 ** t;
452
- return Math.round(e * n) / n;
453
- }
454
- //#endregion
455
- //#region ../core/src/rendering/immediate/geometry/linkGeometry.js
456
- function fe(e, t, n, r) {
457
- if (r.shape == "arc") {
458
- let i = [...e], a = [...t], o = X(a, i), s = ge(o);
459
- if (s == 0) return [
460
- i,
461
- i,
462
- a,
463
- a
464
- ];
465
- let c = Z(o, 1 / s), l = [-c[1], c[0]];
466
- s = pe(i, a, s, r.maxChordLength, n);
467
- let u = Z(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
468
- return [
469
- i,
470
- Y(i, u),
471
- Y(a, u),
472
- a
473
- ];
474
- } else if (r.shape == "dome") {
475
- let i, a, o;
476
- 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]);
477
- let s = ge(X(a, i));
478
- pe(i, a, s, r.maxChordLength, n), r.clampApex && me(i, a, r.orient, n);
479
- let c = Z(o, 1 / .75);
480
- return [
481
- i,
482
- Y(i, c),
483
- Y(a, c),
484
- a
485
- ];
486
- } else if (r.shape == "diagonal") if (r.orient == "vertical") {
487
- let n = (e[1] + t[1]) / 2;
488
- return [
489
- e,
490
- [e[0], n],
491
- [t[0], n],
492
- t
493
- ];
494
- } else {
495
- let n = (e[0] + t[0]) / 2;
496
- return [
497
- e,
498
- [n, e[1]],
499
- [n, t[1]],
500
- t
501
- ];
502
- }
503
- else if (r.shape == "line") {
504
- let n = Z(Y(e, t), .5);
505
- return [
506
- e,
507
- n,
508
- n,
509
- t
510
- ];
511
- } else throw Error(`Unsupported link shape: ${r.shape}`);
512
- }
513
- function pe(e, t, n, r, i) {
514
- if (n <= r) return n;
515
- let a = Z(X(t, e), 1 / n);
516
- return he(e, i, 2) ? (_e(t, Y(e, Z(a, r))), r) : he(t, i, 2) ? (_e(e, X(t, Z(a, r))), r) : n;
517
- }
518
- function me(e, t, n, r) {
519
- 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])));
520
- }
521
- function he(e, t, n) {
522
- return e[0] >= -t.width * n && e[0] <= t.width * (1 + n) && e[1] >= -t.height * n && e[1] <= t.height * (1 + n);
523
- }
524
- function Y(e, t) {
525
- return [e[0] + t[0], e[1] + t[1]];
526
- }
527
- function X(e, t) {
528
- return [e[0] - t[0], e[1] - t[1]];
529
- }
530
- function Z(e, t) {
531
- return [e[0] * t, e[1] * t];
532
- }
533
- function ge(e) {
534
- return Math.hypot(e[0], e[1]);
535
- }
536
- function _e(e, t) {
537
- e[0] = t[0], e[1] = t[1];
538
- }
539
- //#endregion
540
- //#region ../core/src/rendering/immediate/marks/link.js
541
- function ve(e) {
542
- let t = e.properties;
543
- return {
544
- shape: R(e, t.linkShape),
545
- orient: R(e, t.orient),
546
- arcHeightFactor: R(e, t.arcHeightFactor),
547
- minArcHeight: R(e, t.minArcHeight),
548
- maxChordLength: R(e, t.maxChordLength),
549
- clampApex: R(e, t.clampApex)
550
- };
551
- }
552
- function ye(e, t, n, r) {
553
- let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
554
- if (a.length == 0) return 0;
555
- let c = M(i, s, "x", a[0]), l = M(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = i.x, p = i.y, h = {
556
- width: i.width,
557
- height: i.height
558
- }, g = p + h.height, _ = 0;
559
- for (let e of a) {
560
- c(e, u), l(e, d);
561
- let [n, i] = u, [a, p] = d, v = fe([n - f, g - a], [i - f, g - p], h, t);
562
- for (let e of v) e[0] += f, e[1] = g - e[1];
563
- let [y, b, x, S] = v, C = P(s.size, e);
564
- m(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({
565
- datum: e,
566
- points: v,
567
- strokeWidth: C
568
- }));
569
- }
570
- return _;
571
- }
572
- //#endregion
573
- //#region ../core/src/rendering/immediate/marks/point.js
574
- function be(e) {
575
- return { inwardStroke: R(e, e.properties.inwardStroke) };
576
- }
577
- function xe(e, t, n, r) {
578
- let { coords: i, data: a, visibleBounds: o, anchorCullBounds: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
579
- if (c === l) return 0;
580
- let d = M(i, u, "x", a[c]), f = M(i, u, "y", a[c]), h = [0, 0], g = [0, 0], _ = e.getSemanticThreshold(), v = {
581
- datum: {},
582
- shape: "circle",
583
- x: 0,
584
- y: 0,
585
- geometryRadius: 0,
586
- boundsRadius: 0,
587
- angle: 0,
588
- strokeWidth: 0,
589
- lineShape: !1
590
- }, y = 0;
591
- for (let e = c; e < l; e++) {
592
- let n = a[e];
593
- if (P(u.semanticScore, n) < _) continue;
594
- d(n, h), f(n, g);
595
- let i = h[0] + P(u.dx, n), c = g[0] - P(u.dy, n);
596
- if (p(s, i, c)) continue;
597
- let l = Math.sqrt(P(u.size, n)) / 2;
598
- if (t.inwardStroke && l <= 0) continue;
599
- let b = L(u.shape, n), x = P(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;
600
- m(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 = P(u.angle, n), v.strokeWidth = C, v.lineShape = S, r(v));
601
- }
602
- return y;
603
- }
604
- //#endregion
605
- //#region ../core/src/rendering/immediate/geometry/pointPath.js
606
- function Se(e, t, n, r, i) {
607
- let a = r * .4, o = r * .15, s = Math.sqrt(3) * r / 2;
608
- switch (e) {
609
- 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;
610
- case "cross": return i.moveTo(t - a, n - r), i.lineTo(t + a, n - r), i.lineTo(t + a, n - a), i.lineTo(t + r, n - a), i.lineTo(t + r, n + a), i.lineTo(t + a, n + a), i.lineTo(t + a, n + r), i.lineTo(t - a, n + r), i.lineTo(t - a, n + a), i.lineTo(t - r, n + a), i.lineTo(t - r, n - a), i.lineTo(t - a, n - a), i.closePath(), !0;
611
- case "triangle-up": return i.moveTo(t, n - s), i.lineTo(t + r, n + s), i.lineTo(t - r, n + s), i.closePath(), !0;
612
- case "triangle-right": return i.moveTo(t + s, n), i.lineTo(t - s, n + r), i.lineTo(t - s, n - r), i.closePath(), !0;
613
- case "triangle-down": return i.moveTo(t, n + s), i.lineTo(t - r, n - s), i.lineTo(t + r, n - s), i.closePath(), !0;
614
- case "triangle-left": return i.moveTo(t - s, n), i.lineTo(t + s, n - r), i.lineTo(t + s, n + r), i.closePath(), !0;
615
- case "tick-up": return Q(i, t - o, n - r, t + o, n), !0;
616
- case "tick-right": return Q(i, t, n - o, t + r, n + o), !0;
617
- case "tick-down": return Q(i, t - o, n, t + o, n + r), !0;
618
- case "tick-left": return Q(i, t - r, n - o, t, n + o), !0;
619
- case "+": return i.moveTo(t - r, n), i.lineTo(t + r, n), i.moveTo(t, n - r), i.lineTo(t, n + r), !0;
620
- 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;
621
- default: return !1;
622
- }
623
- }
624
- function Q(e, t, n, r, i) {
625
- e.moveTo(t, n), e.lineTo(r, n), e.lineTo(r, i), e.lineTo(t, i), e.closePath();
626
- }
627
- //#endregion
628
- //#region ../core/src/rendering/immediate/marks/rect.js
629
- var Ce = .1;
630
- function we(e) {
631
- let t = e.properties, n = R(e, t.cornerRadius), r = {
632
- topLeft: R(e, t.cornerRadiusTopLeft ?? n),
633
- topRight: R(e, t.cornerRadiusTopRight ?? n),
634
- bottomRight: R(e, t.cornerRadiusBottomRight ?? n),
635
- bottomLeft: R(e, t.cornerRadiusBottomLeft ?? n)
636
- }, i = {
637
- blur: R(e, t.shadowBlur ?? 0),
638
- color: R(e, t.shadowColor ?? "black"),
639
- offsetX: R(e, t.shadowOffsetX ?? 0),
640
- offsetY: R(e, t.shadowOffsetY ?? 0),
641
- opacity: R(e, t.shadowOpacity ?? 0)
642
- }, a = R(e, t.hatch ?? "none"), o = !Oe(r);
643
- return {
644
- cornerRadii: r,
645
- minWidth: R(e, t.minWidth),
646
- minHeight: R(e, t.minHeight),
647
- minOpacity: R(e, t.minOpacity),
648
- shadow: i,
649
- hatch: a,
650
- hasCornerRadii: o,
651
- canPadSeams: a == "none" && i.opacity == 0 && !o
652
- };
653
- }
654
- function Te(e, t, n, r) {
655
- let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
656
- if (c === l) return 0;
657
- let d = u.strokeWidth.constant, f = u.fillOpacity.constant, p = d ? P(u.strokeWidth, a[c]) : 0, h = f ? P(u.fillOpacity, a[c]) : 0, g = u.fill.constant, _ = g ? z(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 = M(i, u, "x", a[c]), b = M(i, u, "y", a[c]), x = [0, 0], S = [0, 0], C = {
658
- datum: {},
659
- x: 0,
660
- y: 0,
661
- width: 0,
662
- height: 0,
663
- radii: {
664
- topLeft: 0,
665
- topRight: 0,
666
- bottomRight: 0,
667
- bottomLeft: 0
668
- },
669
- opacityFactor: 1,
670
- strokeWidth: 0,
671
- fill: "none",
672
- fillOpacity: 0
673
- }, w = 0;
674
- for (let e = c; e < l; e++) {
675
- let n = a[e];
676
- y(n, x), b(n, S);
677
- 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 = Ee(l, t.minWidth), D = Ee(T, t.minHeight), O = Math.max(t.minOpacity, E * D);
678
- l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth), T < t.minHeight && (c -= (t.minHeight - T) / 2, T = t.minHeight);
679
- let k = d ? p : P(u.strokeWidth, n), A = g ? _ : z(u.fill(n)), j = (f ? h : P(u.fillOpacity, n)) * s, M = k == 0 && j == 1 && O == 1 && t.canPadSeams && A != "none" ? Ce : 0;
680
- M && (i -= M, c -= M, l += M * 2, T += M * 2), m(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 && De(t.cornerRadii, l, T, C.radii), r(C));
681
- }
682
- return w;
683
- }
684
- function Ee(e, t) {
685
- return t > 0 && e < t ? e / t : 1;
686
- }
687
- function De(e, t, n, r) {
688
- let i = Math.min(t, n) / 2;
689
- 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));
690
- }
691
- function Oe(e) {
692
- return e.topLeft == 0 && e.topRight == 0 && e.bottomRight == 0 && e.bottomLeft == 0;
693
- }
694
- //#endregion
695
- //#region ../core/src/rendering/immediate/marks/rule.js
696
- function ke(e) {
697
- return { minLength: R(e, e.properties.minLength) };
698
- }
699
- function Ae(e, t, n, r) {
700
- let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
701
- if (a.length == 0) return 0;
702
- let c = M(i, s, "x", a[0]), l = M(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = {
703
- datum: {},
704
- x1: 0,
705
- y1: 0,
706
- x2: 0,
707
- y2: 0,
708
- strokeWidth: 0
709
- }, p = 0;
710
- for (let e of a) {
711
- c(e, u), l(e, d);
712
- let [n, i] = u, [a, h] = d, g = i - n, _ = h - a, v = Math.hypot(g, _);
713
- if (v > 0 && v < t.minLength) {
714
- let e = (t.minLength - v) / 2, r = g / v, o = _ / v;
715
- n -= r * e, a -= o * e, i += r * e, h += o * e;
716
- }
717
- let y = P(s.size, e);
718
- m(o, n, a, i, h, y / 2) && (p++, f.datum = e, f.x1 = n, f.y1 = a, f.x2 = i, f.y2 = h, f.strokeWidth = y, r(f));
719
- }
720
- return p;
721
- }
722
- //#endregion
723
- //#region ../core/src/rendering/immediate/marks/text.js
724
- function je(e) {
725
- let t = e.properties;
726
- return {
727
- align: R(e, t.align),
728
- baseline: R(e, t.baseline),
729
- logoLetters: R(e, t.logoLetters),
730
- paddingX: R(e, t.paddingX),
731
- paddingY: R(e, t.paddingY),
732
- flushX: R(e, t.flushX),
733
- flushY: R(e, t.flushY),
734
- squeeze: R(e, t.squeeze),
735
- dx: R(e, t.dx),
736
- dy: R(e, t.dy)
737
- };
738
- }
739
- function Me(n, i, a, o) {
740
- let { coords: s, data: c, visibleBounds: l, anchorCullBounds: u } = a, { align: d, baseline: f } = i, m = n.encoders;
741
- if (c.length == 0) return 0;
742
- let h = m.size.constant ? P(m.size, c[0]) : 0, g = m.angle.constant ? P(m.angle, c[0]) : 0, _ = M(s, m, "x", c[0]), v = M(s, m, "y", c[0]), y = n.encoding.text, b = "format" in y ? r(y.format) : (e) => e, x = [0, 0], S = [0, 0], C = {
743
- width: 0,
744
- height: 0
745
- }, w = {
746
- x: 0,
747
- y: 0
748
- }, T = {
749
- position: 0,
750
- scale: 0
751
- }, E = {
752
- width: 0,
753
- heightScale: 0
754
- }, D = Array(8).fill(0), O = {
755
- datum: {},
756
- text: "",
757
- x: 0,
758
- y: 0,
759
- size: 0,
760
- width: 0,
761
- angle: 0,
762
- dx: i.dx,
763
- dy: i.dy,
764
- fadeOpacity: 1,
765
- scale: 1,
766
- logoScale: void 0,
767
- multiCharacterLogo: !1,
768
- boundsQuad: D
769
- }, k = !!m.x2, A = !!m.y2, j = 0;
770
- for (let r of c) {
771
- let a = b(m.text(r)), c = t(a) ? a : a === null ? "" : "" + a;
772
- if (!c) continue;
773
- _(r, x), v(r, S);
774
- let [y, M] = x, [N, F] = S, I = m.size.constant ? h : P(m.size, r), L = m.angle.constant ? g : P(m.angle, r);
775
- if (i.logoLetters) {
776
- let e = I, t = I;
777
- if (k && (e = M - y, y = (y + M) / 2), A && (t = N - F, N = (N + F) / 2), Ne(D, y, N, Math.abs(e), Math.abs(t), "center", "middle", L, i.dx, i.dy), !e || !t || p(u, y, N) || !Pe(l, D)) continue;
778
- let a = n.font.metrics.getChar(c[0]), s = t * n.font.metrics.common.base * (a.height + 10) / (a.height * a.height);
779
- j++, O.datum = r, O.text = c, O.x = y, O.y = N, O.size = 1, O.width = 1, O.angle = L, O.fadeOpacity = 1, O.scale = 1, E.width = e, E.heightScale = s, O.logoScale = E, O.multiCharacterLogo = c.length > 1, o(O);
780
- continue;
781
- }
782
- let R = n.font.metrics.measureWidth(c, I);
783
- Fe(R, I, L, C), k || A ? Le(d, f, L, w) : (w.x = Re[d], w.y = ze[f]);
784
- let z = 1;
785
- if (k && (Ie(Math.min(y, M), Math.max(y, M), C.width, i.paddingX, w.x, i.flushX, s.x, s.x2, T), y = T.position, z *= T.scale), A && (Ie(Math.min(N, F), Math.max(N, F), C.height * z, i.paddingY, w.y, i.flushY, s.y, s.y2, T), N = T.position, z *= T.scale), p(u, y, N)) continue;
786
- let B = 1;
787
- if (z < 1) {
788
- if (!i.squeeze || z < 3 / I) continue;
789
- B = e(3 / I, 6 / I, z);
790
- }
791
- let V = I * z, H = R * z;
792
- Ne(D, y, N, H, V, d, f, L, i.dx, i.dy), Pe(l, D) && (j++, O.datum = r, O.text = c, O.x = y, O.y = N, O.size = V, O.width = H, O.angle = L, O.fadeOpacity = B, O.scale = z, O.logoScale = void 0, O.multiCharacterLogo = !1, o(O));
793
- }
794
- return j;
795
- }
796
- function Ne(e, t, n, r, i, a, o, s, c, l) {
797
- let u = t + c - (Re[a] + 1) / 2 * r, d = n + l - (ze[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
798
- 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;
799
- }
800
- function Pe(e, t) {
801
- return m(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);
802
- }
803
- function $(e, t, n, r, i, a, o, s) {
804
- e[t] = n + (i - n) * s - (a - r) * o, e[t + 1] = r + (i - n) * o + (a - r) * s;
805
- }
806
- function Fe(e, t, n, r) {
807
- let i = n * Math.PI / 180, a = Math.abs(Math.sin(i)), o = Math.abs(Math.cos(i));
808
- r.width = e * o + t * a, r.height = e * a + t * o;
809
- }
810
- function Ie(e, t, n, r, i, a, o, s, c) {
811
- let l = t - e, u = n + 2 * r;
812
- if (e > s || t < o) {
813
- c.position = 0, c.scale = 0;
814
- return;
815
- }
816
- let d = Math.max(0, l - u), f;
817
- if (i == 0) {
818
- let n = e + t;
819
- if (a) {
820
- let e = Math.max(0, 2 * o + u - n);
821
- n += Math.min(e, d);
822
- let t = Math.max(0, u + n - 2 * s);
823
- n -= Math.min(t, d);
824
- }
825
- f = n / 2;
826
- } else if (i < 0) {
827
- let t = e;
828
- a && (t += Math.min(Math.max(0, o - t), d)), f = t + r;
829
- } else {
830
- let e = t;
831
- a && (e -= Math.min(Math.max(0, e - s), d)), f = e - r;
832
- }
833
- c.position = f, c.scale = Math.max(0, Math.min(1, (l - r) / u));
834
- }
835
- function Le(e, t, n, r) {
836
- let i = Re[e], a = -ze[t], o = ((n + 45) % 360 + 360) % 360, s, c;
837
- 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;
838
- }
839
- var Re = {
840
- left: -1,
841
- center: 0,
842
- right: 1
843
- }, ze = {
844
- top: -1,
845
- middle: 0,
846
- bottom: 1,
847
- alphabetic: 1,
848
- baseline: 1
849
- }, Be = {
850
- thin: 100,
851
- light: 300,
852
- regular: 400,
853
- normal: 400,
854
- medium: 500,
855
- bold: 700,
856
- black: 900
857
- };
858
- function Ve(e) {
859
- return typeof e == "number" ? e : Be[e];
860
- }
861
- //#endregion
862
- //#region ../core/src/rendering/nativeText.js
863
- var He = [
864
- "Lato",
865
- "Avenir Next",
866
- "Avenir",
867
- "Segoe UI",
868
- "Ubuntu",
869
- "Noto Sans",
870
- "Helvetica Neue",
871
- "Helvetica",
872
- "Arial",
873
- "sans-serif"
874
- ], Ue = /* @__PURE__ */ new Set([
875
- "serif",
876
- "sans-serif",
877
- "monospace",
878
- "cursive",
879
- "fantasy",
880
- "system-ui",
881
- "ui-serif",
882
- "ui-sans-serif",
883
- "ui-monospace",
884
- "ui-rounded",
885
- "emoji",
886
- "math",
887
- "fangsong"
888
- ]);
889
- function We(e) {
890
- let t = e ?? "Lato";
891
- return [t, ...He.filter((e) => e.toLowerCase() != t.toLowerCase())].map(Ke).join(", ");
892
- }
893
- function Ge(e, t) {
894
- switch (e) {
895
- case "top": return .79 * t;
896
- case "middle": return .35 * t;
897
- case "bottom": return -.21 * t;
898
- case "alphabetic":
899
- case "baseline": return 0;
900
- default: throw Error(`Unknown text baseline: ${e}`);
901
- }
902
- }
903
- function Ke(e) {
904
- let t = e.toLowerCase();
905
- return Ue.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
906
- }
907
- //#endregion
908
- //#region ../core/src/rendering/immediate/order.js
909
- function qe(e, t, n, r, i) {
910
- let a = [], o = [];
911
- for (let i = t; i < n; i++) {
912
- let t = e[i];
913
- (r(t) ? a : o).push(t);
914
- }
915
- return i.map((e) => e === "matching" ? a : o);
916
- }
917
- //#endregion
918
- export { f as A, P as C, z as D, R as E, o as M, c as N, d as O, H as S, j as T, ce as _, je as a, U as b, Ae as c, Se as d, be as f, ue as g, ye as h, Ve as i, m as j, u as k, we as l, ve as m, We as n, Me as o, xe as p, Ge as r, ke as s, qe as t, Te as u, le as v, A as w, V as x, B as y };