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