@genome-spy/app 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agentApi-sPuuT0KS.js → agentApi-8hMSlqAQ.js} +8307 -6861
- package/dist/agentApi.es.js +5569 -4250
- package/dist/agentShared.es.js +9 -9
- package/dist/{canvas2d-iDK4BC5j.js → canvas2d-Bd8H8MMo.js} +149 -134
- package/dist/{canvas2d-MXaFeZnP.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-BDKkEjXl.js → containerView-CRJSc4bM.js} +24 -31
- package/dist/{viewIdentityRegistry-BIYd4TE0.js → containerView-aEVmYmkA.js} +24 -31
- package/dist/{debug-DbigmdrK.js → debug-CQ0agCrd.js} +9 -9
- package/dist/{debug-BlqDxTw3.js → debug-DkIMiGdW.js} +10 -10
- package/dist/index.es.js +3582 -3566
- package/dist/index.js +698 -454
- 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-B4uR9Q04.js → order-BVvkjDRT.js} +369 -316
- package/dist/{order-BSPy5DI8.js → order-DmMoZsi1.js} +360 -308
- package/dist/{rasterExport-DQH3hVg_.js → rasterExport-DxvowWjH.js} +3 -3
- package/dist/{rasterExport-B62RmAK1.js → rasterExport-jeRVq6kY.js} +4 -4
- package/dist/{rasterization-B05bDo5e.js → rasterization-DFj3Cvx4.js} +26 -19
- package/dist/{rectangle-DE98gIxF.js → rectangle-DZTR6NFQ.js} +10 -1
- package/dist/rectangle-Dl4Dy0hS.js +191 -0
- package/dist/{renderCanvas2D-Bdv-B4wj.js → renderCanvas2D-Bfm1NHFu.js} +96 -91
- package/dist/{renderCanvas2D-ChdoHGrU.js → renderCanvas2D-DVjhp834.js} +98 -93
- package/dist/{scalePosition-ByvlXaML.js → scalePosition-0aeqp_kz.js} +8 -1
- package/dist/schema.json +27198 -13709
- package/dist/style.css +1 -1
- package/dist/{svg-N3tj05-e.js → svg-Bm2zxBPu.js} +315 -316
- package/dist/{svg-DHsq1RpV.js → svg-CkfuhONt.js} +290 -291
- package/dist/{svgRasterizer-CYVDlt5z.js → svgRasterizer-DoRQEqFA.js} +2 -2
- package/dist/{svgRasterizer-CvCBlxLj.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-DDLW-byr.js → viewSelectors-7LyasQN-.js} +498 -434
- package/dist/{viewSelectors-j-F9XwsE.js → viewSelectors-CbmkSQRT.js} +549 -485
- package/dist/{viewUtils-JX6CMEYH.js → viewUtils-DuddMNNw.js} +2138 -2009
- package/dist/{webgl-Dw8xqZpX.js → webgl-CQfvgnxo.js} +1229 -1140
- package/dist/{webgl-DdmOwEH0.js → webgl-DVYkXtiZ.js} +1477 -1389
- package/package.json +4 -4
- package/src/spec/view.d.ts +44 -5
- package/dist/viewError-BiR9VCgL.js +0 -29
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as g, n as
|
|
3
|
-
import { H as
|
|
4
|
-
import { t as
|
|
1
|
+
import { At as e, B as t, Bt as n, Dt as r, It as i, Lt as a, Nt as o, O as s, On as c, Pt as l, Sn as u, _n as d, bn as f, dn as p, ft as m, l as ee, o as te, pt as ne, t as re, xn as ie, y as h } from "./clipOptions-D_wBNhzs.js";
|
|
2
|
+
import { a as g, n as ae, r as oe, t as _ } from "./viewError-IYqyluc7.js";
|
|
3
|
+
import { H as se, m as v, y } from "./vega-scale-BoGHANI7.js";
|
|
4
|
+
import { t as ce } from "./warning-CpIIpk8e.js";
|
|
5
5
|
//#region ../core/src/view/layout/flexLayout.js
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
function le(e, t, n = {}) {
|
|
7
|
+
let { sizes: r } = ve(e, t, n.spacing || 0);
|
|
8
|
+
return b(e, r, t, n);
|
|
9
|
+
}
|
|
10
|
+
function b(e, t, n, { spacing: r, devicePixelRatio: i, offset: a, reverse: o } = {}) {
|
|
11
|
+
r ||= 0, a ||= 0;
|
|
12
|
+
let s = 0, c = 0;
|
|
13
|
+
for (let n = 0; n < e.length; n++) s += t[n], C(e[n]) || c++;
|
|
14
|
+
let l = s + Math.max(0, c - 1) * r, u = i === void 0 ? (e) => e : (e) => Math.round(e * i) / i, d = 0, f = [], p = (e) => {
|
|
11
15
|
let t = d;
|
|
12
16
|
if (!t) return;
|
|
13
|
-
let
|
|
14
|
-
m -=
|
|
17
|
+
let n = (e ? r : 0) * (o ? -1 : 1);
|
|
18
|
+
m -= n;
|
|
15
19
|
for (let e = 0; e < t; e++) f.push({
|
|
16
|
-
location: m + (e + 1) / (t + 1) *
|
|
20
|
+
location: m + (e + 1) / (t + 1) * n,
|
|
17
21
|
size: 0
|
|
18
22
|
});
|
|
19
|
-
m +=
|
|
20
|
-
}, m =
|
|
21
|
-
if (e.length == 1 &&
|
|
23
|
+
m += n, d = 0;
|
|
24
|
+
}, m = o ? Math.max(n, l) : 0 + a;
|
|
25
|
+
if (e.length == 1 && C(e[0])) return [{
|
|
22
26
|
location: m,
|
|
23
27
|
size: 0
|
|
24
28
|
}];
|
|
25
|
-
for (let
|
|
26
|
-
let
|
|
27
|
-
if (
|
|
29
|
+
for (let n = 0; n < e.length; n++) {
|
|
30
|
+
let i = e[n];
|
|
31
|
+
if (C(i)) d++;
|
|
28
32
|
else {
|
|
29
33
|
p(f.length > 0);
|
|
30
|
-
let e =
|
|
31
|
-
|
|
34
|
+
let e = t[n];
|
|
35
|
+
o && (m -= e), f.push({
|
|
32
36
|
location: u(m),
|
|
33
37
|
size: u(e)
|
|
34
|
-
}),
|
|
38
|
+
}), o ? m -= r : m += e + r;
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
|
-
return m +=
|
|
41
|
+
return m += o ? r : -r, p(!1), f;
|
|
38
42
|
}
|
|
39
|
-
function
|
|
43
|
+
function ue(e, { spacing: t } = { spacing: 0 }) {
|
|
40
44
|
let n = 0;
|
|
41
|
-
for (let r of e) n += E(r) + (
|
|
45
|
+
for (let r of e) n += E(r) + (C(r) ? 0 : t);
|
|
42
46
|
return Math.max(0, n - t);
|
|
43
47
|
}
|
|
44
|
-
function
|
|
48
|
+
function de(e, t, { spacing: n = 0 } = {}) {
|
|
45
49
|
let r = [], i = [], a = 0, o = 0;
|
|
46
50
|
for (let [s, c] of e.entries()) {
|
|
47
|
-
let e = E(c), l = !
|
|
51
|
+
let e = E(c), l = !C(c), u = o && l ? n : 0;
|
|
48
52
|
i.length && a + u + e > t && (r.push(i), i = [], a = 0, o = 0), i.push(s), a += (o && l ? n : 0) + e, o += +!!l;
|
|
49
53
|
}
|
|
50
54
|
return i.length && r.push(i), r;
|
|
51
55
|
}
|
|
52
|
-
function
|
|
56
|
+
function fe(e) {
|
|
53
57
|
let t = 0, n = 0, r = 0, i, a = !0;
|
|
54
58
|
for (let o of e) {
|
|
55
59
|
t = Math.max(t, o.px ?? 0), n = Math.max(n, o.grow ?? 0), r = Math.max(r, E(o));
|
|
56
60
|
let e = D(o);
|
|
57
61
|
e === void 0 ? a = !1 : i = i === void 0 ? e : Math.max(i, e);
|
|
58
62
|
}
|
|
59
|
-
return
|
|
63
|
+
return A({
|
|
60
64
|
px: t,
|
|
61
65
|
grow: n,
|
|
62
66
|
minPx: r,
|
|
63
67
|
maxPx: a ? i : void 0
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
|
-
function
|
|
67
|
-
let t = {
|
|
68
|
-
px:
|
|
69
|
-
grow: 0,
|
|
70
|
-
minPx:
|
|
71
|
-
maxPx:
|
|
72
|
-
},
|
|
73
|
-
for (let
|
|
74
|
-
|
|
75
|
-
let e = D(
|
|
76
|
-
e === void 0 ?
|
|
77
|
-
}
|
|
78
|
-
return
|
|
79
|
-
}
|
|
80
|
-
var
|
|
70
|
+
function pe(e, t = 0, n = 0) {
|
|
71
|
+
let r = Math.max(0, e.length - 1) * t, i = {
|
|
72
|
+
px: r,
|
|
73
|
+
grow: e.length ? 0 : n,
|
|
74
|
+
minPx: r,
|
|
75
|
+
maxPx: r
|
|
76
|
+
}, a = e.length > 0;
|
|
77
|
+
for (let t of e) {
|
|
78
|
+
i.px += w(t.px), i.grow += w(t.grow), i.minPx += E(t);
|
|
79
|
+
let e = D(t);
|
|
80
|
+
e === void 0 ? a = !1 : i.maxPx += e;
|
|
81
|
+
}
|
|
82
|
+
return a || delete i.maxPx, A(i);
|
|
83
|
+
}
|
|
84
|
+
var x = class e {
|
|
81
85
|
constructor(e, t) {
|
|
82
86
|
this.width = e, this.height = t;
|
|
83
87
|
}
|
|
@@ -88,31 +92,31 @@ var y = class e {
|
|
|
88
92
|
return this.#e(-e.width, -e.height);
|
|
89
93
|
}
|
|
90
94
|
#e(t, n) {
|
|
91
|
-
return new e(
|
|
95
|
+
return new e(k(this.width, t), k(this.height, n));
|
|
92
96
|
}
|
|
93
97
|
isGrowing() {
|
|
94
98
|
return !!(this.width.grow || this.height.grow);
|
|
95
99
|
}
|
|
96
|
-
},
|
|
100
|
+
}, me = Object.freeze({
|
|
97
101
|
px: 0,
|
|
98
102
|
grow: 0
|
|
99
|
-
}),
|
|
100
|
-
function
|
|
103
|
+
}), S = new x(me, me);
|
|
104
|
+
function C(e) {
|
|
101
105
|
return !e.px && !e.grow && !e.minPx;
|
|
102
106
|
}
|
|
103
|
-
function
|
|
107
|
+
function he(e, t) {
|
|
104
108
|
return !e || !t ? !1 : e.px === t.px && e.grow === t.grow && e.minPx === t.minPx && e.maxPx === t.maxPx;
|
|
105
109
|
}
|
|
106
|
-
function
|
|
110
|
+
function w(e) {
|
|
107
111
|
return e || 0;
|
|
108
112
|
}
|
|
109
|
-
function
|
|
110
|
-
return e && (
|
|
113
|
+
function ge(e) {
|
|
114
|
+
return e && (f(e.px) || f(e.grow) || f(e.minPx) || f(e.maxPx));
|
|
111
115
|
}
|
|
112
|
-
function
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
115
|
-
if (
|
|
116
|
+
function _e(e) {
|
|
117
|
+
if (q(e)) throw Error("parseSizeDef does not accept step-based sizes.");
|
|
118
|
+
if (ge(e)) return be(e), A(e);
|
|
119
|
+
if (f(e)) return {
|
|
116
120
|
px: e,
|
|
117
121
|
grow: 0
|
|
118
122
|
};
|
|
@@ -122,80 +126,89 @@ function he(e) {
|
|
|
122
126
|
};
|
|
123
127
|
throw Error(`Invalid sizeDef: ${e}`);
|
|
124
128
|
}
|
|
125
|
-
function
|
|
129
|
+
function ve(e, t, n = 0) {
|
|
126
130
|
let r = !1;
|
|
127
|
-
for (let t of e)
|
|
128
|
-
if (!r) return
|
|
131
|
+
for (let t of e) be(t), r ||= O(t);
|
|
132
|
+
if (!r) return ye(e, t, n);
|
|
129
133
|
let i = Array(e.length).fill(0), a = [];
|
|
130
|
-
for (let t = 0; t < e.length; t++)
|
|
134
|
+
for (let t = 0; t < e.length; t++) C(e[t]) || a.push(t);
|
|
131
135
|
let o = Math.max(0, a.length - 1) * n, s = Math.max(0, t - o), c = /* @__PURE__ */ new Set();
|
|
132
136
|
for (let t of a) {
|
|
133
137
|
let n = e[t];
|
|
134
|
-
|
|
138
|
+
w(n.grow) || (i[t] = T(w(n.px), n), c.add(t));
|
|
135
139
|
}
|
|
140
|
+
let l = 0;
|
|
136
141
|
for (;;) {
|
|
137
142
|
let t = 0, n = 0, r = 0;
|
|
138
|
-
for (let o of a) c.has(o) ? r += i[o] : (t +=
|
|
143
|
+
for (let o of a) c.has(o) ? r += i[o] : (t += w(e[o].px), n += w(e[o].grow));
|
|
139
144
|
if (!n) {
|
|
140
|
-
for (let t of a) c.has(t) || (i[t] = T(
|
|
145
|
+
for (let t of a) c.has(t) || (i[t] = T(w(e[t].px), e[t]), c.add(t));
|
|
141
146
|
break;
|
|
142
147
|
}
|
|
143
|
-
let o = Math.max(0, s - r - t)
|
|
148
|
+
let o = Math.max(0, s - r - t);
|
|
149
|
+
l = o / n;
|
|
150
|
+
let u = 0, d = [], f = [];
|
|
144
151
|
for (let t of a) {
|
|
145
152
|
if (c.has(t)) continue;
|
|
146
|
-
let r = e[t], a =
|
|
153
|
+
let r = e[t], a = w(r.px) + w(r.grow) / n * o, s = T(a, r);
|
|
147
154
|
i[t] = s;
|
|
148
|
-
let
|
|
149
|
-
|
|
155
|
+
let l = s - a;
|
|
156
|
+
u += l, l > 0 ? d.push(t) : l < 0 && f.push(t);
|
|
150
157
|
}
|
|
151
|
-
if (!
|
|
152
|
-
if (
|
|
153
|
-
else if (
|
|
158
|
+
if (!d.length && !f.length) break;
|
|
159
|
+
if (u > 0) for (let e of d) c.add(e);
|
|
160
|
+
else if (u < 0) for (let e of f) c.add(e);
|
|
154
161
|
else for (let e of a) c.add(e);
|
|
155
162
|
}
|
|
156
|
-
return
|
|
163
|
+
return {
|
|
164
|
+
sizes: i,
|
|
165
|
+
growth: l
|
|
166
|
+
};
|
|
157
167
|
}
|
|
158
|
-
function
|
|
168
|
+
function ye(e, t, n) {
|
|
159
169
|
let r = 0, i = 0;
|
|
160
|
-
for (let t of e) r +=
|
|
170
|
+
for (let t of e) r += w(t.px) + (C(t) ? 0 : n), i += w(t.grow);
|
|
161
171
|
r -= n;
|
|
162
172
|
let a = Math.max(0, t - r), o = Array(e.length);
|
|
163
173
|
for (let t = 0; t < e.length; t++) {
|
|
164
174
|
let n = e[t];
|
|
165
|
-
o[t] =
|
|
175
|
+
o[t] = C(n) ? 0 : w(n.px) + (i ? w(n.grow) / i * a : 0);
|
|
166
176
|
}
|
|
167
|
-
return
|
|
177
|
+
return {
|
|
178
|
+
sizes: o,
|
|
179
|
+
growth: i ? a / i : 0
|
|
180
|
+
};
|
|
168
181
|
}
|
|
169
|
-
function
|
|
182
|
+
function be(e) {
|
|
170
183
|
if (e.minPx !== void 0 && e.maxPx !== void 0 && e.minPx > e.maxPx) throw Error("SizeDef minPx cannot be greater than maxPx.");
|
|
171
184
|
}
|
|
172
185
|
function T(e, t) {
|
|
173
186
|
return Math.min(Math.max(e, t.minPx ?? 0), t.maxPx ?? Infinity);
|
|
174
187
|
}
|
|
175
188
|
function E(e) {
|
|
176
|
-
return T(
|
|
189
|
+
return T(w(e.px), e);
|
|
177
190
|
}
|
|
178
191
|
function D(e) {
|
|
179
|
-
return e.maxPx ?? (
|
|
192
|
+
return e.maxPx ?? (w(e.grow) ? void 0 : E(e));
|
|
180
193
|
}
|
|
181
|
-
function
|
|
194
|
+
function O(e) {
|
|
182
195
|
return e.minPx !== void 0 || e.maxPx !== void 0;
|
|
183
196
|
}
|
|
184
|
-
function
|
|
185
|
-
return
|
|
197
|
+
function k(e, t) {
|
|
198
|
+
return A({
|
|
186
199
|
px: (e.px ?? 0) + t,
|
|
187
200
|
grow: e.grow,
|
|
188
201
|
minPx: e.minPx === void 0 ? void 0 : Math.max(0, e.minPx + t),
|
|
189
202
|
maxPx: e.maxPx === void 0 ? void 0 : Math.max(0, e.maxPx + t)
|
|
190
203
|
});
|
|
191
204
|
}
|
|
192
|
-
function
|
|
193
|
-
let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i =
|
|
194
|
-
return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx >
|
|
205
|
+
function A(e) {
|
|
206
|
+
let t = {}, n = e.px !== void 0, r = e.grow !== void 0, i = O(e);
|
|
207
|
+
return e.px ? t.px = e.px : e.px === 0 && (t.px = 0), e.grow ? t.grow = e.grow : e.grow === 0 ? t.grow = 0 : !n && !r && i && (t.grow = 1), e.minPx && e.minPx > w(e.px) && (t.minPx = e.minPx), e.maxPx !== void 0 && (w(t.grow) || e.maxPx < w(e.px)) && (t.maxPx = e.maxPx), t;
|
|
195
208
|
}
|
|
196
209
|
//#endregion
|
|
197
210
|
//#region ../core/src/view/layout/padding.js
|
|
198
|
-
var
|
|
211
|
+
var j = class e {
|
|
199
212
|
constructor(e, t, n, r) {
|
|
200
213
|
this.top = e || 0, this.right = t || 0, this.bottom = n || 0, this.left = r || 0;
|
|
201
214
|
}
|
|
@@ -230,35 +243,35 @@ var k = class e {
|
|
|
230
243
|
return this.top + this.bottom;
|
|
231
244
|
}
|
|
232
245
|
static createFromConfig(e) {
|
|
233
|
-
return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) :
|
|
246
|
+
return typeof e == "number" ? this.createUniformPadding(e) : e ? this.createFromRecord(e) : M;
|
|
234
247
|
}
|
|
235
248
|
static createFromRecord(t) {
|
|
236
249
|
return new e(t.top, t.right, t.bottom, t.left);
|
|
237
250
|
}
|
|
238
251
|
static zero() {
|
|
239
|
-
return
|
|
252
|
+
return M;
|
|
240
253
|
}
|
|
241
254
|
static createUniformPadding(t) {
|
|
242
255
|
return new e(t, t, t, t);
|
|
243
256
|
}
|
|
244
257
|
};
|
|
245
|
-
function
|
|
246
|
-
return t ? new
|
|
258
|
+
function xe(e, t, n = j.zero()) {
|
|
259
|
+
return t ? new j(t.top === !1 ? n.top : e.top, t.right === !1 ? n.right : e.right, t.bottom === !1 ? n.bottom : e.bottom, t.left === !1 ? n.left : e.left) : e;
|
|
247
260
|
}
|
|
248
|
-
var
|
|
249
|
-
Object.freeze(
|
|
261
|
+
var M = j.createUniformPadding(0);
|
|
262
|
+
Object.freeze(M);
|
|
250
263
|
//#endregion
|
|
251
264
|
//#region ../core/src/utils/url.js
|
|
252
|
-
var
|
|
253
|
-
function
|
|
254
|
-
if (t &&
|
|
265
|
+
var Se = /^([A-Za-z]+:)?\/\//;
|
|
266
|
+
function N(e, t) {
|
|
267
|
+
if (t && Se.test(t)) return t;
|
|
255
268
|
let n = typeof e == "function" ? e() : e;
|
|
256
269
|
if (!n) return t;
|
|
257
270
|
if (!t) return n;
|
|
258
271
|
if (/[#?]/.test(n)) throw Error(`Cannot append to a url with query or hash. Append: ${t}, base: ${n}`);
|
|
259
|
-
return
|
|
272
|
+
return P(n) + t;
|
|
260
273
|
}
|
|
261
|
-
function
|
|
274
|
+
function Ce(e, t, n = we()) {
|
|
262
275
|
let r = typeof e == "function" ? e() : e;
|
|
263
276
|
if (!t) return r;
|
|
264
277
|
try {
|
|
@@ -268,19 +281,19 @@ function Se(e, t, n = Ce()) {
|
|
|
268
281
|
}
|
|
269
282
|
if (n) return new URL(t, n).href;
|
|
270
283
|
} catch {}
|
|
271
|
-
return
|
|
284
|
+
return N(r, t);
|
|
272
285
|
}
|
|
273
|
-
function
|
|
286
|
+
function P(e) {
|
|
274
287
|
let t = e.replace(/[^/]*$/, "");
|
|
275
288
|
return t === "" ? void 0 : t.endsWith("://") ? e + "/" : t;
|
|
276
289
|
}
|
|
277
|
-
function
|
|
290
|
+
function we() {
|
|
278
291
|
if (typeof document < "u" && document.baseURI) return document.baseURI;
|
|
279
292
|
if (typeof window < "u" && window.location?.href) return window.location.href;
|
|
280
293
|
}
|
|
281
294
|
//#endregion
|
|
282
295
|
//#region ../../node_modules/flatqueue/index.js
|
|
283
|
-
var
|
|
296
|
+
var F = class {
|
|
284
297
|
constructor(e = Infinity, t = Float64Array, n = Uint32Array) {
|
|
285
298
|
let r = e !== Infinity;
|
|
286
299
|
this.ids = r ? new n(e) : [], this.values = r ? new t(e) : [], this.capacity = e, this.length = 0;
|
|
@@ -321,11 +334,11 @@ var N = class {
|
|
|
321
334
|
shrink() {
|
|
322
335
|
Array.isArray(this.ids) && (this.ids.length = this.length), Array.isArray(this.values) && (this.values.length = this.length);
|
|
323
336
|
}
|
|
324
|
-
},
|
|
325
|
-
function
|
|
337
|
+
}, I = Symbol("runtimeNode"), L = 1e6;
|
|
338
|
+
function Te(e) {
|
|
326
339
|
return e ? (t, n) => e.addDisposer(t, n) : () => () => void 0;
|
|
327
340
|
}
|
|
328
|
-
function
|
|
341
|
+
function R(e, t, n = !0) {
|
|
329
342
|
let r = {
|
|
330
343
|
id: e.id,
|
|
331
344
|
name: e.name,
|
|
@@ -340,7 +353,7 @@ function I(e, t, n = !0) {
|
|
|
340
353
|
};
|
|
341
354
|
}
|
|
342
355
|
};
|
|
343
|
-
return Object.defineProperty(r,
|
|
356
|
+
return Object.defineProperty(r, I, {
|
|
344
357
|
enumerable: !1,
|
|
345
358
|
configurable: !1,
|
|
346
359
|
writable: !1,
|
|
@@ -349,18 +362,18 @@ function I(e, t, n = !0) {
|
|
|
349
362
|
t(e);
|
|
350
363
|
} }) : r;
|
|
351
364
|
}
|
|
352
|
-
function
|
|
353
|
-
let t = e[
|
|
365
|
+
function Ee(e) {
|
|
366
|
+
let t = e[I];
|
|
354
367
|
if (!t) throw Error("ParamRef is not bound to this graph runtime. Expected runtime-created ref.");
|
|
355
368
|
return t;
|
|
356
369
|
}
|
|
357
|
-
function Ee(e) {
|
|
358
|
-
return typeof e.rank == "number" ? e.rank : Te(e).rank;
|
|
359
|
-
}
|
|
360
370
|
function De(e) {
|
|
371
|
+
return typeof e.rank == "number" ? e.rank : Ee(e).rank;
|
|
372
|
+
}
|
|
373
|
+
function Oe(e) {
|
|
361
374
|
for (let t of e) t();
|
|
362
375
|
}
|
|
363
|
-
var
|
|
376
|
+
var ke = class {
|
|
364
377
|
#e = 1;
|
|
365
378
|
#t = 1;
|
|
366
379
|
#n = 0;
|
|
@@ -374,13 +387,13 @@ var Oe = class {
|
|
|
374
387
|
#u = /* @__PURE__ */ new Map();
|
|
375
388
|
#d = /* @__PURE__ */ new Set();
|
|
376
389
|
#f = /* @__PURE__ */ new Set();
|
|
377
|
-
#p = new
|
|
378
|
-
#m = new
|
|
390
|
+
#p = new F();
|
|
391
|
+
#m = new F();
|
|
379
392
|
#h = /* @__PURE__ */ new Set();
|
|
380
393
|
#g;
|
|
381
394
|
#_;
|
|
382
395
|
constructor(e = {}) {
|
|
383
|
-
this.#g =
|
|
396
|
+
this.#g = Te(e.lifecycleRegistry), this.#_ = e.onError;
|
|
384
397
|
}
|
|
385
398
|
createWritable(e, t, n, r, i = {}) {
|
|
386
399
|
let a = "n" + this.#e++, o = i.notify ?? !0, s = {
|
|
@@ -402,7 +415,7 @@ var Oe = class {
|
|
|
402
415
|
}, l = () => {
|
|
403
416
|
s.disposed = !0, s.listeners.clear(), u();
|
|
404
417
|
}, u = this.#g(e, l);
|
|
405
|
-
return Object.assign(
|
|
418
|
+
return Object.assign(R(s, c, o), { dispose: l });
|
|
406
419
|
}
|
|
407
420
|
computed(e, t, n, r, i = {}) {
|
|
408
421
|
return this.#v(e, t, n, r, i);
|
|
@@ -437,12 +450,12 @@ var Oe = class {
|
|
|
437
450
|
})), l = c(), u = () => {
|
|
438
451
|
s.disposed || (s.disposed = !0, d(), l.forEach((e) => e()), s.listeners.clear(), this.#d.delete(s));
|
|
439
452
|
}, d = this.#g(e, u);
|
|
440
|
-
return Object.assign(
|
|
453
|
+
return Object.assign(R(s), {
|
|
441
454
|
dispose: u,
|
|
442
455
|
rebind: (e, n) => {
|
|
443
456
|
if (s.disposed) throw Error("Cannot rebind disposed operation: " + t);
|
|
444
457
|
let r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
445
|
-
let n = e[
|
|
458
|
+
let n = e[I];
|
|
446
459
|
if (n === s) throw Error("Reactive dependency cycle: " + t);
|
|
447
460
|
if (!r.has(n)) {
|
|
448
461
|
r.add(n);
|
|
@@ -543,7 +556,7 @@ var Oe = class {
|
|
|
543
556
|
#y(e) {
|
|
544
557
|
this.#s++;
|
|
545
558
|
try {
|
|
546
|
-
|
|
559
|
+
Oe(e);
|
|
547
560
|
} catch (e) {
|
|
548
561
|
throw this.#c = !1, !this.#o && this.#s === 1 && this.#b(e), e;
|
|
549
562
|
} finally {
|
|
@@ -587,7 +600,7 @@ var Oe = class {
|
|
|
587
600
|
}
|
|
588
601
|
#S(e) {
|
|
589
602
|
let t = -1, n = 0;
|
|
590
|
-
return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e,
|
|
603
|
+
return () => (t !== this.#n && (n = 1 + e().reduce((e, t) => Math.max(e, De(t)), 0), t = this.#n), n);
|
|
591
604
|
}
|
|
592
605
|
#C(e) {
|
|
593
606
|
if (this.#d.has(e)) {
|
|
@@ -604,8 +617,8 @@ var Oe = class {
|
|
|
604
617
|
this.#f.add(e), this.#m.push(e, this.#T(e.rank)), this.#E();
|
|
605
618
|
}
|
|
606
619
|
#T(e) {
|
|
607
|
-
let t = this.#t %
|
|
608
|
-
return this.#t += 1, e *
|
|
620
|
+
let t = this.#t % L;
|
|
621
|
+
return this.#t += 1, e * L + t;
|
|
609
622
|
}
|
|
610
623
|
#E() {
|
|
611
624
|
this.#r > 0 || this.#a || this.#o || (this.#a = !0, queueMicrotask(() => {
|
|
@@ -621,7 +634,7 @@ var Oe = class {
|
|
|
621
634
|
this.#h.clear();
|
|
622
635
|
}
|
|
623
636
|
}
|
|
624
|
-
},
|
|
637
|
+
}, Ae = class {
|
|
625
638
|
#e = 1;
|
|
626
639
|
#t = /* @__PURE__ */ new Map();
|
|
627
640
|
createOwner(e, t) {
|
|
@@ -642,7 +655,7 @@ var Oe = class {
|
|
|
642
655
|
t.clear(), this.#t.delete(e);
|
|
643
656
|
}
|
|
644
657
|
}
|
|
645
|
-
},
|
|
658
|
+
}, je = class {
|
|
646
659
|
#e = 1;
|
|
647
660
|
#t = /* @__PURE__ */ new Map();
|
|
648
661
|
createRootScope(e) {
|
|
@@ -673,41 +686,41 @@ var Oe = class {
|
|
|
673
686
|
if (!t) throw Error("Unknown scope: " + e);
|
|
674
687
|
t.params.clear(), t.initializers.clear();
|
|
675
688
|
}
|
|
676
|
-
registerInitializer(e,
|
|
677
|
-
t
|
|
689
|
+
registerInitializer(e, t, r) {
|
|
690
|
+
n(t);
|
|
678
691
|
let i = this.#t.get(e);
|
|
679
692
|
if (!i) throw Error("Unknown scope: " + e);
|
|
680
|
-
if (i.params.has(
|
|
681
|
-
i.initializers.set(
|
|
693
|
+
if (i.params.has(t) || i.initializers.has(t)) throw Error(`Parameter "${t}" already exists in scope ${e}`);
|
|
694
|
+
i.initializers.set(t, {
|
|
682
695
|
initialize: r,
|
|
683
696
|
initializing: !1
|
|
684
697
|
});
|
|
685
698
|
}
|
|
686
|
-
register(e,
|
|
687
|
-
t
|
|
699
|
+
register(e, t, r) {
|
|
700
|
+
n(t);
|
|
688
701
|
let i = this.#t.get(e);
|
|
689
702
|
if (!i) throw Error("Unknown scope: " + e);
|
|
690
|
-
if (i.params.has(
|
|
691
|
-
return i.params.set(
|
|
703
|
+
if (i.params.has(t) || i.initializers.get(t)?.initializing === !1) throw Error("Parameter \"" + t + "\" already exists in scope " + e);
|
|
704
|
+
return i.params.set(t, r), r;
|
|
692
705
|
}
|
|
693
|
-
resolve(e,
|
|
694
|
-
t
|
|
706
|
+
resolve(e, t) {
|
|
707
|
+
n(t);
|
|
695
708
|
let r = e;
|
|
696
709
|
for (; r;) {
|
|
697
710
|
let e = this.#t.get(r);
|
|
698
711
|
if (!e) throw Error("Unknown scope: " + r);
|
|
699
|
-
let
|
|
700
|
-
if (
|
|
701
|
-
if (
|
|
702
|
-
|
|
712
|
+
let n = e.initializers.get(t);
|
|
713
|
+
if (n) {
|
|
714
|
+
if (n.initializing) throw Error(`Parameter dependency cycle while initializing "${t}" in ${r}.`);
|
|
715
|
+
n.initializing = !0;
|
|
703
716
|
try {
|
|
704
|
-
if (
|
|
705
|
-
e.initializers.delete(
|
|
717
|
+
if (n.initialize(), !e.params.has(t)) throw Error(`Initializer did not register parameter "${t}".`);
|
|
718
|
+
e.initializers.delete(t);
|
|
706
719
|
} finally {
|
|
707
|
-
|
|
720
|
+
n.initializing = !1;
|
|
708
721
|
}
|
|
709
722
|
}
|
|
710
|
-
let i = e.params.get(
|
|
723
|
+
let i = e.params.get(t);
|
|
711
724
|
if (i) return i;
|
|
712
725
|
r = e.parentScope;
|
|
713
726
|
}
|
|
@@ -715,60 +728,64 @@ var Oe = class {
|
|
|
715
728
|
};
|
|
716
729
|
//#endregion
|
|
717
730
|
//#region ../core/src/paramRuntime/expressionCompiler.js
|
|
718
|
-
function
|
|
719
|
-
return
|
|
731
|
+
function Me(e, t = {}, n = {}) {
|
|
732
|
+
return ne(e, t, n);
|
|
720
733
|
}
|
|
721
734
|
//#endregion
|
|
722
735
|
//#region ../core/src/paramRuntime/expressionRef.js
|
|
723
|
-
function
|
|
724
|
-
let
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
736
|
+
function z(t, n, r = {}) {
|
|
737
|
+
let i = {}, a = Me(t, i, r), o = /* @__PURE__ */ new Map();
|
|
738
|
+
try {
|
|
739
|
+
for (let e of a.globals) {
|
|
740
|
+
if (o.has(e)) continue;
|
|
741
|
+
let r = n(e);
|
|
742
|
+
if (!r) throw Error("Unknown variable \"" + e + "\" in expression: " + t);
|
|
743
|
+
o.set(e, r), Object.defineProperty(i, e, {
|
|
744
|
+
enumerable: !0,
|
|
745
|
+
get() {
|
|
746
|
+
return r.get();
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
} catch (t) {
|
|
751
|
+
throw e(t, r.specLocation);
|
|
735
752
|
}
|
|
736
|
-
let
|
|
737
|
-
return
|
|
753
|
+
let s = /* @__PURE__ */ new Set();
|
|
754
|
+
return a.subscribe = (e) => {
|
|
738
755
|
let t = [];
|
|
739
|
-
for (let n of
|
|
740
|
-
for (let n of
|
|
756
|
+
for (let n of o.values()) t.push(n.subscribe(e));
|
|
757
|
+
for (let n of a.scaleDependencies ?? []) t.push(n.subscribe(e));
|
|
741
758
|
let n = !0, r = () => {
|
|
742
|
-
n && (n = !1,
|
|
759
|
+
n && (n = !1, s.delete(r), t.forEach((e) => e()));
|
|
743
760
|
};
|
|
744
|
-
return
|
|
745
|
-
},
|
|
746
|
-
for (let e of
|
|
747
|
-
|
|
748
|
-
},
|
|
761
|
+
return s.add(r), r;
|
|
762
|
+
}, a.invalidate = () => {
|
|
763
|
+
for (let e of s) e();
|
|
764
|
+
s.clear();
|
|
765
|
+
}, a.createSnapshotEvaluator = () => {
|
|
749
766
|
let e = {};
|
|
750
|
-
for (let t of Object.keys(
|
|
751
|
-
for (let [t, n] of
|
|
767
|
+
for (let t of Object.keys(i)) o.has(t) || (e[t] = i[t]);
|
|
768
|
+
for (let [t, n] of o) n.batchStable || Object.defineProperty(e, t, {
|
|
752
769
|
enumerable: !0,
|
|
753
770
|
get: () => n.get()
|
|
754
771
|
});
|
|
755
|
-
let t = Object.assign(
|
|
756
|
-
for (let [t, n] of
|
|
772
|
+
let t = Object.assign(a.createEvaluator(e), { refresh() {
|
|
773
|
+
for (let [t, n] of o) n.batchStable && (e[t] = n.get());
|
|
757
774
|
} });
|
|
758
775
|
return t.refresh(), t;
|
|
759
|
-
},
|
|
760
|
-
expression:
|
|
761
|
-
dependencies:
|
|
776
|
+
}, a.identifier = () => a.code + "|" + Array.from(o.values()).map((e) => e.id).concat((a.scaleDependencies ?? []).map((e) => e.id)).join(","), a.dependencies = Array.from(o.values()).concat(a.scaleDependencies ?? []), {
|
|
777
|
+
expression: a,
|
|
778
|
+
dependencies: a.dependencies
|
|
762
779
|
};
|
|
763
780
|
}
|
|
764
781
|
//#endregion
|
|
765
782
|
//#region ../core/src/paramRuntime/paramRuntime.js
|
|
766
783
|
var Ne = class {
|
|
767
|
-
#e = new
|
|
784
|
+
#e = new Ae();
|
|
768
785
|
#t;
|
|
769
|
-
#n = new
|
|
786
|
+
#n = new je();
|
|
770
787
|
constructor(e = {}) {
|
|
771
|
-
this.#t = new
|
|
788
|
+
this.#t = new ke({
|
|
772
789
|
lifecycleRegistry: this.#e,
|
|
773
790
|
onError: e.onError
|
|
774
791
|
});
|
|
@@ -797,11 +814,11 @@ var Ne = class {
|
|
|
797
814
|
return this.#n.register(e, t, a);
|
|
798
815
|
}
|
|
799
816
|
registerDerived(e, t, n, r) {
|
|
800
|
-
let { expression: i, dependencies: a } =
|
|
817
|
+
let { expression: i, dependencies: a } = z(n, (t) => this.resolve(r?.expressionScope ?? e, t), r), o = this.#n.getOwnerId(e), s = this.#t.computed(o, t, a, () => i(null));
|
|
801
818
|
return this.#n.register(e, t, s);
|
|
802
819
|
}
|
|
803
820
|
createExpression(e, t, n) {
|
|
804
|
-
let { expression: r } =
|
|
821
|
+
let { expression: r } = z(t, (t) => this.resolve(e, t), n);
|
|
805
822
|
return r;
|
|
806
823
|
}
|
|
807
824
|
resolve(e, t) {
|
|
@@ -925,7 +942,7 @@ function ze() {
|
|
|
925
942
|
}
|
|
926
943
|
//#endregion
|
|
927
944
|
//#region ../core/src/paramRuntime/viewParamRuntime.js
|
|
928
|
-
var
|
|
945
|
+
var B = class {
|
|
929
946
|
#e;
|
|
930
947
|
#t;
|
|
931
948
|
#n = /* @__PURE__ */ new Map();
|
|
@@ -941,9 +958,10 @@ var Be = class {
|
|
|
941
958
|
#f;
|
|
942
959
|
#p;
|
|
943
960
|
#m;
|
|
944
|
-
#h
|
|
961
|
+
#h;
|
|
962
|
+
#g = !1;
|
|
945
963
|
constructor(e, t, n, r = {}) {
|
|
946
|
-
this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
|
|
964
|
+
this.#d = e ?? (() => void 0), this.#f = t ?? (() => void 0), this.#p = n, this.#h = r.getSpecOrigin, this.#m = r.settleTemporalUpdatesImmediately ?? !1;
|
|
947
965
|
let i = this.#d();
|
|
948
966
|
i ? (this.#e = i.#e, this.#t = this.#e.createScope(i.#t)) : (this.#e = new Ne({ onError: r.onError }), this.#t = this.#e.createScope());
|
|
949
967
|
}
|
|
@@ -964,38 +982,46 @@ var Be = class {
|
|
|
964
982
|
if (o) throw Error(`Conflicting selection declarations for "${e}" in "${i.location}" and "${o.location}".`);
|
|
965
983
|
return i;
|
|
966
984
|
}
|
|
967
|
-
#
|
|
985
|
+
#_(e) {
|
|
968
986
|
if (!("select" in e)) return;
|
|
969
|
-
let
|
|
970
|
-
kind:
|
|
971
|
-
components:
|
|
987
|
+
let n = t(e.select), r = n.type === "interval" ? "interval" : n.toggle ? "multi" : "single", i = n.type === "interval" ? Array.from(new Set(n.encodings)).sort() : [], a = e.push === "outer" ? this.findRuntimeForParam(e.name) : this, o = {
|
|
988
|
+
kind: r,
|
|
989
|
+
components: i,
|
|
972
990
|
source: this.#s
|
|
973
991
|
}, s = a.#c.get(e.name) ?? /* @__PURE__ */ new Set(), c = s.values().next().value;
|
|
974
|
-
if (c && (c.kind !==
|
|
992
|
+
if (c && (c.kind !== r || JSON.stringify(c.components) !== JSON.stringify(i))) throw Error(`Conflicting selection declarations for "${e.name}" in "${c.source?.name ?? e.name}" and "${this.#s?.name ?? e.name}".`);
|
|
975
993
|
s.add(o), a.#c.set(e.name, s), this.#e.addScopeDisposer(this.#t, () => {
|
|
976
994
|
s.delete(o);
|
|
977
995
|
});
|
|
978
996
|
}
|
|
979
|
-
|
|
980
|
-
return {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
997
|
+
#v(e) {
|
|
998
|
+
return {
|
|
999
|
+
resolveScaleResolution: this.#f,
|
|
1000
|
+
specLocation: this.getSpecLocation(e, ["expr"])
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
registerParam(t, r = {}) {
|
|
1004
|
+
let i = t.name;
|
|
1005
|
+
try {
|
|
1006
|
+
n(i);
|
|
1007
|
+
} catch (n) {
|
|
1008
|
+
throw e(n, this.getSpecLocation(t, ["name"]));
|
|
1009
|
+
}
|
|
1010
|
+
if (this.#i.has(i) || this.#a.has(i)) throw e(/* @__PURE__ */ Error("Parameter \"" + i + "\" already registered in this scope."), this.getSpecLocation(t, ["name"]));
|
|
1011
|
+
if (Ve(t), r.defer) {
|
|
1012
|
+
if (!("expr" in t)) throw Error("Only expression parameters can be deferred.");
|
|
1013
|
+
return this.#e.registerInitializer(this.#t, i, () => {
|
|
1014
|
+
this.#y(t);
|
|
1015
|
+
}), this.#i.set(i, t), () => {
|
|
1016
|
+
throw Error("Cannot set derived parameter \"" + i + "\".");
|
|
991
1017
|
};
|
|
992
1018
|
}
|
|
993
|
-
return this.#
|
|
1019
|
+
return this.#y(t);
|
|
994
1020
|
}
|
|
995
1021
|
registerLazyExpression(e, t, n) {
|
|
996
1022
|
this.#e.registerInitializer(this.#t, e, () => {
|
|
997
1023
|
n?.();
|
|
998
|
-
let r = this.#e.registerDerived(this.#t, e, t, this.#
|
|
1024
|
+
let r = this.#e.registerDerived(this.#t, e, t, this.#v());
|
|
999
1025
|
this.#r.set(e, r);
|
|
1000
1026
|
}), this.#a.add(e);
|
|
1001
1027
|
}
|
|
@@ -1005,7 +1031,7 @@ var Be = class {
|
|
|
1005
1031
|
this.#e.registerInitializer(this.#t, e, () => {
|
|
1006
1032
|
let r = this.#e.registerDerived(this.#t, e, t, {
|
|
1007
1033
|
expressionScope: n.#t,
|
|
1008
|
-
...n.#
|
|
1034
|
+
...n.#v()
|
|
1009
1035
|
});
|
|
1010
1036
|
this.#r.set(e, r);
|
|
1011
1037
|
}), this.#i.set(e, {
|
|
@@ -1013,65 +1039,65 @@ var Be = class {
|
|
|
1013
1039
|
expr: t
|
|
1014
1040
|
});
|
|
1015
1041
|
}
|
|
1016
|
-
#
|
|
1017
|
-
let
|
|
1018
|
-
if (
|
|
1019
|
-
let
|
|
1020
|
-
if (!
|
|
1021
|
-
let
|
|
1022
|
-
if (!
|
|
1023
|
-
if ("expr" in
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
}, this.#n.set(
|
|
1027
|
-
} else if ("value" in
|
|
1028
|
-
else if (
|
|
1029
|
-
if ("transition" in
|
|
1030
|
-
else if ("debounce" in
|
|
1042
|
+
#y(t) {
|
|
1043
|
+
let n = t.name, r, i;
|
|
1044
|
+
if (t.push == "outer") {
|
|
1045
|
+
let a = this.findRuntimeForParam(n);
|
|
1046
|
+
if (!a) throw e(/* @__PURE__ */ Error(`Parameter "${n}" not found in outer scope!`), this.getSpecLocation(t, ["name"]));
|
|
1047
|
+
let s = a.paramConfigs.get(n);
|
|
1048
|
+
if (!s) throw Error(`Outer parameter "${n}" exists as a value but has no registered config.`);
|
|
1049
|
+
if ("expr" in s || "select" in s || "ruler" in s) throw Error(`The outer parameter "${n}" must not have expr, select, or ruler properties!`);
|
|
1050
|
+
r = (e) => {
|
|
1051
|
+
a.setValue(n, e);
|
|
1052
|
+
}, this.#n.set(n, r), "ruler" in t && (i = o(t, this), r(i));
|
|
1053
|
+
} else if ("value" in t) i = o(t, this), r = "transition" in t ? this.#x(n, i, t.transition) : this.#b(n, i);
|
|
1054
|
+
else if (l(t)) {
|
|
1055
|
+
if ("transition" in t) this.#S(n, t, t.transition);
|
|
1056
|
+
else if ("debounce" in t) this.#C(n, t, t.debounce);
|
|
1031
1057
|
else {
|
|
1032
|
-
let
|
|
1033
|
-
this.#r.set(
|
|
1058
|
+
let e = this.#e.registerDerived(this.#t, n, t.expr, this.#v(t));
|
|
1059
|
+
this.#r.set(n, e);
|
|
1034
1060
|
}
|
|
1035
|
-
|
|
1036
|
-
throw Error("Cannot set derived parameter \"" +
|
|
1061
|
+
r = () => {
|
|
1062
|
+
throw Error("Cannot set derived parameter \"" + n + "\".");
|
|
1037
1063
|
};
|
|
1038
|
-
} else
|
|
1039
|
-
if ("select" in
|
|
1040
|
-
if (
|
|
1041
|
-
let e = this.#e.registerSelection(this.#t,
|
|
1042
|
-
this.#r.set(
|
|
1064
|
+
} else i = o(t, this), r = this.#b(n, i);
|
|
1065
|
+
if ("select" in t) {
|
|
1066
|
+
if (i ??= o(t, this), !this.#n.has(n)) {
|
|
1067
|
+
let e = this.#e.registerSelection(this.#t, n, i);
|
|
1068
|
+
this.#r.set(n, e), this.#n.set(n, (t) => {
|
|
1043
1069
|
e.set(t), this.#e.flushNow();
|
|
1044
|
-
}),
|
|
1070
|
+
}), r = this.#n.get(n);
|
|
1045
1071
|
}
|
|
1046
|
-
|
|
1072
|
+
r(i);
|
|
1047
1073
|
}
|
|
1048
|
-
return this.#i.set(
|
|
1074
|
+
return this.#i.set(n, t), this.#_(t), r;
|
|
1049
1075
|
}
|
|
1050
|
-
allocateSetter(e,
|
|
1051
|
-
if (
|
|
1052
|
-
let i = this.#e.registerBase(this.#t, e,
|
|
1076
|
+
allocateSetter(e, t, r = !1) {
|
|
1077
|
+
if (n(e), this.#n.has(e)) throw Error("Setter already allocated for parameter: " + e);
|
|
1078
|
+
let i = this.#e.registerBase(this.#t, e, t, { notify: !r });
|
|
1053
1079
|
this.#r.set(e, i);
|
|
1054
1080
|
let a = (e) => {
|
|
1055
1081
|
i.set(e), this.#e.flushNow();
|
|
1056
1082
|
};
|
|
1057
1083
|
return this.#n.set(e, a), a;
|
|
1058
1084
|
}
|
|
1059
|
-
setValue(e,
|
|
1060
|
-
|
|
1085
|
+
setValue(e, t, r) {
|
|
1086
|
+
n(e);
|
|
1061
1087
|
let i = this.#n.get(e);
|
|
1062
1088
|
if (!i) throw Error("Writable parameter not found in this scope: " + e);
|
|
1063
|
-
i(
|
|
1089
|
+
i(t, r);
|
|
1064
1090
|
}
|
|
1065
1091
|
getValue(e) {
|
|
1066
1092
|
return !this.#r.has(e) && this.hasLocalParam(e) && this.#e.resolve(this.#t, e), this.#r.get(e)?.get();
|
|
1067
1093
|
}
|
|
1068
1094
|
getParamRef(e) {
|
|
1069
|
-
|
|
1070
|
-
let
|
|
1071
|
-
if (
|
|
1095
|
+
n(e);
|
|
1096
|
+
let t = this.findRuntimeForParam(e);
|
|
1097
|
+
if (t) return t.#r.has(e) || t.#e.resolve(t.#t, e), t.#r.get(e);
|
|
1072
1098
|
}
|
|
1073
1099
|
getTargetValue(e) {
|
|
1074
|
-
return
|
|
1100
|
+
return n(e), this.#l.get(e)?.target ?? this.#u.get(e)?.target ?? this.getValue(e);
|
|
1075
1101
|
}
|
|
1076
1102
|
subscribe(e, t) {
|
|
1077
1103
|
let n = this.getParamRef(e);
|
|
@@ -1088,16 +1114,16 @@ var Be = class {
|
|
|
1088
1114
|
return this.#i;
|
|
1089
1115
|
}
|
|
1090
1116
|
hasLocalParam(e) {
|
|
1091
|
-
|
|
1092
|
-
let
|
|
1093
|
-
return this.#r.has(e) || this.#a.has(e) ||
|
|
1117
|
+
n(e);
|
|
1118
|
+
let t = this.#i.get(e);
|
|
1119
|
+
return this.#r.has(e) || this.#a.has(e) || t !== void 0 && "expr" in t;
|
|
1094
1120
|
}
|
|
1095
1121
|
isPendingParam(e) {
|
|
1096
1122
|
let t = this.findRuntimeForParam(e);
|
|
1097
1123
|
return t !== void 0 && !t.#r.has(e);
|
|
1098
1124
|
}
|
|
1099
1125
|
hasConfiguredParamInScopeChain(e) {
|
|
1100
|
-
return
|
|
1126
|
+
return n(e), this.#i.has(e) ? !0 : this.#d()?.hasConfiguredParamInScopeChain(e) ?? !1;
|
|
1101
1127
|
}
|
|
1102
1128
|
findRuntimeForParam(e) {
|
|
1103
1129
|
return this.hasLocalParam(e) ? this : this.#d()?.findRuntimeForParam(e);
|
|
@@ -1128,7 +1154,7 @@ var Be = class {
|
|
|
1128
1154
|
let r = this.#i.get(t);
|
|
1129
1155
|
e.push({
|
|
1130
1156
|
name: t,
|
|
1131
|
-
kind:
|
|
1157
|
+
kind: Be(r),
|
|
1132
1158
|
value: n.get(),
|
|
1133
1159
|
writable: this.#n.has(t),
|
|
1134
1160
|
configured: !!r,
|
|
@@ -1138,12 +1164,15 @@ var Be = class {
|
|
|
1138
1164
|
}
|
|
1139
1165
|
return {
|
|
1140
1166
|
scopeId: this.#t,
|
|
1141
|
-
disposed: this.#
|
|
1167
|
+
disposed: this.#g,
|
|
1142
1168
|
params: e
|
|
1143
1169
|
};
|
|
1144
1170
|
}
|
|
1171
|
+
getSpecLocation(e, t) {
|
|
1172
|
+
return ee(e, this.#h, t);
|
|
1173
|
+
}
|
|
1145
1174
|
createExpression(e) {
|
|
1146
|
-
return this.#e.createExpression(this.#t, e, this.#
|
|
1175
|
+
return this.#e.createExpression(this.#t, typeof e == "string" ? e : e.expr, this.#v(typeof e == "string" ? void 0 : e));
|
|
1147
1176
|
}
|
|
1148
1177
|
watchExpression(e, t, n = {}) {
|
|
1149
1178
|
let r = this.createExpression(e), i = r.subscribe(t);
|
|
@@ -1170,7 +1199,7 @@ var Be = class {
|
|
|
1170
1199
|
cancelUpdate(e) {
|
|
1171
1200
|
this.#e.cancelUpdate(e);
|
|
1172
1201
|
}
|
|
1173
|
-
#
|
|
1202
|
+
#b(e, t) {
|
|
1174
1203
|
let n = this.#e.registerBase(this.#t, e, t);
|
|
1175
1204
|
this.#r.set(e, n);
|
|
1176
1205
|
let r = (e) => {
|
|
@@ -1178,19 +1207,19 @@ var Be = class {
|
|
|
1178
1207
|
};
|
|
1179
1208
|
return this.#n.set(e, r), r;
|
|
1180
1209
|
}
|
|
1181
|
-
#
|
|
1182
|
-
let r = this.#
|
|
1183
|
-
this.#
|
|
1210
|
+
#x(e, t, n) {
|
|
1211
|
+
let r = this.#w(e, t, n), i = (t, n) => {
|
|
1212
|
+
this.#T(e, r, t, n);
|
|
1184
1213
|
};
|
|
1185
1214
|
return this.#n.set(e, i), i;
|
|
1186
1215
|
}
|
|
1187
|
-
#
|
|
1188
|
-
let r = this.createExpression(t), i = this.#
|
|
1189
|
-
this.#
|
|
1216
|
+
#S(e, t, n) {
|
|
1217
|
+
let r = this.createExpression(t), i = this.#w(e, r(null), n), a = r.subscribe(() => {
|
|
1218
|
+
this.#T(e, i, r(null), { animate: !this.#m });
|
|
1190
1219
|
});
|
|
1191
1220
|
this.#e.addScopeDisposer(this.#t, a);
|
|
1192
1221
|
}
|
|
1193
|
-
#
|
|
1222
|
+
#C(e, t, n) {
|
|
1194
1223
|
let r = this.createExpression(t), i = r(null), a = this.#e.registerBase(this.#t, e, i);
|
|
1195
1224
|
this.#r.set(e, a);
|
|
1196
1225
|
let o = {
|
|
@@ -1205,8 +1234,8 @@ var Be = class {
|
|
|
1205
1234
|
clearTimeout(o.timeout), c(), this.#u.delete(e);
|
|
1206
1235
|
});
|
|
1207
1236
|
}
|
|
1208
|
-
#
|
|
1209
|
-
let r =
|
|
1237
|
+
#w(e, t, n) {
|
|
1238
|
+
let r = He(e, t), i = this.#e.registerBase(this.#t, e, r);
|
|
1210
1239
|
this.#r.set(e, i);
|
|
1211
1240
|
let a = this.#p;
|
|
1212
1241
|
if (!a) throw Error(`The parameter "${e}" uses transition but no animator is available.`);
|
|
@@ -1221,8 +1250,8 @@ var Be = class {
|
|
|
1221
1250
|
};
|
|
1222
1251
|
return this.#l.set(e, s), this.#e.addScopeDisposer(this.#t, s.dispose), s;
|
|
1223
1252
|
}
|
|
1224
|
-
#
|
|
1225
|
-
let i =
|
|
1253
|
+
#T(e, t, n, r = {}) {
|
|
1254
|
+
let i = He(e, n);
|
|
1226
1255
|
t.target = i, r.animate === !1 ? t.smoother.snap({ value: i }) : t.smoother({ value: i });
|
|
1227
1256
|
}
|
|
1228
1257
|
evaluateAndGet(e) {
|
|
@@ -1241,22 +1270,17 @@ var Be = class {
|
|
|
1241
1270
|
this.#m = !1;
|
|
1242
1271
|
}
|
|
1243
1272
|
dispose() {
|
|
1244
|
-
this.#
|
|
1245
|
-
}
|
|
1246
|
-
hasPointSelections() {
|
|
1247
|
-
for (let e of
|
|
1248
|
-
let t = e.select;
|
|
1249
|
-
if (te(t)) {
|
|
1250
|
-
if (t == "point") return !0;
|
|
1251
|
-
} else if (t.type == "point") return !0;
|
|
1252
|
-
}
|
|
1273
|
+
this.#g || (this.#g = !0, this.#e.disposeScope(this.#t), this.#n.clear(), this.#r.clear(), this.#i.clear(), this.#a.clear(), this.#o.clear(), this.#l.clear(), this.#u.clear());
|
|
1274
|
+
}
|
|
1275
|
+
hasPointSelections({ inherited: e = !1 } = {}) {
|
|
1276
|
+
for (let t = this; t; t = e ? t.#d() : void 0) for (let n of t.#i.values()) if (i(n) && (n.select === "point" || typeof n.select == "object" && n.select.type === "point") && (!e || this.findConfiguredParam(n.name).config === n)) return !0;
|
|
1253
1277
|
return !1;
|
|
1254
1278
|
}
|
|
1255
1279
|
};
|
|
1256
|
-
function
|
|
1280
|
+
function Be(e) {
|
|
1257
1281
|
return e ? e.push === "outer" ? "push" : "select" in e ? "selection" : "ruler" in e ? "ruler" : "expr" in e ? "derived" : "base" : "auto";
|
|
1258
1282
|
}
|
|
1259
|
-
function
|
|
1283
|
+
function Ve(e) {
|
|
1260
1284
|
let t = e.name;
|
|
1261
1285
|
if ("value" in e && "expr" in e) throw Error(`The parameter "${t}" must not have both value and expr properties!`);
|
|
1262
1286
|
if ("expr" in e && "bind" in e) throw Error(`The parameter "${t}" must not have both expr and bind properties!`);
|
|
@@ -1274,62 +1298,62 @@ function He(e) {
|
|
|
1274
1298
|
if (n.halfLife != null && (!Number.isFinite(n.halfLife) || n.halfLife <= 0)) throw Error(`The transition halfLife for parameter "${t}" must be a positive finite number.`);
|
|
1275
1299
|
if (n.epsilon != null && (!Number.isFinite(n.epsilon) || n.epsilon < 0)) throw Error(`The transition epsilon for parameter "${t}" must be a non-negative finite number.`);
|
|
1276
1300
|
}
|
|
1277
|
-
function
|
|
1301
|
+
function He(e, t) {
|
|
1278
1302
|
if (typeof t != "number" || !Number.isFinite(t)) throw Error(`Transitioned parameter "${e}" must have a finite numeric value.`);
|
|
1279
1303
|
return t;
|
|
1280
1304
|
}
|
|
1281
1305
|
//#endregion
|
|
1282
1306
|
//#region ../core/src/utils/addBaseUrl.js
|
|
1283
|
-
function
|
|
1307
|
+
function Ue(e, t) {
|
|
1284
1308
|
return !t || /^(data:|([A-Za-z]+:)?\/\/)/.test(e) || e.startsWith("/") ? e : (t.endsWith("/") || (t += "/"), t + e);
|
|
1285
1309
|
}
|
|
1286
|
-
function
|
|
1310
|
+
function We(e) {
|
|
1287
1311
|
if (!e) return e;
|
|
1288
1312
|
if (/[?#]/.test(e)) throw Error(`Invalid base URL: ${e} - cannot contain query or hash.`);
|
|
1289
1313
|
return e.endsWith("/") ? e : e + "/";
|
|
1290
1314
|
}
|
|
1291
1315
|
//#endregion
|
|
1292
1316
|
//#region ../core/src/config/mergeConfig.js
|
|
1293
|
-
function
|
|
1294
|
-
return
|
|
1317
|
+
function V(e) {
|
|
1318
|
+
return ie(e) && !Array.isArray(e) && !("expr" in e && typeof e.expr == "string");
|
|
1295
1319
|
}
|
|
1296
|
-
function
|
|
1320
|
+
function Ge(e) {
|
|
1297
1321
|
let t = {};
|
|
1298
|
-
for (let [n, r] of Object.entries(e)) t[n] =
|
|
1322
|
+
for (let [n, r] of Object.entries(e)) t[n] = H(r);
|
|
1299
1323
|
return t;
|
|
1300
1324
|
}
|
|
1301
|
-
function
|
|
1302
|
-
return Array.isArray(e) ? e.map(
|
|
1325
|
+
function H(e) {
|
|
1326
|
+
return Array.isArray(e) ? e.map(H) : V(e) ? Ge(e) : e;
|
|
1303
1327
|
}
|
|
1304
|
-
function
|
|
1328
|
+
function Ke(e, t) {
|
|
1305
1329
|
for (let [n, r] of Object.entries(t)) {
|
|
1306
1330
|
if (r === void 0) continue;
|
|
1307
1331
|
let t = e[n];
|
|
1308
|
-
|
|
1332
|
+
V(r) && V(t) ? Ke(t, r) : e[n] = H(r);
|
|
1309
1333
|
}
|
|
1310
1334
|
return e;
|
|
1311
1335
|
}
|
|
1312
|
-
function
|
|
1336
|
+
function qe(e) {
|
|
1313
1337
|
let t = {};
|
|
1314
|
-
for (let n of e) n &&
|
|
1338
|
+
for (let n of e) n && Ke(t, n);
|
|
1315
1339
|
return t;
|
|
1316
1340
|
}
|
|
1317
1341
|
//#endregion
|
|
1318
1342
|
//#region ../core/src/view/viewChrome.js
|
|
1319
|
-
var
|
|
1320
|
-
function
|
|
1321
|
-
|
|
1343
|
+
var U = /* @__PURE__ */ new WeakMap();
|
|
1344
|
+
function Je(e, t) {
|
|
1345
|
+
U.set(e, t);
|
|
1322
1346
|
}
|
|
1323
|
-
function
|
|
1324
|
-
return
|
|
1347
|
+
function Ye(e) {
|
|
1348
|
+
return U.get(e);
|
|
1325
1349
|
}
|
|
1326
|
-
function
|
|
1327
|
-
return
|
|
1350
|
+
function Xe(e) {
|
|
1351
|
+
return U.has(e);
|
|
1328
1352
|
}
|
|
1329
|
-
function
|
|
1353
|
+
function Ze(e) {
|
|
1330
1354
|
let t = e;
|
|
1331
1355
|
for (; t;) {
|
|
1332
|
-
let n =
|
|
1356
|
+
let n = U.get(t);
|
|
1333
1357
|
if (n === "excludeSubtree" || t === e && n === "exclude") return !0;
|
|
1334
1358
|
t = t.layoutParent;
|
|
1335
1359
|
}
|
|
@@ -1337,16 +1361,16 @@ function U(e) {
|
|
|
1337
1361
|
}
|
|
1338
1362
|
//#endregion
|
|
1339
1363
|
//#region ../core/src/view/postScaleParams.js
|
|
1340
|
-
var
|
|
1341
|
-
function
|
|
1342
|
-
|
|
1364
|
+
var Qe = /* @__PURE__ */ new WeakMap();
|
|
1365
|
+
function $e(e, t) {
|
|
1366
|
+
Qe.set(e, t);
|
|
1343
1367
|
}
|
|
1344
|
-
function
|
|
1345
|
-
return
|
|
1368
|
+
function et(e) {
|
|
1369
|
+
return Qe.get(e);
|
|
1346
1370
|
}
|
|
1347
1371
|
//#endregion
|
|
1348
1372
|
//#region ../core/src/data/namedDataScope.js
|
|
1349
|
-
var
|
|
1373
|
+
var tt = class {
|
|
1350
1374
|
name;
|
|
1351
1375
|
owner;
|
|
1352
1376
|
getDefaultData;
|
|
@@ -1384,13 +1408,13 @@ var Ze = class {
|
|
|
1384
1408
|
dispose() {
|
|
1385
1409
|
this.#e = void 0, this.#t = !1, this.#n++, this.#r = !0;
|
|
1386
1410
|
}
|
|
1387
|
-
},
|
|
1411
|
+
}, nt = class {
|
|
1388
1412
|
view;
|
|
1389
1413
|
#e = /* @__PURE__ */ new Map();
|
|
1390
1414
|
#t = /* @__PURE__ */ new Map();
|
|
1391
1415
|
constructor(e) {
|
|
1392
1416
|
this.view = e;
|
|
1393
|
-
for (let [t, n] of Object.entries(e.spec.datasets ?? {})) this.#e.set(t, new
|
|
1417
|
+
for (let [t, n] of Object.entries(e.spec.datasets ?? {})) this.#e.set(t, new tt(t, e, () => n));
|
|
1394
1418
|
}
|
|
1395
1419
|
getLocalBinding(e) {
|
|
1396
1420
|
return this.#e.get(e);
|
|
@@ -1404,7 +1428,7 @@ var Ze = class {
|
|
|
1404
1428
|
let n = this.view.dataParent?.namedDataScope;
|
|
1405
1429
|
if (n) return n.resolve(e);
|
|
1406
1430
|
let r = this.#t.get(e);
|
|
1407
|
-
return r || (r = new
|
|
1431
|
+
return r || (r = new tt(e, void 0, () => this.view.context.getNamedDataFromProvider(e)), this.#t.set(e, r)), r;
|
|
1408
1432
|
}
|
|
1409
1433
|
dispose() {
|
|
1410
1434
|
for (let e of this.#e.values()) e.dispose();
|
|
@@ -1412,7 +1436,7 @@ var Ze = class {
|
|
|
1412
1436
|
for (let e of this.#t.values()) e.dispose();
|
|
1413
1437
|
this.#t.clear();
|
|
1414
1438
|
}
|
|
1415
|
-
},
|
|
1439
|
+
}, W = "VISIT_SKIP", G = "VISIT_STOP", K = (e) => e, rt = class {
|
|
1416
1440
|
spec;
|
|
1417
1441
|
namedDataScope;
|
|
1418
1442
|
#e;
|
|
@@ -1427,34 +1451,36 @@ var Ze = class {
|
|
|
1427
1451
|
#l = void 0;
|
|
1428
1452
|
#u = !1;
|
|
1429
1453
|
#d = [];
|
|
1430
|
-
opacityFunction =
|
|
1454
|
+
opacityFunction = K;
|
|
1431
1455
|
#f = [];
|
|
1432
1456
|
#p = "none";
|
|
1433
1457
|
#m = /* @__PURE__ */ new Map();
|
|
1434
|
-
facetCoords = new
|
|
1458
|
+
facetCoords = new p([], JSON.stringify);
|
|
1459
|
+
layoutCoords;
|
|
1435
1460
|
constructor(e, t, n, r, i, a = {}) {
|
|
1436
1461
|
if (!e) throw Error("View spec must be defined!");
|
|
1437
|
-
if (this.context = t, this.layoutParent = n, this.dataParent = r, this.#t = i, this.spec = e, this.namedDataScope = new
|
|
1462
|
+
if (this.context = t, this.layoutParent = n, this.dataParent = r, a.chrome && Je(this, "excludeSubtree"), this.#t = i, this.spec = e, this.namedDataScope = new nt(this), r && e.theme !== void 0) throw Error("\"theme\" is only supported at the root specification. Use \"config\" and \"style\" for subtree customization.");
|
|
1438
1463
|
let o = r ? r.getConfigScopes() : [t.getBaseConfig()], s = e.config;
|
|
1439
1464
|
this.#e = [...o, s].filter((e) => !!e), this.resolutions = {
|
|
1440
1465
|
scale: {},
|
|
1441
1466
|
axis: {},
|
|
1442
1467
|
legend: {}
|
|
1443
|
-
},
|
|
1468
|
+
}, oe(this), this.options = {
|
|
1444
1469
|
inheritEncoding: !1,
|
|
1445
1470
|
layoutSizeParams: "own",
|
|
1446
1471
|
...a
|
|
1447
1472
|
}, this.flowHandle = void 0, this.needsAxes = {
|
|
1448
1473
|
x: !1,
|
|
1449
1474
|
y: !1
|
|
1450
|
-
}, this.paramRuntime = new
|
|
1475
|
+
}, this.paramRuntime = new B(() => this.dataParent?.paramRuntime, (e) => this.getScaleResolution(e), t.animator, {
|
|
1451
1476
|
settleTemporalUpdatesImmediately: !0,
|
|
1452
|
-
onError: t.reportError
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1477
|
+
onError: t.reportError,
|
|
1478
|
+
getSpecOrigin: t.getSpecOrigin
|
|
1479
|
+
}), this.paramRuntime.setSelectionSource(this), "mark" in e && this.paramRuntime.registerLazyExpression("zoomLevel", "zoomLevel()", () => ce("The automatic zoomLevel parameter is deprecated. Use zoomLevel() or an explicit channel such as zoomLevel(\"x\") instead."));
|
|
1480
|
+
let c = [...e.params ?? [], ...et(e) ?? []];
|
|
1481
|
+
for (let e of c) {
|
|
1456
1482
|
if ("expr" in e) {
|
|
1457
|
-
let { usesScaleHelper: t, globals: n } =
|
|
1483
|
+
let { usesScaleHelper: t, globals: n } = m(e.expr, this.paramRuntime.getSpecLocation(e, ["expr"])), r = n.some((e) => this.paramRuntime.isPendingParam(e));
|
|
1458
1484
|
if (t || r) {
|
|
1459
1485
|
this.paramRuntime.registerParam(e, { defer: !0 }), this.#d.push(e.name);
|
|
1460
1486
|
continue;
|
|
@@ -1480,18 +1506,18 @@ var Ze = class {
|
|
|
1480
1506
|
return this.#t;
|
|
1481
1507
|
}
|
|
1482
1508
|
getConfig() {
|
|
1483
|
-
return
|
|
1509
|
+
return qe(this.#e);
|
|
1484
1510
|
}
|
|
1485
1511
|
getCursorSpec() {
|
|
1486
1512
|
return this.spec.cursor;
|
|
1487
1513
|
}
|
|
1488
1514
|
getCursor() {
|
|
1489
1515
|
let e = this.getCursorSpec();
|
|
1490
|
-
return
|
|
1516
|
+
return l(e) ? this.paramRuntime.evaluateAndGet(e) : e;
|
|
1491
1517
|
}
|
|
1492
1518
|
watchCursor(e, t) {
|
|
1493
|
-
let
|
|
1494
|
-
n
|
|
1519
|
+
let n = this.getCursorSpec();
|
|
1520
|
+
l(n) && this.paramRuntime.watchExpression(n, e, {
|
|
1495
1521
|
scopeOwned: !1,
|
|
1496
1522
|
registerDisposer: t
|
|
1497
1523
|
});
|
|
@@ -1503,45 +1529,73 @@ var Ze = class {
|
|
|
1503
1529
|
return this.facetCoords.values().next().value;
|
|
1504
1530
|
}
|
|
1505
1531
|
getPadding() {
|
|
1506
|
-
return this._cache("size/padding", () =>
|
|
1532
|
+
return this._cache("size/padding", () => j.createFromConfig(this.spec.padding));
|
|
1507
1533
|
}
|
|
1508
1534
|
getOverhang() {
|
|
1509
|
-
return
|
|
1535
|
+
return j.zero();
|
|
1536
|
+
}
|
|
1537
|
+
getStructuralOverhang() {
|
|
1538
|
+
return j.zero();
|
|
1539
|
+
}
|
|
1540
|
+
getStructuralSizeDefs(e) {
|
|
1541
|
+
let t = this.getStructuralOverhang();
|
|
1542
|
+
return {
|
|
1543
|
+
before: { px: t[e === "x" ? "left" : "top"] },
|
|
1544
|
+
after: { px: t[e === "x" ? "right" : "bottom"] }
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
getAlignment(e) {
|
|
1548
|
+
let t = e === "x" ? "width" : "height";
|
|
1549
|
+
return {
|
|
1550
|
+
size: this.getViewportSize().subtractPadding(this.getOverhang())[t],
|
|
1551
|
+
before: 0,
|
|
1552
|
+
after: 0
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
getAlignmentCoords(e) {
|
|
1556
|
+
return this.coords.shrink(this.getOverhang());
|
|
1557
|
+
}
|
|
1558
|
+
getLayoutFootprints() {
|
|
1559
|
+
return [{
|
|
1560
|
+
view: this,
|
|
1561
|
+
coords: this.coords.shrink(this.getOverhang()),
|
|
1562
|
+
chrome: !1
|
|
1563
|
+
}];
|
|
1510
1564
|
}
|
|
1511
1565
|
isScrollable() {
|
|
1512
1566
|
return this.spec.viewportWidth != null || this.spec.viewportHeight != null;
|
|
1513
1567
|
}
|
|
1514
1568
|
getSize() {
|
|
1515
|
-
return this._cache("size/size", () => this.isConfiguredVisible() ? new
|
|
1569
|
+
return this._cache("size/size", () => this.isConfiguredVisible() ? new x(this.#g("width"), this.#g("height")) : S);
|
|
1516
1570
|
}
|
|
1517
1571
|
getViewportSize() {
|
|
1518
1572
|
if (!this.isScrollable()) return this.getSize();
|
|
1519
|
-
if (!this.isConfiguredVisible()) return
|
|
1573
|
+
if (!this.isConfiguredVisible()) return S;
|
|
1520
1574
|
let e = this.getSize();
|
|
1521
|
-
return new
|
|
1575
|
+
return new x(this.#g("viewportWidth") ?? e.width, this.#g("viewportHeight") ?? e.height);
|
|
1522
1576
|
}
|
|
1523
1577
|
#g(e) {
|
|
1524
|
-
let { value: t, implicit: n } = this.#_(e),
|
|
1525
|
-
if (
|
|
1526
|
-
if (
|
|
1527
|
-
let t = this.#x(e,
|
|
1528
|
-
if (
|
|
1578
|
+
let { value: t, implicit: n } = this.#_(e), i = this.resolveSizeValue(e, t), a = q(i), o = e == "viewportWidth" || e == "viewportHeight";
|
|
1579
|
+
if (a) {
|
|
1580
|
+
if (o) throw new _(`Cannot use step-based size with "${e}"!`, this);
|
|
1581
|
+
let t = this.#x(e, i), a = this.getScaleResolution(e == "width" ? "x" : "y")?.getScale();
|
|
1582
|
+
if (a) {
|
|
1529
1583
|
let n;
|
|
1530
|
-
if (
|
|
1531
|
-
else if (["locus", "index"].includes(
|
|
1532
|
-
let e =
|
|
1533
|
-
n =
|
|
1534
|
-
} else throw new _(`Cannot use step-based size with "${
|
|
1535
|
-
let
|
|
1536
|
-
n =
|
|
1537
|
-
let
|
|
1538
|
-
if (
|
|
1539
|
-
if (!
|
|
1540
|
-
let t =
|
|
1541
|
-
|
|
1584
|
+
if (y(a.type)) n = a.domain().length;
|
|
1585
|
+
else if (["locus", "index"].includes(a.type)) {
|
|
1586
|
+
let e = a.domain();
|
|
1587
|
+
n = r(e) - e[0];
|
|
1588
|
+
} else throw new _(`Cannot use step-based size with "${a.type}" scale!`, this);
|
|
1589
|
+
let o = a;
|
|
1590
|
+
n = v(n, o.paddingInner(), o.paddingOuter());
|
|
1591
|
+
let s = e == "width" ? "xOffset" : "yOffset", c = this.getScaleResolution(s)?.getScale(), l = i.for ?? (c && y(c.type) ? "offset" : "position"), u = t;
|
|
1592
|
+
if (l == "offset") {
|
|
1593
|
+
if (!c || !y(c.type)) throw new _(`Cannot use ${e}.step.for = "offset" without a discrete ${s} scale!`, this);
|
|
1594
|
+
let t = c, n = v(c.domain().length, t.paddingInner(), t.paddingOuter());
|
|
1595
|
+
u *= n / (1 - o.paddingInner());
|
|
1542
1596
|
}
|
|
1543
1597
|
return {
|
|
1544
|
-
px: n *
|
|
1598
|
+
px: n * u,
|
|
1545
1599
|
grow: 0
|
|
1546
1600
|
};
|
|
1547
1601
|
}
|
|
@@ -1551,7 +1605,7 @@ var Ze = class {
|
|
|
1551
1605
|
};
|
|
1552
1606
|
throw new _(`Cannot use step-based size with "${e}"!`, this);
|
|
1553
1607
|
}
|
|
1554
|
-
return (
|
|
1608
|
+
return (i && _e(i)) ?? (o ? void 0 : {
|
|
1555
1609
|
px: 0,
|
|
1556
1610
|
grow: 1
|
|
1557
1611
|
});
|
|
@@ -1567,16 +1621,16 @@ var Ze = class {
|
|
|
1567
1621
|
};
|
|
1568
1622
|
}
|
|
1569
1623
|
#v(e) {
|
|
1570
|
-
if (
|
|
1624
|
+
if (Ze(this)) return;
|
|
1571
1625
|
let t = this.getConfig().view;
|
|
1572
1626
|
if (!t) return;
|
|
1573
1627
|
let n = e == "width" ? "x" : "y", r = this.getScaleResolution(n)?.getResolvedScaleType();
|
|
1574
|
-
return r && !
|
|
1628
|
+
return r && !y(r) ? e == "width" ? t.continuousWidth : t.continuousHeight : (e == "width" ? t.discreteWidth : t.discreteHeight) ?? (t.step === void 0 ? void 0 : { step: t.step });
|
|
1575
1629
|
}
|
|
1576
1630
|
resolveSizeValue(e, t) {
|
|
1577
|
-
if (!
|
|
1578
|
-
let
|
|
1579
|
-
if (
|
|
1631
|
+
if (!l(t)) return t;
|
|
1632
|
+
let n = this.#C(e)();
|
|
1633
|
+
if (ct(n) || n === "container") return n;
|
|
1580
1634
|
throw new _(`"${e}" ExprRef must resolve to a finite number or "container"!`, this);
|
|
1581
1635
|
}
|
|
1582
1636
|
registerSizeInvalidation() {
|
|
@@ -1584,7 +1638,7 @@ var Ze = class {
|
|
|
1584
1638
|
}
|
|
1585
1639
|
#y(e, t) {
|
|
1586
1640
|
let { value: n, implicit: r } = this.#_(e);
|
|
1587
|
-
if (!
|
|
1641
|
+
if (!q(n)) return;
|
|
1588
1642
|
let i = this.getScaleResolution(t);
|
|
1589
1643
|
if (!i) {
|
|
1590
1644
|
if (r) return;
|
|
@@ -1594,20 +1648,20 @@ var Ze = class {
|
|
|
1594
1648
|
let t = this.getSize()[e];
|
|
1595
1649
|
this.invalidateSizeCache();
|
|
1596
1650
|
let n = this.getSize()[e];
|
|
1597
|
-
|
|
1651
|
+
he(t, n) || this.context.requestLayoutReflow();
|
|
1598
1652
|
};
|
|
1599
1653
|
if (i.addEventListener("domain", a), this.registerDisposer(() => i.removeEventListener("domain", a)), n.for != "position") {
|
|
1600
1654
|
let t = e == "width" ? "xOffset" : "yOffset", n = this.getScaleResolution(t);
|
|
1601
|
-
n &&
|
|
1655
|
+
n && y(n.getResolvedScaleType()) && (n.addEventListener("domain", a), this.registerDisposer(() => n.removeEventListener("domain", a)));
|
|
1602
1656
|
}
|
|
1603
1657
|
}
|
|
1604
1658
|
#b(e) {
|
|
1605
1659
|
let { value: t } = this.#_(e);
|
|
1606
|
-
|
|
1660
|
+
l(t) ? this.#S(e, t) : q(t) && l(t.step) && this.#S(e + ".step", t.step);
|
|
1607
1661
|
}
|
|
1608
1662
|
#x(e, t) {
|
|
1609
|
-
let
|
|
1610
|
-
if (
|
|
1663
|
+
let n = l(t.step) ? this.#C(e + ".step")() : t.step;
|
|
1664
|
+
if (ct(n)) return n;
|
|
1611
1665
|
throw new _(`"${e}.step" ExprRef must resolve to a finite number!`, this);
|
|
1612
1666
|
}
|
|
1613
1667
|
#S(e, t) {
|
|
@@ -1653,7 +1707,7 @@ var Ze = class {
|
|
|
1653
1707
|
return this.opacityFunction(1);
|
|
1654
1708
|
}
|
|
1655
1709
|
hasLocalOpacity() {
|
|
1656
|
-
return this.opacityFunction !==
|
|
1710
|
+
return this.opacityFunction !== K;
|
|
1657
1711
|
}
|
|
1658
1712
|
getPathString() {
|
|
1659
1713
|
return this.getLayoutAncestors().map((e) => e.name).reverse().join("/");
|
|
@@ -1684,7 +1738,7 @@ var Ze = class {
|
|
|
1684
1738
|
};
|
|
1685
1739
|
}
|
|
1686
1740
|
handleInteraction(e, t) {
|
|
1687
|
-
t && e.type === "mousemove" && e.pointedViews.
|
|
1741
|
+
t && e.type === "mousemove" && e.pointedViews.set(this, e.facetId);
|
|
1688
1742
|
let n = t ? this.#r : this.#i;
|
|
1689
1743
|
for (let t of n[e.type] || []) t(e);
|
|
1690
1744
|
}
|
|
@@ -1717,7 +1771,7 @@ var Ze = class {
|
|
|
1717
1771
|
for (let e of this.#f) e();
|
|
1718
1772
|
this.#f.length = 0;
|
|
1719
1773
|
let e = this.flowHandle;
|
|
1720
|
-
e?.collector && (this.context.dataFlow.pruneCollectorBranch(e.collector), this.context.dataFlow.removeCollector(e.collector)), e?.dataSource && e.dataSource.view === this && !e.dataSource.shareKey && this.context.dataFlow.removeDataSource(e.dataSource), this.paramRuntime.dispose(), this.namedDataScope.dispose(), this.context.dataFlow.loadingStatusRegistry.delete(this)
|
|
1774
|
+
e?.collector && (this.context.dataFlow.pruneCollectorBranch(e.collector), this.context.dataFlow.removeCollector(e.collector)), e?.dataSource && e.dataSource.view === this && !e.dataSource.shareKey && this.context.dataFlow.removeDataSource(e.dataSource), this.paramRuntime.dispose(), this.namedDataScope.dispose(), this.flowHandle = void 0, this.context.dataFlow.loadingStatusRegistry.delete(this);
|
|
1721
1775
|
}
|
|
1722
1776
|
registerDisposer(e) {
|
|
1723
1777
|
this.#f.push(e);
|
|
@@ -1741,7 +1795,7 @@ var Ze = class {
|
|
|
1741
1795
|
}
|
|
1742
1796
|
}
|
|
1743
1797
|
configureViewOpacity() {
|
|
1744
|
-
(!this.opacityFunction || this.opacityFunction ===
|
|
1798
|
+
(!this.opacityFunction || this.opacityFunction === K) && (this.opacityFunction = at(this));
|
|
1745
1799
|
}
|
|
1746
1800
|
finalizeParamRuntimeInitialization() {
|
|
1747
1801
|
this.#l === void 0 ? this.paramRuntime.finalizeInitialization() : this.#T();
|
|
@@ -1753,8 +1807,10 @@ var Ze = class {
|
|
|
1753
1807
|
return this.#s;
|
|
1754
1808
|
}
|
|
1755
1809
|
arrange(e, t, n = {}) {
|
|
1756
|
-
if (
|
|
1757
|
-
|
|
1810
|
+
if (this.layoutParent || this.visit((e) => {
|
|
1811
|
+
e.layoutCoords = void 0;
|
|
1812
|
+
}), this.layoutCoords = t, n.firstFacet && this.facetCoords.clear(), this.facetCoords.set(n.facetId, re(t, te(n))), this.#a || this.#o) {
|
|
1813
|
+
let e = this.getOverhang(), n = this.layoutParent ? j.zero() : this.getPadding();
|
|
1758
1814
|
this.#a?.(t.width - e.width - n.width), this.#o?.(t.height - e.height - n.height);
|
|
1759
1815
|
}
|
|
1760
1816
|
this.#c = !0, this.#T();
|
|
@@ -1775,7 +1831,7 @@ var Ze = class {
|
|
|
1775
1831
|
}
|
|
1776
1832
|
getFacetFields(e) {
|
|
1777
1833
|
let t = this.getEncoding().sample;
|
|
1778
|
-
return
|
|
1834
|
+
return s(t) ? [t.field] : this.options.inheritEncoding ? this.layoutParent?.getFacetFields(this) : [];
|
|
1779
1835
|
}
|
|
1780
1836
|
usesSampleFacetRendering() {
|
|
1781
1837
|
return this.layoutParent?.usesSampleFacetRendering() ?? !1;
|
|
@@ -1787,15 +1843,23 @@ var Ze = class {
|
|
|
1787
1843
|
};
|
|
1788
1844
|
}
|
|
1789
1845
|
getScaleResolution(e) {
|
|
1790
|
-
|
|
1791
|
-
return this.getDataAncestors().map((e) => e.resolutions.scale[t]).find((e) => e);
|
|
1846
|
+
return this.#E(e, "scale");
|
|
1792
1847
|
}
|
|
1793
1848
|
getAxisResolution(e) {
|
|
1794
|
-
|
|
1795
|
-
|
|
1849
|
+
return this.#E(e, "axis");
|
|
1850
|
+
}
|
|
1851
|
+
#E(e, t) {
|
|
1852
|
+
let n = h(e);
|
|
1853
|
+
for (let e of this.getDataAncestors()) {
|
|
1854
|
+
let r = e.resolutions[t][n];
|
|
1855
|
+
if (r || e.isResolutionBoundary(n)) return r;
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
isResolutionBoundary(e) {
|
|
1859
|
+
return this.options.resolutionBoundaryChannels?.some((t) => t === h(e)) ?? !1;
|
|
1796
1860
|
}
|
|
1797
1861
|
getLegendResolution(e) {
|
|
1798
|
-
let t =
|
|
1862
|
+
let t = h(e);
|
|
1799
1863
|
return this.getDataAncestors().map((e) => e.resolutions.legend[t]).find((e) => e);
|
|
1800
1864
|
}
|
|
1801
1865
|
getConfiguredResolution(e, t) {
|
|
@@ -1808,17 +1872,17 @@ var Ze = class {
|
|
|
1808
1872
|
return "independent";
|
|
1809
1873
|
}
|
|
1810
1874
|
getBaseUrl() {
|
|
1811
|
-
return
|
|
1875
|
+
return N(() => this.dataParent?.getBaseUrl(), We(this.spec.baseUrl));
|
|
1812
1876
|
}
|
|
1813
1877
|
isPickingSupported() {
|
|
1814
1878
|
return !0;
|
|
1815
1879
|
}
|
|
1816
1880
|
getTitleText() {
|
|
1817
1881
|
let e = this.spec.title;
|
|
1818
|
-
if (e) return
|
|
1882
|
+
if (e) return u(e) ? e : l(e.text) ? this.paramRuntime.evaluateAndGet(e.text) : e.text;
|
|
1819
1883
|
}
|
|
1820
1884
|
_cache(e, t) {
|
|
1821
|
-
return
|
|
1885
|
+
return ae(this, e, t);
|
|
1822
1886
|
}
|
|
1823
1887
|
_invalidateCacheByPrefix(e, t = "self") {
|
|
1824
1888
|
switch (t) {
|
|
@@ -1836,15 +1900,15 @@ var Ze = class {
|
|
|
1836
1900
|
}
|
|
1837
1901
|
propagateInteraction(e) {}
|
|
1838
1902
|
};
|
|
1839
|
-
function
|
|
1903
|
+
function it(e) {
|
|
1840
1904
|
return "unitsPerPixel" in e;
|
|
1841
1905
|
}
|
|
1842
|
-
function
|
|
1906
|
+
function at(e) {
|
|
1843
1907
|
let t = "opacity" in e.spec ? e.spec.opacity : void 0;
|
|
1844
1908
|
if (t !== void 0) {
|
|
1845
|
-
if (
|
|
1846
|
-
if (
|
|
1847
|
-
let
|
|
1909
|
+
if (f(t)) return (e) => e * t;
|
|
1910
|
+
if (it(t)) {
|
|
1911
|
+
let n = (t) => {
|
|
1848
1912
|
let n = e.getScaleResolution(t), r = n?.getScale();
|
|
1849
1913
|
if ([
|
|
1850
1914
|
"linear",
|
|
@@ -1854,46 +1918,46 @@ function tt(e) {
|
|
|
1854
1918
|
scale: r,
|
|
1855
1919
|
scaleResolution: n
|
|
1856
1920
|
};
|
|
1857
|
-
},
|
|
1858
|
-
if (!
|
|
1859
|
-
let
|
|
1860
|
-
let t =
|
|
1861
|
-
|
|
1921
|
+
}, r = st(t.values, "opacity.values", e);
|
|
1922
|
+
if (!d(t.unitsPerPixel)) throw new _("\"opacity.unitsPerPixel\" must be an array.", e);
|
|
1923
|
+
let i = () => 1, a = [], o = () => {
|
|
1924
|
+
let t = ot(st(a.map((e) => e()), "opacity.unitsPerPixel", e), r, e), n = se().domain(t.unitsPerPixel).range(t.values).clamp(!0);
|
|
1925
|
+
i = (e) => n(e);
|
|
1862
1926
|
};
|
|
1863
|
-
|
|
1864
|
-
if (
|
|
1865
|
-
let n = e.paramRuntime.watchExpression(t
|
|
1866
|
-
|
|
1927
|
+
a = t.unitsPerPixel.map((t) => {
|
|
1928
|
+
if (l(t)) {
|
|
1929
|
+
let n = e.paramRuntime.watchExpression(t, () => {
|
|
1930
|
+
o(), e.context.animator.requestRender();
|
|
1867
1931
|
});
|
|
1868
1932
|
return () => n(null);
|
|
1869
1933
|
}
|
|
1870
1934
|
return () => t;
|
|
1871
|
-
}),
|
|
1872
|
-
let
|
|
1935
|
+
}), o();
|
|
1936
|
+
let s = (e) => {
|
|
1873
1937
|
let t = e.scaleResolution.getAxisLength() || 1e3;
|
|
1874
|
-
return
|
|
1875
|
-
},
|
|
1938
|
+
return c(e.scale.domain()) / t;
|
|
1939
|
+
}, u;
|
|
1876
1940
|
if (t.channel === "auto") {
|
|
1877
|
-
let t =
|
|
1878
|
-
if (t &&
|
|
1879
|
-
else if (t)
|
|
1880
|
-
else if (
|
|
1941
|
+
let t = n("x"), r = n("y");
|
|
1942
|
+
if (t && r) u = () => (s(t) + s(r)) / 2;
|
|
1943
|
+
else if (t) u = () => s(t);
|
|
1944
|
+
else if (r) u = () => s(r);
|
|
1881
1945
|
else throw new _("Cannot find a resolved quantitative x or y scale for dynamic opacity!", e);
|
|
1882
1946
|
} else {
|
|
1883
|
-
let
|
|
1884
|
-
if (!
|
|
1885
|
-
|
|
1947
|
+
let r = t.channel ? n(t.channel) : n("x") ?? n("y");
|
|
1948
|
+
if (!r) throw new _("Cannot find a resolved quantitative scale for dynamic opacity!", e);
|
|
1949
|
+
u = () => s(r);
|
|
1886
1950
|
}
|
|
1887
|
-
return (e) =>
|
|
1951
|
+
return (e) => i(u()) * e;
|
|
1888
1952
|
}
|
|
1889
|
-
if (
|
|
1890
|
-
let n = e.paramRuntime.watchExpression(t
|
|
1953
|
+
if (l(t)) {
|
|
1954
|
+
let n = e.paramRuntime.watchExpression(t, () => e.context.animator.requestRender());
|
|
1891
1955
|
return (e) => n(null) * e;
|
|
1892
1956
|
}
|
|
1893
1957
|
}
|
|
1894
|
-
return
|
|
1958
|
+
return K;
|
|
1895
1959
|
}
|
|
1896
|
-
function
|
|
1960
|
+
function ot(e, t, n) {
|
|
1897
1961
|
if (!e.length) throw new _("\"opacity.unitsPerPixel\" must contain at least one stop.", n);
|
|
1898
1962
|
if (e.length !== t.length) throw new _("\"opacity.unitsPerPixel\" and \"opacity.values\" must have the same length.", n);
|
|
1899
1963
|
e.forEach((e, t) => {
|
|
@@ -1911,155 +1975,155 @@ function nt(e, t, n) {
|
|
|
1911
1975
|
values: a
|
|
1912
1976
|
};
|
|
1913
1977
|
}
|
|
1914
|
-
function
|
|
1915
|
-
if (!
|
|
1978
|
+
function st(e, t, n) {
|
|
1979
|
+
if (!d(e)) throw new _("\"" + t + "\" must evaluate to an array.", n);
|
|
1916
1980
|
return e.map((e, r) => {
|
|
1917
|
-
if (!
|
|
1981
|
+
if (!f(e) || !Number.isFinite(e)) throw new _("Invalid " + t + " value at index " + r + ". Expected a finite number.", n);
|
|
1918
1982
|
return e;
|
|
1919
1983
|
});
|
|
1920
1984
|
}
|
|
1921
|
-
var
|
|
1922
|
-
function
|
|
1985
|
+
var q = (e) => !!e && typeof e == "object" && "step" in e;
|
|
1986
|
+
function ct(e) {
|
|
1923
1987
|
return typeof e == "number" && Number.isFinite(e);
|
|
1924
1988
|
}
|
|
1925
|
-
var
|
|
1926
|
-
function
|
|
1927
|
-
|
|
1989
|
+
var J = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap();
|
|
1990
|
+
function lt(e, t) {
|
|
1991
|
+
dt(e, t, "Import");
|
|
1928
1992
|
}
|
|
1929
|
-
function
|
|
1930
|
-
|
|
1993
|
+
function ut(e, t) {
|
|
1994
|
+
dt(e, t, "View");
|
|
1931
1995
|
}
|
|
1932
|
-
function
|
|
1996
|
+
function dt(e, t, n) {
|
|
1933
1997
|
if (t !== null && typeof t != "string") throw Error(n + " scope name must be a string or null.");
|
|
1934
|
-
|
|
1998
|
+
J.set(e, { name: t });
|
|
1935
1999
|
}
|
|
1936
|
-
function
|
|
1937
|
-
return
|
|
2000
|
+
function ft(e) {
|
|
2001
|
+
return J.get(e);
|
|
1938
2002
|
}
|
|
1939
|
-
function
|
|
2003
|
+
function pt(e, t = {}) {
|
|
1940
2004
|
let n = t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude";
|
|
1941
|
-
|
|
2005
|
+
Y.set(e, n);
|
|
1942
2006
|
}
|
|
1943
|
-
function
|
|
1944
|
-
|
|
2007
|
+
function mt(e, t = {}) {
|
|
2008
|
+
Je(e, t.skipSubtree ?? !1 ? "excludeSubtree" : "exclude");
|
|
1945
2009
|
}
|
|
1946
|
-
function
|
|
1947
|
-
return e.getLayoutAncestors().some(
|
|
2010
|
+
function ht(e) {
|
|
2011
|
+
return e.getLayoutAncestors().some(Xe);
|
|
1948
2012
|
}
|
|
1949
|
-
function
|
|
2013
|
+
function X(e) {
|
|
1950
2014
|
let t = e.getDataAncestors(), n = [];
|
|
1951
2015
|
for (let e = t.length - 1; e >= 0; --e) {
|
|
1952
|
-
let r =
|
|
2016
|
+
let r = J.get(t[e]);
|
|
1953
2017
|
r && typeof r.name == "string" && n.push(r.name);
|
|
1954
2018
|
}
|
|
1955
2019
|
return n;
|
|
1956
2020
|
}
|
|
1957
|
-
function
|
|
2021
|
+
function gt(e) {
|
|
1958
2022
|
let t = e.explicitName;
|
|
1959
2023
|
if (!t) throw Error("Cannot build a selector for a view without a name.");
|
|
1960
2024
|
return {
|
|
1961
|
-
scope:
|
|
2025
|
+
scope: X(e),
|
|
1962
2026
|
view: t
|
|
1963
2027
|
};
|
|
1964
2028
|
}
|
|
1965
|
-
function
|
|
2029
|
+
function _t(e, t) {
|
|
1966
2030
|
if (!t) throw Error("Cannot build a selector for a parameter without a name.");
|
|
1967
2031
|
return {
|
|
1968
|
-
scope:
|
|
2032
|
+
scope: X(e),
|
|
1969
2033
|
param: t
|
|
1970
2034
|
};
|
|
1971
2035
|
}
|
|
1972
|
-
function
|
|
1973
|
-
return
|
|
2036
|
+
function vt(e) {
|
|
2037
|
+
return Et(e), "p:" + JSON.stringify({
|
|
1974
2038
|
scope: e.scope,
|
|
1975
2039
|
param: e.param
|
|
1976
2040
|
});
|
|
1977
2041
|
}
|
|
1978
|
-
function
|
|
2042
|
+
function yt(e, t) {
|
|
1979
2043
|
e.visit((e) => {
|
|
1980
|
-
let n =
|
|
1981
|
-
if (n === "excludeSubtree") return
|
|
2044
|
+
let n = Ye(e);
|
|
2045
|
+
if (n === "excludeSubtree") return W;
|
|
1982
2046
|
if (n !== "exclude") return t(e);
|
|
1983
2047
|
});
|
|
1984
2048
|
}
|
|
1985
|
-
function
|
|
2049
|
+
function bt(e, t) {
|
|
1986
2050
|
e.visit((e) => {
|
|
1987
|
-
let n =
|
|
1988
|
-
if (n === "excludeSubtree") return
|
|
2051
|
+
let n = Y.get(e);
|
|
2052
|
+
if (n === "excludeSubtree") return W;
|
|
1989
2053
|
if (n !== "exclude") return t(e);
|
|
1990
2054
|
});
|
|
1991
2055
|
}
|
|
1992
|
-
function
|
|
1993
|
-
if (
|
|
2056
|
+
function xt(e, t) {
|
|
2057
|
+
if (Dt(t), !Ft(e, t.scope)) return;
|
|
1994
2058
|
let n = [];
|
|
1995
|
-
if (
|
|
2059
|
+
if (Q(e, t.scope, (e) => {
|
|
1996
2060
|
e.explicitName === t.view && n.push(e);
|
|
1997
2061
|
}, { includeNamedImportRoots: !0 }), n.length === 1) return n[0];
|
|
1998
2062
|
if (n.length !== 0) throw Error("View selector is ambiguous for view \"" + t.view + "\" in scope " + JSON.stringify(t.scope));
|
|
1999
2063
|
}
|
|
2000
|
-
function
|
|
2001
|
-
if (
|
|
2064
|
+
function St(e, t) {
|
|
2065
|
+
if (Et(t), !Ft(e, t.scope)) return;
|
|
2002
2066
|
let n = [];
|
|
2003
|
-
if (
|
|
2004
|
-
for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param &&
|
|
2067
|
+
if (Q(e, t.scope, (e) => {
|
|
2068
|
+
for (let [r, i] of e.paramRuntime.paramConfigs) r === t.param && Z(i) && n.push({
|
|
2005
2069
|
view: e,
|
|
2006
2070
|
param: i
|
|
2007
2071
|
});
|
|
2008
2072
|
}), n.length === 1) return n[0];
|
|
2009
2073
|
if (n.length !== 0) throw Error("Param selector is ambiguous for param \"" + t.param + "\" in scope " + JSON.stringify(t.scope));
|
|
2010
2074
|
}
|
|
2011
|
-
function
|
|
2075
|
+
function Ct(e, t) {
|
|
2012
2076
|
e.visit((e) => {
|
|
2013
|
-
let n =
|
|
2014
|
-
if (n === "excludeSubtree") return
|
|
2015
|
-
if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs)
|
|
2077
|
+
let n = Y.get(e);
|
|
2078
|
+
if (n === "excludeSubtree") return W;
|
|
2079
|
+
if (n !== "exclude") for (let [n, r] of e.paramRuntime.paramConfigs) Z(r) && t({
|
|
2016
2080
|
view: e,
|
|
2017
2081
|
param: r,
|
|
2018
|
-
selector:
|
|
2082
|
+
selector: _t(e, n)
|
|
2019
2083
|
});
|
|
2020
2084
|
});
|
|
2021
2085
|
}
|
|
2022
|
-
function
|
|
2086
|
+
function wt(e) {
|
|
2023
2087
|
let t = [];
|
|
2024
|
-
return
|
|
2088
|
+
return Ct(e, (e) => t.push(e)), t;
|
|
2025
2089
|
}
|
|
2026
|
-
function
|
|
2090
|
+
function Tt(e) {
|
|
2027
2091
|
let t = [];
|
|
2028
|
-
for (let n of
|
|
2029
|
-
let r =
|
|
2030
|
-
|
|
2092
|
+
for (let n of Ot(e)) {
|
|
2093
|
+
let r = kt(n);
|
|
2094
|
+
jt(e, r, t), Mt(e, r, t);
|
|
2031
2095
|
}
|
|
2032
2096
|
return t;
|
|
2033
2097
|
}
|
|
2034
|
-
function
|
|
2098
|
+
function Et(e) {
|
|
2035
2099
|
if (!e || !Array.isArray(e.scope)) throw Error("Param selector scope must be an array.");
|
|
2036
2100
|
if (typeof e.param != "string" || !e.param.length) throw Error("Param selector param must be a non-empty string.");
|
|
2037
2101
|
}
|
|
2038
|
-
function
|
|
2102
|
+
function Dt(e) {
|
|
2039
2103
|
if (!e || !Array.isArray(e.scope)) throw Error("View selector scope must be an array.");
|
|
2040
2104
|
if (typeof e.view != "string" || !e.view.length) throw Error("View selector view must be a non-empty string.");
|
|
2041
2105
|
}
|
|
2042
|
-
function
|
|
2043
|
-
return e.persist === !1 ? !1 :
|
|
2106
|
+
function Z(e) {
|
|
2107
|
+
return e.persist === !1 ? !1 : i(e) ? !0 : a(e) ? !!e.bind : !1;
|
|
2044
2108
|
}
|
|
2045
|
-
function
|
|
2109
|
+
function Ot(e) {
|
|
2046
2110
|
let t = /* @__PURE__ */ new Set([e]);
|
|
2047
2111
|
return e.visit((e) => {
|
|
2048
|
-
let n =
|
|
2112
|
+
let n = J.get(e);
|
|
2049
2113
|
n && typeof n.name == "string" && t.add(e);
|
|
2050
2114
|
}), Array.from(t);
|
|
2051
2115
|
}
|
|
2052
|
-
function
|
|
2053
|
-
return
|
|
2116
|
+
function kt(e) {
|
|
2117
|
+
return X(e);
|
|
2054
2118
|
}
|
|
2055
|
-
function
|
|
2119
|
+
function At(e) {
|
|
2056
2120
|
return e.length ? "import scope [" + e.join(" / ") + "]" : "import scope (root)";
|
|
2057
2121
|
}
|
|
2058
|
-
function
|
|
2122
|
+
function jt(e, t, n) {
|
|
2059
2123
|
let r = /* @__PURE__ */ new Map();
|
|
2060
|
-
|
|
2124
|
+
Q(e, t, (e) => {
|
|
2061
2125
|
for (let [t, n] of e.paramRuntime.paramConfigs) {
|
|
2062
|
-
if (!
|
|
2126
|
+
if (!Z(n)) continue;
|
|
2063
2127
|
let i = r.get(t);
|
|
2064
2128
|
i ? i.push(e) : r.set(t, [e]);
|
|
2065
2129
|
}
|
|
@@ -2068,53 +2132,53 @@ function Dt(e, t, n) {
|
|
|
2068
2132
|
if (i.length <= 1) continue;
|
|
2069
2133
|
let r = i.map((e) => e.getPathString()).join(", ");
|
|
2070
2134
|
n.push({
|
|
2071
|
-
message: "Bookmarkable parameter \"" + e + "\" is not unique within " +
|
|
2135
|
+
message: "Bookmarkable parameter \"" + e + "\" is not unique within " + At(t) + ". Found in: " + r + ".",
|
|
2072
2136
|
scope: t
|
|
2073
2137
|
});
|
|
2074
2138
|
}
|
|
2075
2139
|
}
|
|
2076
|
-
function
|
|
2077
|
-
let r =
|
|
2140
|
+
function Mt(e, t, n) {
|
|
2141
|
+
let r = Nt(e, t);
|
|
2078
2142
|
if (!r.length) return;
|
|
2079
|
-
let i = r.filter((e) =>
|
|
2143
|
+
let i = r.filter((e) => Pt(e));
|
|
2080
2144
|
if (i.length <= 1) return;
|
|
2081
2145
|
let a = /* @__PURE__ */ new Map();
|
|
2082
2146
|
for (let e of i) {
|
|
2083
|
-
let t =
|
|
2147
|
+
let t = J.get(e), n = t ? t.name : void 0;
|
|
2084
2148
|
typeof n == "string" && n.length && a.set(n, (a.get(n) ?? 0) + 1);
|
|
2085
2149
|
}
|
|
2086
2150
|
for (let [e, r] of a) r > 1 && n.push({
|
|
2087
|
-
message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " +
|
|
2151
|
+
message: "Import instance name \"" + e + "\" is used multiple times for addressable instances in " + At(t) + ".",
|
|
2088
2152
|
scope: t
|
|
2089
2153
|
});
|
|
2090
2154
|
}
|
|
2091
|
-
function
|
|
2155
|
+
function Nt(e, t) {
|
|
2092
2156
|
let n = [];
|
|
2093
|
-
return
|
|
2094
|
-
if (
|
|
2095
|
-
let r =
|
|
2157
|
+
return Q(e, t, (e) => {
|
|
2158
|
+
if (X(e).length !== t.length + 1) return;
|
|
2159
|
+
let r = J.get(e);
|
|
2096
2160
|
r && typeof r.name == "string" && n.push(e);
|
|
2097
2161
|
}, { includeNamedImportRoots: !0 }), n;
|
|
2098
2162
|
}
|
|
2099
|
-
function
|
|
2163
|
+
function Pt(e) {
|
|
2100
2164
|
let t = !1;
|
|
2101
2165
|
return e.visit((e) => {
|
|
2102
|
-
let n =
|
|
2103
|
-
if (n === "excludeSubtree") return
|
|
2166
|
+
let n = Y.get(e);
|
|
2167
|
+
if (n === "excludeSubtree") return W;
|
|
2104
2168
|
if (n !== "exclude") {
|
|
2105
|
-
for (let n of e.paramRuntime.paramConfigs.values()) if (
|
|
2169
|
+
for (let n of e.paramRuntime.paramConfigs.values()) if (Z(n)) return t = !0, G;
|
|
2106
2170
|
}
|
|
2107
2171
|
}), t;
|
|
2108
2172
|
}
|
|
2109
|
-
function
|
|
2173
|
+
function Ft(e, t) {
|
|
2110
2174
|
let n = e, r = [];
|
|
2111
2175
|
for (let i of t) {
|
|
2112
2176
|
if (typeof i != "string" || !i.length) throw Error("Scope names must be non-empty strings.");
|
|
2113
2177
|
let t, a = !1;
|
|
2114
|
-
if (
|
|
2115
|
-
let n =
|
|
2116
|
-
if (n && n.name === i &&
|
|
2117
|
-
if (t) return a = !0,
|
|
2178
|
+
if (Q(e, r, (e) => {
|
|
2179
|
+
let n = J.get(e);
|
|
2180
|
+
if (n && n.name === i && X(e).length === r.length + 1) {
|
|
2181
|
+
if (t) return a = !0, G;
|
|
2118
2182
|
t = e;
|
|
2119
2183
|
}
|
|
2120
2184
|
}, { includeNamedImportRoots: !0 }), a) throw Error("Multiple import instances named \"" + i + "\" in scope.");
|
|
@@ -2123,25 +2187,25 @@ function jt(e, t) {
|
|
|
2123
2187
|
}
|
|
2124
2188
|
return n;
|
|
2125
2189
|
}
|
|
2126
|
-
function
|
|
2190
|
+
function Q(e, t, n, r = {}) {
|
|
2127
2191
|
let i = r.includeNamedImportRoots ?? !1;
|
|
2128
2192
|
e.visit((e) => {
|
|
2129
|
-
let r =
|
|
2130
|
-
if (a === "excludeSubtree") return
|
|
2131
|
-
if (a !== "exclude" &&
|
|
2193
|
+
let r = J.get(e), a = Y.get(e);
|
|
2194
|
+
if (a === "excludeSubtree") return W;
|
|
2195
|
+
if (a !== "exclude" && It(e, t, r, i)) return n(e);
|
|
2132
2196
|
});
|
|
2133
2197
|
}
|
|
2134
|
-
function
|
|
2135
|
-
let i =
|
|
2136
|
-
return
|
|
2198
|
+
function It(e, t, n, r) {
|
|
2199
|
+
let i = X(e);
|
|
2200
|
+
return Lt(i, t) ? !0 : !r || !n || typeof n.name != "string" || i.length !== t.length + 1 ? !1 : $(t, i);
|
|
2137
2201
|
}
|
|
2138
|
-
function
|
|
2139
|
-
return e.length === t.length &&
|
|
2202
|
+
function Lt(e, t) {
|
|
2203
|
+
return e.length === t.length && $(e, t);
|
|
2140
2204
|
}
|
|
2141
|
-
function
|
|
2205
|
+
function $(e, t) {
|
|
2142
2206
|
if (e.length > t.length) return !1;
|
|
2143
2207
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
2144
2208
|
return !0;
|
|
2145
2209
|
}
|
|
2146
2210
|
//#endregion
|
|
2147
|
-
export {
|
|
2211
|
+
export { P as A, D as B, Ue as C, Fe as D, Re as E, S as F, ve as G, le as H, k as I, pe as K, T as L, j as M, xe as N, F as O, x as P, fe as R, qe as S, Le as T, _e as U, E as V, b as W, G as _, ht as a, Xe as b, pt as c, St as d, xt as f, W as g, yt as h, gt as i, Ce as j, N as k, lt as l, bt as m, ft as n, vt as o, Tt as p, de as q, X as r, mt as s, wt as t, ut as u, rt as v, B as w, Ze as x, $e as y, ue as z };
|