@genome-spy/app 1.1.0 → 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.
- package/dist/{agentApi-BgZUOeB-.js → agentApi-8hMSlqAQ.js} +8459 -6960
- package/dist/agentApi.es.js +5609 -4236
- package/dist/agentShared.es.js +9 -9
- package/dist/{canvas2d-DiPQvNtZ.js → canvas2d-Bd8H8MMo.js} +149 -134
- package/dist/{canvas2d-t_N10CeW.js → canvas2d-D6VYooRf.js} +136 -122
- package/dist/{clipOptions-Cba4I0AO.js → clipOptions-DElJ8dTZ.js} +2274 -2080
- package/dist/{clipOptions-B5PibDq3.js → clipOptions-D_wBNhzs.js} +2121 -1957
- package/dist/{viewIdentityRegistry-BW415b3o.js → containerView-CRJSc4bM.js} +24 -31
- package/dist/{viewIdentityRegistry-_F0E7nkA.js → containerView-aEVmYmkA.js} +24 -31
- package/dist/{debug-DP4WzTNo.js → debug-CQ0agCrd.js} +9 -9
- package/dist/{debug-CVAlrcZt.js → debug-DkIMiGdW.js} +10 -10
- package/dist/index.es.js +1133 -1115
- package/dist/index.js +757 -513
- package/dist/{indexer-En7gpvLN.js → indexer-DDC0YRGn.js} +1 -1
- package/dist/{indexer-DbFTKGlm.js → indexer-DOYMJ-Md.js} +1 -1
- package/dist/markUtils-CvLDz744.js +75 -0
- package/dist/{metadataChannels-DV62inJh.js → metadataChannels-DLSmx7kU.js} +6 -3
- package/dist/{order-R043xTpC.js → order-BVvkjDRT.js} +369 -316
- package/dist/{order-BkYCnwD7.js → order-DmMoZsi1.js} +360 -308
- package/dist/{rasterExport-C_FcNBkC.js → rasterExport-DxvowWjH.js} +4 -4
- package/dist/{rasterExport-Z7gs5346.js → rasterExport-jeRVq6kY.js} +4 -4
- package/dist/rasterization-CFogVB3B.js +50 -0
- package/dist/rasterization-DFj3Cvx4.js +67 -0
- package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
- package/dist/rectangle-Dl4Dy0hS.js +191 -0
- package/dist/{renderCanvas2D-DK1c9TFK.js → renderCanvas2D-Bfm1NHFu.js} +99 -94
- package/dist/{renderCanvas2D-IM-A9DYG.js → renderCanvas2D-DVjhp834.js} +101 -96
- package/dist/scalePosition-0aeqp_kz.js +18 -0
- package/dist/schema.json +27198 -13709
- package/dist/style.css +1 -1
- package/dist/{svg-DW3tfUmm.js → svg-Bm2zxBPu.js} +316 -317
- package/dist/{svg-PabUdcDi.js → svg-CkfuhONt.js} +290 -291
- package/dist/{svgRasterizer-B6YtWLJs.js → svgRasterizer-DoRQEqFA.js} +3 -3
- package/dist/{svgRasterizer-BEVDyyS3.js → svgRasterizer-raDDhBF-.js} +3 -3
- package/dist/{vega-scale-Byaw1K8O.js → vega-scale-BoGHANI7.js} +90 -90
- package/dist/{vega-scale-Ctz_wa3z.js → vega-scale-o9TRyzYH.js} +699 -699
- package/dist/viewError-BkJeVYXA.js +33 -0
- package/dist/viewError-IYqyluc7.js +33 -0
- package/dist/{viewSelectors-KtD-QSN0.js → viewSelectors-7LyasQN-.js} +572 -478
- package/dist/{viewSelectors-DYz-PhTO.js → viewSelectors-CbmkSQRT.js} +624 -530
- package/dist/{viewUtils-BZGPseMx.js → viewUtils-DuddMNNw.js} +2146 -2016
- package/dist/{webgl-tdKf9SlZ.js → webgl-CQfvgnxo.js} +1247 -1137
- package/dist/{webgl-BKSGqHaz.js → webgl-DVYkXtiZ.js} +1495 -1386
- package/package.json +4 -4
- package/src/spec/view.d.ts +44 -5
- package/dist/rasterization-_-9JmSas.js +0 -63
- package/dist/viewError-BiR9VCgL.js +0 -29
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
|
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
|
|
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
|
|
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) ??
|
|
41
|
-
}
|
|
42
|
-
function
|
|
43
|
-
let o =
|
|
44
|
-
if (t.sampleFacetRenderingOptions)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
92
|
+
function y(e) {
|
|
79
93
|
return e.x1 <= e.x2 && e.y1 <= e.y2;
|
|
80
94
|
}
|
|
81
|
-
function
|
|
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
|
|
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
|
|
90
|
-
function
|
|
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 &&
|
|
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 <=
|
|
103
|
-
let s =
|
|
104
|
-
e.some((e, t) => t != r.polygonIndex &&
|
|
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
|
|
125
|
+
return D(E(n));
|
|
112
126
|
}
|
|
113
|
-
function
|
|
114
|
-
let r =
|
|
115
|
-
if (Math.abs(o) >
|
|
116
|
-
let e =
|
|
117
|
-
e >
|
|
118
|
-
} else Math.abs(
|
|
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
|
|
121
|
-
let r =
|
|
122
|
-
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
|
|
138
|
+
function E(e) {
|
|
125
139
|
let t = /* @__PURE__ */ new Map();
|
|
126
140
|
for (let n of e) {
|
|
127
|
-
let e =
|
|
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
|
|
146
|
+
function D(e) {
|
|
133
147
|
let t = /* @__PURE__ */ new Map();
|
|
134
148
|
for (let n of e) {
|
|
135
|
-
let 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),
|
|
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(
|
|
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
|
|
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 (
|
|
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
|
|
164
|
-
return Math.abs(
|
|
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
|
|
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
|
|
173
|
-
return `${Math.round(e.x /
|
|
186
|
+
function j(e) {
|
|
187
|
+
return `${Math.round(e.x / S)},${Math.round(e.y / S)}`;
|
|
174
188
|
}
|
|
175
|
-
function
|
|
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
|
|
195
|
+
function N(e, t) {
|
|
182
196
|
return e.x * t.x + e.y * t.y;
|
|
183
197
|
}
|
|
184
|
-
function
|
|
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
|
|
190
|
-
|
|
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 =
|
|
205
|
-
if (
|
|
206
|
-
let t =
|
|
207
|
-
|
|
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] =
|
|
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
|
-
|
|
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
|
|
232
|
+
return o(t, r);
|
|
227
233
|
}
|
|
228
234
|
function z(e, t) {
|
|
229
|
-
return
|
|
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
|
|
232
|
-
return n
|
|
247
|
+
function V(t, n) {
|
|
248
|
+
return e(n) ? t.unitView.paramRuntime.evaluateAndGet(n) : n;
|
|
233
249
|
}
|
|
234
|
-
function
|
|
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
|
|
240
|
-
let t = e.properties, n =
|
|
255
|
+
function ee(e) {
|
|
256
|
+
let t = e.properties, n = V(e, t.headSpacing);
|
|
241
257
|
return {
|
|
242
|
-
configuredRHeadSlope:
|
|
243
|
-
configuredRHeadNotchSlope:
|
|
244
|
-
headShape:
|
|
245
|
-
headWidth:
|
|
246
|
-
minSize:
|
|
247
|
-
stem:
|
|
248
|
-
startNotch:
|
|
249
|
-
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:
|
|
268
|
+
headPlacement: V(e, t.headPlacement)
|
|
253
269
|
};
|
|
254
270
|
}
|
|
255
|
-
function
|
|
256
|
-
let { viewOpacity:
|
|
257
|
-
return
|
|
258
|
-
let n = t.stem ?
|
|
259
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
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
|
|
276
|
-
let { coords: i, data: a, visibleBounds: o, countOnly:
|
|
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
|
|
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
|
-
},
|
|
334
|
+
}, h = 0;
|
|
319
335
|
for (let e of a) {
|
|
320
|
-
|
|
321
|
-
let n = te(
|
|
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 =
|
|
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" ?
|
|
336
|
-
a && (
|
|
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 ?
|
|
338
|
-
if (!
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
418
|
+
function se(e, t, n, r) {
|
|
403
419
|
return t * n - (t - e) * Math.min(r, n);
|
|
404
420
|
}
|
|
405
|
-
function
|
|
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
|
|
411
|
-
let t =
|
|
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
|
|
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
|
|
435
|
-
function
|
|
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
|
|
457
|
-
let r =
|
|
458
|
-
return t != "arc" && t != "dome" || r === !1 || r[0] <= 0 || r[1] <= 0 || n &&
|
|
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
|
|
476
|
+
function me(e, t) {
|
|
461
477
|
let n = [], r = (r) => {
|
|
462
|
-
for (let i = 0; i <=
|
|
463
|
-
let a = i /
|
|
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 -
|
|
482
|
+
opacity: 1 - he(c)
|
|
467
483
|
});
|
|
468
484
|
}
|
|
469
485
|
};
|
|
470
486
|
return r(!0), r(!1), n;
|
|
471
487
|
}
|
|
472
|
-
function
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
505
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
594
|
+
function xe(e) {
|
|
566
595
|
return Math.hypot(e[0], e[1]);
|
|
567
596
|
}
|
|
568
|
-
function
|
|
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
|
|
602
|
+
function Ce(e) {
|
|
574
603
|
let t = e.properties;
|
|
575
604
|
return {
|
|
576
|
-
shape:
|
|
577
|
-
orient:
|
|
578
|
-
arcHeightFactor:
|
|
579
|
-
minArcHeight:
|
|
580
|
-
maxChordLength:
|
|
581
|
-
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
|
|
585
|
-
let { coords: i, data: a, visibleBounds: o } = n,
|
|
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
|
|
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
|
-
},
|
|
619
|
+
}, g = m + h.height, _ = s(e, "x") || s(e, "y"), v = 0;
|
|
591
620
|
for (let e of a) {
|
|
592
|
-
|
|
593
|
-
let [
|
|
594
|
-
for (let e of
|
|
595
|
-
let
|
|
596
|
-
|
|
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
|
-
|
|
599
|
-
strokeWidth:
|
|
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
|
|
607
|
-
return { inwardStroke:
|
|
635
|
+
function Te(e) {
|
|
636
|
+
return { inwardStroke: V(e, e.properties.inwardStroke) };
|
|
608
637
|
}
|
|
609
|
-
function
|
|
610
|
-
let { coords: i, data:
|
|
611
|
-
if (
|
|
612
|
-
let
|
|
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 =
|
|
624
|
-
let n =
|
|
625
|
-
if (I(
|
|
626
|
-
|
|
627
|
-
let
|
|
628
|
-
if (
|
|
629
|
-
let
|
|
630
|
-
if (t.inwardStroke &&
|
|
631
|
-
let
|
|
632
|
-
|
|
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
|
|
663
|
+
return C;
|
|
635
664
|
}
|
|
636
665
|
//#endregion
|
|
637
666
|
//#region ../core/src/rendering/immediate/geometry/pointPath.js
|
|
638
|
-
function
|
|
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
|
|
662
|
-
function
|
|
663
|
-
let t = e.properties, n =
|
|
664
|
-
topLeft:
|
|
665
|
-
topRight:
|
|
666
|
-
bottomRight:
|
|
667
|
-
bottomLeft:
|
|
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:
|
|
670
|
-
color:
|
|
671
|
-
offsetX:
|
|
672
|
-
offsetY:
|
|
673
|
-
opacity:
|
|
674
|
-
}, a =
|
|
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:
|
|
678
|
-
minHeight:
|
|
679
|
-
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
|
|
687
|
-
let { coords: i, data: a, visibleBounds: o, viewOpacity:
|
|
688
|
-
if (
|
|
689
|
-
let
|
|
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
|
-
},
|
|
706
|
-
for (let e =
|
|
734
|
+
}, E = 0;
|
|
735
|
+
for (let e = l; e < u; e++) {
|
|
707
736
|
let n = a[e];
|
|
708
|
-
|
|
709
|
-
let i = Math.min(
|
|
710
|
-
l < t.minWidth && (i -= (t.minWidth - l) / 2, l = t.minWidth),
|
|
711
|
-
let
|
|
712
|
-
|
|
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
|
|
743
|
+
return E;
|
|
715
744
|
}
|
|
716
|
-
function
|
|
745
|
+
function je(e, t) {
|
|
717
746
|
return t > 0 && e < t ? e / t : 1;
|
|
718
747
|
}
|
|
719
|
-
function
|
|
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
|
|
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
|
|
729
|
-
return { minLength:
|
|
776
|
+
function Fe(e) {
|
|
777
|
+
return { minLength: V(e, e.properties.minLength) };
|
|
730
778
|
}
|
|
731
|
-
function
|
|
732
|
-
let { coords: i, data: a, visibleBounds: o } = n,
|
|
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
|
|
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
|
-
},
|
|
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
|
-
|
|
744
|
-
let [n,
|
|
745
|
-
if (v
|
|
746
|
-
|
|
747
|
-
|
|
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
|
-
|
|
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
|
|
806
|
+
return _;
|
|
753
807
|
}
|
|
754
808
|
//#endregion
|
|
755
809
|
//#region ../core/src/rendering/immediate/marks/text.js
|
|
756
|
-
function
|
|
810
|
+
function Le(e) {
|
|
757
811
|
let t = e.properties;
|
|
758
812
|
return {
|
|
759
|
-
align:
|
|
760
|
-
baseline:
|
|
761
|
-
logoLetters:
|
|
762
|
-
paddingX:
|
|
763
|
-
paddingY:
|
|
764
|
-
flushX:
|
|
765
|
-
flushY:
|
|
766
|
-
squeeze:
|
|
767
|
-
dx:
|
|
768
|
-
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
|
|
772
|
-
let { coords:
|
|
773
|
-
if (
|
|
774
|
-
let
|
|
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
|
-
},
|
|
831
|
+
}, T = {
|
|
778
832
|
x: 0,
|
|
779
833
|
y: 0
|
|
780
|
-
},
|
|
834
|
+
}, E = {
|
|
781
835
|
position: 0,
|
|
782
836
|
scale: 0
|
|
783
|
-
},
|
|
837
|
+
}, D = {
|
|
784
838
|
scaleX: 0,
|
|
785
839
|
scaleY: 0,
|
|
786
840
|
originX: 0,
|
|
787
841
|
originY: 0
|
|
788
|
-
},
|
|
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:
|
|
797
|
-
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:
|
|
803
|
-
},
|
|
804
|
-
for (let e of
|
|
805
|
-
let
|
|
806
|
-
if (!
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
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
|
-
|
|
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
|
|
818
|
-
|
|
819
|
-
let
|
|
820
|
-
if (
|
|
821
|
-
let
|
|
822
|
-
if (
|
|
823
|
-
if (!
|
|
824
|
-
|
|
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
|
|
827
|
-
|
|
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
|
|
882
|
+
return P;
|
|
830
883
|
}
|
|
831
|
-
function
|
|
832
|
-
let u = t + c - (
|
|
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
|
|
836
|
-
return
|
|
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
|
|
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
|
|
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
|
|
871
|
-
let i =
|
|
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
|
|
927
|
+
var We = {
|
|
875
928
|
left: -1,
|
|
876
929
|
center: 0,
|
|
877
930
|
right: 1
|
|
878
|
-
},
|
|
931
|
+
}, Ge = {
|
|
879
932
|
top: -1,
|
|
880
933
|
middle: 0,
|
|
881
934
|
bottom: 1,
|
|
882
935
|
alphabetic: 1,
|
|
883
936
|
baseline: 1
|
|
884
|
-
},
|
|
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
|
-
],
|
|
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
|
-
]),
|
|
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
|
|
971
|
+
function Ye(e) {
|
|
919
972
|
let t = e ?? "Lato";
|
|
920
|
-
return [t, ...
|
|
973
|
+
return [t, ...Ke.filter((e) => e.toLowerCase() != t.toLowerCase())].map($e).join(", ");
|
|
921
974
|
}
|
|
922
|
-
function
|
|
975
|
+
function Xe(e) {
|
|
923
976
|
if (typeof e == "number") return e;
|
|
924
|
-
let t =
|
|
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
|
|
981
|
+
function Ze(e) {
|
|
929
982
|
return {
|
|
930
983
|
style: e.fontStyle ?? "normal",
|
|
931
|
-
weight:
|
|
932
|
-
family:
|
|
984
|
+
weight: Xe(e.fontWeight ?? "normal"),
|
|
985
|
+
family: Ye(e.font)
|
|
933
986
|
};
|
|
934
987
|
}
|
|
935
|
-
function
|
|
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
|
|
998
|
+
function $e(e) {
|
|
946
999
|
let t = e.toLowerCase();
|
|
947
|
-
return
|
|
1000
|
+
return qe.has(t) ? t : `'${e.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
|
|
948
1001
|
}
|
|
949
1002
|
//#endregion
|
|
950
1003
|
//#region ../core/src/rendering/nativeTextMetrics.js
|
|
951
|
-
var
|
|
1004
|
+
var et = "Mg", tt = 100, nt = class {
|
|
952
1005
|
#e;
|
|
953
1006
|
#t;
|
|
954
|
-
#n = new
|
|
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 =
|
|
1014
|
+
let t = Ze(e), n = this.#n.get(t);
|
|
962
1015
|
if (!n) {
|
|
963
|
-
n = new
|
|
964
|
-
let e = this.#t?.load(
|
|
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 =
|
|
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
|
-
},
|
|
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(
|
|
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 =
|
|
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
|
|
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
|
|
1078
|
+
function at(e, t) {
|
|
1026
1079
|
let n = e.requestFont(t);
|
|
1027
|
-
return n instanceof
|
|
1028
|
-
let t = n.measureWidth(e,
|
|
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
|
|
1090
|
+
function ot(e, t) {
|
|
1038
1091
|
return `${e.style} ${e.weight} ${t}px ${e.family}`;
|
|
1039
1092
|
}
|
|
1040
|
-
function
|
|
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
|
|
1096
|
+
return new nt(t, e.fonts);
|
|
1044
1097
|
}
|
|
1045
|
-
async function
|
|
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
|
|
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,
|
|
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 };
|