@genome-spy/app 0.87.0 → 0.88.1

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 (35) hide show
  1. package/dist/{agentApi-BZ1JCo1N.js → agentApi-BIpg3JKh.js} +5365 -5080
  2. package/dist/agentApi.es.js +3160 -2909
  3. package/dist/agentShared.es.js +3 -3
  4. package/dist/{canvas2d-Cafq5v-N.js → canvas2d-BVQ7-2eJ.js} +68 -68
  5. package/dist/{canvas2d-B_PnIof-.js → canvas2d-D7SZK3xv.js} +39 -39
  6. package/dist/{clipOptions-H68pJyEZ.js → clipOptions-BWHr3aTa.js} +822 -768
  7. package/dist/{clipOptions-D6eh9T-_.js → clipOptions-DTMcB_9z.js} +547 -493
  8. package/dist/{debug-BGzgZmyk.js → debug-CVpoEOWx.js} +2 -2
  9. package/dist/{debug-UYKZLNh4.js → debug-DYAMZZKl.js} +2 -2
  10. package/dist/index.es.js +3390 -3410
  11. package/dist/index.js +395 -374
  12. package/dist/{indexer-Di57GyxX.js → indexer-CXjZDo2Q.js} +1 -1
  13. package/dist/{indexer-o6Hpg4nN.js → indexer-DAH_ruVn.js} +1 -1
  14. package/dist/{nativeText-DAjvkrzc.js → order-C5CzA37O.js} +271 -287
  15. package/dist/{nativeText-D9SoxpaD.js → order-DvY7KNcu.js} +271 -287
  16. package/dist/{rasterExport-DzldLv6E.js → rasterExport-BgZ98e6U.js} +1 -1
  17. package/dist/{rasterExport-IAbJwi8F.js → rasterExport-DEr8fOLm.js} +1 -1
  18. package/dist/{renderCanvas2D-yJ1IrDcX.js → renderCanvas2D-DtcJjqpB.js} +57 -50
  19. package/dist/{renderCanvas2D-BJ93Ptqj.js → renderCanvas2D-DxturTEW.js} +62 -55
  20. package/dist/schema.json +756 -96
  21. package/dist/{svg-DJuqHIyc.js → svg-CyrLfa9e.js} +364 -357
  22. package/dist/{svg-BRpl2Xub.js → svg-SDJMzL--.js} +338 -331
  23. package/dist/{svgRasterizer-PAoqLn1j.js → svgRasterizer-f7DJ3UO0.js} +1 -1
  24. package/dist/{svgRasterizer-CGZQ5njV.js → svgRasterizer-mWK7HTkx.js} +1 -1
  25. package/dist/{vega-scale-BGC53c22.js → vega-scale-CypF85iS.js} +801 -801
  26. package/dist/{vega-scale-DdW2NzQ3.js → vega-scale-DLKCwWRs.js} +65 -65
  27. package/dist/{viewIdentityRegistry-Dc2hXYsO.js → viewIdentityRegistry-DIDo44XQ.js} +1 -1
  28. package/dist/{viewIdentityRegistry-D4p067HU.js → viewIdentityRegistry-Dl-vMN9I.js} +1 -1
  29. package/dist/{viewSelectors-DNXnGwEW.js → viewSelectors-CymbZyE6.js} +375 -340
  30. package/dist/{viewSelectors-DYYlOt91.js → viewSelectors-DNiDip5e.js} +370 -335
  31. package/dist/{viewUtils-EdhZTPrJ.js → viewUtils-BrJLIj2o.js} +1750 -1716
  32. package/dist/{webgl-C53DwzVT.js → webgl-CTJt7jQd.js} +1019 -983
  33. package/dist/{webgl-CdgNFlJk.js → webgl-tZfZ8y3q.js} +1200 -1164
  34. package/package.json +5 -5
  35. package/src/embedTypes.d.ts +1 -1
@@ -1,14 +1,14 @@
1
- import { F as e, L as t, Ot as n, Wt as r, Y as i, b as a, ot as o, rt as s, sn as c, z as l } from "./clipOptions-H68pJyEZ.js";
2
- import { t as u } from "./rectangle-DKnrAmKs.js";
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
3
  //#region ../core/src/rendering/immediate/markData.js
4
- var d = [], f = class {
4
+ var a = [], o = class {
5
5
  #e = {
6
6
  x: 0,
7
7
  y: 0,
8
8
  width: 0,
9
9
  height: 0
10
10
  };
11
- #t = new u(() => this.#e.x, () => this.#e.y, () => this.#e.width, () => this.#e.height);
11
+ #t = new i(() => this.#e.x, () => this.#e.y, () => this.#e.width, () => this.#e.height);
12
12
  #n;
13
13
  #r = 0;
14
14
  #i = 0;
@@ -32,22 +32,22 @@ var d = [], f = class {
32
32
  this.#e.y = this.#r + e * n * this.#i, this.#e.height = t * n * this.#i;
33
33
  }
34
34
  };
35
- function p(e, t) {
35
+ function s(e, t) {
36
36
  let n = e.unitView.getCollector();
37
37
  if (!n) throw Error(`Cannot render an uninitialized mark. View: ${e.unitView.getPathString()}`);
38
38
  let r = n.facetBatches.get(void 0);
39
- return r?.length ? r : n.facetBatches.get(t.facetId) ?? d;
39
+ return r?.length ? r : n.facetBatches.get(t.facetId) ?? a;
40
40
  }
41
- function m(e, t, n, r, i, a) {
42
- let o = p(e, t);
41
+ function c(e, t, n, r, i, a) {
42
+ let o = s(e, t);
43
43
  if (t.sampleFacetRenderingOptions) i(r.resolveFacet(n, t.sampleFacetRenderingOptions), o);
44
- else if (e.encoders.facetIndex) for (let [s, c] of h(e.encoders.facetIndex, o)) {
44
+ else if (e.encoders.facetIndex) for (let [s, c] of l(e.encoders.facetIndex, o)) {
45
45
  let e = r.resolvePlacement(n, t.placement?.source, s);
46
46
  e ? i(e, c) : a(s);
47
47
  }
48
48
  else i(n, o);
49
49
  }
50
- function h(e, t) {
50
+ function l(e, t) {
51
51
  let n = /* @__PURE__ */ new Map();
52
52
  for (let r of t) {
53
53
  let t = +e(r), i = n.get(t);
@@ -57,7 +57,7 @@ function h(e, t) {
57
57
  }
58
58
  //#endregion
59
59
  //#region ../core/src/rendering/immediate/bounds.js
60
- function g(e, t, n) {
60
+ function u(e, t, n) {
61
61
  return {
62
62
  x1: n?.clipX ? Math.max(0, n.rect.x) : 0,
63
63
  y1: n?.clipY ? Math.max(0, n.rect.y) : 0,
@@ -65,7 +65,7 @@ function g(e, t, n) {
65
65
  y2: n?.clipY ? Math.min(t, n.rect.y2) : t
66
66
  };
67
67
  }
68
- function _(e, t, n) {
68
+ function d(e, t, n) {
69
69
  let r = n === !0 || n === "x", i = n === !0 || n === "y";
70
70
  return {
71
71
  x1: r ? t?.clipX ? t.rect.x : e.x : -Infinity,
@@ -74,19 +74,19 @@ function _(e, t, n) {
74
74
  y2: i ? t?.clipY ? t.rect.y2 : e.y2 : Infinity
75
75
  };
76
76
  }
77
- function v(e) {
77
+ function f(e) {
78
78
  return e.x1 <= e.x2 && e.y1 <= e.y2;
79
79
  }
80
- function y(e, t, n) {
80
+ function p(e, t, n) {
81
81
  return t < e.x1 || t > e.x2 || n < e.y1 || n > e.y2;
82
82
  }
83
- function b(e, t, n, r, i, a = 0) {
83
+ function m(e, t, n, r, i, a = 0) {
84
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
85
  }
86
86
  //#endregion
87
87
  //#region ../core/src/rendering/immediate/geometry/polygonUnion.js
88
- var x = 1e-8;
89
- function S(e) {
88
+ var h = 1e-8;
89
+ function g(e) {
90
90
  let t = e.flatMap((e, t) => e.map((n, r) => ({
91
91
  a: n,
92
92
  b: e[(r + 1) % e.length],
@@ -94,55 +94,55 @@ function S(e) {
94
94
  }))), n = [];
95
95
  for (let r of t) {
96
96
  let i = [0, 1];
97
- for (let e of t) r.polygonIndex != e.polygonIndex && C(r, e, i);
97
+ for (let e of t) r.polygonIndex != e.polygonIndex && _(r, e, i);
98
98
  i.sort((e, t) => e - t);
99
99
  for (let t = 0; t < i.length - 1; t++) {
100
100
  let a = i[t], o = i[t + 1];
101
- if (o - a <= x) continue;
102
- let s = k(r.a, r.b, a), c = k(r.a, r.b, o), l = k(s, c, .5);
103
- e.some((e, t) => t != r.polygonIndex && D(l, e)) || n.push({
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
104
  a: s,
105
105
  b: c,
106
106
  polygonIndex: r.polygonIndex
107
107
  });
108
108
  }
109
109
  }
110
- return E(T(n));
110
+ return b(y(n));
111
111
  }
112
- function C(e, t, n) {
113
- let r = j(e.b, e.a), i = j(t.b, t.a), a = j(t.a, e.a), o = N(r, i);
114
- if (Math.abs(o) > x) {
115
- let e = N(a, i) / o, t = N(a, r) / o;
116
- e > x && e < 1 - x && t >= -1e-8 && t <= 1.00000001 && n.push(e);
117
- } else Math.abs(N(a, r)) <= x && (w(e, t.a, n), w(e, t.b, n));
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
118
  }
119
- function w(e, t, n) {
120
- let r = j(e.b, e.a), i = M(r, r), a = M(j(t, e.a), r) / i;
121
- a > x && a < 1 - x && n.push(a);
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
122
  }
123
- function T(e) {
123
+ function y(e) {
124
124
  let t = /* @__PURE__ */ new Map();
125
125
  for (let n of e) {
126
- let e = A(n.a) + ":" + A(n.b), r = A(n.b) + ":" + A(n.a);
126
+ let e = w(n.a) + ":" + w(n.b), r = w(n.b) + ":" + w(n.a);
127
127
  t.has(r) ? t.delete(r) : t.has(e) || t.set(e, n);
128
128
  }
129
129
  return Array.from(t.values());
130
130
  }
131
- function E(e) {
131
+ function b(e) {
132
132
  let t = /* @__PURE__ */ new Map();
133
133
  for (let n of e) {
134
- let e = A(n.a), r = t.get(e) ?? [];
134
+ let e = w(n.a), r = t.get(e) ?? [];
135
135
  r.push(n), t.set(e, r);
136
136
  }
137
137
  let n = new Set(e), r = [];
138
138
  for (; n.size;) {
139
139
  let e = n.values().next().value, i = [e.a], a = e;
140
140
  for (;;) {
141
- if (n.delete(a), i.push(a.b), A(a.b) == A(i[0])) {
141
+ if (n.delete(a), i.push(a.b), w(a.b) == w(i[0])) {
142
142
  i.pop();
143
143
  break;
144
144
  }
145
- let e = (t.get(A(a.b)) ?? []).find((e) => n.has(e));
145
+ let e = (t.get(w(a.b)) ?? []).find((e) => n.has(e));
146
146
  if (!e) throw Error("Cannot chain SVG polygon union boundary.");
147
147
  a = e;
148
148
  }
@@ -150,75 +150,75 @@ function E(e) {
150
150
  }
151
151
  return r;
152
152
  }
153
- function D(e, t) {
153
+ function x(e, t) {
154
154
  let n = !1;
155
155
  for (let r = 0, i = t.length - 1; r < t.length; i = r++) {
156
156
  let a = t[i], o = t[r];
157
- if (O(e, a, o)) return !1;
157
+ if (S(e, a, o)) return !1;
158
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
159
  }
160
160
  return n;
161
161
  }
162
- function O(e, t, n) {
163
- return Math.abs(N(j(e, t), j(n, t))) <= x && M(j(e, t), j(e, n)) <= x;
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
164
  }
165
- function k(e, t, n) {
165
+ function C(e, t, n) {
166
166
  return {
167
167
  x: e.x + (t.x - e.x) * n,
168
168
  y: e.y + (t.y - e.y) * n
169
169
  };
170
170
  }
171
- function A(e) {
172
- return `${Math.round(e.x / x)},${Math.round(e.y / x)}`;
171
+ function w(e) {
172
+ return `${Math.round(e.x / h)},${Math.round(e.y / h)}`;
173
173
  }
174
- function j(e, t) {
174
+ function T(e, t) {
175
175
  return {
176
176
  x: e.x - t.x,
177
177
  y: e.y - t.y
178
178
  };
179
179
  }
180
- function M(e, t) {
180
+ function E(e, t) {
181
181
  return e.x * t.x + e.y * t.y;
182
182
  }
183
- function N(e, t) {
183
+ function D(e, t) {
184
184
  return e.x * t.y - e.y * t.x;
185
185
  }
186
186
  //#endregion
187
187
  //#region ../core/src/rendering/immediate/markEncoding.js
188
- function P(e, t, n) {
188
+ function O(e, t, n) {
189
189
  return e.x + t * e.width + n;
190
190
  }
191
- function F(e, t, n) {
191
+ function k(e, t, n) {
192
192
  return e.y + (1 - t) * e.height + n;
193
193
  }
194
- function I(e, t, n, r = [0, 0]) {
195
- return z(e, t.x, t.x2, t.xOffset, t.x2Offset, n, P, r);
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
196
  }
197
- function L(e, t, n, r = [0, 0]) {
198
- return z(e, t.y, t.y2, t.yOffset, t.y2Offset, n, F, r);
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
199
  }
200
- function R(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 = H(i), f = a ? H(a) : 0, p = i.constant ? B(i, r) + d : 0, m = a?.constant ? B(a, r) + f : 0, h = o.constant ? B(o, r) : 0, g = a && s?.constant ? B(s, r) : 0;
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
202
  return (e, t) => {
203
- let n = o.constant ? h : B(o, e), r = i.constant ? p : B(i, e) + d, c = l + r * u + n, _ = c;
203
+ let n = o.constant ? h : P(o, e), r = i.constant ? p : P(i, e) + d, c = l + r * u + n, _ = c;
204
204
  if (a) {
205
- let t = a.constant ? m : B(a, e) + f, r = s ? s.constant ? g : B(s, e) : n;
205
+ let t = a.constant ? m : P(a, e) + f, r = s ? s.constant ? g : P(s, e) : n;
206
206
  _ = l + t * u + r;
207
207
  }
208
208
  return t[0] = c, t[1] = _, t;
209
209
  };
210
210
  }
211
- function z(e, t, n, r, i, a, o, s) {
212
- let c = B(r, a), l = o(e, V(t, a), c), u = n ? o(e, V(n, a), i ? B(i, a) : c) : l;
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
213
  return s[0] = l, s[1] = u, s;
214
214
  }
215
- function B(e, t) {
215
+ function P(e, t) {
216
216
  return e(t);
217
217
  }
218
- function V(e, t) {
219
- return B(e, t) + H(e);
218
+ function F(e, t) {
219
+ return P(e, t) + I(e);
220
220
  }
221
- function H(e) {
221
+ function I(e) {
222
222
  let t = e.scale;
223
223
  if (!t) return 0;
224
224
  let n = e.channelDef, r = n && "band" in n ? n.band ?? .5 : .5;
@@ -228,57 +228,57 @@ function H(e) {
228
228
  return Math.sign(e.step()) * e.bandwidth() * (r - e.align());
229
229
  } else return 0;
230
230
  }
231
- function ee(e, t) {
232
- return W(e(t));
231
+ function L(e, t) {
232
+ return z(e(t));
233
233
  }
234
- function U(e, t) {
235
- return a(t) ? e.unitView.paramRuntime.evaluateAndGet(t.expr) : t;
234
+ function R(e, t) {
235
+ return n(t) ? e.unitView.paramRuntime.evaluateAndGet(t.expr) : t;
236
236
  }
237
- function W(e) {
237
+ function z(e) {
238
238
  return e == null ? "none" : "" + e;
239
239
  }
240
240
  //#endregion
241
241
  //#region ../core/src/rendering/immediate/marks/arrow.js
242
- function te(e) {
243
- let t = e.properties, n = U(e, t.headSpacing);
242
+ function B(e) {
243
+ let t = e.properties, n = R(e, t.headSpacing);
244
244
  return {
245
- configuredRHeadSlope: de(U(e, t.headAngle)),
246
- configuredRHeadNotchSlope: de(U(e, t.headNotchAngle)),
247
- headShape: U(e, t.headShape),
248
- headWidth: U(e, t.headWidth),
249
- minSize: U(e, t.minSize),
250
- stem: U(e, t.stem),
251
- startNotch: U(e, t.startNotch),
252
- minStemLength: U(e, t.minStemLength),
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
253
  headSpacing: n,
254
254
  repeatHeads: n != null && n >= 0,
255
- headPlacement: U(e, t.headPlacement)
255
+ headPlacement: R(e, t.headPlacement)
256
256
  };
257
257
  }
258
- function ne(e, t, n, r) {
258
+ function V(e, t, n, r) {
259
259
  let { viewOpacity: i } = n, a = e.encoders;
260
- return re(e, t, n, (e) => {
261
- let n = t.stem ? oe(e.tail, e.tip, e.tangent, e.normal, e.stemHalfWidth, e.rHeadSlope, t.startNotch) : null, o = n ? [n] : [];
262
- ie(e, (t, n) => {
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
263
  let r = {
264
264
  x: t,
265
265
  y: n
266
266
  };
267
- o.push(e.renderedHeadShape == "open" ? se(r, e.tangent, e.normal, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope, e.size) : ae(r, e.tangent, e.normal, e.headHalfWidth, e.rHeadSlope, e.rHeadNotchSlope));
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
268
  });
269
- let s = W(a.stroke(e.datum)) != "none" && B(a.strokeOpacity, e.datum) * i > 0 && e.strokeWidth > 0;
269
+ let s = z(a.stroke(e.datum)) != "none" && P(a.strokeOpacity, e.datum) * i > 0 && e.strokeWidth > 0;
270
270
  r({
271
271
  datum: e.datum,
272
- boundaryLoops: o.length == 1 || !s ? o : S(o),
272
+ boundaryLoops: o.length == 1 || !s ? o : g(o),
273
273
  strokeWidth: e.strokeWidth,
274
274
  headShapeFallback: e.headShapeFallback
275
275
  });
276
276
  });
277
277
  }
278
- function re(e, t, n, r) {
278
+ function H(e, t, n, r) {
279
279
  let { coords: i, data: a, visibleBounds: o, countOnly: s } = n, c = e.encoders;
280
280
  if (a.length == 0) return 0;
281
- let l = R(i, c, "x", a[0]), u = R(i, c, "y", a[0]), d = [0, 0], f = [0, 0], p = {
281
+ let l = M(i, c, "x", a[0]), u = M(i, c, "y", a[0]), d = [0, 0], f = [0, 0], p = {
282
282
  datum: {},
283
283
  tail: {
284
284
  x: 0,
@@ -309,13 +309,13 @@ function re(e, t, n, r) {
309
309
  stemContainsHead: !1,
310
310
  renderedHeadShape: "triangle",
311
311
  headShapeFallback: !1
312
- }, m = 0;
312
+ }, h = 0;
313
313
  for (let e of a) {
314
314
  l(e, d), u(e, f);
315
- let n = ee(c.direction, e) == "reverse", i = n ? d[1] : d[0], a = n ? f[1] : f[0], h = n ? d[0] : d[1], g = n ? f[0] : f[1], _ = h - i, v = g - a, y = Math.hypot(_, v);
316
- if (y == 0) continue;
317
- let x = _ / y, S = v / y, C = Math.max(B(c.size, e), t.minSize), w = C / 2, T = Math.max(t.headWidth * C, 0) / 2, E = ce({
318
- segmentLength: y,
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
319
  headHalfWidth: T,
320
320
  stemHalfWidth: t.stem ? w : -w,
321
321
  configuredRHeadSlope: t.configuredRHeadSlope,
@@ -325,88 +325,88 @@ function re(e, t, n, r) {
325
325
  startNotch: t.startNotch,
326
326
  minStemLength: t.minStemLength,
327
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" ? ue(T, E, D, O) : 0, A = h + x * k, j = g + S * k, M = T * E, N = Math.hypot(T, M), P = t.headShape == "open" && N > 0 ? C * T / N : 0, F = A - x * (M + P), I = j - S * (M + P), L = B(c.strokeWidth, e), R = Math.max(t.stem ? w : 0, T) + L * 2;
329
- if (!b(o, Math.min(i, A, F), Math.min(a, j, I), Math.max(i, A, F), Math.max(a, j, I), R) || (m++, s)) continue;
330
- let z = t.headShape == "triangle" || t.headShape == "open" ? t.headShape : "triangle", V = M + O / Math.hypot(E, 1) + L, H = t.repeatHeads ? Math.max((t.headSpacing ?? 0) * C, V) : Infinity;
331
- p.datum = e, q(p.tail, i, a), q(p.tip, A, j), q(p.tangent, x, S), q(p.normal, -S, x), p.size = C, p.stemHalfWidth = w, p.headHalfWidth = T, p.headAxisLength = M, p.rHeadSlope = E, p.rHeadNotchSlope = D, p.strokeWidth = L, p.repeatSpacing = H, p.headRepeatFootprint = V, p.geometryLength = Math.hypot(A - i, j - a), p.stemContainsHead = t.stem && z == "triangle" && !t.repeatHeads && T <= w, p.renderedHeadShape = z, p.headShapeFallback = z != t.headShape, r(p);
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
332
  }
333
- return m;
333
+ return h;
334
334
  }
335
- function ie(e, t) {
335
+ function U(e, t) {
336
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
337
  }
338
- function ae(e, t, n, r, i, a) {
339
- 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));
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
340
  return [
341
341
  e,
342
342
  c,
343
- G(e, K(t, -s)),
343
+ W(e, G(t, -s)),
344
344
  l
345
345
  ];
346
346
  }
347
- function oe(e, t, n, r, i, a, o) {
348
- let s = i * a, c = G(G(t, K(n, -s)), K(r, i)), l = G(G(t, K(n, -s)), K(r, -i)), u = G(e, K(r, i)), d = G(e, K(r, -i));
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
349
  return [
350
350
  t,
351
351
  c,
352
352
  u,
353
- ...o ? [G(e, K(n, i * a))] : [],
353
+ ...o ? [W(e, G(n, i * a))] : [],
354
354
  d,
355
355
  l
356
356
  ];
357
357
  }
358
- function se(e, t, n, r, i, a, o) {
359
- 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 = o * r / u, f = o * s / u, p = G(G(c, K(t, -d)), K(n, -f)), m = G(G(l, K(t, -d)), K(n, f));
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
360
  return [
361
361
  e,
362
362
  c,
363
363
  p,
364
- G(e, K(t, -(s + d - (r - f) * a))),
364
+ W(e, G(t, -(s + d - (r - f) * a))),
365
365
  m,
366
366
  l
367
367
  ];
368
368
  }
369
- function ce({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l }) {
369
+ function re({ segmentLength: e, headHalfWidth: t, stemHalfWidth: n, configuredRHeadSlope: r, configuredRHeadNotchSlope: i, headRepeat: a, headPlacement: o, startNotch: s, minStemLength: c, headShape: l }) {
370
370
  if (a || n < 0) return r;
371
371
  if (o == "outside") return !s || n <= 0 ? r : Math.min(r, Math.max(e - c, 0) / n);
372
372
  if (l != "triangle") return r;
373
373
  let u = Math.max(e - c, 0);
374
- return le(n, t, r, i) <= u ? r : u < n * i ? n > 0 ? fe(u / n, 0, r) : 0 : fe((u + (t - n) * i) / t, 0, r);
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
375
  }
376
- function le(e, t, n, r) {
376
+ function ie(e, t, n, r) {
377
377
  return t * n - (t - e) * Math.min(r, n);
378
378
  }
379
- function ue(e, t, n, r) {
379
+ function ae(e, t, n, r) {
380
380
  if (e <= 0) return 0;
381
381
  let i = e * t, a = Math.hypot(e, i);
382
382
  return i + r * e / a - (e - r * i / a) * n;
383
383
  }
384
- function de(e) {
385
- let t = fe(e, 1, 90) * Math.PI / 180;
384
+ function oe(e) {
385
+ let t = q(e, 1, 90) * Math.PI / 180;
386
386
  return 1 / Math.max(Math.tan(t), 1e-6);
387
387
  }
388
- function G(e, t) {
388
+ function W(e, t) {
389
389
  return {
390
390
  x: e.x + t.x,
391
391
  y: e.y + t.y
392
392
  };
393
393
  }
394
- function K(e, t) {
394
+ function G(e, t) {
395
395
  return {
396
396
  x: e.x * t,
397
397
  y: e.y * t
398
398
  };
399
399
  }
400
- function q(e, t, n) {
400
+ function K(e, t, n) {
401
401
  e.x = t, e.y = n;
402
402
  }
403
- function fe(e, t, n) {
403
+ function q(e, t, n) {
404
404
  return Math.min(Math.max(e, t), n);
405
405
  }
406
406
  //#endregion
407
407
  //#region ../core/src/rendering/immediate/linkFading.js
408
- var pe = 4;
409
- function me(e, t, n) {
408
+ var se = 4;
409
+ function ce(e, t, n) {
410
410
  let r = t[0] - e[0], i = t[1] - e[1], a = Math.hypot(r, i);
411
411
  if (a == 0) return;
412
412
  let o = -i / a, s = r / a;
@@ -427,49 +427,23 @@ function me(e, t, n) {
427
427
  key: d
428
428
  };
429
429
  }
430
- function he(e, t) {
431
- let n = U(e, e.properties.arcFadingDistance);
432
- if (t != "arc" && t != "dome" || n === !1 || n[0] <= 0 || n[1] <= 0) return () => !1;
433
- let r = e.encoders.uniqueId && U(e, e.properties.noFadingOnPointSelection) ? ge(e) : [];
434
- return (e) => !r.some((t) => t(e)) && n;
435
- }
436
- function ge(r) {
437
- let i = new Set(Object.values(r.encoders).flatMap((e) => e.branches).map((e) => e.predicate.param).filter((e) => e));
438
- return Array.from(i, (i) => {
439
- let a = r.unitView.paramRuntime.findValue(i);
440
- if (l(a)) return (e) => a.uniqueId != null && a.uniqueId == e.__uniqueId;
441
- if (t(a)) return (e) => a.data.has(e[n]);
442
- if (e(a)) {
443
- let e = Object.entries(a.intervals).map(([e, t]) => {
444
- if (e != "x" && e != "y") throw Error(`Unsupported link selection channel: ${e}`);
445
- let n = r.encoders[e], i = r.encoders[o(e)];
446
- return {
447
- interval: t,
448
- start: s(n) ?? n.branches[0].accessor,
449
- end: s(i) ?? i.branches[0].accessor
450
- };
451
- });
452
- return (t) => e.every(({ interval: e, start: n, end: r }) => {
453
- if (!e) return !1;
454
- let i = +n(t), a = +r(t);
455
- return e[0] <= i && i <= e[1] || e[0] <= a && a <= e[1];
456
- });
457
- } else throw Error(`Unsupported link selection type: ${a.type}`);
458
- });
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;
459
433
  }
460
- function _e(e, t) {
434
+ function ue(e, t) {
461
435
  let n = [], r = (r) => {
462
- for (let i = 0; i <= pe; i++) {
463
- let a = i / pe, o = r ? t + (e - t) * a : e + (t - e) * a, s = r ? (t - o) / (2 * t) : (t + o) / (2 * t), c = (o - e) / (t - e);
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);
464
438
  n.push({
465
439
  offset: s,
466
- opacity: 1 - ve(c)
440
+ opacity: 1 - de(c)
467
441
  });
468
442
  }
469
443
  };
470
444
  return r(!0), r(!1), n;
471
445
  }
472
- function ve(e) {
446
+ function de(e) {
473
447
  let t = Math.max(0, Math.min(1, e));
474
448
  return t * t * (3 - 2 * t);
475
449
  }
@@ -479,9 +453,9 @@ function J(e, t) {
479
453
  }
480
454
  //#endregion
481
455
  //#region ../core/src/rendering/immediate/geometry/linkGeometry.js
482
- function ye(e, t, n, r) {
456
+ function fe(e, t, n, r) {
483
457
  if (r.shape == "arc") {
484
- let i = [...e], a = [...t], o = X(a, i), s = Ce(o);
458
+ let i = [...e], a = [...t], o = X(a, i), s = ge(o);
485
459
  if (s == 0) return [
486
460
  i,
487
461
  i,
@@ -489,7 +463,7 @@ function ye(e, t, n, r) {
489
463
  a
490
464
  ];
491
465
  let c = Z(o, 1 / s), l = [-c[1], c[0]];
492
- s = be(i, a, s, r.maxChordLength, n);
466
+ s = pe(i, a, s, r.maxChordLength, n);
493
467
  let u = Z(l, Math.max(s / 2 * r.arcHeightFactor, r.minArcHeight) / .75);
494
468
  return [
495
469
  i,
@@ -500,8 +474,8 @@ function ye(e, t, n, r) {
500
474
  } else if (r.shape == "dome") {
501
475
  let i, a, o;
502
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]);
503
- let s = Ce(X(a, i));
504
- be(i, a, s, r.maxChordLength, n), r.clampApex && xe(i, a, r.orient, n);
477
+ let s = ge(X(a, i));
478
+ pe(i, a, s, r.maxChordLength, n), r.clampApex && me(i, a, r.orient, n);
505
479
  let c = Z(o, 1 / .75);
506
480
  return [
507
481
  i,
@@ -536,15 +510,15 @@ function ye(e, t, n, r) {
536
510
  ];
537
511
  } else throw Error(`Unsupported link shape: ${r.shape}`);
538
512
  }
539
- function be(e, t, n, r, i) {
513
+ function pe(e, t, n, r, i) {
540
514
  if (n <= r) return n;
541
515
  let a = Z(X(t, e), 1 / n);
542
- return Se(e, i, 2) ? (we(t, Y(e, Z(a, r))), r) : Se(t, i, 2) ? (we(e, X(t, Z(a, r))), r) : 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;
543
517
  }
544
- function xe(e, t, n, r) {
518
+ function me(e, t, n, r) {
545
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])));
546
520
  }
547
- function Se(e, t, n) {
521
+ function he(e, t, n) {
548
522
  return e[0] >= -t.width * n && e[0] <= t.width * (1 + n) && e[1] >= -t.height * n && e[1] <= t.height * (1 + n);
549
523
  }
550
524
  function Y(e, t) {
@@ -556,54 +530,54 @@ function X(e, t) {
556
530
  function Z(e, t) {
557
531
  return [e[0] * t, e[1] * t];
558
532
  }
559
- function Ce(e) {
533
+ function ge(e) {
560
534
  return Math.hypot(e[0], e[1]);
561
535
  }
562
- function we(e, t) {
536
+ function _e(e, t) {
563
537
  e[0] = t[0], e[1] = t[1];
564
538
  }
565
539
  //#endregion
566
540
  //#region ../core/src/rendering/immediate/marks/link.js
567
- function Te(e) {
541
+ function ve(e) {
568
542
  let t = e.properties;
569
543
  return {
570
- shape: U(e, t.linkShape),
571
- orient: U(e, t.orient),
572
- arcHeightFactor: U(e, t.arcHeightFactor),
573
- minArcHeight: U(e, t.minArcHeight),
574
- maxChordLength: U(e, t.maxChordLength),
575
- clampApex: U(e, t.clampApex)
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)
576
550
  };
577
551
  }
578
- function Ee(e, t, n, r) {
552
+ function ye(e, t, n, r) {
579
553
  let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
580
554
  if (a.length == 0) return 0;
581
- let c = R(i, s, "x", a[0]), l = R(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = i.x, p = i.y, m = {
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 = {
582
556
  width: i.width,
583
557
  height: i.height
584
- }, h = p + m.height, g = 0;
558
+ }, g = p + h.height, _ = 0;
585
559
  for (let e of a) {
586
560
  c(e, u), l(e, d);
587
- let [n, i] = u, [a, p] = d, _ = ye([n - f, h - a], [i - f, h - p], m, t);
588
- for (let e of _) e[0] += f, e[1] = h - e[1];
589
- let [v, y, x, S] = _, C = B(s.size, e);
590
- b(o, Math.min(v[0], y[0], x[0], S[0]), Math.min(v[1], y[1], x[1], S[1]), Math.max(v[0], y[0], x[0], S[0]), Math.max(v[1], y[1], x[1], S[1]), C / 2) && (g++, r({
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({
591
565
  datum: e,
592
- points: _,
566
+ points: v,
593
567
  strokeWidth: C
594
568
  }));
595
569
  }
596
- return g;
570
+ return _;
597
571
  }
598
572
  //#endregion
599
573
  //#region ../core/src/rendering/immediate/marks/point.js
600
- function De(e) {
601
- return { inwardStroke: U(e, e.properties.inwardStroke) };
574
+ function be(e) {
575
+ return { inwardStroke: R(e, e.properties.inwardStroke) };
602
576
  }
603
- function Oe(e, t, n, r) {
577
+ function xe(e, t, n, r) {
604
578
  let { coords: i, data: a, visibleBounds: o, anchorCullBounds: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
605
579
  if (c === l) return 0;
606
- let d = R(i, u, "x", a[c]), f = R(i, u, "y", a[c]), p = [0, 0], m = [0, 0], h = e.getSemanticThreshold(), g = {
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 = {
607
581
  datum: {},
608
582
  shape: "circle",
609
583
  x: 0,
@@ -613,23 +587,23 @@ function Oe(e, t, n, r) {
613
587
  angle: 0,
614
588
  strokeWidth: 0,
615
589
  lineShape: !1
616
- }, _ = 0;
590
+ }, y = 0;
617
591
  for (let e = c; e < l; e++) {
618
592
  let n = a[e];
619
- if (B(u.semanticScore, n) < h) continue;
620
- d(n, p), f(n, m);
621
- let i = p[0] + B(u.dx, n), c = m[0] - B(u.dy, n);
622
- if (y(s, i, c)) continue;
623
- let l = Math.sqrt(B(u.size, n)) / 2;
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;
624
598
  if (t.inwardStroke && l <= 0) continue;
625
- let v = ee(u.shape, n), x = B(u.strokeWidth, n), S = v == "x" || v == "+", 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;
626
- b(o, i - E, c - E, i + E, c + E) && (_++, g.datum = n, g.shape = v, g.x = i, g.y = c, g.geometryRadius = w, g.boundsRadius = E, g.angle = B(u.angle, n), g.strokeWidth = C, g.lineShape = S, r(g));
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));
627
601
  }
628
- return _;
602
+ return y;
629
603
  }
630
604
  //#endregion
631
605
  //#region ../core/src/rendering/immediate/geometry/pointPath.js
632
- function ke(e, t, n, r, i) {
606
+ function Se(e, t, n, r, i) {
633
607
  let a = r * .4, o = r * .15, s = Math.sqrt(3) * r / 2;
634
608
  switch (e) {
635
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;
@@ -652,35 +626,35 @@ function Q(e, t, n, r, i) {
652
626
  }
653
627
  //#endregion
654
628
  //#region ../core/src/rendering/immediate/marks/rect.js
655
- var Ae = .1;
656
- function je(e) {
657
- let t = e.properties, n = U(e, t.cornerRadius), r = {
658
- topLeft: U(e, t.cornerRadiusTopLeft ?? n),
659
- topRight: U(e, t.cornerRadiusTopRight ?? n),
660
- bottomRight: U(e, t.cornerRadiusBottomRight ?? n),
661
- bottomLeft: U(e, t.cornerRadiusBottomLeft ?? n)
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)
662
636
  }, i = {
663
- blur: U(e, t.shadowBlur ?? 0),
664
- color: U(e, t.shadowColor ?? "black"),
665
- offsetX: U(e, t.shadowOffsetX ?? 0),
666
- offsetY: U(e, t.shadowOffsetY ?? 0),
667
- opacity: U(e, t.shadowOpacity ?? 0)
668
- }, a = U(e, t.hatch ?? "none"), o = !Fe(r);
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);
669
643
  return {
670
644
  cornerRadii: r,
671
- minWidth: U(e, t.minWidth),
672
- minHeight: U(e, t.minHeight),
673
- minOpacity: U(e, t.minOpacity),
645
+ minWidth: R(e, t.minWidth),
646
+ minHeight: R(e, t.minHeight),
647
+ minOpacity: R(e, t.minOpacity),
674
648
  shadow: i,
675
649
  hatch: a,
676
650
  hasCornerRadii: o,
677
651
  canPadSeams: a == "none" && i.opacity == 0 && !o
678
652
  };
679
653
  }
680
- function Me(e, t, n, r) {
654
+ function Te(e, t, n, r) {
681
655
  let { coords: i, data: a, visibleBounds: o, viewOpacity: s } = n, c = n.start ?? 0, l = n.end ?? a.length, u = e.encoders;
682
656
  if (c === l) return 0;
683
- let d = u.strokeWidth.constant, f = u.fillOpacity.constant, p = d ? B(u.strokeWidth, a[c]) : 0, m = f ? B(u.fillOpacity, a[c]) : 0, h = u.fill.constant, g = h ? W(u.fill(a[c])) : "none", _ = t.shadow.opacity > 0 ? t.shadow.blur + Math.max(Math.abs(t.shadow.offsetX), Math.abs(t.shadow.offsetY)) : 0, v = R(i, u, "x", a[c]), y = R(i, u, "y", a[c]), x = [0, 0], S = [0, 0], C = {
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 = {
684
658
  datum: {},
685
659
  x: 0,
686
660
  y: 0,
@@ -699,33 +673,33 @@ function Me(e, t, n, r) {
699
673
  }, w = 0;
700
674
  for (let e = c; e < l; e++) {
701
675
  let n = a[e];
702
- v(n, x), y(n, S);
703
- 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 = Ne(l, t.minWidth), D = Ne(T, t.minHeight), O = Math.max(t.minOpacity, E * D);
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);
704
678
  l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth), T < t.minHeight && (c -= (t.minHeight - T) / 2, T = t.minHeight);
705
- let k = d ? p : B(u.strokeWidth, n), A = h ? g : W(u.fill(n)), j = (f ? m : B(u.fillOpacity, n)) * s, M = k == 0 && j == 1 && O == 1 && t.canPadSeams && A != "none" ? Ae : 0;
706
- M && (i -= M, c -= M, l += M * 2, T += M * 2), b(o, i, c, i + l, c + T, k / 2 + _) && (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 && Pe(t.cornerRadii, l, T, C.radii), r(C));
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));
707
681
  }
708
682
  return w;
709
683
  }
710
- function Ne(e, t) {
684
+ function Ee(e, t) {
711
685
  return t > 0 && e < t ? e / t : 1;
712
686
  }
713
- function Pe(e, t, n, r) {
687
+ function De(e, t, n, r) {
714
688
  let i = Math.min(t, n) / 2;
715
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));
716
690
  }
717
- function Fe(e) {
691
+ function Oe(e) {
718
692
  return e.topLeft == 0 && e.topRight == 0 && e.bottomRight == 0 && e.bottomLeft == 0;
719
693
  }
720
694
  //#endregion
721
695
  //#region ../core/src/rendering/immediate/marks/rule.js
722
- function Ie(e) {
723
- return { minLength: U(e, e.properties.minLength) };
696
+ function ke(e) {
697
+ return { minLength: R(e, e.properties.minLength) };
724
698
  }
725
- function Le(e, t, n, r) {
699
+ function Ae(e, t, n, r) {
726
700
  let { coords: i, data: a, visibleBounds: o } = n, s = e.encoders;
727
701
  if (a.length == 0) return 0;
728
- let c = R(i, s, "x", a[0]), l = R(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = {
702
+ let c = M(i, s, "x", a[0]), l = M(i, s, "y", a[0]), u = [0, 0], d = [0, 0], f = {
729
703
  datum: {},
730
704
  x1: 0,
731
705
  y1: 0,
@@ -735,37 +709,37 @@ function Le(e, t, n, r) {
735
709
  }, p = 0;
736
710
  for (let e of a) {
737
711
  c(e, u), l(e, d);
738
- let [n, i] = u, [a, m] = d, h = i - n, g = m - a, _ = Math.hypot(h, g);
739
- if (_ > 0 && _ < t.minLength) {
740
- let e = (t.minLength - _) / 2, r = h / _, o = g / _;
741
- n -= r * e, a -= o * e, i += r * e, m += o * e;
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;
742
716
  }
743
- let v = B(s.size, e);
744
- b(o, n, a, i, m, v / 2) && (p++, f.datum = e, f.x1 = n, f.y1 = a, f.x2 = i, f.y2 = m, f.strokeWidth = v, r(f));
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));
745
719
  }
746
720
  return p;
747
721
  }
748
722
  //#endregion
749
723
  //#region ../core/src/rendering/immediate/marks/text.js
750
- function Re(e) {
724
+ function je(e) {
751
725
  let t = e.properties;
752
726
  return {
753
- align: U(e, t.align),
754
- baseline: U(e, t.baseline),
755
- logoLetters: U(e, t.logoLetters),
756
- paddingX: U(e, t.paddingX),
757
- paddingY: U(e, t.paddingY),
758
- flushX: U(e, t.flushX),
759
- flushY: U(e, t.flushY),
760
- squeeze: U(e, t.squeeze),
761
- dx: U(e, t.dx),
762
- dy: U(e, t.dy)
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)
763
737
  };
764
738
  }
765
- function ze(e, t, n, a) {
766
- let { coords: o, data: s, visibleBounds: l, anchorCullBounds: u } = n, { align: d, baseline: f } = t, p = e.encoders;
767
- if (s.length == 0) return 0;
768
- let m = p.size.constant ? B(p.size, s[0]) : 0, h = p.angle.constant ? B(p.angle, s[0]) : 0, g = R(o, p, "x", s[0]), _ = R(o, p, "y", s[0]), v = e.encoding.text, b = "format" in v ? c(v.format) : (e) => e, x = [0, 0], S = [0, 0], C = {
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 = {
769
743
  width: 0,
770
744
  height: 0
771
745
  }, w = {
@@ -785,55 +759,55 @@ function ze(e, t, n, a) {
785
759
  size: 0,
786
760
  width: 0,
787
761
  angle: 0,
788
- dx: t.dx,
789
- dy: t.dy,
762
+ dx: i.dx,
763
+ dy: i.dy,
790
764
  fadeOpacity: 1,
791
765
  scale: 1,
792
766
  logoScale: void 0,
793
767
  multiCharacterLogo: !1,
794
768
  boundsQuad: D
795
- }, k = !!p.x2, A = !!p.y2, j = 0;
796
- for (let n of s) {
797
- let s = b(p.text(n)), c = r(s) ? s : s === null ? "" : "" + s;
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;
798
772
  if (!c) continue;
799
- g(n, x), _(n, S);
800
- let [v, M] = x, [N, P] = S, F = p.size.constant ? m : B(p.size, n), I = p.angle.constant ? h : B(p.angle, n);
801
- if (t.logoLetters) {
802
- let r = F, i = F;
803
- if (k && (r = M - v, v = (v + M) / 2), A && (i = N - P, N = (N + P) / 2), Be(D, v, N, Math.abs(r), Math.abs(i), "center", "middle", I, t.dx, t.dy), !r || !i || y(u, v, N) || !Ve(l, D)) continue;
804
- let o = e.font.metrics.getChar(c[0]), s = i * e.font.metrics.common.base * (o.height + 10) / (o.height * o.height);
805
- j++, O.datum = n, O.text = c, O.x = v, O.y = N, O.size = 1, O.width = 1, O.angle = I, O.fadeOpacity = 1, O.scale = 1, E.width = r, E.heightScale = s, O.logoScale = E, O.multiCharacterLogo = c.length > 1, a(O);
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);
806
780
  continue;
807
781
  }
808
- let L = e.font.metrics.measureWidth(c, F);
809
- He(L, F, I, C), k || A ? We(d, f, I, w) : (w.x = Ge[d], w.y = Ke[f]);
810
- let R = 1;
811
- if (k && (Ue(Math.min(v, M), Math.max(v, M), C.width, t.paddingX, w.x, t.flushX, o.x, o.x2, T), v = T.position, R *= T.scale), A && (Ue(Math.min(N, P), Math.max(N, P), C.height * R, t.paddingY, w.y, t.flushY, o.y, o.y2, T), N = T.position, R *= T.scale), y(u, v, N)) continue;
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]);
812
784
  let z = 1;
813
- if (R < 1) {
814
- if (!t.squeeze || R < 3 / F) continue;
815
- z = i(3 / F, 6 / F, R);
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);
816
790
  }
817
- let V = F * R, H = L * R;
818
- Be(D, v, N, H, V, d, f, I, t.dx, t.dy), Ve(l, D) && (j++, O.datum = n, O.text = c, O.x = v, O.y = N, O.size = V, O.width = H, O.angle = I, O.fadeOpacity = z, O.scale = R, O.logoScale = void 0, O.multiCharacterLogo = !1, a(O));
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));
819
793
  }
820
794
  return j;
821
795
  }
822
- function Be(e, t, n, r, i, a, o, s, c, l) {
823
- let u = t + c - (Ge[a] + 1) / 2 * r, d = n + l - (Ke[o] + 1) / 2 * i, f = u + r, p = d + i, m = s * Math.PI / 180, h = Math.sin(m), g = Math.cos(m);
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);
824
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;
825
799
  }
826
- function Ve(e, t) {
827
- return b(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);
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);
828
802
  }
829
803
  function $(e, t, n, r, i, a, o, s) {
830
804
  e[t] = n + (i - n) * s - (a - r) * o, e[t + 1] = r + (i - n) * o + (a - r) * s;
831
805
  }
832
- function He(e, t, n, r) {
806
+ function Fe(e, t, n, r) {
833
807
  let i = n * Math.PI / 180, a = Math.abs(Math.sin(i)), o = Math.abs(Math.cos(i));
834
808
  r.width = e * o + t * a, r.height = e * a + t * o;
835
809
  }
836
- function Ue(e, t, n, r, i, a, o, s, c) {
810
+ function Ie(e, t, n, r, i, a, o, s, c) {
837
811
  let l = t - e, u = n + 2 * r;
838
812
  if (e > s || t < o) {
839
813
  c.position = 0, c.scale = 0;
@@ -858,21 +832,21 @@ function Ue(e, t, n, r, i, a, o, s, c) {
858
832
  }
859
833
  c.position = f, c.scale = Math.max(0, Math.min(1, (l - r) / u));
860
834
  }
861
- function We(e, t, n, r) {
862
- let i = Ge[e], a = -Ke[t], o = ((n + 45) % 360 + 360) % 360, s, c;
835
+ function Le(e, t, n, r) {
836
+ let i = Re[e], a = -ze[t], o = ((n + 45) % 360 + 360) % 360, s, c;
863
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;
864
838
  }
865
- var Ge = {
839
+ var Re = {
866
840
  left: -1,
867
841
  center: 0,
868
842
  right: 1
869
- }, Ke = {
843
+ }, ze = {
870
844
  top: -1,
871
845
  middle: 0,
872
846
  bottom: 1,
873
847
  alphabetic: 1,
874
848
  baseline: 1
875
- }, qe = {
849
+ }, Be = {
876
850
  thin: 100,
877
851
  light: 300,
878
852
  regular: 400,
@@ -881,12 +855,12 @@ var Ge = {
881
855
  bold: 700,
882
856
  black: 900
883
857
  };
884
- function Je(e) {
885
- return typeof e == "number" ? e : qe[e];
858
+ function Ve(e) {
859
+ return typeof e == "number" ? e : Be[e];
886
860
  }
887
861
  //#endregion
888
862
  //#region ../core/src/rendering/nativeText.js
889
- var Ye = [
863
+ var He = [
890
864
  "Lato",
891
865
  "Avenir Next",
892
866
  "Avenir",
@@ -897,7 +871,7 @@ var Ye = [
897
871
  "Helvetica",
898
872
  "Arial",
899
873
  "sans-serif"
900
- ], Xe = /* @__PURE__ */ new Set([
874
+ ], Ue = /* @__PURE__ */ new Set([
901
875
  "serif",
902
876
  "sans-serif",
903
877
  "monospace",
@@ -912,11 +886,11 @@ var Ye = [
912
886
  "math",
913
887
  "fangsong"
914
888
  ]);
915
- function Ze(e) {
889
+ function We(e) {
916
890
  let t = e ?? "Lato";
917
- return [t, ...Ye.filter((e) => e.toLowerCase() != t.toLowerCase())].map($e).join(", ");
891
+ return [t, ...He.filter((e) => e.toLowerCase() != t.toLowerCase())].map(Ke).join(", ");
918
892
  }
919
- function Qe(e, t) {
893
+ function Ge(e, t) {
920
894
  switch (e) {
921
895
  case "top": return .79 * t;
922
896
  case "middle": return .35 * t;
@@ -926,9 +900,19 @@ function Qe(e, t) {
926
900
  default: throw Error(`Unknown text baseline: ${e}`);
927
901
  }
928
902
  }
929
- function $e(e) {
903
+ function Ke(e) {
930
904
  let t = e.toLowerCase();
931
- return Xe.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
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);
932
916
  }
933
917
  //#endregion
934
- export { b as A, I as C, _ as D, W as E, m as M, g as O, B as S, U as T, me as _, ze as a, ne as b, je as c, De as d, Oe as f, he as g, _e as h, Re as i, f as j, v as k, Me as l, Ee as m, Qe as n, Ie as o, Te as p, Je as r, Le as s, Ze as t, ke as u, te as v, L as w, re as x, ie as y };
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 };