@graphysdk/viz-engine 1.9.0-beta.1791303306567 → 1.9.0-beta.1791327466935
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/{annotations-Dbu_IKSb.js → annotations-DxhCRW-P.js} +1460 -1439
- package/dist/annotations-yCWHP5d2.cjs +1 -0
- package/dist/compiler-BrvFi5ri.cjs +1 -0
- package/dist/{compiler-OQqnbvBa.js → compiler-CA4I72Zj.js} +1862 -1696
- package/dist/graph-config.cjs +1 -1
- package/dist/graph-config.d.ts +70 -18
- package/dist/graph-config.mjs +36 -36
- package/dist/index.cjs +8 -8
- package/dist/index.d.ts +186 -42
- package/dist/index.mjs +2413 -2444
- package/dist/spec-builder-B9z0zfzu.cjs +1 -0
- package/dist/{spec-builder-PGdPuKYr.js → spec-builder-DFMsJ20K.js} +76 -76
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.ts +89 -23
- package/dist/testing.mjs +64 -62
- package/package.json +1 -1
- package/dist/annotations-BeLDhvXU.cjs +0 -1
- package/dist/compiler-CHaaZLZC.cjs +0 -1
- package/dist/spec-builder-Tvg21h5C.cjs +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { getContrast as je, mix as
|
|
2
|
-
import { differenceInDays as
|
|
3
|
-
import { isEqual as
|
|
4
|
-
var ut = "#FFFFFF", Be = "#1A1A1A",
|
|
1
|
+
import { getContrast as je, mix as $r, opacify as zt, parseToRgba as Ce } from "color2k";
|
|
2
|
+
import { differenceInDays as jr, isBefore as Hr, isValid as k, isWithinInterval as Kr, parse as le } from "date-fns";
|
|
3
|
+
import { isEqual as Xr, isInteger as qr, merge as Jr } from "lodash-es";
|
|
4
|
+
var ut = "#FFFFFF", Be = "#1A1A1A", Qr = 4.5, Zr = (e) => {
|
|
5
5
|
try {
|
|
6
6
|
const t = ce(e);
|
|
7
7
|
return je(t, ut) > je(t, Be) ? ut : Be;
|
|
8
8
|
} catch {
|
|
9
9
|
return Be;
|
|
10
10
|
}
|
|
11
|
-
},
|
|
11
|
+
}, Ti = (e, t) => {
|
|
12
12
|
try {
|
|
13
|
-
const r =
|
|
14
|
-
return r === void 0 || je(r, ce(e)) >=
|
|
13
|
+
const r = ea(void 0, t);
|
|
14
|
+
return r === void 0 || je(r, ce(e)) >= Qr ? e : Zr(r);
|
|
15
15
|
} catch {
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, ea = (e, t) => {
|
|
19
19
|
try {
|
|
20
20
|
const r = ce(t);
|
|
21
21
|
if (e === void 0) {
|
|
@@ -23,17 +23,17 @@ var ut = "#FFFFFF", Be = "#1A1A1A", Jr = 4.5, Qr = (e) => {
|
|
|
23
23
|
return s >= 1 ? r : void 0;
|
|
24
24
|
}
|
|
25
25
|
const a = ce(e), [, , , n] = Ce(a);
|
|
26
|
-
return n >= 1 ? a : Ce(r)[3] < 1 ? void 0 :
|
|
26
|
+
return n >= 1 ? a : Ce(r)[3] < 1 ? void 0 : $r(r, zt(a, 1), n);
|
|
27
27
|
} catch {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
},
|
|
30
|
+
}, wi = (e) => {
|
|
31
31
|
try {
|
|
32
32
|
return zt(ce(e), 1);
|
|
33
33
|
} catch {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, ta = (e, t) => {
|
|
37
37
|
if (t >= 1) return e;
|
|
38
38
|
try {
|
|
39
39
|
const [r, a, n, s] = Ce(ce(e));
|
|
@@ -54,100 +54,100 @@ var ut = "#FFFFFF", Be = "#1A1A1A", Jr = 4.5, Qr = (e) => {
|
|
|
54
54
|
if (i === void 0) return `${t[1]}(${o.join(", ")})`;
|
|
55
55
|
const l = i.endsWith("%") ? Number.parseFloat(i) / 100 : i;
|
|
56
56
|
return `${t[1]}a(${[...o, l].join(", ")})`;
|
|
57
|
-
}, He = (e) => e instanceof Date && k(e),
|
|
57
|
+
}, He = (e) => e instanceof Date && k(e), Si = (e) => He(e) || e === null, ki = (e) => typeof e == "string", S = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e), _i = (e) => S(e) || e === null, $ = Math.PI * 2, Li = 8, ra = 1e-9, aa = [
|
|
58
58
|
0,
|
|
59
59
|
Math.PI / 2,
|
|
60
60
|
Math.PI,
|
|
61
61
|
$ * 3 / 4
|
|
62
|
-
],
|
|
63
|
-
if (
|
|
62
|
+
], na = (e, t) => Math.abs(t - e) >= $ - ra, ue = (e) => (e % $ + $) % $, sa = (e, t, r) => {
|
|
63
|
+
if (na(t, r)) return !0;
|
|
64
64
|
const a = ue(r - t);
|
|
65
65
|
return ue(e - t) <= a;
|
|
66
66
|
}, $t = (e, t) => {
|
|
67
67
|
const r = Math.abs(ue(e) - ue(t));
|
|
68
68
|
return Math.min(r, $ - r);
|
|
69
|
-
},
|
|
69
|
+
}, Ri = (e, t) => {
|
|
70
70
|
const r = ue(t - e);
|
|
71
71
|
return r > Math.PI ? r - $ : r;
|
|
72
|
-
},
|
|
72
|
+
}, Ci = (e, t, r) => e * $ + t + r, ia = (e, t) => ({
|
|
73
73
|
x: t * Math.sin(e),
|
|
74
74
|
y: t * Math.cos(e)
|
|
75
75
|
}), q = (e, t) => {
|
|
76
|
-
const r =
|
|
76
|
+
const r = ia(e, t);
|
|
77
77
|
return {
|
|
78
78
|
x: 0.5 + r.x / 2,
|
|
79
79
|
y: 0.5 + r.y / 2
|
|
80
80
|
};
|
|
81
|
-
},
|
|
81
|
+
}, oa = (e, t, r, a) => {
|
|
82
82
|
const n = [
|
|
83
83
|
q(e, r),
|
|
84
84
|
q(e, a),
|
|
85
85
|
q(t, r),
|
|
86
86
|
q(t, a)
|
|
87
|
-
], s = Math.max(r, a), i =
|
|
87
|
+
], s = Math.max(r, a), i = aa.filter((l) => sa(l, e, t)).map((l) => q(l, s)), o = [...n, ...i];
|
|
88
88
|
return {
|
|
89
89
|
xMin: Math.min(...o.map((l) => l.x)),
|
|
90
90
|
xMax: Math.max(...o.map((l) => l.x)),
|
|
91
91
|
yMin: Math.min(...o.map((l) => l.y)),
|
|
92
92
|
yMax: Math.max(...o.map((l) => l.y))
|
|
93
93
|
};
|
|
94
|
-
},
|
|
94
|
+
}, la = (e, t) => ({
|
|
95
95
|
angle: ue(Math.atan2(e, t)),
|
|
96
96
|
radius: Math.hypot(e, t)
|
|
97
|
-
}),
|
|
97
|
+
}), ca = (e, t) => {
|
|
98
98
|
const r = e.x - 0.5, a = e.y - 0.5;
|
|
99
99
|
return {
|
|
100
100
|
x: t >= 1 ? r * 2 * t : r * 2,
|
|
101
101
|
y: t >= 1 ? a * 2 : a * 2 / t
|
|
102
102
|
};
|
|
103
|
-
},
|
|
104
|
-
const { x: r, y: a } =
|
|
105
|
-
return
|
|
106
|
-
}, jt = "\0graphy\0_",
|
|
107
|
-
bar:
|
|
108
|
-
line:
|
|
103
|
+
}, Di = (e, t) => {
|
|
104
|
+
const { x: r, y: a } = ca(e, t);
|
|
105
|
+
return la(r, a);
|
|
106
|
+
}, jt = "\0graphy\0_", v = (e) => `${jt}${e}`, Ht = { x: v("constantX") }, Ii = {
|
|
107
|
+
bar: v("barSeriesLabel"),
|
|
108
|
+
line: v("lineSeriesLabel")
|
|
109
109
|
}, Kt = {
|
|
110
|
-
count:
|
|
111
|
-
mean:
|
|
112
|
-
sum:
|
|
113
|
-
summaryEstimate:
|
|
114
|
-
summaryLower:
|
|
115
|
-
summaryUpper:
|
|
116
|
-
}, Ke = { group:
|
|
117
|
-
x:
|
|
118
|
-
y:
|
|
119
|
-
xBand:
|
|
120
|
-
yBand:
|
|
121
|
-
xMin:
|
|
122
|
-
xMax:
|
|
123
|
-
yMin:
|
|
124
|
-
yMax:
|
|
125
|
-
yRaw:
|
|
126
|
-
}, Xt = { role:
|
|
127
|
-
color:
|
|
128
|
-
size:
|
|
129
|
-
alpha:
|
|
130
|
-
strokeWidth:
|
|
131
|
-
lineType:
|
|
132
|
-
},
|
|
133
|
-
y:
|
|
134
|
-
x:
|
|
135
|
-
},
|
|
110
|
+
count: v("count"),
|
|
111
|
+
mean: v("mean"),
|
|
112
|
+
sum: v("sum"),
|
|
113
|
+
summaryEstimate: v("summaryEstimate"),
|
|
114
|
+
summaryLower: v("summaryLower"),
|
|
115
|
+
summaryUpper: v("summaryUpper")
|
|
116
|
+
}, Ke = { group: v("group") }, y = {
|
|
117
|
+
x: v("x"),
|
|
118
|
+
y: v("y"),
|
|
119
|
+
xBand: v("xBand"),
|
|
120
|
+
yBand: v("yBand"),
|
|
121
|
+
xMin: v("xMin"),
|
|
122
|
+
xMax: v("xMax"),
|
|
123
|
+
yMin: v("yMin"),
|
|
124
|
+
yMax: v("yMax"),
|
|
125
|
+
yRaw: v("yRaw")
|
|
126
|
+
}, Xt = { role: v("stackRole") }, fe = {
|
|
127
|
+
color: v("color"),
|
|
128
|
+
size: v("size"),
|
|
129
|
+
alpha: v("alpha"),
|
|
130
|
+
strokeWidth: v("strokeWidth"),
|
|
131
|
+
lineType: v("lineType")
|
|
132
|
+
}, ve = {
|
|
133
|
+
y: v("ruleY"),
|
|
134
|
+
x: v("ruleX")
|
|
135
|
+
}, Pi = {
|
|
136
136
|
...Ht,
|
|
137
137
|
...Kt,
|
|
138
138
|
...Ke,
|
|
139
139
|
...y,
|
|
140
140
|
...Xt,
|
|
141
141
|
...fe,
|
|
142
|
-
...
|
|
143
|
-
},
|
|
142
|
+
...ve
|
|
143
|
+
}, ua = new Set(Object.values(Kt)), da = (e) => v(`scaled_${e}`), Fi = (e) => e.startsWith(jt), ha = (e) => ua.has(e);
|
|
144
144
|
function Q(e) {
|
|
145
145
|
return e[y.x];
|
|
146
146
|
}
|
|
147
147
|
function j(e) {
|
|
148
148
|
return e[y.y];
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Oi(e) {
|
|
151
151
|
return e[y.xBand] ?? e[y.x];
|
|
152
152
|
}
|
|
153
153
|
function Ni(e) {
|
|
@@ -165,18 +165,18 @@ function H(e) {
|
|
|
165
165
|
function K(e) {
|
|
166
166
|
return e[y.yMax];
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function fa(e) {
|
|
169
169
|
return e[y.yRaw];
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return e[
|
|
171
|
+
function Bi(e, t) {
|
|
172
|
+
return e[da(t)];
|
|
173
173
|
}
|
|
174
|
-
var
|
|
174
|
+
var pa = {
|
|
175
175
|
xMin: 0,
|
|
176
176
|
xMax: 1,
|
|
177
177
|
yMin: 0,
|
|
178
178
|
yMax: 1
|
|
179
|
-
},
|
|
179
|
+
}, ya = (e, t) => {
|
|
180
180
|
const r = Z(e) ?? Q(e), a = ee(e) ?? Q(e), n = H(e) ?? j(e), s = K(e) ?? j(e);
|
|
181
181
|
return !S(r) || !S(a) || !S(n) || !S(s) ? null : t.type !== "polar" ? {
|
|
182
182
|
xMin: r,
|
|
@@ -184,7 +184,7 @@ var fa = {
|
|
|
184
184
|
yMin: n,
|
|
185
185
|
yMax: s
|
|
186
186
|
} : {
|
|
187
|
-
...
|
|
187
|
+
...oa(r, a, n, s),
|
|
188
188
|
space: "disk"
|
|
189
189
|
};
|
|
190
190
|
}, qt = (e, t) => {
|
|
@@ -236,24 +236,24 @@ var fa = {
|
|
|
236
236
|
y: a
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, Vi = (e) => qt(pa, e), Xe = (e) => (Array.isArray(e) ? e : [e]).map((t) => t instanceof Date ? t.toISOString() : String(t ?? "<null>")).join("\0"), Wi = (e, t) => e === t ? !0 : He(e) && He(t) ? e.getTime() === t.getTime() : !1, ga = (e) => e === null ? "null" : e instanceof Date ? `date:${e.getTime()}` : `${typeof e}:${e}`, Ui = (e) => e.length > 0;
|
|
240
240
|
function Y(e) {
|
|
241
241
|
return e != null;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Yi(e) {
|
|
244
244
|
if (e === null || typeof e != "object") return !1;
|
|
245
245
|
const t = Object.getPrototypeOf(e);
|
|
246
246
|
return t === Object.prototype || t === null;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Gi(e) {
|
|
249
249
|
const { numeric: t, categorical: r, temporal: a } = e.groupVariableNamesByType();
|
|
250
250
|
return a[0] ?? r[0] ?? t[0] ?? "";
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function zi(e, t) {
|
|
253
253
|
const { categorical: r, temporal: a } = e.groupVariableNamesByType(), n = [...r, ...a];
|
|
254
254
|
return t === "" || n.includes(t) ? n : [t, ...n];
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function $i(e) {
|
|
257
257
|
const t = D(e.x);
|
|
258
258
|
return t === null || t === Ht.x ? "" : t;
|
|
259
259
|
}
|
|
@@ -264,21 +264,21 @@ function De(e) {
|
|
|
264
264
|
if (!(!Y(e) || typeof e == "string") && "value" in e)
|
|
265
265
|
return e.value;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function ji(e, t) {
|
|
268
268
|
return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((r) => dt(e[r]) === dt(t[r]));
|
|
269
269
|
}
|
|
270
270
|
function dt(e) {
|
|
271
271
|
const t = D(e);
|
|
272
272
|
if (t !== null) return `variable:${t}`;
|
|
273
273
|
const r = De(e);
|
|
274
|
-
return r === void 0 ? "" : `value:${
|
|
274
|
+
return r === void 0 ? "" : `value:${ga(r)}`;
|
|
275
275
|
}
|
|
276
|
-
var
|
|
276
|
+
var ma = [
|
|
277
277
|
"stack",
|
|
278
278
|
"dodge",
|
|
279
279
|
"identity",
|
|
280
280
|
"fill"
|
|
281
|
-
],
|
|
281
|
+
], va = [
|
|
282
282
|
"solid",
|
|
283
283
|
"dashed",
|
|
284
284
|
"dotted"
|
|
@@ -313,7 +313,7 @@ var ga = [
|
|
|
313
313
|
dashed: [1.5, 3],
|
|
314
314
|
dotted: [0, 2]
|
|
315
315
|
}
|
|
316
|
-
},
|
|
316
|
+
}, Hi = (e) => va.includes(e);
|
|
317
317
|
function Ae(e) {
|
|
318
318
|
return e === "stack" || e === "fill";
|
|
319
319
|
}
|
|
@@ -332,22 +332,22 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
332
332
|
code: e.code ?? "INTERNAL_INVARIANT"
|
|
333
333
|
}), this.kind = "internal";
|
|
334
334
|
}
|
|
335
|
-
}, Qt = (e) => e.type === "lookup", ba = (e) => e.type === "text", Ee = (e) => e.type === "date" || e.type === "datetime" || e.type === "year" || e.type === "month_year" || e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range" || e.type === "weekly_date_range_with_year" || e.type === "quarter" || e.type === "time",
|
|
335
|
+
}, Qt = (e) => e.type === "lookup", ba = (e) => e.type === "text", Ee = (e) => e.type === "date" || e.type === "datetime" || e.type === "year" || e.type === "month_year" || e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range" || e.type === "weekly_date_range_with_year" || e.type === "quarter" || e.type === "time", Aa = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", Ki = (e) => e.type === "currency", Xi = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", Zt = (e) => {
|
|
336
336
|
if (Qt(e)) return Zt(e.fallback);
|
|
337
337
|
if (Ee(e)) return "temporal";
|
|
338
|
-
if (
|
|
338
|
+
if (Aa(e)) return "numeric";
|
|
339
339
|
if (ba(e)) return "categorical";
|
|
340
340
|
throw new R({ message: `No data type found for value format: ${e.type}` });
|
|
341
|
-
},
|
|
341
|
+
}, qi = (e) => Qt(e) ? e.fallback : e, xa = class {
|
|
342
342
|
constructor() {
|
|
343
343
|
this.currentYear = (/* @__PURE__ */ new Date()).getUTCFullYear(), this.previousDate = null, this.previousYear = null;
|
|
344
344
|
}
|
|
345
345
|
incrementYearIfNeeded(e) {
|
|
346
|
-
this.previousYear === null ? this.previousYear = e.getUTCFullYear() : this.previousDate !== null &&
|
|
346
|
+
this.previousYear === null ? this.previousYear = e.getUTCFullYear() : this.previousDate !== null && Hr(new Date(this.currentYear, e.getUTCMonth(), e.getUTCDate()), new Date(this.currentYear, this.previousDate.getUTCMonth(), this.previousDate.getUTCDate())) && this.previousYear++;
|
|
347
347
|
const t = new Date(e.getTime());
|
|
348
348
|
return t.setUTCFullYear(this.previousYear), this.previousDate = t, t;
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, Ma = {
|
|
351
351
|
k: 1e3,
|
|
352
352
|
m: 1e6,
|
|
353
353
|
b: 1e9,
|
|
@@ -357,7 +357,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
357
357
|
"m",
|
|
358
358
|
"b",
|
|
359
359
|
"t"
|
|
360
|
-
],
|
|
360
|
+
], Ea = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${et.join("|")})?$`, "i"), Ta = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, te = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? Ea.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${et.join("")}]`, "gi"), ""))) : Number.isFinite(Number(e)), er = (e) => te(e) ? !0 : typeof e == "string" ? Ta.test(e) : !1, wa = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, Sa = /^\s*(1[89]\d{2}|2[01]\d{2})\s*$/, ka = [
|
|
361
361
|
[/\bJan\b/i, "January"],
|
|
362
362
|
[/\bFeb\b/i, "February"],
|
|
363
363
|
[/\bMar\b/i, "March"],
|
|
@@ -369,7 +369,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
369
369
|
[/\bOct\b/i, "October"],
|
|
370
370
|
[/\bNov\b/i, "November"],
|
|
371
371
|
[/\bDec\b/i, "December"]
|
|
372
|
-
],
|
|
372
|
+
], _a = {
|
|
373
373
|
"en-US": "MDY",
|
|
374
374
|
"en-GB": "DMY",
|
|
375
375
|
"pt-PT": "DMY",
|
|
@@ -564,7 +564,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
564
564
|
["MMMM", "d"],
|
|
565
565
|
["MMMM", "dd"],
|
|
566
566
|
["MMMM", "do"]
|
|
567
|
-
],
|
|
567
|
+
], La = [
|
|
568
568
|
{
|
|
569
569
|
dateFormat: "MMMM d, yyyy",
|
|
570
570
|
type: "date"
|
|
@@ -581,35 +581,35 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
581
581
|
dateFormat: "yyyy-MM",
|
|
582
582
|
type: "month_year"
|
|
583
583
|
}
|
|
584
|
-
], ar = 1800, nr = 2199,
|
|
584
|
+
], ar = 1800, nr = 2199, Ra = 3, Ca = 6, Da = 5, Ia = 1, Pa = 28, Fa = /\s*[–—]\s*|\s-\s/, Oa = (e) => typeof e == "number" ? Number.isInteger(e) && e >= ar && e <= nr : typeof e == "string" ? Sa.test(e) : !1, sr = (e, t) => {
|
|
585
585
|
const r = xe(e);
|
|
586
|
-
return !t && te(r) ?
|
|
586
|
+
return !t && te(r) ? Wa(r) : typeof r == "string" ? t ? k(le(r, t, /* @__PURE__ */ new Date())) : !!ir(r) || Pe(r) && k(new Date(r)) : k(r);
|
|
587
587
|
}, xe = (e) => {
|
|
588
588
|
if (typeof e != "string") return e;
|
|
589
589
|
let t = e;
|
|
590
|
-
for (const [r, a] of
|
|
590
|
+
for (const [r, a] of ka) t = t.replace(r, a);
|
|
591
591
|
return t;
|
|
592
592
|
}, ir = (e, t = Ie) => {
|
|
593
593
|
const r = xe(e);
|
|
594
|
-
return
|
|
595
|
-
},
|
|
594
|
+
return Pe(r) ? { type: "datetime" } : or(t).find((a) => !Ee(a) || a.type === "month" && r.length < Ra ? !1 : a.dateFormat && k(le(r, a.dateFormat, /* @__PURE__ */ new Date())));
|
|
595
|
+
}, Pe = (e) => wa.test(e.trim()), Na = (e) => {
|
|
596
596
|
if (e instanceof Date) return k(e) ? e : null;
|
|
597
|
-
if (typeof e != "string" || !
|
|
597
|
+
if (typeof e != "string" || !Pe(e)) return null;
|
|
598
598
|
const t = new Date(e.trim());
|
|
599
599
|
return k(t) ? t : null;
|
|
600
|
-
},
|
|
600
|
+
}, Ba = (e, t = Ie) => {
|
|
601
601
|
const [r, a] = e.split(Fa);
|
|
602
602
|
if (!r || !a) return;
|
|
603
603
|
const n = xe(r).trim(), s = xe(a).trim();
|
|
604
|
-
return
|
|
604
|
+
return Va(t).find((i) => {
|
|
605
605
|
if (!Ee(i) || !i.dateFormat) return !1;
|
|
606
606
|
const o = le(n, i.dateFormat, /* @__PURE__ */ new Date()), l = le(s, i.dateFormat, /* @__PURE__ */ new Date());
|
|
607
607
|
if (!k(o) || !k(l)) return !1;
|
|
608
|
-
const c = new
|
|
609
|
-
return
|
|
608
|
+
const c = new xa(), u = c.incrementYearIfNeeded(o), h = c.incrementYearIfNeeded(l), d = jr(h, u);
|
|
609
|
+
return Kr(new Date(u.getFullYear(), Ia, Pa), {
|
|
610
610
|
start: u,
|
|
611
611
|
end: h
|
|
612
|
-
}) && d ===
|
|
612
|
+
}) && d === Da ? !0 : d === Ca;
|
|
613
613
|
});
|
|
614
614
|
}, or = (e) => {
|
|
615
615
|
const t = {
|
|
@@ -620,11 +620,11 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
620
620
|
month: [["MMMM"]],
|
|
621
621
|
quarter: [["QQQ", "yyyy"], ["yyyy", "QQQ"]]
|
|
622
622
|
};
|
|
623
|
-
return [...
|
|
623
|
+
return [...La, ...Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => tr.map((s) => ({
|
|
624
624
|
dateFormat: n.join(s),
|
|
625
625
|
type: r
|
|
626
626
|
}))))];
|
|
627
|
-
}, lr = (e) =>
|
|
627
|
+
}, lr = (e) => _a[e] === "MDY" ? [
|
|
628
628
|
...ft,
|
|
629
629
|
...ht,
|
|
630
630
|
...pt
|
|
@@ -632,7 +632,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
632
632
|
...ht,
|
|
633
633
|
...ft,
|
|
634
634
|
...pt
|
|
635
|
-
],
|
|
635
|
+
], Va = (e) => {
|
|
636
636
|
const t = {
|
|
637
637
|
weekly_date_range: rr,
|
|
638
638
|
weekly_date_range_with_year: lr(e)
|
|
@@ -641,9 +641,9 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
641
641
|
dateFormat: n.join(s),
|
|
642
642
|
type: r
|
|
643
643
|
}))));
|
|
644
|
-
},
|
|
644
|
+
}, Wa = (e) => {
|
|
645
645
|
const t = Number(e);
|
|
646
|
-
if (!
|
|
646
|
+
if (!qr(t)) return !1;
|
|
647
647
|
const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (s) => k(s) && s.getFullYear() >= ar && s.getFullYear() <= nr;
|
|
648
648
|
return n(r) || n(a);
|
|
649
649
|
}, cr = {
|
|
@@ -684,7 +684,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
684
684
|
return t.length ? te(t) : !1;
|
|
685
685
|
}
|
|
686
686
|
return te(e);
|
|
687
|
-
},
|
|
687
|
+
}, Ua = (e) => {
|
|
688
688
|
const t = hr(e), r = t ? cr[t] : void 0;
|
|
689
689
|
if (!r) throw new R({ message: "Could not get currency ISO" });
|
|
690
690
|
return r;
|
|
@@ -699,7 +699,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
699
699
|
}, hr = (e) => Object.keys(cr).sort((t, r) => r.length - t.length).find((t) => e.includes(t)), fr = (e) => {
|
|
700
700
|
const t = Object.entries(e);
|
|
701
701
|
return !t.length || !t.some(([, r]) => !he(r));
|
|
702
|
-
}, he = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-",
|
|
702
|
+
}, he = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", Ya = /\s*[–—]\s*|\s-\s/, pr = (e, t, r) => {
|
|
703
703
|
if (he(e)) return null;
|
|
704
704
|
switch (t.type) {
|
|
705
705
|
case "decimal":
|
|
@@ -707,9 +707,9 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
707
707
|
case "duration":
|
|
708
708
|
return gr(e);
|
|
709
709
|
case "percentage":
|
|
710
|
-
return Ya(e);
|
|
711
|
-
case "currency":
|
|
712
710
|
return Ga(e);
|
|
711
|
+
case "currency":
|
|
712
|
+
return za(e);
|
|
713
713
|
case "datetime":
|
|
714
714
|
case "date":
|
|
715
715
|
case "year":
|
|
@@ -721,9 +721,9 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
721
721
|
return yr(e, t.dateFormat, r);
|
|
722
722
|
case "weekly_date_range":
|
|
723
723
|
case "weekly_date_range_with_year":
|
|
724
|
-
return
|
|
724
|
+
return $a(e, t.dateFormat, r);
|
|
725
725
|
case "text":
|
|
726
|
-
return
|
|
726
|
+
return ja(e);
|
|
727
727
|
case "lookup":
|
|
728
728
|
throw new R({ message: "Cannot parse: lookup value formats are produced by transforms, not raw input" });
|
|
729
729
|
default:
|
|
@@ -744,7 +744,7 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
744
744
|
if (k(o)) return Ve(o);
|
|
745
745
|
}
|
|
746
746
|
const s = new Date(a);
|
|
747
|
-
return sr(s) ?
|
|
747
|
+
return sr(s) ? Pe(a) ? s : Ve(s) : null;
|
|
748
748
|
}, gr = (e) => {
|
|
749
749
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
750
750
|
if (typeof e != "string") return null;
|
|
@@ -752,451 +752,833 @@ var Ie = "en-GB", Jt = class extends Error {
|
|
|
752
752
|
if (!te(t)) return null;
|
|
753
753
|
let r = 1;
|
|
754
754
|
for (const a of et) if (new RegExp(`${a}$`, "i").test(t)) {
|
|
755
|
-
r =
|
|
755
|
+
r = Ma[a], t = t.slice(0, -1);
|
|
756
756
|
break;
|
|
757
757
|
}
|
|
758
758
|
return Number(t.split(",").join("")) * r;
|
|
759
|
-
},
|
|
759
|
+
}, Ga = (e) => {
|
|
760
760
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
761
761
|
if (typeof e != "string") return null;
|
|
762
762
|
const t = e.trim();
|
|
763
763
|
if (!er(t)) return null;
|
|
764
764
|
const r = Number(t.replace(/%/g, "").replace(/,/g, "")) / 100;
|
|
765
765
|
return Number.isNaN(r) ? null : r;
|
|
766
|
-
},
|
|
766
|
+
}, za = (e) => {
|
|
767
767
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
768
768
|
if (typeof e != "string") return null;
|
|
769
769
|
const t = e.trim();
|
|
770
770
|
return ur(t) ? gr(dr(t)) : null;
|
|
771
|
-
},
|
|
772
|
-
const a = String(e).trim().split(
|
|
771
|
+
}, $a = (e, t, r) => {
|
|
772
|
+
const a = String(e).trim().split(Ya), [n, s] = [a[0]?.trim(), a[1]?.trim()];
|
|
773
773
|
return !n || !s ? null : yr(n, t, r);
|
|
774
|
-
},
|
|
774
|
+
}, ja = (e) => String(e).trim(), Ve = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), mr = (e, t, r) => {
|
|
775
775
|
if (t.type === "text" && typeof e == "string") return e;
|
|
776
776
|
const a = pr(e, t, r);
|
|
777
777
|
return a !== null || !Ee(t) ? a : Na(e);
|
|
778
|
-
}, ie = process.env.NODE_ENV !== "production"
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
778
|
+
}, ie = process.env.NODE_ENV !== "production", vr = [
|
|
779
|
+
"none",
|
|
780
|
+
"xs",
|
|
781
|
+
"sm",
|
|
782
|
+
"md",
|
|
783
|
+
"lg",
|
|
784
|
+
"xl",
|
|
785
|
+
"full"
|
|
786
|
+
], Ji = {
|
|
787
|
+
point: Ka,
|
|
788
|
+
line: Xa,
|
|
789
|
+
area: qa,
|
|
790
|
+
bar: Ja,
|
|
791
|
+
rule: Qa,
|
|
792
|
+
tile: Za
|
|
793
|
+
}, Ha = (e) => typeof e == "string" && vr.includes(e);
|
|
794
|
+
function pe(e, t) {
|
|
795
|
+
return {
|
|
796
|
+
type: "layer",
|
|
797
|
+
id: t.id,
|
|
798
|
+
geom: e,
|
|
799
|
+
mapping: t.aes,
|
|
800
|
+
stat: t.stat,
|
|
801
|
+
params: t.params,
|
|
802
|
+
position: t.position,
|
|
803
|
+
yScaleType: t.yScaleType,
|
|
804
|
+
transforms: t.transforms,
|
|
805
|
+
interactive: t.interactive,
|
|
806
|
+
tooltip: t.tooltip,
|
|
807
|
+
dataLabels: t.dataLabels
|
|
808
808
|
};
|
|
809
|
-
return Object.assign((a, n, s) => {
|
|
810
|
-
if (!Pe)
|
|
811
|
-
return ie && (t.misses += 1), s();
|
|
812
|
-
const i = e.get(a);
|
|
813
|
-
if (i) for (let l = 0; l < i.length; l += 1) {
|
|
814
|
-
const c = i[l];
|
|
815
|
-
if (c && br(c.args, n))
|
|
816
|
-
return ie && (t.hits += 1), l > 0 && (i.splice(l, 1), i.unshift(c)), c.out;
|
|
817
|
-
}
|
|
818
|
-
ie && (t.misses += 1);
|
|
819
|
-
const o = s();
|
|
820
|
-
return i ? (i.unshift({
|
|
821
|
-
args: n,
|
|
822
|
-
out: o
|
|
823
|
-
}), i.length > 16 && (i.length = 16)) : e.set(a, [{
|
|
824
|
-
args: n,
|
|
825
|
-
out: o
|
|
826
|
-
}]), o;
|
|
827
|
-
}, { stats: t });
|
|
828
|
-
}, Zi = (...e) => e.reduce((t, r) => ({
|
|
829
|
-
hits: t.hits + r.hits,
|
|
830
|
-
misses: t.misses + r.misses
|
|
831
|
-
}), {
|
|
832
|
-
hits: 0,
|
|
833
|
-
misses: 0
|
|
834
|
-
}), br = (e, t) => {
|
|
835
|
-
if (e.length !== t.length) return !1;
|
|
836
|
-
for (let r = 0; r < e.length; r += 1) if (e[r] !== t[r]) return !1;
|
|
837
|
-
return !0;
|
|
838
|
-
}, Ha = class {
|
|
839
|
-
constructor() {
|
|
840
|
-
this.memo = ja(), this.singletonKey = {};
|
|
841
|
-
}
|
|
842
|
-
get stats() {
|
|
843
|
-
return this.memo.stats;
|
|
844
|
-
}
|
|
845
|
-
compile(e) {
|
|
846
|
-
return this.memo(this.key(e), this.dependencies(e), () => this.run(e));
|
|
847
|
-
}
|
|
848
|
-
key(e) {
|
|
849
|
-
return this.singletonKey;
|
|
850
|
-
}
|
|
851
|
-
}, tt = (e, t) => e >= 0 && e <= 1 && t >= 0 && t <= 1, eo = ["x", "y"], Ka = /* @__PURE__ */ new Set([
|
|
852
|
-
"x",
|
|
853
|
-
"y",
|
|
854
|
-
"ySecondary"
|
|
855
|
-
]), vr = /* @__PURE__ */ new Set([
|
|
856
|
-
"color",
|
|
857
|
-
"size",
|
|
858
|
-
"alpha",
|
|
859
|
-
"strokeWidth",
|
|
860
|
-
"lineType"
|
|
861
|
-
]), Xa = (e) => Ka.has(e), qa = (e) => vr.has(e), to = (e) => Xa(e) || qa(e);
|
|
862
|
-
function Ja(e) {
|
|
863
|
-
return e === "secondary" ? "ySecondary" : "y";
|
|
864
809
|
}
|
|
865
|
-
function
|
|
866
|
-
return
|
|
810
|
+
function Ka(e = {}) {
|
|
811
|
+
return pe("point", e);
|
|
867
812
|
}
|
|
868
|
-
function
|
|
869
|
-
return
|
|
813
|
+
function Xa(e = {}) {
|
|
814
|
+
return pe("line", e);
|
|
870
815
|
}
|
|
871
|
-
|
|
872
|
-
"
|
|
873
|
-
"sum",
|
|
874
|
-
"mean",
|
|
875
|
-
"median"
|
|
876
|
-
]);
|
|
877
|
-
function Ar(e, t) {
|
|
878
|
-
return Qa.has(e) ? "numeric" : t;
|
|
816
|
+
function qa(e = {}) {
|
|
817
|
+
return pe("area", e);
|
|
879
818
|
}
|
|
880
|
-
function
|
|
881
|
-
|
|
882
|
-
code: "INCOMPATIBLE_TYPE",
|
|
883
|
-
message: `'${e}' requires a numeric variable (got '${a.type}' for '${a.variableName}')`,
|
|
884
|
-
context: {
|
|
885
|
-
variableName: a.variableName,
|
|
886
|
-
variableType: a.type
|
|
887
|
-
}
|
|
888
|
-
});
|
|
889
|
-
const n = r?.length ?? t.length;
|
|
890
|
-
if (e === "count") return n;
|
|
891
|
-
if (e === "median" || e === "mode") {
|
|
892
|
-
const o = [];
|
|
893
|
-
for (let l = 0; l < n; l++) {
|
|
894
|
-
const c = We(t, r, l);
|
|
895
|
-
Ue(c) && o.push(c);
|
|
896
|
-
}
|
|
897
|
-
return o.length === 0 ? null : e === "median" ? tn(o) : rn(o);
|
|
898
|
-
}
|
|
899
|
-
if (e === "sum" || e === "mean") {
|
|
900
|
-
let o = 0, l = 0;
|
|
901
|
-
for (let c = 0; c < n; c++) {
|
|
902
|
-
const u = We(t, r, c);
|
|
903
|
-
Ue(u) && (o++, l += Number(u));
|
|
904
|
-
}
|
|
905
|
-
return o === 0 ? null : e === "sum" ? l : l / o;
|
|
906
|
-
}
|
|
907
|
-
const s = e === "min" ? -1 : 1;
|
|
908
|
-
let i = null;
|
|
909
|
-
for (let o = 0; o < n; o++) {
|
|
910
|
-
const l = We(t, r, o);
|
|
911
|
-
Ue(l) && (i === null || Za(l, i) === s) && (i = l);
|
|
912
|
-
}
|
|
913
|
-
return i;
|
|
819
|
+
function Ja(e = {}) {
|
|
820
|
+
return pe("bar", e);
|
|
914
821
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
const t = e.map(Number).sort((s, i) => s - i);
|
|
918
|
-
if (t.length === 1) return t[0] ?? 0;
|
|
919
|
-
const r = (t.length - 1) / 2, a = Math.floor(r), n = t[a] ?? 0;
|
|
920
|
-
return n + ((t[a + 1] ?? n) - n) * (r - a);
|
|
822
|
+
function Qa(e = {}) {
|
|
823
|
+
return pe("rule", e);
|
|
921
824
|
}
|
|
922
|
-
function
|
|
923
|
-
|
|
924
|
-
for (const n of e) {
|
|
925
|
-
const s = en(n), i = t.get(s);
|
|
926
|
-
i === void 0 ? t.set(s, {
|
|
927
|
-
value: n,
|
|
928
|
-
count: 1
|
|
929
|
-
}) : i.count++;
|
|
930
|
-
}
|
|
931
|
-
let r = null, a = 0;
|
|
932
|
-
for (const { value: n, count: s } of t.values()) s > a && (a = s, r = n);
|
|
933
|
-
return r;
|
|
825
|
+
function Za(e = {}) {
|
|
826
|
+
return pe("tile", e);
|
|
934
827
|
}
|
|
935
|
-
var
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
828
|
+
var en = [
|
|
829
|
+
"diagonal",
|
|
830
|
+
"dots",
|
|
831
|
+
"crosshatch",
|
|
832
|
+
"lines"
|
|
833
|
+
], tn = ["tile", "stretch"], br = (e) => typeof e == "object" && e !== null && "gradient" in e, Ar = (e) => typeof e == "object" && e !== null && "pattern" in e, rn = (e) => typeof e == "object" && e !== null && "image" in e, an = (e) => typeof e != "object" ? e : br(e) ? e.stops[0]?.color ?? "transparent" : Ar(e) ? e.color : e.fallback, Qi = (e) => typeof e == "string" ? e : JSON.stringify(e), nn = [
|
|
834
|
+
"topLeft",
|
|
835
|
+
"topRight",
|
|
836
|
+
"bottomRight",
|
|
837
|
+
"bottomLeft"
|
|
838
|
+
], Zi = ["dimmed", "hovered"], sn = [
|
|
839
|
+
"normal",
|
|
840
|
+
"italic",
|
|
841
|
+
"oblique"
|
|
842
|
+
], on = [
|
|
843
|
+
"none",
|
|
844
|
+
"uppercase",
|
|
845
|
+
"lowercase",
|
|
846
|
+
"capitalize"
|
|
847
|
+
], ln = [
|
|
848
|
+
"none",
|
|
849
|
+
"underline",
|
|
850
|
+
"line-through"
|
|
851
|
+
], cn = [
|
|
852
|
+
"butt",
|
|
853
|
+
"round",
|
|
854
|
+
"square"
|
|
855
|
+
], un = [
|
|
856
|
+
"miter",
|
|
857
|
+
"round",
|
|
858
|
+
"bevel"
|
|
859
|
+
], dn = [
|
|
860
|
+
"normal",
|
|
861
|
+
"multiply",
|
|
862
|
+
"screen",
|
|
863
|
+
"overlay",
|
|
864
|
+
"darken",
|
|
865
|
+
"lighten"
|
|
866
|
+
], hn = [
|
|
867
|
+
"circle",
|
|
868
|
+
"square",
|
|
869
|
+
"diamond",
|
|
870
|
+
"triangle",
|
|
871
|
+
"cross",
|
|
872
|
+
"star",
|
|
873
|
+
"wye"
|
|
874
|
+
], eo = [
|
|
875
|
+
"fill",
|
|
876
|
+
"overlay",
|
|
877
|
+
"stroke",
|
|
878
|
+
"alpha",
|
|
879
|
+
"saturation",
|
|
880
|
+
"blur",
|
|
881
|
+
"brightness",
|
|
882
|
+
"contrast",
|
|
883
|
+
"cornerRadius",
|
|
884
|
+
"strokeWidth",
|
|
885
|
+
"dashArray",
|
|
886
|
+
"lineCap",
|
|
887
|
+
"lineJoin",
|
|
888
|
+
"strokeAlpha",
|
|
889
|
+
"fillAlpha",
|
|
890
|
+
"size",
|
|
891
|
+
"symbol",
|
|
892
|
+
"fontFamily",
|
|
893
|
+
"fontSize",
|
|
894
|
+
"fontWeight",
|
|
895
|
+
"fontStyle",
|
|
896
|
+
"letterSpacing",
|
|
897
|
+
"textTransform",
|
|
898
|
+
"textDecoration",
|
|
899
|
+
"textOutlineColor",
|
|
900
|
+
"textOutlineWidth",
|
|
901
|
+
"textShadow",
|
|
902
|
+
"lineHeight",
|
|
903
|
+
"textScale",
|
|
904
|
+
"textColor",
|
|
905
|
+
"offset",
|
|
906
|
+
"gap",
|
|
907
|
+
"length",
|
|
908
|
+
"paddingInline",
|
|
909
|
+
"paddingBlock",
|
|
910
|
+
"padding",
|
|
911
|
+
"margin",
|
|
912
|
+
"shadow",
|
|
913
|
+
"blendMode"
|
|
914
|
+
], yt = 1, gt = 1e3, mt = "'none' or a shadow object { offsetX, offsetY, blur, color }", vt = "a non-negative number of pixels, or an object of those per edge", fn = "a non-empty color string, a { light, dark } pair, or a token(...) reference", pn = [
|
|
915
|
+
"top",
|
|
916
|
+
"right",
|
|
917
|
+
"bottom",
|
|
918
|
+
"left"
|
|
919
|
+
], ke = "a color, a { gradient, stops } object, a { pattern, color } object, or an { image, fallback } object", bt = "a number of pixels, or { topLeft, topRight, bottomRight, bottomLeft } in pixels", Fe = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", xr = (e) => typeof e == "object" && e !== null && typeof e.token == "string", yn = (e) => typeof e == "string" ? e.trim().length > 0 : Fe(e) && e.light.trim().length > 0 && e.dark.trim().length > 0;
|
|
920
|
+
function f(e) {
|
|
921
|
+
return { token: e };
|
|
922
|
+
}
|
|
923
|
+
var At = (e, t) => {
|
|
924
|
+
if (typeof e != "object" || e === null) return e;
|
|
925
|
+
if (Fe(e)) return e[t];
|
|
926
|
+
if (Array.isArray(e)) {
|
|
927
|
+
if (e.every((n) => typeof n == "number")) return e;
|
|
928
|
+
const a = e.map((n) => At(n, t));
|
|
929
|
+
return a.every((n, s) => n === e[s]) ? e : a;
|
|
951
930
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
return
|
|
931
|
+
const r = Object.entries(e).map(([a, n]) => [a, At(n, t)]);
|
|
932
|
+
return r.every(([a, n]) => n === e[a]) ? e : Object.fromEntries(r);
|
|
933
|
+
}, x = (e) => typeof e == "number" && Number.isFinite(e), m = (e, t) => ({
|
|
934
|
+
status: "rejected",
|
|
935
|
+
expected: e,
|
|
936
|
+
actual: t
|
|
937
|
+
}), X = (e) => {
|
|
938
|
+
const t = `one of ${e.map((r) => `'${String(r)}'`).join(", ")}`;
|
|
939
|
+
return (r) => e.includes(r) ? {
|
|
940
|
+
status: "accepted",
|
|
941
|
+
value: r
|
|
942
|
+
} : m(t, r);
|
|
943
|
+
}, J = (e, t) => {
|
|
944
|
+
if (typeof e == "string")
|
|
945
|
+
return e.trim().length > 0 ? {
|
|
946
|
+
status: "accepted",
|
|
947
|
+
value: e
|
|
948
|
+
} : m("a non-empty color string", e);
|
|
949
|
+
if (xr(e)) {
|
|
950
|
+
const r = t[e.token];
|
|
951
|
+
return r === void 0 ? {
|
|
952
|
+
status: "unknownToken",
|
|
953
|
+
token: e.token
|
|
954
|
+
} : yn(r) ? {
|
|
955
|
+
status: "accepted",
|
|
956
|
+
value: typeof r == "string" ? r : {
|
|
957
|
+
light: r.light,
|
|
958
|
+
dark: r.dark
|
|
959
|
+
}
|
|
960
|
+
} : { status: "dropped" };
|
|
967
961
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
962
|
+
return Fe(e) && e.light.trim().length > 0 && e.dark.trim().length > 0 ? {
|
|
963
|
+
status: "accepted",
|
|
964
|
+
value: {
|
|
965
|
+
light: e.light,
|
|
966
|
+
dark: e.dark
|
|
973
967
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
968
|
+
} : m(fn, e);
|
|
969
|
+
}, Mr = (e, t) => {
|
|
970
|
+
if (typeof e != "object" || e === null || Fe(e) || xr(e)) return J(e, t);
|
|
971
|
+
const r = e;
|
|
972
|
+
if (br(r)) {
|
|
973
|
+
const a = r.gradient;
|
|
974
|
+
if (a !== "linear" && a !== "radial") return m(ke, e);
|
|
975
|
+
if (!Array.isArray(r.stops) || r.stops.length < 2) return m("a gradient with at least two stops", e);
|
|
976
|
+
const n = [];
|
|
977
|
+
for (const s of r.stops) {
|
|
978
|
+
if (!x(s.offset) || s.offset < 0 || s.offset > 1) return m("a gradient stop offset in [0, 1]", e);
|
|
979
|
+
const i = J(s.color, t);
|
|
980
|
+
if (i.status !== "accepted") return i;
|
|
981
|
+
n.push({
|
|
982
|
+
offset: s.offset,
|
|
983
|
+
color: i.value
|
|
984
|
+
});
|
|
981
985
|
}
|
|
982
|
-
return
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
} : {
|
|
989
|
-
|
|
990
|
-
|
|
986
|
+
return r.gradient === "radial" ? {
|
|
987
|
+
status: "accepted",
|
|
988
|
+
value: {
|
|
989
|
+
gradient: "radial",
|
|
990
|
+
stops: n
|
|
991
|
+
}
|
|
992
|
+
} : r.angle !== void 0 && !x(r.angle) ? m("a gradient angle in degrees", e) : {
|
|
993
|
+
status: "accepted",
|
|
994
|
+
value: {
|
|
995
|
+
gradient: "linear",
|
|
996
|
+
...r.angle === void 0 ? {} : { angle: r.angle },
|
|
997
|
+
stops: n
|
|
998
|
+
}
|
|
991
999
|
};
|
|
992
|
-
return new z(this.names, /* @__PURE__ */ new Map(), t.length, r);
|
|
993
|
-
}
|
|
994
|
-
sortedIndices(t, r) {
|
|
995
|
-
const a = this.values(t);
|
|
996
|
-
if (a === void 0) return Array.from({ length: this.rowCount }, (o, l) => l);
|
|
997
|
-
const n = [], s = [];
|
|
998
|
-
for (let o = 0; o < this.rowCount; o++) (an(a[o]) ? n : s).push(o);
|
|
999
|
-
const i = r === "asc" ? 1 : -1;
|
|
1000
|
-
return s.sort((o, l) => {
|
|
1001
|
-
const c = a[o], u = a[l];
|
|
1002
|
-
return c < u ? -i : c > u ? i : 0;
|
|
1003
|
-
}), n.length === 0 ? s : r === "asc" ? [...n, ...s] : [...s, ...n];
|
|
1004
1000
|
}
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
for (let s = 0; s < this.rowCount; s++) {
|
|
1018
|
-
const i = Xe(r.map((l) => l[s])), o = n.get(i);
|
|
1019
|
-
o === void 0 ? n.set(i, {
|
|
1020
|
-
key: i,
|
|
1021
|
-
indices: [s]
|
|
1022
|
-
}) : o.indices.push(s);
|
|
1001
|
+
if (Ar(r)) {
|
|
1002
|
+
if (!en.includes(r.pattern)) return m(ke, e);
|
|
1003
|
+
const a = J(r.color, t);
|
|
1004
|
+
if (a.status !== "accepted") return a;
|
|
1005
|
+
const n = {
|
|
1006
|
+
pattern: r.pattern,
|
|
1007
|
+
color: a.value
|
|
1008
|
+
};
|
|
1009
|
+
if (r.background !== void 0) {
|
|
1010
|
+
const s = J(r.background, t);
|
|
1011
|
+
if (s.status !== "accepted") return s;
|
|
1012
|
+
n.background = s.value;
|
|
1023
1013
|
}
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
const n = this.names.filter((d) => !t.includes(d)), s = this.rowCount * t.length, i = n.map((d) => ({
|
|
1028
|
-
name: d,
|
|
1029
|
-
source: this.values(d) ?? [],
|
|
1030
|
-
repeated: new Array(s)
|
|
1031
|
-
})), o = t.map((d) => this.values(d) ?? []), l = new Array(s), c = new Array(s);
|
|
1032
|
-
let u = 0;
|
|
1033
|
-
for (let d = 0; d < this.rowCount; d++) for (let p = 0; p < t.length; p++, u++) {
|
|
1034
|
-
for (const g of i) g.repeated[u] = g.source[d] ?? null;
|
|
1035
|
-
l[u] = t[p] ?? "", c[u] = o[p]?.[d] ?? null;
|
|
1014
|
+
if (r.size !== void 0) {
|
|
1015
|
+
if (!x(r.size) || r.size <= 0) return m("a pattern size in pixels", e);
|
|
1016
|
+
n.size = r.size;
|
|
1036
1017
|
}
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
r,
|
|
1042
|
-
a
|
|
1043
|
-
], h, s);
|
|
1044
|
-
}
|
|
1045
|
-
objectAt(t) {
|
|
1046
|
-
const { names: r, arrays: a, template: n } = this.rowShape ?? this.resolveRowShape(), s = { ...n };
|
|
1047
|
-
for (let i = 0; i < r.length; i++) s[r[i] ?? ""] = a[i]?.[t] ?? null;
|
|
1048
|
-
return s;
|
|
1049
|
-
}
|
|
1050
|
-
*[Symbol.iterator]() {
|
|
1051
|
-
for (let t = 0; t < this.rowCount; t++) yield this.objectAt(t);
|
|
1052
|
-
}
|
|
1053
|
-
resolveRowShape() {
|
|
1054
|
-
const t = {};
|
|
1055
|
-
for (const r of this.names) t[r] = null;
|
|
1056
|
-
return this.rowShape = {
|
|
1057
|
-
names: this.names,
|
|
1058
|
-
arrays: this.names.map((r) => this.values(r) ?? []),
|
|
1059
|
-
template: t
|
|
1060
|
-
}, this.rowShape;
|
|
1061
|
-
}
|
|
1062
|
-
gathered() {
|
|
1063
|
-
if (this.source === null) return this;
|
|
1064
|
-
for (const t of this.names) this.values(t);
|
|
1065
|
-
return new z(this.names, new Map(this.columns), this.rowCount);
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1068
|
-
var sn = "value", ve = {
|
|
1069
|
-
numeric: { type: "decimal" },
|
|
1070
|
-
categorical: { type: "text" },
|
|
1071
|
-
temporal: { type: "datetime" }
|
|
1072
|
-
}, yt = {
|
|
1073
|
-
eq: (e, t) => e === t,
|
|
1074
|
-
neq: (e, t) => e !== t,
|
|
1075
|
-
gt: (e, t) => e !== null && t !== null && e > t,
|
|
1076
|
-
gte: (e, t) => e !== null && t !== null && e >= t,
|
|
1077
|
-
lt: (e, t) => e !== null && t !== null && e < t,
|
|
1078
|
-
lte: (e, t) => e !== null && t !== null && e <= t
|
|
1079
|
-
}, gt = (e) => e === null ? null : e instanceof Date ? e.getTime() : new Date(e).getTime(), Mr = (e, t) => e === "count" ? { type: "integer" } : t, Er = (e, t, r) => {
|
|
1080
|
-
const a = e.values(t);
|
|
1081
|
-
if (a !== void 0) return a;
|
|
1082
|
-
if (r === "count") return new Array(e.rowCount);
|
|
1083
|
-
throw new R({ message: `Variable '${t}' not defined` });
|
|
1084
|
-
}, oe = class w {
|
|
1085
|
-
constructor(t = {}) {
|
|
1086
|
-
const { table: r, variableMetadata: a } = this.parseVariableMap(t);
|
|
1087
|
-
this.table = r, this.variableMetadata = a;
|
|
1018
|
+
return {
|
|
1019
|
+
status: "accepted",
|
|
1020
|
+
value: n
|
|
1021
|
+
};
|
|
1088
1022
|
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1023
|
+
if (rn(r)) {
|
|
1024
|
+
if (typeof r.image != "string" || !r.image.startsWith("data:image/")) return m("an image as a data:image URI", e);
|
|
1025
|
+
if (r.fit !== void 0 && !tn.includes(r.fit)) return m(ke, e);
|
|
1026
|
+
if (r.alpha !== void 0 && (!x(r.alpha) || r.alpha < 0 || r.alpha > 1)) return m("an image alpha in [0, 1]", e);
|
|
1027
|
+
if (r.size !== void 0 && (!x(r.size) || r.size <= 0)) return m("an image size in pixels", e);
|
|
1028
|
+
const a = J(r.fallback, t);
|
|
1029
|
+
return a.status !== "accepted" ? a : {
|
|
1030
|
+
status: "accepted",
|
|
1031
|
+
value: {
|
|
1032
|
+
image: r.image,
|
|
1033
|
+
...r.fit === void 0 ? {} : { fit: r.fit },
|
|
1034
|
+
...r.alpha === void 0 ? {} : { alpha: r.alpha },
|
|
1035
|
+
...r.size === void 0 ? {} : { size: r.size },
|
|
1036
|
+
fallback: a.value
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1092
1039
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1040
|
+
return m(ke, e);
|
|
1041
|
+
}, gn = (e, t) => {
|
|
1042
|
+
if (e === "none") return {
|
|
1043
|
+
status: "accepted",
|
|
1044
|
+
value: []
|
|
1045
|
+
};
|
|
1046
|
+
const r = [];
|
|
1047
|
+
for (const a of Array.isArray(e) ? e : [e]) {
|
|
1048
|
+
const n = Mr(a, t);
|
|
1049
|
+
if (n.status !== "accepted") return n;
|
|
1050
|
+
r.push(n.value);
|
|
1095
1051
|
}
|
|
1096
|
-
|
|
1097
|
-
|
|
1052
|
+
return {
|
|
1053
|
+
status: "accepted",
|
|
1054
|
+
value: r
|
|
1055
|
+
};
|
|
1056
|
+
}, xt = (e) => {
|
|
1057
|
+
if (x(e) && e >= 0) return {
|
|
1058
|
+
status: "accepted",
|
|
1059
|
+
value: {
|
|
1060
|
+
top: e,
|
|
1061
|
+
right: e,
|
|
1062
|
+
bottom: e,
|
|
1063
|
+
left: e
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
if (typeof e != "object" || e === null) return m(vt, e);
|
|
1067
|
+
const t = e, r = {};
|
|
1068
|
+
for (const a of pn) {
|
|
1069
|
+
const n = t[a];
|
|
1070
|
+
if (n !== void 0) {
|
|
1071
|
+
if (!x(n) || n < 0) return m(vt, e);
|
|
1072
|
+
r[a] = n;
|
|
1073
|
+
}
|
|
1098
1074
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1075
|
+
return {
|
|
1076
|
+
status: "accepted",
|
|
1077
|
+
value: r
|
|
1078
|
+
};
|
|
1079
|
+
}, mn = (e) => {
|
|
1080
|
+
if (x(e) && e >= 0) return {
|
|
1081
|
+
status: "accepted",
|
|
1082
|
+
value: e
|
|
1083
|
+
};
|
|
1084
|
+
if (typeof e != "object" || e === null) return m(bt, e);
|
|
1085
|
+
const t = e, r = {};
|
|
1086
|
+
for (const a of nn) {
|
|
1087
|
+
const n = t[a];
|
|
1088
|
+
if (!x(n) || n < 0) return m(bt, e);
|
|
1089
|
+
r[a] = n;
|
|
1101
1090
|
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1091
|
+
return {
|
|
1092
|
+
status: "accepted",
|
|
1093
|
+
value: r
|
|
1094
|
+
};
|
|
1095
|
+
}, to = {
|
|
1096
|
+
color: J,
|
|
1097
|
+
paint: Mr,
|
|
1098
|
+
overlay: gn,
|
|
1099
|
+
unitInterval: (e) => x(e) && e >= 0 && e <= 1 ? {
|
|
1100
|
+
status: "accepted",
|
|
1101
|
+
value: e
|
|
1102
|
+
} : m("a number in [0, 1]", e),
|
|
1103
|
+
pixels: (e) => x(e) && e >= 0 ? {
|
|
1104
|
+
status: "accepted",
|
|
1105
|
+
value: e
|
|
1106
|
+
} : m("a non-negative number of pixels", e),
|
|
1107
|
+
barRadius: (e) => Ha(e) || x(e) && e >= 0 ? {
|
|
1108
|
+
status: "accepted",
|
|
1109
|
+
value: e
|
|
1110
|
+
} : m(`a number of pixels or one of ${vr.map((t) => `'${t}'`).join(", ")}`, e),
|
|
1111
|
+
dashArray: (e) => Array.isArray(e) && e.every((t) => x(t) && t >= 0) ? {
|
|
1112
|
+
status: "accepted",
|
|
1113
|
+
value: [...e]
|
|
1114
|
+
} : m("an array of non-negative dash and gap lengths, in stroke widths", e),
|
|
1115
|
+
fontFamily: (e) => typeof e == "string" && e.trim().length > 0 ? {
|
|
1116
|
+
status: "accepted",
|
|
1117
|
+
value: e
|
|
1118
|
+
} : m("a non-empty CSS font-family list", e),
|
|
1119
|
+
fontWeight: (e) => x(e) && e >= yt && e <= gt ? {
|
|
1120
|
+
status: "accepted",
|
|
1121
|
+
value: e
|
|
1122
|
+
} : m(`a number in [${yt}, ${gt}]`, e),
|
|
1123
|
+
multiplier: (e) => x(e) && e >= 0 ? {
|
|
1124
|
+
status: "accepted",
|
|
1125
|
+
value: e
|
|
1126
|
+
} : m("a non-negative multiple, 1 being unchanged", e),
|
|
1127
|
+
shadow: (e, t) => {
|
|
1128
|
+
if (e === "none") return {
|
|
1129
|
+
status: "accepted",
|
|
1130
|
+
value: e
|
|
1131
|
+
};
|
|
1132
|
+
if (typeof e != "object" || e === null) return m(mt, e);
|
|
1133
|
+
const r = e;
|
|
1134
|
+
if (!x(r.offsetX) || !x(r.offsetY) || !x(r.blur) || r.blur < 0) return m(mt, e);
|
|
1135
|
+
const a = J(r.color, t);
|
|
1136
|
+
return a.status !== "accepted" ? a : {
|
|
1137
|
+
status: "accepted",
|
|
1138
|
+
value: {
|
|
1139
|
+
offsetX: r.offsetX,
|
|
1140
|
+
offsetY: r.offsetY,
|
|
1141
|
+
blur: r.blur,
|
|
1142
|
+
color: a.value
|
|
1120
1143
|
}
|
|
1121
|
-
}, [i = null] = this.normalizeRawValues(r, [a]), o = this.table.assign(t, new Array(this.size()).fill(i));
|
|
1122
|
-
return w.fromTrusted(o, s);
|
|
1123
|
-
}
|
|
1124
|
-
getConstant(t) {
|
|
1125
|
-
return this.variableMetadata[t]?.constant;
|
|
1126
|
-
}
|
|
1127
|
-
deriveVariable(t, r, a, n) {
|
|
1128
|
-
const s = Array.from({ length: this.size() }, (i, o) => a(this.table.objectAt(o)));
|
|
1129
|
-
return this.addVariable(t, r, s, n);
|
|
1130
|
-
}
|
|
1131
|
-
deriveVariableFrom(t, r, a, n, s) {
|
|
1132
|
-
const i = this.hasVariable(t) ? this.getValues(t).map(n) : Array.from({ length: this.size() }, () => n(null));
|
|
1133
|
-
return this.addVariable(r, a, i, s);
|
|
1134
|
-
}
|
|
1135
|
-
renameVariable(t, r) {
|
|
1136
|
-
const a = this.variableMetadata[t];
|
|
1137
|
-
if (!a) throw new R({ message: `Variable ${t} not defined` });
|
|
1138
|
-
const n = this.table.rename(t, r), { [t]: s, ...i } = this.variableMetadata, o = {
|
|
1139
|
-
...i,
|
|
1140
|
-
[r]: a
|
|
1141
1144
|
};
|
|
1142
|
-
|
|
1145
|
+
},
|
|
1146
|
+
padding: xt,
|
|
1147
|
+
margin: xt,
|
|
1148
|
+
blendMode: X(dn),
|
|
1149
|
+
signedPixels: (e) => x(e) ? {
|
|
1150
|
+
status: "accepted",
|
|
1151
|
+
value: e
|
|
1152
|
+
} : m("a number of pixels, negative allowed", e),
|
|
1153
|
+
fontStyle: X(sn),
|
|
1154
|
+
textTransform: X(on),
|
|
1155
|
+
textDecoration: X(ln),
|
|
1156
|
+
lineCap: X(cn),
|
|
1157
|
+
lineJoin: X(un),
|
|
1158
|
+
pointSymbol: X(hn),
|
|
1159
|
+
boxRadius: mn
|
|
1160
|
+
};
|
|
1161
|
+
var Oe = !0, ro = (e) => {
|
|
1162
|
+
Oe = e;
|
|
1163
|
+
}, ao = () => Oe, no = () => {
|
|
1164
|
+
let e = null;
|
|
1165
|
+
const t = {
|
|
1166
|
+
hits: 0,
|
|
1167
|
+
misses: 0
|
|
1168
|
+
};
|
|
1169
|
+
return Object.assign((a, n) => {
|
|
1170
|
+
if (!Oe)
|
|
1171
|
+
return ie && (t.misses += 1), n();
|
|
1172
|
+
if (e && Er(e.args, a))
|
|
1173
|
+
return ie && (t.hits += 1), e.out;
|
|
1174
|
+
ie && (t.misses += 1);
|
|
1175
|
+
const s = n();
|
|
1176
|
+
return e = {
|
|
1177
|
+
args: a,
|
|
1178
|
+
out: s
|
|
1179
|
+
}, s;
|
|
1180
|
+
}, {
|
|
1181
|
+
stats: t,
|
|
1182
|
+
reset: () => {
|
|
1183
|
+
e = null;
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
}, vn = () => {
|
|
1187
|
+
const e = /* @__PURE__ */ new WeakMap(), t = {
|
|
1188
|
+
hits: 0,
|
|
1189
|
+
misses: 0
|
|
1190
|
+
};
|
|
1191
|
+
return Object.assign((a, n, s) => {
|
|
1192
|
+
if (!Oe)
|
|
1193
|
+
return ie && (t.misses += 1), s();
|
|
1194
|
+
const i = e.get(a);
|
|
1195
|
+
if (i) for (let l = 0; l < i.length; l += 1) {
|
|
1196
|
+
const c = i[l];
|
|
1197
|
+
if (c && Er(c.args, n))
|
|
1198
|
+
return ie && (t.hits += 1), l > 0 && (i.splice(l, 1), i.unshift(c)), c.out;
|
|
1199
|
+
}
|
|
1200
|
+
ie && (t.misses += 1);
|
|
1201
|
+
const o = s();
|
|
1202
|
+
return i ? (i.unshift({
|
|
1203
|
+
args: n,
|
|
1204
|
+
out: o
|
|
1205
|
+
}), i.length > 16 && (i.length = 16)) : e.set(a, [{
|
|
1206
|
+
args: n,
|
|
1207
|
+
out: o
|
|
1208
|
+
}]), o;
|
|
1209
|
+
}, { stats: t });
|
|
1210
|
+
}, so = (...e) => e.reduce((t, r) => ({
|
|
1211
|
+
hits: t.hits + r.hits,
|
|
1212
|
+
misses: t.misses + r.misses
|
|
1213
|
+
}), {
|
|
1214
|
+
hits: 0,
|
|
1215
|
+
misses: 0
|
|
1216
|
+
}), Er = (e, t) => {
|
|
1217
|
+
if (e.length !== t.length) return !1;
|
|
1218
|
+
for (let r = 0; r < e.length; r += 1) if (e[r] !== t[r]) return !1;
|
|
1219
|
+
return !0;
|
|
1220
|
+
}, bn = class {
|
|
1221
|
+
constructor() {
|
|
1222
|
+
this.memo = vn(), this.singletonKey = {};
|
|
1143
1223
|
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
return w.fromTrusted(r, a);
|
|
1224
|
+
get stats() {
|
|
1225
|
+
return this.memo.stats;
|
|
1147
1226
|
}
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
if (!r) throw new R({ message: `Variable ${t} not defined` });
|
|
1151
|
-
return r.type;
|
|
1227
|
+
compile(e) {
|
|
1228
|
+
return this.memo(this.key(e), this.dependencies(e), () => this.run(e));
|
|
1152
1229
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
if (!r) throw new R({ message: `Variable ${t} not defined` });
|
|
1156
|
-
return r.valueFormat;
|
|
1230
|
+
key(e) {
|
|
1231
|
+
return this.singletonKey;
|
|
1157
1232
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1233
|
+
}, tt = (e, t) => e >= 0 && e <= 1 && t >= 0 && t <= 1, io = ["x", "y"], An = /* @__PURE__ */ new Set([
|
|
1234
|
+
"x",
|
|
1235
|
+
"y",
|
|
1236
|
+
"ySecondary"
|
|
1237
|
+
]), Tr = /* @__PURE__ */ new Set([
|
|
1238
|
+
"color",
|
|
1239
|
+
"size",
|
|
1240
|
+
"alpha",
|
|
1241
|
+
"strokeWidth",
|
|
1242
|
+
"lineType"
|
|
1243
|
+
]), xn = (e) => An.has(e), Mn = (e) => Tr.has(e), oo = (e) => xn(e) || Mn(e);
|
|
1244
|
+
function En(e) {
|
|
1245
|
+
return e === "secondary" ? "ySecondary" : "y";
|
|
1246
|
+
}
|
|
1247
|
+
function lo(e, t) {
|
|
1248
|
+
return e === "y" ? En(t) : "x";
|
|
1249
|
+
}
|
|
1250
|
+
function co(e) {
|
|
1251
|
+
return e === "ySecondary" ? "y" : e;
|
|
1252
|
+
}
|
|
1253
|
+
var Tn = /* @__PURE__ */ new Set([
|
|
1254
|
+
"count",
|
|
1255
|
+
"sum",
|
|
1256
|
+
"mean",
|
|
1257
|
+
"median"
|
|
1258
|
+
]);
|
|
1259
|
+
function wr(e, t) {
|
|
1260
|
+
return Tn.has(e) ? "numeric" : t;
|
|
1261
|
+
}
|
|
1262
|
+
function Sr(e, t, r, a) {
|
|
1263
|
+
if (a !== void 0 && a.type !== "numeric" && (e === "sum" || e === "mean" || e === "median")) throw new de({
|
|
1264
|
+
code: "INCOMPATIBLE_TYPE",
|
|
1265
|
+
message: `'${e}' requires a numeric variable (got '${a.type}' for '${a.variableName}')`,
|
|
1266
|
+
context: {
|
|
1267
|
+
variableName: a.variableName,
|
|
1268
|
+
variableType: a.type
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
const n = r?.length ?? t.length;
|
|
1272
|
+
if (e === "count") return n;
|
|
1273
|
+
if (e === "median" || e === "mode") {
|
|
1274
|
+
const o = [];
|
|
1275
|
+
for (let l = 0; l < n; l++) {
|
|
1276
|
+
const c = We(t, r, l);
|
|
1277
|
+
Ue(c) && o.push(c);
|
|
1278
|
+
}
|
|
1279
|
+
return o.length === 0 ? null : e === "median" ? kn(o) : _n(o);
|
|
1166
1280
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
throw new R({ message: `Variable '${t}' has type '${a}', expected '${r.type}'` });
|
|
1281
|
+
if (e === "sum" || e === "mean") {
|
|
1282
|
+
let o = 0, l = 0;
|
|
1283
|
+
for (let c = 0; c < n; c++) {
|
|
1284
|
+
const u = We(t, r, c);
|
|
1285
|
+
Ue(u) && (o++, l += Number(u));
|
|
1173
1286
|
}
|
|
1174
|
-
|
|
1175
|
-
return r?.distinct && (n = this.getDistinctValues(a, n)), r?.skipNulls && (n = this.skipNulls(n)), n;
|
|
1287
|
+
return o === 0 ? null : e === "sum" ? l : l / o;
|
|
1176
1288
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1289
|
+
const s = e === "min" ? -1 : 1;
|
|
1290
|
+
let i = null;
|
|
1291
|
+
for (let o = 0; o < n; o++) {
|
|
1292
|
+
const l = We(t, r, o);
|
|
1293
|
+
Ue(l) && (i === null || wn(l, i) === s) && (i = l);
|
|
1182
1294
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1295
|
+
return i;
|
|
1296
|
+
}
|
|
1297
|
+
var We = (e, t, r) => e[t?.[r] ?? r] ?? null, Ue = (e) => e !== null && !(typeof e == "number" && Number.isNaN(e)), wn = (e, t) => e === null || t === null ? 0 : e < t ? -1 : e > t ? 1 : 0, Sn = (e) => e instanceof Date ? e.getTime() : e ?? null;
|
|
1298
|
+
function kn(e) {
|
|
1299
|
+
const t = e.map(Number).sort((s, i) => s - i);
|
|
1300
|
+
if (t.length === 1) return t[0] ?? 0;
|
|
1301
|
+
const r = (t.length - 1) / 2, a = Math.floor(r), n = t[a] ?? 0;
|
|
1302
|
+
return n + ((t[a + 1] ?? n) - n) * (r - a);
|
|
1303
|
+
}
|
|
1304
|
+
function _n(e) {
|
|
1305
|
+
const t = /* @__PURE__ */ new Map();
|
|
1306
|
+
for (const n of e) {
|
|
1307
|
+
const s = Sn(n), i = t.get(s);
|
|
1308
|
+
i === void 0 ? t.set(s, {
|
|
1309
|
+
value: n,
|
|
1310
|
+
count: 1
|
|
1311
|
+
}) : i.count++;
|
|
1188
1312
|
}
|
|
1189
|
-
|
|
1190
|
-
|
|
1313
|
+
let r = null, a = 0;
|
|
1314
|
+
for (const { value: n, count: s } of t.values()) s > a && (a = s, r = n);
|
|
1315
|
+
return r;
|
|
1316
|
+
}
|
|
1317
|
+
var Ln = (e) => e == null || typeof e == "number" && Number.isNaN(e), Rn = (e) => e instanceof Date ? e.getTime() : e ?? null, qe = class z {
|
|
1318
|
+
constructor(t, r, a, n = null) {
|
|
1319
|
+
this.rowShape = null, this.names = t, this.columns = r, this.rowCount = a, this.source = n;
|
|
1191
1320
|
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
return w.fromTrusted(a, this.variableMetadata);
|
|
1321
|
+
get columnCount() {
|
|
1322
|
+
return this.names.length;
|
|
1195
1323
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1324
|
+
static from(t) {
|
|
1325
|
+
const r = Object.entries(t);
|
|
1326
|
+
return new z(r.map(([a]) => a), new Map(r), r[0]?.[1].length ?? 0);
|
|
1198
1327
|
}
|
|
1199
|
-
|
|
1328
|
+
columnNames() {
|
|
1329
|
+
return [...this.names];
|
|
1330
|
+
}
|
|
1331
|
+
hasColumn(t) {
|
|
1332
|
+
return this.names.includes(t);
|
|
1333
|
+
}
|
|
1334
|
+
values(t) {
|
|
1335
|
+
const r = this.columns.get(t);
|
|
1336
|
+
if (r !== void 0) return r;
|
|
1337
|
+
if (this.source === null || !this.names.includes(t)) return;
|
|
1338
|
+
const a = this.source.table.values(t);
|
|
1339
|
+
if (a === void 0) return;
|
|
1340
|
+
const { indices: n } = this.source, s = new Array(n.length);
|
|
1341
|
+
for (let i = 0; i < n.length; i++) s[i] = a[n[i] ?? 0] ?? null;
|
|
1342
|
+
return this.columns.set(t, s), this.columns.size === this.names.length && (this.source = null), s;
|
|
1343
|
+
}
|
|
1344
|
+
assign(t, r) {
|
|
1345
|
+
const a = this.gathered(), n = new Map(a.columns);
|
|
1346
|
+
n.set(t, r);
|
|
1347
|
+
const s = a.names.includes(t) ? [...a.names] : [...a.names, t];
|
|
1348
|
+
return new z(s, n, a.names.length === 0 ? r.length : a.rowCount);
|
|
1349
|
+
}
|
|
1350
|
+
select(t) {
|
|
1351
|
+
const r = t.filter((n) => this.names.includes(n)), a = /* @__PURE__ */ new Map();
|
|
1352
|
+
for (const n of r) {
|
|
1353
|
+
const s = this.columns.get(n);
|
|
1354
|
+
s !== void 0 && a.set(n, s);
|
|
1355
|
+
}
|
|
1356
|
+
return new z(r, a, this.rowCount, this.source);
|
|
1357
|
+
}
|
|
1358
|
+
rename(t, r) {
|
|
1359
|
+
const a = this.gathered(), n = /* @__PURE__ */ new Map();
|
|
1360
|
+
for (const s of a.names) {
|
|
1361
|
+
const i = a.columns.get(s);
|
|
1362
|
+
i !== void 0 && n.set(s === t ? r : s, i);
|
|
1363
|
+
}
|
|
1364
|
+
return new z(a.names.map((s) => s === t ? r : s), n, a.rowCount);
|
|
1365
|
+
}
|
|
1366
|
+
take(t) {
|
|
1367
|
+
const r = this.source === null ? {
|
|
1368
|
+
table: this,
|
|
1369
|
+
indices: t
|
|
1370
|
+
} : {
|
|
1371
|
+
table: this.source.table,
|
|
1372
|
+
indices: t.map((a) => this.source?.indices[a] ?? 0)
|
|
1373
|
+
};
|
|
1374
|
+
return new z(this.names, /* @__PURE__ */ new Map(), t.length, r);
|
|
1375
|
+
}
|
|
1376
|
+
sortedIndices(t, r) {
|
|
1377
|
+
const a = this.values(t);
|
|
1378
|
+
if (a === void 0) return Array.from({ length: this.rowCount }, (o, l) => l);
|
|
1379
|
+
const n = [], s = [];
|
|
1380
|
+
for (let o = 0; o < this.rowCount; o++) (Ln(a[o]) ? n : s).push(o);
|
|
1381
|
+
const i = r === "asc" ? 1 : -1;
|
|
1382
|
+
return s.sort((o, l) => {
|
|
1383
|
+
const c = a[o], u = a[l];
|
|
1384
|
+
return c < u ? -i : c > u ? i : 0;
|
|
1385
|
+
}), n.length === 0 ? s : r === "asc" ? [...n, ...s] : [...s, ...n];
|
|
1386
|
+
}
|
|
1387
|
+
partition(t) {
|
|
1388
|
+
const r = t.map((s) => this.values(s)).filter((s) => s !== void 0), a = r.length === 1 ? r[0] : void 0, n = /* @__PURE__ */ new Map();
|
|
1389
|
+
if (a !== void 0) {
|
|
1390
|
+
for (let s = 0; s < this.rowCount; s++) {
|
|
1391
|
+
const i = Rn(a[s]), o = n.get(i);
|
|
1392
|
+
o === void 0 ? n.set(i, {
|
|
1393
|
+
key: Xe(a[s] ?? null),
|
|
1394
|
+
indices: [s]
|
|
1395
|
+
}) : o.indices.push(s);
|
|
1396
|
+
}
|
|
1397
|
+
return [...n.values()];
|
|
1398
|
+
}
|
|
1399
|
+
for (let s = 0; s < this.rowCount; s++) {
|
|
1400
|
+
const i = Xe(r.map((l) => l[s])), o = n.get(i);
|
|
1401
|
+
o === void 0 ? n.set(i, {
|
|
1402
|
+
key: i,
|
|
1403
|
+
indices: [s]
|
|
1404
|
+
}) : o.indices.push(s);
|
|
1405
|
+
}
|
|
1406
|
+
return [...n.values()];
|
|
1407
|
+
}
|
|
1408
|
+
fold(t, r, a) {
|
|
1409
|
+
const n = this.names.filter((d) => !t.includes(d)), s = this.rowCount * t.length, i = n.map((d) => ({
|
|
1410
|
+
name: d,
|
|
1411
|
+
source: this.values(d) ?? [],
|
|
1412
|
+
repeated: new Array(s)
|
|
1413
|
+
})), o = t.map((d) => this.values(d) ?? []), l = new Array(s), c = new Array(s);
|
|
1414
|
+
let u = 0;
|
|
1415
|
+
for (let d = 0; d < this.rowCount; d++) for (let p = 0; p < t.length; p++, u++) {
|
|
1416
|
+
for (const g of i) g.repeated[u] = g.source[d] ?? null;
|
|
1417
|
+
l[u] = t[p] ?? "", c[u] = o[p]?.[d] ?? null;
|
|
1418
|
+
}
|
|
1419
|
+
const h = /* @__PURE__ */ new Map();
|
|
1420
|
+
for (const { name: d, repeated: p } of i) h.set(d, p);
|
|
1421
|
+
return h.set(r, l), h.set(a, c), new z([
|
|
1422
|
+
...n,
|
|
1423
|
+
r,
|
|
1424
|
+
a
|
|
1425
|
+
], h, s);
|
|
1426
|
+
}
|
|
1427
|
+
objectAt(t) {
|
|
1428
|
+
const { names: r, arrays: a, template: n } = this.rowShape ?? this.resolveRowShape(), s = { ...n };
|
|
1429
|
+
for (let i = 0; i < r.length; i++) s[r[i] ?? ""] = a[i]?.[t] ?? null;
|
|
1430
|
+
return s;
|
|
1431
|
+
}
|
|
1432
|
+
*[Symbol.iterator]() {
|
|
1433
|
+
for (let t = 0; t < this.rowCount; t++) yield this.objectAt(t);
|
|
1434
|
+
}
|
|
1435
|
+
resolveRowShape() {
|
|
1436
|
+
const t = {};
|
|
1437
|
+
for (const r of this.names) t[r] = null;
|
|
1438
|
+
return this.rowShape = {
|
|
1439
|
+
names: this.names,
|
|
1440
|
+
arrays: this.names.map((r) => this.values(r) ?? []),
|
|
1441
|
+
template: t
|
|
1442
|
+
}, this.rowShape;
|
|
1443
|
+
}
|
|
1444
|
+
gathered() {
|
|
1445
|
+
if (this.source === null) return this;
|
|
1446
|
+
for (const t of this.names) this.values(t);
|
|
1447
|
+
return new z(this.names, new Map(this.columns), this.rowCount);
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
var Cn = "value", be = {
|
|
1451
|
+
numeric: { type: "decimal" },
|
|
1452
|
+
categorical: { type: "text" },
|
|
1453
|
+
temporal: { type: "datetime" }
|
|
1454
|
+
}, Mt = {
|
|
1455
|
+
eq: (e, t) => e === t,
|
|
1456
|
+
neq: (e, t) => e !== t,
|
|
1457
|
+
gt: (e, t) => e !== null && t !== null && e > t,
|
|
1458
|
+
gte: (e, t) => e !== null && t !== null && e >= t,
|
|
1459
|
+
lt: (e, t) => e !== null && t !== null && e < t,
|
|
1460
|
+
lte: (e, t) => e !== null && t !== null && e <= t
|
|
1461
|
+
}, Et = (e) => e === null ? null : e instanceof Date ? e.getTime() : new Date(e).getTime(), kr = (e, t) => e === "count" ? { type: "integer" } : t, _r = (e, t, r) => {
|
|
1462
|
+
const a = e.values(t);
|
|
1463
|
+
if (a !== void 0) return a;
|
|
1464
|
+
if (r === "count") return new Array(e.rowCount);
|
|
1465
|
+
throw new R({ message: `Variable '${t}' not defined` });
|
|
1466
|
+
}, oe = class w {
|
|
1467
|
+
constructor(t = {}) {
|
|
1468
|
+
const { table: r, variableMetadata: a } = this.parseVariableMap(t);
|
|
1469
|
+
this.table = r, this.variableMetadata = a;
|
|
1470
|
+
}
|
|
1471
|
+
static fromTrusted(t, r) {
|
|
1472
|
+
const a = Object.create(w.prototype);
|
|
1473
|
+
return a.table = t, a.variableMetadata = r, a;
|
|
1474
|
+
}
|
|
1475
|
+
size() {
|
|
1476
|
+
return this.table.rowCount;
|
|
1477
|
+
}
|
|
1478
|
+
getVariableNames() {
|
|
1479
|
+
return this.table.columnNames();
|
|
1480
|
+
}
|
|
1481
|
+
hasVariable(t) {
|
|
1482
|
+
return this.table.hasColumn(t);
|
|
1483
|
+
}
|
|
1484
|
+
addVariable(t, r, a, n) {
|
|
1485
|
+
if (this.table.columnCount > 0 && a.length !== this.size()) throw new R({ message: `Variable '${t}' has ${a.length} values, expected ${this.size()}` });
|
|
1486
|
+
const s = {
|
|
1487
|
+
...this.variableMetadata,
|
|
1488
|
+
[t]: {
|
|
1489
|
+
type: r,
|
|
1490
|
+
valueFormat: this.resolveAddedVariableFormat(t, r, n)
|
|
1491
|
+
}
|
|
1492
|
+
}, i = this.normalizeRawValues(r, a), o = this.table.assign(t, i);
|
|
1493
|
+
return w.fromTrusted(o, s);
|
|
1494
|
+
}
|
|
1495
|
+
addConstantVariable(t, r, a, n) {
|
|
1496
|
+
const s = {
|
|
1497
|
+
...this.variableMetadata,
|
|
1498
|
+
[t]: {
|
|
1499
|
+
type: r,
|
|
1500
|
+
valueFormat: this.resolveAddedVariableFormat(t, r, n),
|
|
1501
|
+
constant: { value: a }
|
|
1502
|
+
}
|
|
1503
|
+
}, [i = null] = this.normalizeRawValues(r, [a]), o = this.table.assign(t, new Array(this.size()).fill(i));
|
|
1504
|
+
return w.fromTrusted(o, s);
|
|
1505
|
+
}
|
|
1506
|
+
getConstant(t) {
|
|
1507
|
+
return this.variableMetadata[t]?.constant;
|
|
1508
|
+
}
|
|
1509
|
+
deriveVariable(t, r, a, n) {
|
|
1510
|
+
const s = Array.from({ length: this.size() }, (i, o) => a(this.table.objectAt(o)));
|
|
1511
|
+
return this.addVariable(t, r, s, n);
|
|
1512
|
+
}
|
|
1513
|
+
deriveVariableFrom(t, r, a, n, s) {
|
|
1514
|
+
const i = this.hasVariable(t) ? this.getValues(t).map(n) : Array.from({ length: this.size() }, () => n(null));
|
|
1515
|
+
return this.addVariable(r, a, i, s);
|
|
1516
|
+
}
|
|
1517
|
+
renameVariable(t, r) {
|
|
1518
|
+
const a = this.variableMetadata[t];
|
|
1519
|
+
if (!a) throw new R({ message: `Variable ${t} not defined` });
|
|
1520
|
+
const n = this.table.rename(t, r), { [t]: s, ...i } = this.variableMetadata, o = {
|
|
1521
|
+
...i,
|
|
1522
|
+
[r]: a
|
|
1523
|
+
};
|
|
1524
|
+
return w.fromTrusted(n, o);
|
|
1525
|
+
}
|
|
1526
|
+
selectVariables(...t) {
|
|
1527
|
+
const r = this.table.select(t), a = Object.fromEntries(Object.entries(this.variableMetadata).filter(([n]) => t.includes(n)));
|
|
1528
|
+
return w.fromTrusted(r, a);
|
|
1529
|
+
}
|
|
1530
|
+
getType(t) {
|
|
1531
|
+
const r = this.variableMetadata[t];
|
|
1532
|
+
if (!r) throw new R({ message: `Variable ${t} not defined` });
|
|
1533
|
+
return r.type;
|
|
1534
|
+
}
|
|
1535
|
+
getValueFormat(t) {
|
|
1536
|
+
const r = this.variableMetadata[t];
|
|
1537
|
+
if (!r) throw new R({ message: `Variable ${t} not defined` });
|
|
1538
|
+
return r.valueFormat;
|
|
1539
|
+
}
|
|
1540
|
+
groupVariableNamesByType() {
|
|
1541
|
+
const t = {
|
|
1542
|
+
numeric: [],
|
|
1543
|
+
categorical: [],
|
|
1544
|
+
temporal: []
|
|
1545
|
+
};
|
|
1546
|
+
for (const [r, { type: a }] of Object.entries(this.variableMetadata)) t[a].push(r);
|
|
1547
|
+
return t;
|
|
1548
|
+
}
|
|
1549
|
+
getValues(t, r) {
|
|
1550
|
+
if (!this.hasVariable(t)) throw new R({ message: `Variable '${t}' not defined` });
|
|
1551
|
+
const a = this.getType(t);
|
|
1552
|
+
if (r?.type !== void 0 && a !== r.type) {
|
|
1553
|
+
if (this.size() === 0) return [];
|
|
1554
|
+
throw new R({ message: `Variable '${t}' has type '${a}', expected '${r.type}'` });
|
|
1555
|
+
}
|
|
1556
|
+
let n = this.table.values(t) ?? [];
|
|
1557
|
+
return r?.distinct && (n = this.getDistinctValues(a, n)), r?.skipNulls && (n = this.skipNulls(n)), n;
|
|
1558
|
+
}
|
|
1559
|
+
filter(t, r, a) {
|
|
1560
|
+
if (this.hasVariable(t) && this.getType(t) === "temporal") return this.filterByTimestamp(t, r, a);
|
|
1561
|
+
const n = Mt[r], s = this.table.values(t) ?? [], i = [];
|
|
1562
|
+
for (let o = 0; o < s.length; o++) n(s[o] ?? null, a) && i.push(o);
|
|
1563
|
+
return w.fromTrusted(this.table.take(i), this.variableMetadata);
|
|
1564
|
+
}
|
|
1565
|
+
filterByMask(t) {
|
|
1566
|
+
if (t.length !== this.size()) throw new R({ message: `Row mask length ${t.length} does not match dataset size ${this.size()}` });
|
|
1567
|
+
const r = [];
|
|
1568
|
+
for (let a = 0; a < t.length; a++) t[a] === 1 && r.push(a);
|
|
1569
|
+
return w.fromTrusted(this.table.take(r), this.variableMetadata);
|
|
1570
|
+
}
|
|
1571
|
+
take(t) {
|
|
1572
|
+
return w.fromTrusted(this.table.take(t), this.variableMetadata);
|
|
1573
|
+
}
|
|
1574
|
+
orderBy(t, r = "asc") {
|
|
1575
|
+
const a = this.table.take(this.table.sortedIndices(t, r));
|
|
1576
|
+
return w.fromTrusted(a, this.variableMetadata);
|
|
1577
|
+
}
|
|
1578
|
+
getAt(t) {
|
|
1579
|
+
return t < 0 || t >= this.size() ? null : this.table.objectAt(t);
|
|
1580
|
+
}
|
|
1581
|
+
getFirst() {
|
|
1200
1582
|
return this.getAt(0);
|
|
1201
1583
|
}
|
|
1202
1584
|
getLast() {
|
|
@@ -1218,23 +1600,23 @@ var sn = "value", ve = {
|
|
|
1218
1600
|
return null;
|
|
1219
1601
|
}
|
|
1220
1602
|
groupBy(...t) {
|
|
1221
|
-
return new
|
|
1603
|
+
return new Dn(t, this.table, this.variableMetadata);
|
|
1222
1604
|
}
|
|
1223
1605
|
rollup(t) {
|
|
1224
|
-
const r = qe.from(Object.fromEntries(Object.entries(t).map(([n, { variableName: s, aggregation: i }]) => [n, [
|
|
1606
|
+
const r = qe.from(Object.fromEntries(Object.entries(t).map(([n, { variableName: s, aggregation: i }]) => [n, [Sr(i, _r(this.table, s, i), void 0, {
|
|
1225
1607
|
type: this.variableMetadata[s]?.type ?? "numeric",
|
|
1226
1608
|
variableName: s
|
|
1227
1609
|
})]]))), a = {};
|
|
1228
1610
|
for (const [n, { variableName: s, aggregation: i }] of Object.entries(t)) {
|
|
1229
|
-
const o = this.variableMetadata[s], l = o?.type ?? "numeric", c = o?.valueFormat ??
|
|
1611
|
+
const o = this.variableMetadata[s], l = o?.type ?? "numeric", c = o?.valueFormat ?? be[l];
|
|
1230
1612
|
a[n] = {
|
|
1231
|
-
type:
|
|
1232
|
-
valueFormat:
|
|
1613
|
+
type: wr(i, l),
|
|
1614
|
+
valueFormat: kr(i, c)
|
|
1233
1615
|
};
|
|
1234
1616
|
}
|
|
1235
1617
|
return w.fromTrusted(r, a);
|
|
1236
1618
|
}
|
|
1237
|
-
reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n =
|
|
1619
|
+
reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n = Cn } = {}) {
|
|
1238
1620
|
const { numeric: s, categorical: i, temporal: o } = this.groupVariableNamesByType(), l = t ?? [...i, ...o], c = r ?? s.filter((d) => !l.includes(d));
|
|
1239
1621
|
if (l.includes(a) || l.includes(n)) throw new de({
|
|
1240
1622
|
code: "INVALID_DATA_SHAPE",
|
|
@@ -1274,7 +1656,7 @@ var sn = "value", ve = {
|
|
|
1274
1656
|
valueFormat: { type: "text" }
|
|
1275
1657
|
}, h[n] = {
|
|
1276
1658
|
type: "numeric",
|
|
1277
|
-
valueFormat:
|
|
1659
|
+
valueFormat: In(this.variableMetadata, c, a)
|
|
1278
1660
|
}, w.fromTrusted(u, h);
|
|
1279
1661
|
}
|
|
1280
1662
|
print() {
|
|
@@ -1284,21 +1666,21 @@ var sn = "value", ve = {
|
|
|
1284
1666
|
return this.table[Symbol.iterator]();
|
|
1285
1667
|
}
|
|
1286
1668
|
filterByTimestamp(t, r, a) {
|
|
1287
|
-
const n =
|
|
1288
|
-
for (let c = 0; c < o.length; c++) n(
|
|
1669
|
+
const n = Mt[r], s = mr(a, this.getValueFormat(t), Ie), i = Et(s ?? a), o = this.getValues(t, { type: "temporal" }), l = [];
|
|
1670
|
+
for (let c = 0; c < o.length; c++) n(Et(o[c] ?? null), i) && l.push(c);
|
|
1289
1671
|
return w.fromTrusted(this.table.take(l), this.variableMetadata);
|
|
1290
1672
|
}
|
|
1291
1673
|
resolveAddedVariableFormat(t, r, a) {
|
|
1292
1674
|
if (a !== void 0) return a;
|
|
1293
1675
|
const n = this.variableMetadata[t];
|
|
1294
|
-
return n ? n.valueFormat :
|
|
1676
|
+
return n ? n.valueFormat : be[r];
|
|
1295
1677
|
}
|
|
1296
1678
|
parseVariableMap(t) {
|
|
1297
1679
|
const r = {}, a = {};
|
|
1298
1680
|
for (const [n, { type: s, values: i, valueFormat: o }] of Object.entries(t))
|
|
1299
1681
|
r[n] = i, a[n] = {
|
|
1300
1682
|
type: s,
|
|
1301
|
-
valueFormat: o ??
|
|
1683
|
+
valueFormat: o ?? be[s]
|
|
1302
1684
|
};
|
|
1303
1685
|
return {
|
|
1304
1686
|
table: qe.from(r),
|
|
@@ -1328,7 +1710,7 @@ var sn = "value", ve = {
|
|
|
1328
1710
|
}
|
|
1329
1711
|
return s;
|
|
1330
1712
|
}
|
|
1331
|
-
},
|
|
1713
|
+
}, Dn = class {
|
|
1332
1714
|
constructor(e, t, r) {
|
|
1333
1715
|
this.groupedBy = e, this.table = t, this.variableMetadata = r;
|
|
1334
1716
|
}
|
|
@@ -1347,19 +1729,19 @@ var sn = "value", ve = {
|
|
|
1347
1729
|
const s = this.variableMetadata[n], i = s?.type ?? "categorical";
|
|
1348
1730
|
return [n, {
|
|
1349
1731
|
type: i,
|
|
1350
|
-
valueFormat: s?.valueFormat ??
|
|
1732
|
+
valueFormat: s?.valueFormat ?? be[i]
|
|
1351
1733
|
}];
|
|
1352
1734
|
}));
|
|
1353
1735
|
for (const [n, { variableName: s, aggregation: i }] of Object.entries(e)) {
|
|
1354
|
-
const o =
|
|
1355
|
-
r[n] = t.map(({ indices: h }) =>
|
|
1736
|
+
const o = _r(this.table, s, i), l = this.variableMetadata[s], c = l?.type ?? "numeric";
|
|
1737
|
+
r[n] = t.map(({ indices: h }) => Sr(i, o, h, {
|
|
1356
1738
|
type: c,
|
|
1357
1739
|
variableName: s
|
|
1358
1740
|
}));
|
|
1359
|
-
const u = l?.valueFormat ??
|
|
1741
|
+
const u = l?.valueFormat ?? be[c];
|
|
1360
1742
|
a[n] = {
|
|
1361
|
-
type:
|
|
1362
|
-
valueFormat:
|
|
1743
|
+
type: wr(i, c),
|
|
1744
|
+
valueFormat: kr(i, u)
|
|
1363
1745
|
};
|
|
1364
1746
|
}
|
|
1365
1747
|
return oe.fromTrusted(qe.from(r), a);
|
|
@@ -1368,14 +1750,14 @@ var sn = "value", ve = {
|
|
|
1368
1750
|
return this.partitions ??= this.table.partition(this.groupedBy), this.partitions;
|
|
1369
1751
|
}
|
|
1370
1752
|
};
|
|
1371
|
-
function
|
|
1753
|
+
function In(e, t, r) {
|
|
1372
1754
|
const a = t.map((o) => e[o]?.valueFormat ?? { type: "decimal" }), [n, ...s] = a;
|
|
1373
1755
|
if (!n) return { type: "decimal" };
|
|
1374
1756
|
for (const o of a) if (o.type === "lookup") throw new de({
|
|
1375
1757
|
code: "INVALID_DATA_SHAPE",
|
|
1376
1758
|
message: "Cannot reshape: a source column has a lookup format and lookups cannot nest"
|
|
1377
1759
|
});
|
|
1378
|
-
if (s.every((o) =>
|
|
1760
|
+
if (s.every((o) => Xr(o, n)) || n.type === "lookup") return n;
|
|
1379
1761
|
const i = {};
|
|
1380
1762
|
for (const [o, l] of t.entries()) {
|
|
1381
1763
|
const c = Xe([l]), u = a[o];
|
|
@@ -1388,7 +1770,7 @@ function ln(e, t, r) {
|
|
|
1388
1770
|
fallback: n
|
|
1389
1771
|
};
|
|
1390
1772
|
}
|
|
1391
|
-
var
|
|
1773
|
+
var Lr = class {
|
|
1392
1774
|
constructor(e) {
|
|
1393
1775
|
this.label = e, this.items = /* @__PURE__ */ new Map();
|
|
1394
1776
|
}
|
|
@@ -1403,505 +1785,141 @@ var Tr = class {
|
|
|
1403
1785
|
message: `Unknown ${this.label}: '${e}' (available: ${t})`,
|
|
1404
1786
|
context: {
|
|
1405
1787
|
kind: this.label,
|
|
1406
|
-
requested: e,
|
|
1407
|
-
available: [...this.items.keys()]
|
|
1408
|
-
},
|
|
1409
|
-
suggestion: `Register a custom ${this.label} named '${e}' in the \`plugins\` array, or use one of: ${t}.`
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
|
-
return this.items.get(e);
|
|
1413
|
-
}
|
|
1414
|
-
getAll() {
|
|
1415
|
-
return [...this.items.values()];
|
|
1416
|
-
}
|
|
1417
|
-
has(e) {
|
|
1418
|
-
return this.items.has(e);
|
|
1419
|
-
}
|
|
1420
|
-
}, cn = (e, t) => {
|
|
1421
|
-
const r = typeof e == "string" ? e.trim() : e;
|
|
1422
|
-
if (te(r)) return { type: "decimal" };
|
|
1423
|
-
const a = typeof r == "string" && ir(r, t);
|
|
1424
|
-
if (a) return a;
|
|
1425
|
-
const n = typeof r == "string" && Oa(r, t);
|
|
1426
|
-
return n || (sr(e) ? { type: "date" } : er(e) ? { type: "percentage" } : ur(e) && typeof e == "string" ? {
|
|
1427
|
-
type: "currency",
|
|
1428
|
-
iso: Wa(e)
|
|
1429
|
-
} : { type: "text" });
|
|
1430
|
-
}, un = {
|
|
1431
|
-
type: "year",
|
|
1432
|
-
dateFormat: "yyyy"
|
|
1433
|
-
}, dn = { type: "text" }, hn = (e) => {
|
|
1434
|
-
const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a = yn(e), n = fn(e), s = a.size > 0;
|
|
1435
|
-
for (const [i, o] of e.columns.entries()) {
|
|
1436
|
-
if (o._metadata?.isHidden) continue;
|
|
1437
|
-
const l = a.get(o.key);
|
|
1438
|
-
if (he(l) && s) continue;
|
|
1439
|
-
const c = o.valueFormat ?? (he(l) ? dn : i === n ? un : cn(l, t)), u = Zt(c);
|
|
1440
|
-
r[o.key] = pn(o.key, e.rows, c, u, t);
|
|
1441
|
-
}
|
|
1442
|
-
return new oe(r);
|
|
1443
|
-
}, no = class extends Ha {
|
|
1444
|
-
dependencies(e) {
|
|
1445
|
-
return [e];
|
|
1446
|
-
}
|
|
1447
|
-
run(e) {
|
|
1448
|
-
return hn(e);
|
|
1449
|
-
}
|
|
1450
|
-
}, fn = (e) => {
|
|
1451
|
-
if (e.columns.some((r) => r.valueFormat?.type === "year")) return -1;
|
|
1452
|
-
const t = gn(e.rows, 5);
|
|
1453
|
-
return e.columns.findIndex((r) => {
|
|
1454
|
-
if (r.valueFormat) return !1;
|
|
1455
|
-
const a = t.map((n) => n[r.key]).filter((n) => !he(n));
|
|
1456
|
-
return a.length >= 2 && a.every(Pa);
|
|
1457
|
-
});
|
|
1458
|
-
}, pn = (e, t, r, a, n) => ({
|
|
1459
|
-
type: a,
|
|
1460
|
-
values: t.reduce((s, i) => (fr(i) || s.push(pr(i[e], r, n)), s), []),
|
|
1461
|
-
valueFormat: r
|
|
1462
|
-
}), yn = (e) => {
|
|
1463
|
-
const t = /* @__PURE__ */ new Map(), r = new Set(e.columns.map((a) => a.key));
|
|
1464
|
-
for (const a of e.rows) {
|
|
1465
|
-
for (const n of r) {
|
|
1466
|
-
const s = a[n];
|
|
1467
|
-
he(s) || (t.set(n, s), r.delete(n));
|
|
1468
|
-
}
|
|
1469
|
-
if (r.size === 0) break;
|
|
1470
|
-
}
|
|
1471
|
-
return t;
|
|
1472
|
-
}, gn = (e, t) => {
|
|
1473
|
-
const r = [];
|
|
1474
|
-
for (const a of e)
|
|
1475
|
-
if (fr(a) || r.push(a), r.length === t) return r;
|
|
1476
|
-
return r;
|
|
1477
|
-
}, so = /* @__PURE__ */ new Set([
|
|
1478
|
-
"min",
|
|
1479
|
-
"max",
|
|
1480
|
-
"scalar"
|
|
1481
|
-
]), mn = {
|
|
1482
|
-
x: {
|
|
1483
|
-
min: y.xMin,
|
|
1484
|
-
max: y.xMax
|
|
1485
|
-
},
|
|
1486
|
-
y: {
|
|
1487
|
-
min: y.yMin,
|
|
1488
|
-
max: y.yMax
|
|
1489
|
-
}
|
|
1490
|
-
};
|
|
1491
|
-
function bn(e) {
|
|
1492
|
-
const t = /* @__PURE__ */ new Set();
|
|
1493
|
-
for (const r of e) r.role === "point" ? t.add(r.axis) : (r.role === "min" || r.role === "max") && Y(r.aes) && t.add(r.aes);
|
|
1494
|
-
return [...t];
|
|
1495
|
-
}
|
|
1496
|
-
function io(e) {
|
|
1497
|
-
const t = /* @__PURE__ */ new Set();
|
|
1498
|
-
for (const r of e)
|
|
1499
|
-
r.role === "point" && t.add(r.axis), Y(r.aes) && t.add(r.aes);
|
|
1500
|
-
return [...t];
|
|
1501
|
-
}
|
|
1502
|
-
function oo(e, t, r) {
|
|
1503
|
-
let a = e;
|
|
1504
|
-
for (const n of t) {
|
|
1505
|
-
if (n.role !== "min" && n.role !== "max" || !Y(n.aes)) continue;
|
|
1506
|
-
const s = mn[n.axis][n.role];
|
|
1507
|
-
if (a.hasVariable(s)) continue;
|
|
1508
|
-
const i = D(r[n.aes]);
|
|
1509
|
-
!Y(i) || !a.hasVariable(i) || (a = a.addVariable(s, "numeric", a.getValues(i, { type: "numeric" })));
|
|
1510
|
-
}
|
|
1511
|
-
return a;
|
|
1512
|
-
}
|
|
1513
|
-
var vn = (e, t) => {
|
|
1514
|
-
if (Y(t.group)) {
|
|
1515
|
-
const n = D(t.group);
|
|
1516
|
-
if (n !== null) return [n];
|
|
1517
|
-
}
|
|
1518
|
-
const r = new Set([D(t.x), D(t.y)].filter(Y)), a = /* @__PURE__ */ new Set();
|
|
1519
|
-
for (const n of vr) {
|
|
1520
|
-
const s = D(t[n]);
|
|
1521
|
-
Y(s) && (r.has(s) || e.hasVariable(s) && e.getType(s) === "categorical" && a.add(s));
|
|
1522
|
-
}
|
|
1523
|
-
return [...a];
|
|
1524
|
-
}, wr = (e, t) => e.hasVariable(Ke.group) ? e.getValues(Ke.group, {
|
|
1525
|
-
distinct: !0,
|
|
1526
|
-
skipNulls: !0
|
|
1527
|
-
}).length > 1 : vn(e, t).some((r) => e.getValues(r, {
|
|
1528
|
-
distinct: !0,
|
|
1529
|
-
skipNulls: !0
|
|
1530
|
-
}).length > 1), Sr = [
|
|
1531
|
-
"none",
|
|
1532
|
-
"xs",
|
|
1533
|
-
"sm",
|
|
1534
|
-
"md",
|
|
1535
|
-
"lg",
|
|
1536
|
-
"xl",
|
|
1537
|
-
"full"
|
|
1538
|
-
], lo = {
|
|
1539
|
-
point: xn,
|
|
1540
|
-
line: Mn,
|
|
1541
|
-
area: En,
|
|
1542
|
-
bar: Tn,
|
|
1543
|
-
rule: wn,
|
|
1544
|
-
tile: Sn
|
|
1545
|
-
}, An = (e) => typeof e == "string" && Sr.includes(e);
|
|
1546
|
-
function pe(e, t) {
|
|
1547
|
-
return {
|
|
1548
|
-
type: "layer",
|
|
1549
|
-
id: t.id,
|
|
1550
|
-
geom: e,
|
|
1551
|
-
mapping: t.aes,
|
|
1552
|
-
stat: t.stat,
|
|
1553
|
-
params: t.params,
|
|
1554
|
-
position: t.position,
|
|
1555
|
-
yScaleType: t.yScaleType,
|
|
1556
|
-
transforms: t.transforms,
|
|
1557
|
-
interactive: t.interactive,
|
|
1558
|
-
tooltip: t.tooltip,
|
|
1559
|
-
dataLabels: t.dataLabels
|
|
1560
|
-
};
|
|
1561
|
-
}
|
|
1562
|
-
function xn(e = {}) {
|
|
1563
|
-
return pe("point", e);
|
|
1564
|
-
}
|
|
1565
|
-
function Mn(e = {}) {
|
|
1566
|
-
return pe("line", e);
|
|
1567
|
-
}
|
|
1568
|
-
function En(e = {}) {
|
|
1569
|
-
return pe("area", e);
|
|
1570
|
-
}
|
|
1571
|
-
function Tn(e = {}) {
|
|
1572
|
-
return pe("bar", e);
|
|
1573
|
-
}
|
|
1574
|
-
function wn(e = {}) {
|
|
1575
|
-
return pe("rule", e);
|
|
1576
|
-
}
|
|
1577
|
-
function Sn(e = {}) {
|
|
1578
|
-
return pe("tile", e);
|
|
1579
|
-
}
|
|
1580
|
-
var kn = [
|
|
1581
|
-
"diagonal",
|
|
1582
|
-
"dots",
|
|
1583
|
-
"crosshatch"
|
|
1584
|
-
], _n = ["tile", "stretch"], kr = (e) => typeof e == "object" && e !== null && "gradient" in e, _r = (e) => typeof e == "object" && e !== null && "pattern" in e, Ln = (e) => typeof e == "object" && e !== null && "image" in e, Rn = (e) => typeof e != "object" ? e : kr(e) ? e.stops[0]?.color ?? "transparent" : _r(e) ? e.color : e.fallback, co = (e) => typeof e == "string" ? e : JSON.stringify(e), Cn = [
|
|
1585
|
-
"topLeft",
|
|
1586
|
-
"topRight",
|
|
1587
|
-
"bottomRight",
|
|
1588
|
-
"bottomLeft"
|
|
1589
|
-
], uo = ["dimmed", "hovered"], Dn = [
|
|
1590
|
-
"normal",
|
|
1591
|
-
"italic",
|
|
1592
|
-
"oblique"
|
|
1593
|
-
], In = [
|
|
1594
|
-
"none",
|
|
1595
|
-
"uppercase",
|
|
1596
|
-
"lowercase",
|
|
1597
|
-
"capitalize"
|
|
1598
|
-
], Fn = [
|
|
1599
|
-
"none",
|
|
1600
|
-
"underline",
|
|
1601
|
-
"line-through"
|
|
1602
|
-
], Pn = [
|
|
1603
|
-
"butt",
|
|
1604
|
-
"round",
|
|
1605
|
-
"square"
|
|
1606
|
-
], Nn = [
|
|
1607
|
-
"miter",
|
|
1608
|
-
"round",
|
|
1609
|
-
"bevel"
|
|
1610
|
-
], On = [
|
|
1611
|
-
"normal",
|
|
1612
|
-
"multiply",
|
|
1613
|
-
"screen",
|
|
1614
|
-
"overlay",
|
|
1615
|
-
"darken",
|
|
1616
|
-
"lighten"
|
|
1617
|
-
], Bn = [
|
|
1618
|
-
"circle",
|
|
1619
|
-
"square",
|
|
1620
|
-
"diamond",
|
|
1621
|
-
"triangle",
|
|
1622
|
-
"cross",
|
|
1623
|
-
"star",
|
|
1624
|
-
"wye"
|
|
1625
|
-
], ho = [
|
|
1626
|
-
"fill",
|
|
1627
|
-
"stroke",
|
|
1628
|
-
"alpha",
|
|
1629
|
-
"saturation",
|
|
1630
|
-
"blur",
|
|
1631
|
-
"brightness",
|
|
1632
|
-
"contrast",
|
|
1633
|
-
"cornerRadius",
|
|
1634
|
-
"strokeWidth",
|
|
1635
|
-
"dashArray",
|
|
1636
|
-
"lineCap",
|
|
1637
|
-
"lineJoin",
|
|
1638
|
-
"strokeAlpha",
|
|
1639
|
-
"fillAlpha",
|
|
1640
|
-
"size",
|
|
1641
|
-
"symbol",
|
|
1642
|
-
"fontFamily",
|
|
1643
|
-
"fontSize",
|
|
1644
|
-
"fontWeight",
|
|
1645
|
-
"fontStyle",
|
|
1646
|
-
"letterSpacing",
|
|
1647
|
-
"textTransform",
|
|
1648
|
-
"textDecoration",
|
|
1649
|
-
"textOutlineColor",
|
|
1650
|
-
"textOutlineWidth",
|
|
1651
|
-
"textShadow",
|
|
1652
|
-
"lineHeight",
|
|
1653
|
-
"textScale",
|
|
1654
|
-
"textColor",
|
|
1655
|
-
"offset",
|
|
1656
|
-
"gap",
|
|
1657
|
-
"length",
|
|
1658
|
-
"paddingInline",
|
|
1659
|
-
"paddingBlock",
|
|
1660
|
-
"padding",
|
|
1661
|
-
"margin",
|
|
1662
|
-
"shadow",
|
|
1663
|
-
"blendMode"
|
|
1664
|
-
], mt = 1, bt = 1e3, vt = "'none' or a shadow object { offsetX, offsetY, blur, color }", At = "a non-negative number of pixels, or an object of those per edge", Vn = "a non-empty color string, a { light, dark } pair, or a token(...) reference", Wn = [
|
|
1665
|
-
"top",
|
|
1666
|
-
"right",
|
|
1667
|
-
"bottom",
|
|
1668
|
-
"left"
|
|
1669
|
-
], ke = "a color, a { gradient, stops } object, a { pattern, color } object, or an { image, fallback } object", xt = "a number of pixels, or { topLeft, topRight, bottomRight, bottomLeft } in pixels", Ne = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", Lr = (e) => typeof e == "object" && e !== null && typeof e.token == "string", Un = (e) => typeof e == "string" ? e.trim().length > 0 : Ne(e) && e.light.trim().length > 0 && e.dark.trim().length > 0;
|
|
1670
|
-
function f(e) {
|
|
1671
|
-
return { token: e };
|
|
1672
|
-
}
|
|
1673
|
-
var Mt = (e, t) => {
|
|
1674
|
-
if (typeof e != "object" || e === null) return e;
|
|
1675
|
-
if (Ne(e)) return e[t];
|
|
1676
|
-
if (Array.isArray(e)) {
|
|
1677
|
-
if (e.every((n) => typeof n == "number")) return e;
|
|
1678
|
-
const a = e.map((n) => Mt(n, t));
|
|
1679
|
-
return a.every((n, s) => n === e[s]) ? e : a;
|
|
1680
|
-
}
|
|
1681
|
-
const r = Object.entries(e).map(([a, n]) => [a, Mt(n, t)]);
|
|
1682
|
-
return r.every(([a, n]) => n === e[a]) ? e : Object.fromEntries(r);
|
|
1683
|
-
}, x = (e) => typeof e == "number" && Number.isFinite(e), m = (e, t) => ({
|
|
1684
|
-
status: "rejected",
|
|
1685
|
-
expected: e,
|
|
1686
|
-
actual: t
|
|
1687
|
-
}), X = (e) => {
|
|
1688
|
-
const t = `one of ${e.map((r) => `'${String(r)}'`).join(", ")}`;
|
|
1689
|
-
return (r) => e.includes(r) ? {
|
|
1690
|
-
status: "accepted",
|
|
1691
|
-
value: r
|
|
1692
|
-
} : m(t, r);
|
|
1693
|
-
}, J = (e, t) => {
|
|
1694
|
-
if (typeof e == "string")
|
|
1695
|
-
return e.trim().length > 0 ? {
|
|
1696
|
-
status: "accepted",
|
|
1697
|
-
value: e
|
|
1698
|
-
} : m("a non-empty color string", e);
|
|
1699
|
-
if (Lr(e)) {
|
|
1700
|
-
const r = t[e.token];
|
|
1701
|
-
return r === void 0 ? {
|
|
1702
|
-
status: "unknownToken",
|
|
1703
|
-
token: e.token
|
|
1704
|
-
} : Un(r) ? {
|
|
1705
|
-
status: "accepted",
|
|
1706
|
-
value: typeof r == "string" ? r : {
|
|
1707
|
-
light: r.light,
|
|
1708
|
-
dark: r.dark
|
|
1709
|
-
}
|
|
1710
|
-
} : { status: "dropped" };
|
|
1711
|
-
}
|
|
1712
|
-
return Ne(e) && e.light.trim().length > 0 && e.dark.trim().length > 0 ? {
|
|
1713
|
-
status: "accepted",
|
|
1714
|
-
value: {
|
|
1715
|
-
light: e.light,
|
|
1716
|
-
dark: e.dark
|
|
1717
|
-
}
|
|
1718
|
-
} : m(Vn, e);
|
|
1719
|
-
}, Yn = (e, t) => {
|
|
1720
|
-
if (typeof e != "object" || e === null || Ne(e) || Lr(e)) return J(e, t);
|
|
1721
|
-
const r = e;
|
|
1722
|
-
if (kr(r)) {
|
|
1723
|
-
const a = r.gradient;
|
|
1724
|
-
if (a !== "linear" && a !== "radial") return m(ke, e);
|
|
1725
|
-
if (!Array.isArray(r.stops) || r.stops.length < 2) return m("a gradient with at least two stops", e);
|
|
1726
|
-
const n = [];
|
|
1727
|
-
for (const s of r.stops) {
|
|
1728
|
-
if (!x(s.offset) || s.offset < 0 || s.offset > 1) return m("a gradient stop offset in [0, 1]", e);
|
|
1729
|
-
const i = J(s.color, t);
|
|
1730
|
-
if (i.status !== "accepted") return i;
|
|
1731
|
-
n.push({
|
|
1732
|
-
offset: s.offset,
|
|
1733
|
-
color: i.value
|
|
1788
|
+
requested: e,
|
|
1789
|
+
available: [...this.items.keys()]
|
|
1790
|
+
},
|
|
1791
|
+
suggestion: `Register a custom ${this.label} named '${e}' in the \`plugins\` array, or use one of: ${t}.`
|
|
1734
1792
|
});
|
|
1735
1793
|
}
|
|
1736
|
-
return
|
|
1737
|
-
status: "accepted",
|
|
1738
|
-
value: {
|
|
1739
|
-
gradient: "radial",
|
|
1740
|
-
stops: n
|
|
1741
|
-
}
|
|
1742
|
-
} : r.angle !== void 0 && !x(r.angle) ? m("a gradient angle in degrees", e) : {
|
|
1743
|
-
status: "accepted",
|
|
1744
|
-
value: {
|
|
1745
|
-
gradient: "linear",
|
|
1746
|
-
...r.angle === void 0 ? {} : { angle: r.angle },
|
|
1747
|
-
stops: n
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1794
|
+
return this.items.get(e);
|
|
1750
1795
|
}
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
const a = J(r.color, t);
|
|
1754
|
-
if (a.status !== "accepted") return a;
|
|
1755
|
-
const n = {
|
|
1756
|
-
pattern: r.pattern,
|
|
1757
|
-
color: a.value
|
|
1758
|
-
};
|
|
1759
|
-
if (r.background !== void 0) {
|
|
1760
|
-
const s = J(r.background, t);
|
|
1761
|
-
if (s.status !== "accepted") return s;
|
|
1762
|
-
n.background = s.value;
|
|
1763
|
-
}
|
|
1764
|
-
if (r.size !== void 0) {
|
|
1765
|
-
if (!x(r.size) || r.size <= 0) return m("a pattern size in pixels", e);
|
|
1766
|
-
n.size = r.size;
|
|
1767
|
-
}
|
|
1768
|
-
return {
|
|
1769
|
-
status: "accepted",
|
|
1770
|
-
value: n
|
|
1771
|
-
};
|
|
1796
|
+
getAll() {
|
|
1797
|
+
return [...this.items.values()];
|
|
1772
1798
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
if (r.fit !== void 0 && !_n.includes(r.fit)) return m(ke, e);
|
|
1776
|
-
if (r.alpha !== void 0 && (!x(r.alpha) || r.alpha < 0 || r.alpha > 1)) return m("an image alpha in [0, 1]", e);
|
|
1777
|
-
if (r.size !== void 0 && (!x(r.size) || r.size <= 0)) return m("an image size in pixels", e);
|
|
1778
|
-
const a = J(r.fallback, t);
|
|
1779
|
-
return a.status !== "accepted" ? a : {
|
|
1780
|
-
status: "accepted",
|
|
1781
|
-
value: {
|
|
1782
|
-
image: r.image,
|
|
1783
|
-
...r.fit === void 0 ? {} : { fit: r.fit },
|
|
1784
|
-
...r.alpha === void 0 ? {} : { alpha: r.alpha },
|
|
1785
|
-
...r.size === void 0 ? {} : { size: r.size },
|
|
1786
|
-
fallback: a.value
|
|
1787
|
-
}
|
|
1788
|
-
};
|
|
1799
|
+
has(e) {
|
|
1800
|
+
return this.items.has(e);
|
|
1789
1801
|
}
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
if (
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1802
|
+
}, Pn = (e, t) => {
|
|
1803
|
+
const r = typeof e == "string" ? e.trim() : e;
|
|
1804
|
+
if (te(r)) return { type: "decimal" };
|
|
1805
|
+
const a = typeof r == "string" && ir(r, t);
|
|
1806
|
+
if (a) return a;
|
|
1807
|
+
const n = typeof r == "string" && Ba(r, t);
|
|
1808
|
+
return n || (sr(e) ? { type: "date" } : er(e) ? { type: "percentage" } : ur(e) && typeof e == "string" ? {
|
|
1809
|
+
type: "currency",
|
|
1810
|
+
iso: Ua(e)
|
|
1811
|
+
} : { type: "text" });
|
|
1812
|
+
}, Fn = {
|
|
1813
|
+
type: "year",
|
|
1814
|
+
dateFormat: "yyyy"
|
|
1815
|
+
}, On = { type: "text" }, Nn = (e) => {
|
|
1816
|
+
const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a = Wn(e), n = Bn(e), s = a.size > 0;
|
|
1817
|
+
for (const [i, o] of e.columns.entries()) {
|
|
1818
|
+
if (o._metadata?.isHidden) continue;
|
|
1819
|
+
const l = a.get(o.key);
|
|
1820
|
+
if (he(l) && s) continue;
|
|
1821
|
+
const c = o.valueFormat ?? (he(l) ? On : i === n ? Fn : Pn(l, t)), u = Zt(c);
|
|
1822
|
+
r[o.key] = Vn(o.key, e.rows, c, u, t);
|
|
1809
1823
|
}
|
|
1810
|
-
return
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
}, Gn = (e) => {
|
|
1815
|
-
if (x(e) && e >= 0) return {
|
|
1816
|
-
status: "accepted",
|
|
1817
|
-
value: e
|
|
1818
|
-
};
|
|
1819
|
-
if (typeof e != "object" || e === null) return m(xt, e);
|
|
1820
|
-
const t = e, r = {};
|
|
1821
|
-
for (const a of Cn) {
|
|
1822
|
-
const n = t[a];
|
|
1823
|
-
if (!x(n) || n < 0) return m(xt, e);
|
|
1824
|
-
r[a] = n;
|
|
1824
|
+
return new oe(r);
|
|
1825
|
+
}, uo = class extends bn {
|
|
1826
|
+
dependencies(e) {
|
|
1827
|
+
return [e];
|
|
1825
1828
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
}
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
value: e
|
|
1865
|
-
};
|
|
1866
|
-
if (typeof e != "object" || e === null) return m(vt, e);
|
|
1867
|
-
const r = e;
|
|
1868
|
-
if (!x(r.offsetX) || !x(r.offsetY) || !x(r.blur) || r.blur < 0) return m(vt, e);
|
|
1869
|
-
const a = J(r.color, t);
|
|
1870
|
-
return a.status !== "accepted" ? a : {
|
|
1871
|
-
status: "accepted",
|
|
1872
|
-
value: {
|
|
1873
|
-
offsetX: r.offsetX,
|
|
1874
|
-
offsetY: r.offsetY,
|
|
1875
|
-
blur: r.blur,
|
|
1876
|
-
color: a.value
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1829
|
+
run(e) {
|
|
1830
|
+
return Nn(e);
|
|
1831
|
+
}
|
|
1832
|
+
}, Bn = (e) => {
|
|
1833
|
+
if (e.columns.some((r) => r.valueFormat?.type === "year")) return -1;
|
|
1834
|
+
const t = Un(e.rows, 5);
|
|
1835
|
+
return e.columns.findIndex((r) => {
|
|
1836
|
+
if (r.valueFormat) return !1;
|
|
1837
|
+
const a = t.map((n) => n[r.key]).filter((n) => !he(n));
|
|
1838
|
+
return a.length >= 2 && a.every(Oa);
|
|
1839
|
+
});
|
|
1840
|
+
}, Vn = (e, t, r, a, n) => ({
|
|
1841
|
+
type: a,
|
|
1842
|
+
values: t.reduce((s, i) => (fr(i) || s.push(pr(i[e], r, n)), s), []),
|
|
1843
|
+
valueFormat: r
|
|
1844
|
+
}), Wn = (e) => {
|
|
1845
|
+
const t = /* @__PURE__ */ new Map(), r = new Set(e.columns.map((a) => a.key));
|
|
1846
|
+
for (const a of e.rows) {
|
|
1847
|
+
for (const n of r) {
|
|
1848
|
+
const s = a[n];
|
|
1849
|
+
he(s) || (t.set(n, s), r.delete(n));
|
|
1850
|
+
}
|
|
1851
|
+
if (r.size === 0) break;
|
|
1852
|
+
}
|
|
1853
|
+
return t;
|
|
1854
|
+
}, Un = (e, t) => {
|
|
1855
|
+
const r = [];
|
|
1856
|
+
for (const a of e)
|
|
1857
|
+
if (fr(a) || r.push(a), r.length === t) return r;
|
|
1858
|
+
return r;
|
|
1859
|
+
}, ho = /* @__PURE__ */ new Set([
|
|
1860
|
+
"min",
|
|
1861
|
+
"max",
|
|
1862
|
+
"scalar"
|
|
1863
|
+
]), Yn = {
|
|
1864
|
+
x: {
|
|
1865
|
+
min: y.xMin,
|
|
1866
|
+
max: y.xMax
|
|
1879
1867
|
},
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1868
|
+
y: {
|
|
1869
|
+
min: y.yMin,
|
|
1870
|
+
max: y.yMax
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
function Gn(e) {
|
|
1874
|
+
const t = /* @__PURE__ */ new Set();
|
|
1875
|
+
for (const r of e) r.role === "point" ? t.add(r.axis) : (r.role === "min" || r.role === "max") && Y(r.aes) && t.add(r.aes);
|
|
1876
|
+
return [...t];
|
|
1877
|
+
}
|
|
1878
|
+
function fo(e) {
|
|
1879
|
+
const t = /* @__PURE__ */ new Set();
|
|
1880
|
+
for (const r of e)
|
|
1881
|
+
r.role === "point" && t.add(r.axis), Y(r.aes) && t.add(r.aes);
|
|
1882
|
+
return [...t];
|
|
1883
|
+
}
|
|
1884
|
+
function po(e, t, r) {
|
|
1885
|
+
let a = e;
|
|
1886
|
+
for (const n of t) {
|
|
1887
|
+
if (n.role !== "min" && n.role !== "max" || !Y(n.aes)) continue;
|
|
1888
|
+
const s = Yn[n.axis][n.role];
|
|
1889
|
+
if (a.hasVariable(s)) continue;
|
|
1890
|
+
const i = D(r[n.aes]);
|
|
1891
|
+
!Y(i) || !a.hasVariable(i) || (a = a.addVariable(s, "numeric", a.getValues(i, { type: "numeric" })));
|
|
1892
|
+
}
|
|
1893
|
+
return a;
|
|
1894
|
+
}
|
|
1895
|
+
var zn = (e, t) => {
|
|
1896
|
+
if (Y(t.group)) {
|
|
1897
|
+
const n = D(t.group);
|
|
1898
|
+
if (n !== null) return [n];
|
|
1899
|
+
}
|
|
1900
|
+
const r = new Set([D(t.x), D(t.y)].filter(Y)), a = /* @__PURE__ */ new Set();
|
|
1901
|
+
for (const n of Tr) {
|
|
1902
|
+
const s = D(t[n]);
|
|
1903
|
+
Y(s) && (r.has(s) || e.hasVariable(s) && e.getType(s) === "categorical" && a.add(s));
|
|
1904
|
+
}
|
|
1905
|
+
return [...a];
|
|
1906
|
+
}, Rr = (e, t) => e.hasVariable(Ke.group) ? e.getValues(Ke.group, {
|
|
1907
|
+
distinct: !0,
|
|
1908
|
+
skipNulls: !0
|
|
1909
|
+
}).length > 1 : zn(e, t).some((r) => e.getValues(r, {
|
|
1910
|
+
distinct: !0,
|
|
1911
|
+
skipNulls: !0
|
|
1912
|
+
}).length > 1), yo = ["cartesian", "polar"], $n = [
|
|
1895
1913
|
"kind",
|
|
1896
1914
|
"edge",
|
|
1897
1915
|
"axis",
|
|
1898
1916
|
"role",
|
|
1899
1917
|
"position",
|
|
1900
1918
|
"part"
|
|
1901
|
-
],
|
|
1919
|
+
], go = "#B84737", jn = 0.4, mo = "sm", vo = 2, bo = 8, Ao = 12, xo = Object.freeze({
|
|
1902
1920
|
light: "#F5F1E9",
|
|
1903
1921
|
dark: "#1F1E1C"
|
|
1904
|
-
}),
|
|
1922
|
+
}), Mo = "#ffffff", Eo = 1, To = 24, wo = {
|
|
1905
1923
|
top: 24,
|
|
1906
1924
|
right: 24,
|
|
1907
1925
|
bottom: 24,
|
|
@@ -1933,12 +1951,12 @@ var Mt = (e, t) => {
|
|
|
1933
1951
|
cornerRadius: "boxRadius",
|
|
1934
1952
|
shadow: "shadow",
|
|
1935
1953
|
alpha: "unitInterval"
|
|
1936
|
-
},
|
|
1954
|
+
}, Hn = {
|
|
1937
1955
|
offsetX: 0,
|
|
1938
1956
|
offsetY: 2,
|
|
1939
1957
|
blur: 4,
|
|
1940
1958
|
color: "rgba(14, 14, 52, 0.12)"
|
|
1941
|
-
},
|
|
1959
|
+
}, Kn = {
|
|
1942
1960
|
offsetX: 0,
|
|
1943
1961
|
offsetY: 4,
|
|
1944
1962
|
blur: 6,
|
|
@@ -1947,8 +1965,9 @@ var Mt = (e, t) => {
|
|
|
1947
1965
|
"where",
|
|
1948
1966
|
"state",
|
|
1949
1967
|
"layer"
|
|
1950
|
-
],
|
|
1968
|
+
], Cr = {
|
|
1951
1969
|
fill: "paint",
|
|
1970
|
+
overlay: "overlay",
|
|
1952
1971
|
stroke: "color",
|
|
1953
1972
|
alpha: "unitInterval",
|
|
1954
1973
|
fillAlpha: "unitInterval",
|
|
@@ -1959,7 +1978,7 @@ var Mt = (e, t) => {
|
|
|
1959
1978
|
contrast: "multiplier",
|
|
1960
1979
|
shadow: "shadow",
|
|
1961
1980
|
blendMode: "blendMode"
|
|
1962
|
-
},
|
|
1981
|
+
}, Xn = 0.3, qn = 10, Jn = 1, Qn = 24, Zn = 8, E = {
|
|
1963
1982
|
label: {
|
|
1964
1983
|
fontSize: 11.5,
|
|
1965
1984
|
fontWeight: 500,
|
|
@@ -2076,8 +2095,8 @@ var Mt = (e, t) => {
|
|
|
2076
2095
|
paddingBlock: "pixels",
|
|
2077
2096
|
shadow: "shadow",
|
|
2078
2097
|
alpha: "unitInterval"
|
|
2079
|
-
},
|
|
2080
|
-
var
|
|
2098
|
+
}, Dr = /* @__PURE__ */ new Map();
|
|
2099
|
+
var So = (e = Object.values(rt)) => {
|
|
2081
2100
|
const t = [], r = [], a = [], n = (s) => {
|
|
2082
2101
|
if (s.rest !== void 0 && t.push({
|
|
2083
2102
|
select: s.select,
|
|
@@ -2098,14 +2117,14 @@ var To = (e = Object.values(rt)) => {
|
|
|
2098
2117
|
...r,
|
|
2099
2118
|
...a
|
|
2100
2119
|
];
|
|
2101
|
-
},
|
|
2120
|
+
}, ko = (e) => {
|
|
2102
2121
|
for (const t of e) {
|
|
2103
2122
|
Object.freeze(t.select);
|
|
2104
2123
|
for (const r of Object.values(t.declarations)) typeof r == "object" && Object.freeze(r);
|
|
2105
2124
|
Object.freeze(t.declarations), t.when !== void 0 && Object.freeze(t.when), Object.freeze(t);
|
|
2106
2125
|
}
|
|
2107
2126
|
return e;
|
|
2108
|
-
},
|
|
2127
|
+
}, _o = (e) => Dr.get(Ir(e)), _t = (e, t) => ({
|
|
2109
2128
|
x: {
|
|
2110
2129
|
select: {
|
|
2111
2130
|
target: e,
|
|
@@ -2149,7 +2168,7 @@ var To = (e = Object.values(rt)) => {
|
|
|
2149
2168
|
}), rt = {
|
|
2150
2169
|
geom: {
|
|
2151
2170
|
select: { target: "geom" },
|
|
2152
|
-
vocabulary:
|
|
2171
|
+
vocabulary: Cr,
|
|
2153
2172
|
options: Je,
|
|
2154
2173
|
aesthetics: {
|
|
2155
2174
|
fill: "color",
|
|
@@ -2162,8 +2181,8 @@ var To = (e = Object.values(rt)) => {
|
|
|
2162
2181
|
shadow: "none",
|
|
2163
2182
|
blendMode: "normal"
|
|
2164
2183
|
},
|
|
2165
|
-
dimmed: { alpha:
|
|
2166
|
-
hovered: { shadow:
|
|
2184
|
+
dimmed: { alpha: jn },
|
|
2185
|
+
hovered: { shadow: Hn },
|
|
2167
2186
|
acceptsUnknownKinds: !0
|
|
2168
2187
|
},
|
|
2169
2188
|
panelBorder: {
|
|
@@ -2311,9 +2330,9 @@ var To = (e = Object.values(rt)) => {
|
|
|
2311
2330
|
rest: {
|
|
2312
2331
|
...E.label,
|
|
2313
2332
|
textColor: f("textSecondary"),
|
|
2314
|
-
offset:
|
|
2333
|
+
offset: qn,
|
|
2315
2334
|
textOutlineColor: f("graphBackground"),
|
|
2316
|
-
textOutlineWidth:
|
|
2335
|
+
textOutlineWidth: Jn
|
|
2317
2336
|
},
|
|
2318
2337
|
children: {
|
|
2319
2338
|
..._t("tickLabel", ne),
|
|
@@ -2376,6 +2395,7 @@ var To = (e = Object.values(rt)) => {
|
|
|
2376
2395
|
select: { target: "graph" },
|
|
2377
2396
|
vocabulary: {
|
|
2378
2397
|
fill: "paint",
|
|
2398
|
+
overlay: "overlay",
|
|
2379
2399
|
stroke: "color",
|
|
2380
2400
|
strokeWidth: "pixels",
|
|
2381
2401
|
cornerRadius: "pixels",
|
|
@@ -2552,7 +2572,7 @@ var To = (e = Object.values(rt)) => {
|
|
|
2552
2572
|
select: { target: "headline" },
|
|
2553
2573
|
vocabulary: se,
|
|
2554
2574
|
rest: {
|
|
2555
|
-
gap:
|
|
2575
|
+
gap: Qn,
|
|
2556
2576
|
margin: { bottom: 4 }
|
|
2557
2577
|
}
|
|
2558
2578
|
},
|
|
@@ -2652,7 +2672,7 @@ var To = (e = Object.values(rt)) => {
|
|
|
2652
2672
|
legend: {
|
|
2653
2673
|
select: { target: "legend" },
|
|
2654
2674
|
vocabulary: se,
|
|
2655
|
-
rest: { gap:
|
|
2675
|
+
rest: { gap: Zn },
|
|
2656
2676
|
children: {
|
|
2657
2677
|
popover: {
|
|
2658
2678
|
select: {
|
|
@@ -2940,18 +2960,18 @@ var To = (e = Object.values(rt)) => {
|
|
|
2940
2960
|
}
|
|
2941
2961
|
}
|
|
2942
2962
|
}
|
|
2943
|
-
},
|
|
2963
|
+
}, Ir = (e) => {
|
|
2944
2964
|
let t = e.target;
|
|
2945
|
-
for (const r of
|
|
2965
|
+
for (const r of $n) {
|
|
2946
2966
|
const a = e[r];
|
|
2947
2967
|
a !== void 0 && (t += `\0${r}:${a}`);
|
|
2948
2968
|
}
|
|
2949
2969
|
return t;
|
|
2950
|
-
},
|
|
2951
|
-
if (
|
|
2952
|
-
for (const t of Object.values(e.children))
|
|
2970
|
+
}, Pr = (e) => {
|
|
2971
|
+
if (Dr.set(Ir(e.select), e), e.children !== void 0)
|
|
2972
|
+
for (const t of Object.values(e.children)) Pr(t);
|
|
2953
2973
|
};
|
|
2954
|
-
for (const e of Object.values(rt))
|
|
2974
|
+
for (const e of Object.values(rt)) Pr(e);
|
|
2955
2975
|
var at = (e, t) => {
|
|
2956
2976
|
const r = D(t.x);
|
|
2957
2977
|
return !r || !["numeric", "temporal"].includes(e.getType(r)) ? e : e.orderBy(r, "asc");
|
|
@@ -2961,20 +2981,20 @@ var at = (e, t) => {
|
|
|
2961
2981
|
x: r,
|
|
2962
2982
|
y: a
|
|
2963
2983
|
};
|
|
2964
|
-
},
|
|
2965
|
-
function
|
|
2984
|
+
}, Lo = ({ positionRoles: e, aesthetics: t }) => [...Gn(e), ...t.filter((r) => r.required).map((r) => r.name)];
|
|
2985
|
+
function Ro(e) {
|
|
2966
2986
|
return e;
|
|
2967
2987
|
}
|
|
2968
|
-
var
|
|
2969
|
-
...
|
|
2988
|
+
var es = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, ts = (e) => e.observation?.sharedPaint === !1 ? { ...e.observation.vocabulary } : {
|
|
2989
|
+
...Cr,
|
|
2970
2990
|
...e.observation?.vocabulary
|
|
2971
|
-
},
|
|
2991
|
+
}, Co = (e, t) => ({
|
|
2972
2992
|
select: {
|
|
2973
2993
|
target: "geom",
|
|
2974
2994
|
kind: e
|
|
2975
2995
|
},
|
|
2976
|
-
vocabulary:
|
|
2977
|
-
aesthetics:
|
|
2996
|
+
vocabulary: ts(t),
|
|
2997
|
+
aesthetics: es(t),
|
|
2978
2998
|
options: t.observation?.options ?? Je,
|
|
2979
2999
|
...Rt(t.observation),
|
|
2980
3000
|
children: Object.fromEntries(Object.entries(t.parts ?? {}).map(([r, a]) => [r, {
|
|
@@ -2994,10 +3014,10 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
2994
3014
|
...e?.hovered === void 0 ? {} : { hovered: e.hovered }
|
|
2995
3015
|
}), re = class {
|
|
2996
3016
|
constructor() {
|
|
2997
|
-
this.positionRoles = [], this.identityKey = "x-group", this.defaultPosition = "identity", this.defaultStat = null, this.supportedPositions =
|
|
3017
|
+
this.positionRoles = [], this.identityKey = "x-group", this.defaultPosition = "identity", this.defaultStat = null, this.supportedPositions = ma, this.defaultInteractive = !0, this.hoverPriority = "normal", this.aesthetics = [], this.derivedVariables = [], this.highlightStrategy = null, this.supportedCoordTypes = ["cartesian", "flip"], this.spatialKind = "points", this.grid = {}, this.legend = {}, this.dataLabelCoordTypes = [], this.isComposite = !1, this.tooltip = [], this.summaries = {};
|
|
2998
3018
|
}
|
|
2999
3019
|
resolveParams(e) {
|
|
3000
|
-
return
|
|
3020
|
+
return Jr({}, this.defaultParams, e.params);
|
|
3001
3021
|
}
|
|
3002
3022
|
}, Ct = 0.5, Te = (e) => ({
|
|
3003
3023
|
x: 0,
|
|
@@ -3006,18 +3026,18 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3006
3026
|
height: e.height
|
|
3007
3027
|
}), st = (e) => e === "panel-end" ? "end" : e === "panel-start" ? "start" : e, we = ({ box: e, panel: t, orientation: r, placement: a, justify: n, align: s, offset: i, alignOffset: o, labelWidth: l, labelHeight: c }) => {
|
|
3008
3028
|
const u = n === "panel-start" || n === "panel-end", h = (r.valueAxis === "x" ? e.height : e.width) === 0, d = {
|
|
3009
|
-
anchor:
|
|
3029
|
+
anchor: as(n, r.valueDirectionSign),
|
|
3010
3030
|
placement: u ? "inside" : a,
|
|
3011
3031
|
offset: i
|
|
3012
3032
|
}, p = {
|
|
3013
|
-
anchor:
|
|
3033
|
+
anchor: ns(s),
|
|
3014
3034
|
placement: h ? a : "inside",
|
|
3015
3035
|
offset: h ? o ?? i : 0
|
|
3016
|
-
}, g = u ? t : e,
|
|
3017
|
-
min:
|
|
3018
|
-
max:
|
|
3036
|
+
}, g = u ? t : e, b = r.valueAxis === "x" ? g : e, _ = r.valueAxis === "y" ? g : e, P = r.valueAxis === "x" ? d : p, N = r.valueAxis === "x" ? p : d, M = It(P, {
|
|
3037
|
+
min: b.x,
|
|
3038
|
+
max: b.x + b.width,
|
|
3019
3039
|
halfExtent: l / 2
|
|
3020
|
-
}), L = It(
|
|
3040
|
+
}), L = It(N, {
|
|
3021
3041
|
min: _.y,
|
|
3022
3042
|
max: _.y + _.height,
|
|
3023
3043
|
halfExtent: c / 2
|
|
@@ -3025,30 +3045,30 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3025
3045
|
return {
|
|
3026
3046
|
x: M,
|
|
3027
3047
|
y: L,
|
|
3028
|
-
position:
|
|
3048
|
+
position: rs(e, M, L, l, c)
|
|
3029
3049
|
};
|
|
3030
|
-
}, Dt = (e, t, r, a) => r - a >= e - Ct && r + a <= t + Ct,
|
|
3050
|
+
}, Dt = (e, t, r, a) => r - a >= e - Ct && r + a <= t + Ct, rs = (e, t, r, a, n) => {
|
|
3031
3051
|
if (e.width === 0 && e.height === 0) return "outside";
|
|
3032
3052
|
const s = e.width === 0 || Dt(e.x, e.x + e.width, t, a / 2), i = e.height === 0 || Dt(e.y, e.y + e.height, r, n / 2);
|
|
3033
3053
|
return s && i ? "inside" : "outside";
|
|
3034
|
-
},
|
|
3054
|
+
}, as = (e, t) => e === "center" ? "center" : (e === "end" || e === "panel-end") == (t === 1) ? "max" : "min", ns = (e) => e === "center" ? "center" : e === "start" ? "min" : "max", It = ({ anchor: e, placement: t, offset: r }, { min: a, max: n, halfExtent: s }) => {
|
|
3035
3055
|
if (e === "center") return (a + n) / 2;
|
|
3036
3056
|
if (t === "inside" && a === n) return a;
|
|
3037
3057
|
const i = r + s;
|
|
3038
3058
|
return e === "min" ? t === "inside" ? a + i : a - i : t === "inside" ? n - i : n + i;
|
|
3039
|
-
},
|
|
3059
|
+
}, ss = (e) => {
|
|
3040
3060
|
const t = [];
|
|
3041
3061
|
if (!e.layer.dataLabels.showDataLabels) return {
|
|
3042
3062
|
labels: t,
|
|
3043
3063
|
droppedCount: 0
|
|
3044
3064
|
};
|
|
3045
|
-
const { offset: r } = e.layer.dataLabels, a =
|
|
3065
|
+
const { offset: r } = e.layer.dataLabels, a = ls(e.layer);
|
|
3046
3066
|
for (const n of e.layer.data) {
|
|
3047
3067
|
const s = Q(n), i = K(n) ?? j(n);
|
|
3048
3068
|
if (s === null || i === null || !tt(s, i)) continue;
|
|
3049
3069
|
const o = e.formatLabel(n);
|
|
3050
3070
|
if (o === "") continue;
|
|
3051
|
-
const { width: l, height: c } = e.measureDataLabel("observation", "outside", o), { box: u, orientation: h } =
|
|
3071
|
+
const { width: l, height: c } = e.measureDataLabel("observation", "outside", o), { box: u, orientation: h } = os(i, H(n), s, e.panelRect.width, e.panelRect.height), d = we({
|
|
3052
3072
|
box: u,
|
|
3053
3073
|
panel: Te(e.panelRect),
|
|
3054
3074
|
orientation: h,
|
|
@@ -3073,7 +3093,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3073
3093
|
labels: t,
|
|
3074
3094
|
droppedCount: 0
|
|
3075
3095
|
};
|
|
3076
|
-
},
|
|
3096
|
+
}, is = (e) => e.position === "fill" ? "fill" : Ae(e.position) ? "stack" : "none", os = (e, t, r, a, n) => {
|
|
3077
3097
|
const s = t ?? e, i = 1 - Math.max(e, s);
|
|
3078
3098
|
return {
|
|
3079
3099
|
box: {
|
|
@@ -3087,7 +3107,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3087
3107
|
valueDirectionSign: e >= s ? -1 : 1
|
|
3088
3108
|
}
|
|
3089
3109
|
};
|
|
3090
|
-
},
|
|
3110
|
+
}, ls = (e) => {
|
|
3091
3111
|
const { position: t, justify: r, align: a } = e.dataLabels;
|
|
3092
3112
|
return t === "auto" ? {
|
|
3093
3113
|
placement: "outside",
|
|
@@ -3095,10 +3115,10 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3095
3115
|
align: "center"
|
|
3096
3116
|
} : {
|
|
3097
3117
|
placement: t,
|
|
3098
|
-
justify:
|
|
3118
|
+
justify: Rr(e.data, e.mapping) ? st(r) : r,
|
|
3099
3119
|
align: a
|
|
3100
3120
|
};
|
|
3101
|
-
},
|
|
3121
|
+
}, cs = class extends re {
|
|
3102
3122
|
constructor(...e) {
|
|
3103
3123
|
super(...e), this.type = "area", this.styleTarget = { observation: {
|
|
3104
3124
|
vocabulary: {
|
|
@@ -3115,7 +3135,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3115
3135
|
},
|
|
3116
3136
|
rest: {
|
|
3117
3137
|
fill: f("geom"),
|
|
3118
|
-
fillAlpha:
|
|
3138
|
+
fillAlpha: Xn,
|
|
3119
3139
|
strokeWidth: 2,
|
|
3120
3140
|
dashArray: W.line.solid
|
|
3121
3141
|
}
|
|
@@ -3163,7 +3183,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3163
3183
|
], this.summaries = { perGroupHeadline: !0 }, this.dataLabels = {
|
|
3164
3184
|
cartesian: { offset: 8 },
|
|
3165
3185
|
flip: { offset: 8 }
|
|
3166
|
-
}, this.dataLabelCoordTypes = ["cartesian", "flip"], this.resolvePercentageValueStrategy =
|
|
3186
|
+
}, this.dataLabelCoordTypes = ["cartesian", "flip"], this.resolvePercentageValueStrategy = is, this.isComposite = !0, this.legend = {
|
|
3167
3187
|
suppressWhenSingleItem: !0,
|
|
3168
3188
|
sidePlacement: "whenCrowded",
|
|
3169
3189
|
directLabelSupport: {
|
|
@@ -3172,7 +3192,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3172
3192
|
identity: !0,
|
|
3173
3193
|
fill: !0
|
|
3174
3194
|
}
|
|
3175
|
-
}, this.highlightStrategy = "overlay-anchor", this.spatialKind = "filled-buckets", this.resolveAnchorPosition = nt, this.getDataLabelPlacements = (t) =>
|
|
3195
|
+
}, this.highlightStrategy = "overlay-anchor", this.spatialKind = "filled-buckets", this.resolveAnchorPosition = nt, this.getDataLabelPlacements = (t) => ss(t);
|
|
3176
3196
|
}
|
|
3177
3197
|
resolveParams(e) {
|
|
3178
3198
|
const t = super.resolveParams(e);
|
|
@@ -3187,7 +3207,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3187
3207
|
mapping: {}
|
|
3188
3208
|
};
|
|
3189
3209
|
}
|
|
3190
|
-
},
|
|
3210
|
+
}, us = 0.7, Do = 0.1, ds = 0.03, hs = 0.05, fs = (e) => {
|
|
3191
3211
|
const t = e[Xt.role];
|
|
3192
3212
|
return t ?? "solo";
|
|
3193
3213
|
}, it = (e, t, r) => {
|
|
@@ -3211,13 +3231,13 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3211
3231
|
}, ot = (e, t, r = e.get("fill", t)) => {
|
|
3212
3232
|
if (r === void 0) return;
|
|
3213
3233
|
const a = e.get("alpha", t) * (e.get("fillAlpha", t) ?? 1);
|
|
3214
|
-
return
|
|
3215
|
-
}, _e = 6,
|
|
3234
|
+
return ta(an(r), a);
|
|
3235
|
+
}, _e = 6, ps = 0.5, ys = (e) => {
|
|
3216
3236
|
const t = [];
|
|
3217
3237
|
let r = 0;
|
|
3218
3238
|
const a = Ae(e.layer.position), n = e.coordSystem.mainAxis === "y";
|
|
3219
3239
|
if (e.layer.dataLabels.showDataLabels) {
|
|
3220
|
-
const { entries: s, shouldRotate: i } =
|
|
3240
|
+
const { entries: s, shouldRotate: i } = ms({
|
|
3221
3241
|
layer: e.layer,
|
|
3222
3242
|
mainAxis: e.coordSystem.mainAxis,
|
|
3223
3243
|
panelRect: e.panelRect,
|
|
@@ -3226,7 +3246,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3226
3246
|
isFlipped: n
|
|
3227
3247
|
});
|
|
3228
3248
|
for (const o of s) {
|
|
3229
|
-
const l = e.layer.dataLabels.position === "auto" ?
|
|
3249
|
+
const l = e.layer.dataLabels.position === "auto" ? As({
|
|
3230
3250
|
mainAxis: e.coordSystem.mainAxis,
|
|
3231
3251
|
isStacked: a,
|
|
3232
3252
|
isNegativeBar: o.isNegative,
|
|
@@ -3236,7 +3256,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3236
3256
|
panelWidth: e.panelRect.width,
|
|
3237
3257
|
panelHeight: e.panelRect.height,
|
|
3238
3258
|
offset: e.layer.dataLabels.offset
|
|
3239
|
-
}) :
|
|
3259
|
+
}) : Ms(e.layer.dataLabels, e.coordSystem.mainAxis, a, o, Te(e.panelRect));
|
|
3240
3260
|
if (l === null) {
|
|
3241
3261
|
r += 1;
|
|
3242
3262
|
continue;
|
|
@@ -3256,9 +3276,9 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3256
3276
|
});
|
|
3257
3277
|
}
|
|
3258
3278
|
}
|
|
3259
|
-
if (e.layer.dataLabels.showCategoryLabels) for (const s of
|
|
3279
|
+
if (e.layer.dataLabels.showCategoryLabels) for (const s of Es(e, a)) t.push(s);
|
|
3260
3280
|
if (e.layer.dataLabels.showStackTotals) {
|
|
3261
|
-
const s =
|
|
3281
|
+
const s = ks({
|
|
3262
3282
|
layer: e.layer,
|
|
3263
3283
|
mainAxis: e.coordSystem.mainAxis,
|
|
3264
3284
|
panelRect: e.panelRect,
|
|
@@ -3271,18 +3291,18 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3271
3291
|
labels: t,
|
|
3272
3292
|
droppedCount: r
|
|
3273
3293
|
};
|
|
3274
|
-
},
|
|
3294
|
+
}, gs = (e) => e.position === "fill" ? "fill" : Ae(e.position) ? "stack" : "absoluteGrandTotal", ms = ({ layer: e, mainAxis: t, panelRect: r, measureDataLabel: a, formatLabel: n, isFlipped: s }) => {
|
|
3275
3295
|
const i = [];
|
|
3276
3296
|
let o = !1;
|
|
3277
3297
|
const l = e.dataLabels.position === "auto", c = D(e.mapping.y);
|
|
3278
3298
|
for (const u of e.data) {
|
|
3279
|
-
const h =
|
|
3299
|
+
const h = Or(t, u);
|
|
3280
3300
|
if (h === null) continue;
|
|
3281
3301
|
const d = n(u);
|
|
3282
3302
|
if (d === "") continue;
|
|
3283
3303
|
const p = it(a, "observation", d), g = lt(h, r);
|
|
3284
3304
|
l && p.inside.width > g.width && (o = !0);
|
|
3285
|
-
const
|
|
3305
|
+
const b = c === null ? null : u[c], _ = S(b) && b < 0;
|
|
3286
3306
|
i.push({
|
|
3287
3307
|
isNegative: _,
|
|
3288
3308
|
text: d,
|
|
@@ -3317,10 +3337,10 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3317
3337
|
width: i,
|
|
3318
3338
|
height: n - a
|
|
3319
3339
|
};
|
|
3320
|
-
},
|
|
3340
|
+
}, Or = (e, t) => {
|
|
3321
3341
|
const r = Z(t), a = ee(t), n = H(t), s = K(t) ?? j(t);
|
|
3322
3342
|
return r === null || a === null || n === null || s === null ? null : Fr(e, r, a, n, s);
|
|
3323
|
-
},
|
|
3343
|
+
}, vs = (e, t) => {
|
|
3324
3344
|
const { xMin: r, xMax: a, yMin: n, yMax: s } = t.anchor;
|
|
3325
3345
|
return Fr(e, r, a, n, s);
|
|
3326
3346
|
}, bs = (e, t) => e === "x" ? t ? "bottom" : "top" : t ? "left" : "right", Qe = (e, t, r) => r ? {
|
|
@@ -3329,11 +3349,11 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3329
3349
|
} : {
|
|
3330
3350
|
width: e,
|
|
3331
3351
|
height: t
|
|
3332
|
-
},
|
|
3352
|
+
}, As = (e) => e.isStacked ? Ts({
|
|
3333
3353
|
bounds: e.bounds,
|
|
3334
3354
|
box: e.boxes.inside,
|
|
3335
3355
|
isRotated: e.shouldRotate
|
|
3336
|
-
}) :
|
|
3356
|
+
}) : Ss({
|
|
3337
3357
|
edge: bs(e.mainAxis, e.isNegativeBar),
|
|
3338
3358
|
bounds: e.bounds,
|
|
3339
3359
|
boxes: e.boxes,
|
|
@@ -3347,7 +3367,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3347
3367
|
} : {
|
|
3348
3368
|
valueAxis: "x",
|
|
3349
3369
|
valueDirectionSign: t ? -1 : 1
|
|
3350
|
-
},
|
|
3370
|
+
}, xs = (e) => e === "panel-start" || e === "panel-end", Ms = (e, t, r, a, n) => {
|
|
3351
3371
|
if (e.position === "auto") return null;
|
|
3352
3372
|
const s = r && e.position === "outside" ? "inside" : e.position, i = a.boxes[s], o = we({
|
|
3353
3373
|
box: a.bounds,
|
|
@@ -3360,9 +3380,9 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3360
3380
|
labelWidth: i.width,
|
|
3361
3381
|
labelHeight: i.height
|
|
3362
3382
|
});
|
|
3363
|
-
if (s === "inside" && !
|
|
3383
|
+
if (s === "inside" && !xs(e.justify)) {
|
|
3364
3384
|
const l = t === "y", c = l ? a.bounds.width : a.bounds.height;
|
|
3365
|
-
return (l ? i.width : i.height) > c +
|
|
3385
|
+
return (l ? i.width : i.height) > c + ps ? null : {
|
|
3366
3386
|
x: o.x,
|
|
3367
3387
|
y: o.y,
|
|
3368
3388
|
isRotated: !1,
|
|
@@ -3375,23 +3395,23 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3375
3395
|
isRotated: !1,
|
|
3376
3396
|
position: o.position
|
|
3377
3397
|
};
|
|
3378
|
-
},
|
|
3398
|
+
}, Es = (e, t) => {
|
|
3379
3399
|
const r = [], { categoryPosition: a, categoryJustify: n, categoryAlign: s, categoryOffset: i } = e.layer.dataLabels, o = t && a === "outside" ? "inside" : a, l = e.coordSystem.mainAxis, c = Te(e.panelRect), u = D(e.layer.mapping.y);
|
|
3380
3400
|
for (const h of e.layer.data) {
|
|
3381
|
-
const d =
|
|
3401
|
+
const d = Or(l, h);
|
|
3382
3402
|
if (d === null) continue;
|
|
3383
3403
|
const p = e.formatCategory(h);
|
|
3384
3404
|
if (p === null || p === "") continue;
|
|
3385
|
-
const g = it(e.measureDataLabel, "category", p),
|
|
3405
|
+
const g = it(e.measureDataLabel, "category", p), b = g[o], _ = lt(d, e.panelRect), P = u === null ? null : h[u], N = S(P) && P < 0, M = we({
|
|
3386
3406
|
box: _,
|
|
3387
3407
|
panel: c,
|
|
3388
|
-
orientation: Nr(l,
|
|
3408
|
+
orientation: Nr(l, N),
|
|
3389
3409
|
placement: o,
|
|
3390
3410
|
justify: n,
|
|
3391
3411
|
align: s,
|
|
3392
3412
|
offset: i,
|
|
3393
|
-
labelWidth:
|
|
3394
|
-
labelHeight:
|
|
3413
|
+
labelWidth: b.width,
|
|
3414
|
+
labelHeight: b.height
|
|
3395
3415
|
}), L = g[M.position];
|
|
3396
3416
|
r.push({
|
|
3397
3417
|
layerId: e.layer.id,
|
|
@@ -3406,7 +3426,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3406
3426
|
});
|
|
3407
3427
|
}
|
|
3408
3428
|
return r;
|
|
3409
|
-
},
|
|
3429
|
+
}, Ts = ({ bounds: e, box: t, isRotated: r }) => {
|
|
3410
3430
|
const a = Qe(t.width, t.height, r);
|
|
3411
3431
|
return a.width > e.width || a.height > e.height ? null : {
|
|
3412
3432
|
x: e.x + e.width / 2,
|
|
@@ -3414,7 +3434,7 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3414
3434
|
isRotated: r,
|
|
3415
3435
|
position: "inside"
|
|
3416
3436
|
};
|
|
3417
|
-
},
|
|
3437
|
+
}, ws = (e, t, r, a) => {
|
|
3418
3438
|
switch (e) {
|
|
3419
3439
|
case "top":
|
|
3420
3440
|
return {
|
|
@@ -3441,9 +3461,9 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3441
3461
|
panelExtent: r
|
|
3442
3462
|
};
|
|
3443
3463
|
}
|
|
3444
|
-
},
|
|
3445
|
-
const o = e === "top" || e === "bottom", l = t.x + t.width / 2, c = t.y + t.height / 2, u = o ? t.height : t.width, h = o ? t.width : t.height, { edgeCoord: d, outwardSign: p, panelExtent: g } =
|
|
3446
|
-
if (o ?
|
|
3464
|
+
}, Ss = ({ edge: e, bounds: t, boxes: r, isRotated: a, panelWidth: n, panelHeight: s, offset: i }) => {
|
|
3465
|
+
const o = e === "top" || e === "bottom", l = t.x + t.width / 2, c = t.y + t.height / 2, u = o ? t.height : t.width, h = o ? t.width : t.height, { edgeCoord: d, outwardSign: p, panelExtent: g } = ws(e, t, n, s), b = Qe(r.inside.width, r.inside.height, a), _ = o ? b.height : b.width, P = o ? b.width : b.height, N = _ + i < u, M = P <= h;
|
|
3466
|
+
if (o ? N : N && M) {
|
|
3447
3467
|
if (o && !M) return null;
|
|
3448
3468
|
if (a) return {
|
|
3449
3469
|
x: l,
|
|
@@ -3464,29 +3484,29 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3464
3484
|
position: "inside"
|
|
3465
3485
|
};
|
|
3466
3486
|
}
|
|
3467
|
-
const L = Qe(r.outside.width, r.outside.height, a), T = (o ? L.height : L.width) / 2,
|
|
3468
|
-
return
|
|
3487
|
+
const L = Qe(r.outside.width, r.outside.height, a), T = (o ? L.height : L.width) / 2, F = d + p * (T + i);
|
|
3488
|
+
return F - T < 0 || F + T > g ? null : {
|
|
3469
3489
|
...o ? {
|
|
3470
3490
|
x: l,
|
|
3471
|
-
y:
|
|
3491
|
+
y: F
|
|
3472
3492
|
} : {
|
|
3473
|
-
x:
|
|
3493
|
+
x: F,
|
|
3474
3494
|
y: c
|
|
3475
3495
|
},
|
|
3476
3496
|
isRotated: a,
|
|
3477
3497
|
position: "outside"
|
|
3478
3498
|
};
|
|
3479
|
-
},
|
|
3499
|
+
}, ks = ({ layer: e, mainAxis: t, panelRect: r, measureDataLabel: a, formatAbsolute: n }) => {
|
|
3480
3500
|
const s = [], i = e.summary.stackTotals;
|
|
3481
3501
|
if (i === void 0 || i.length === 0) return s;
|
|
3482
3502
|
const o = t === "y";
|
|
3483
3503
|
for (const l of i) {
|
|
3484
|
-
const c = lt(
|
|
3485
|
-
let g,
|
|
3486
|
-
o ? (g = p ? c.x + c.width + _e + h / 2 : c.x - _e - h / 2,
|
|
3504
|
+
const c = lt(vs(t, l), r), u = n(l.total), { width: h, height: d } = a("aggregate", "outside", u), p = l.anchor.direction === "positive";
|
|
3505
|
+
let g, b;
|
|
3506
|
+
o ? (g = p ? c.x + c.width + _e + h / 2 : c.x - _e - h / 2, b = c.y + c.height / 2) : (g = c.x + c.width / 2, b = p ? c.y - _e - d / 2 : c.y + c.height + _e + d / 2), s.push({
|
|
3487
3507
|
layerId: e.id,
|
|
3488
3508
|
x: g,
|
|
3489
|
-
y:
|
|
3509
|
+
y: b,
|
|
3490
3510
|
text: u,
|
|
3491
3511
|
width: h,
|
|
3492
3512
|
height: d,
|
|
@@ -3497,19 +3517,19 @@ var Zn = (e) => e.observation?.aesthetics ?? rt.geom.aesthetics, es = (e) => e.o
|
|
|
3497
3517
|
}
|
|
3498
3518
|
return s;
|
|
3499
3519
|
};
|
|
3500
|
-
function
|
|
3520
|
+
function _s(e) {
|
|
3501
3521
|
return {
|
|
3502
3522
|
startAngle: e[y.xMin],
|
|
3503
3523
|
endAngle: e[y.xMax]
|
|
3504
3524
|
};
|
|
3505
3525
|
}
|
|
3506
|
-
function
|
|
3526
|
+
function Ls(e) {
|
|
3507
3527
|
return {
|
|
3508
3528
|
innerRadius: e[y.yMin],
|
|
3509
3529
|
outerRadius: e[y.yMax] ?? e[y.y]
|
|
3510
3530
|
};
|
|
3511
3531
|
}
|
|
3512
|
-
var
|
|
3532
|
+
var Rs = " · ", U = 2, Cs = (e) => {
|
|
3513
3533
|
const t = [];
|
|
3514
3534
|
if (!e.layer.dataLabels.showDataLabels) return {
|
|
3515
3535
|
labels: t,
|
|
@@ -3517,57 +3537,57 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3517
3537
|
};
|
|
3518
3538
|
const { position: r, justify: a, align: n, offset: s, showCategoryLabels: i } = e.layer.dataLabels, o = e.coordSystem.bandAxis === "y", l = e.panelRect.width / 2, c = e.panelRect.height / 2, u = Math.min(e.panelRect.width, e.panelRect.height) / 2, h = e.styleReaders;
|
|
3519
3539
|
for (const d of e.layer.data) {
|
|
3520
|
-
const { startAngle: p, endAngle: g } =
|
|
3540
|
+
const { startAngle: p, endAngle: g } = _s(d), { innerRadius: b, outerRadius: _ } = Ls(d);
|
|
3521
3541
|
if (p === null || g === null || _ === null) continue;
|
|
3522
|
-
const
|
|
3523
|
-
if (
|
|
3524
|
-
const
|
|
3542
|
+
const P = e.formatLabel(d);
|
|
3543
|
+
if (P === "") continue;
|
|
3544
|
+
const N = i ? e.formatCategory(d) : null, M = N === null ? P : `${N}${Rs}${P}`, L = {
|
|
3525
3545
|
startAngle: p,
|
|
3526
3546
|
endAngle: g,
|
|
3527
3547
|
midAngle: (p + g) / 2,
|
|
3528
|
-
innerRadiusPx: (
|
|
3548
|
+
innerRadiusPx: (b ?? 0) * u,
|
|
3529
3549
|
outerRadiusPx: _ * u
|
|
3530
3550
|
};
|
|
3531
|
-
let T,
|
|
3551
|
+
let T, F;
|
|
3532
3552
|
if (r === "auto") {
|
|
3533
3553
|
const ye = e.measureDataLabel("observation", "inside", M), G = {
|
|
3534
3554
|
width: ye.width,
|
|
3535
3555
|
height: ye.height
|
|
3536
|
-
},
|
|
3556
|
+
}, Ne = Ot({
|
|
3537
3557
|
wedge: L,
|
|
3538
3558
|
position: "inside",
|
|
3539
3559
|
offset: s,
|
|
3540
3560
|
labelWidth: G.width,
|
|
3541
3561
|
labelHeight: G.height
|
|
3542
|
-
}),
|
|
3562
|
+
}), Yr = o || Is({
|
|
3543
3563
|
wedge: L,
|
|
3544
|
-
labelRadius:
|
|
3545
|
-
labelAngle:
|
|
3564
|
+
labelRadius: Ne.labelRadius,
|
|
3565
|
+
labelAngle: Ne.labelAngle,
|
|
3546
3566
|
labelWidth: G.width,
|
|
3547
3567
|
labelHeight: G.height
|
|
3548
3568
|
});
|
|
3549
|
-
if (T =
|
|
3569
|
+
if (T = Ne, F = G, !Yr) {
|
|
3550
3570
|
const ct = e.measureDataLabel("observation", "outside", M), ge = {
|
|
3551
3571
|
width: ct.width,
|
|
3552
3572
|
height: ct.height
|
|
3553
|
-
}, me =
|
|
3573
|
+
}, me = Ot({
|
|
3554
3574
|
wedge: L,
|
|
3555
3575
|
position: "outside",
|
|
3556
3576
|
offset: s,
|
|
3557
3577
|
labelWidth: ge.width,
|
|
3558
3578
|
labelHeight: ge.height
|
|
3559
|
-
}),
|
|
3579
|
+
}), Gr = l + Math.sin(me.labelAngle) * me.labelRadius, zr = c - Math.cos(me.labelAngle) * me.labelRadius;
|
|
3560
3580
|
Fs({
|
|
3561
|
-
x:
|
|
3562
|
-
y:
|
|
3581
|
+
x: Gr,
|
|
3582
|
+
y: zr,
|
|
3563
3583
|
labelWidth: ge.width,
|
|
3564
3584
|
labelHeight: ge.height,
|
|
3565
3585
|
panelRect: e.panelRect
|
|
3566
|
-
}) && (T = me,
|
|
3586
|
+
}) && (T = me, F = ge);
|
|
3567
3587
|
}
|
|
3568
3588
|
} else {
|
|
3569
3589
|
const ye = it(e.measureDataLabel, "observation", M), G = ye[r];
|
|
3570
|
-
T =
|
|
3590
|
+
T = Os({
|
|
3571
3591
|
wedge: L,
|
|
3572
3592
|
placement: r,
|
|
3573
3593
|
justify: st(a),
|
|
@@ -3575,16 +3595,16 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3575
3595
|
offset: s,
|
|
3576
3596
|
labelWidth: G.width,
|
|
3577
3597
|
labelHeight: G.height
|
|
3578
|
-
}),
|
|
3598
|
+
}), F = ye[T.position];
|
|
3579
3599
|
}
|
|
3580
|
-
const Se = l + Math.sin(T.labelAngle) * T.labelRadius,
|
|
3600
|
+
const Se = l + Math.sin(T.labelAngle) * T.labelRadius, Ur = c - Math.cos(T.labelAngle) * T.labelRadius;
|
|
3581
3601
|
t.push({
|
|
3582
3602
|
layerId: e.layer.id,
|
|
3583
3603
|
x: Se,
|
|
3584
|
-
y:
|
|
3604
|
+
y: Ur,
|
|
3585
3605
|
text: M,
|
|
3586
|
-
width:
|
|
3587
|
-
height:
|
|
3606
|
+
width: F.width,
|
|
3607
|
+
height: F.height,
|
|
3588
3608
|
isRotated: !1,
|
|
3589
3609
|
role: "observation",
|
|
3590
3610
|
position: T.position,
|
|
@@ -3595,10 +3615,10 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3595
3615
|
labels: t,
|
|
3596
3616
|
droppedCount: 0
|
|
3597
3617
|
};
|
|
3598
|
-
},
|
|
3618
|
+
}, Ds = () => "absoluteGrandTotal", Ze = (e, t, r, a) => {
|
|
3599
3619
|
const n = Math.abs(e === "radial" ? Math.sin(t) : Math.cos(t)), s = Math.abs(e === "radial" ? Math.cos(t) : Math.sin(t));
|
|
3600
3620
|
return n * (r / 2) + s * (a / 2);
|
|
3601
|
-
},
|
|
3621
|
+
}, Is = ({ wedge: e, labelRadius: t, labelAngle: r, labelWidth: a, labelHeight: n }) => {
|
|
3602
3622
|
if (t <= 0) return !1;
|
|
3603
3623
|
const s = Math.sin(r) * t, i = -Math.cos(r) * t, o = {
|
|
3604
3624
|
left: s - a / 2,
|
|
@@ -3610,18 +3630,18 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3610
3630
|
[o.right, o.top],
|
|
3611
3631
|
[o.right, o.bottom],
|
|
3612
3632
|
[o.left, o.bottom]
|
|
3613
|
-
], c = Math.hypot(
|
|
3633
|
+
], c = Math.hypot(Pt(0, o.left, o.right), Pt(0, o.top, o.bottom)), u = Math.max(...l.map(([d, p]) => Math.hypot(d, p)));
|
|
3614
3634
|
if (c < e.innerRadiusPx - U || u > e.outerRadiusPx + U) return !1;
|
|
3615
3635
|
const h = Math.abs(e.endAngle - e.startAngle) / 2;
|
|
3616
3636
|
return h >= Math.PI ? !0 : l.every(([d, p]) => {
|
|
3617
3637
|
const g = Math.hypot(d, p);
|
|
3618
3638
|
return g <= U ? !0 : $t(Math.atan2(d, -p), e.midAngle) <= h + U / g;
|
|
3619
|
-
}) ? h <= Math.PI / 2 ? !0 : c <= U ? !1 : !
|
|
3620
|
-
},
|
|
3639
|
+
}) ? h <= Math.PI / 2 ? !0 : c <= U ? !1 : !Ft(e.startAngle, o) && !Ft(e.endAngle, o) : !1;
|
|
3640
|
+
}, Ps = (e, t, r) => {
|
|
3621
3641
|
if (t <= 0 || t < e.innerRadiusPx - U || t > e.outerRadiusPx + U) return !1;
|
|
3622
3642
|
const a = Math.abs(e.endAngle - e.startAngle) / 2;
|
|
3623
3643
|
return $t(r, e.midAngle) <= a + U / t;
|
|
3624
|
-
},
|
|
3644
|
+
}, Pt = (e, t, r) => Math.min(r, Math.max(t, e)), Ft = (e, t) => {
|
|
3625
3645
|
const r = U, a = [[
|
|
3626
3646
|
Math.sin(e),
|
|
3627
3647
|
t.left + r,
|
|
@@ -3642,7 +3662,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3642
3662
|
n = Math.max(n, Math.min(c, u)), s = Math.min(s, Math.max(c, u));
|
|
3643
3663
|
}
|
|
3644
3664
|
return n <= s;
|
|
3645
|
-
}, Fs = ({ x: e, y: t, labelWidth: r, labelHeight: a, panelRect: n }) => e - r / 2 >= 0 && e + r / 2 <= n.width && t - a / 2 >= 0 && t + a / 2 <= n.height,
|
|
3665
|
+
}, Fs = ({ x: e, y: t, labelWidth: r, labelHeight: a, panelRect: n }) => e - r / 2 >= 0 && e + r / 2 <= n.width && t - a / 2 >= 0 && t + a / 2 <= n.height, Ot = ({ wedge: e, position: t, offset: r, labelWidth: a, labelHeight: n }) => t === "inside" ? {
|
|
3646
3666
|
labelRadius: (e.innerRadiusPx + e.outerRadiusPx) / 2,
|
|
3647
3667
|
labelAngle: e.midAngle,
|
|
3648
3668
|
position: "inside"
|
|
@@ -3650,7 +3670,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3650
3670
|
labelRadius: e.outerRadiusPx + r + Ze("radial", e.midAngle, a, n),
|
|
3651
3671
|
labelAngle: e.midAngle,
|
|
3652
3672
|
position: "outside"
|
|
3653
|
-
},
|
|
3673
|
+
}, Os = ({ wedge: e, placement: t, justify: r, align: a, offset: n, labelWidth: s, labelHeight: i }) => {
|
|
3654
3674
|
const o = a === "start" ? e.startAngle : a === "end" ? e.endAngle : e.midAngle, l = n + Ze("radial", o, s, i);
|
|
3655
3675
|
let c;
|
|
3656
3676
|
if (r === "center") c = (e.innerRadiusPx + e.outerRadiusPx) / 2;
|
|
@@ -3668,7 +3688,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3668
3688
|
return {
|
|
3669
3689
|
labelRadius: c,
|
|
3670
3690
|
labelAngle: u,
|
|
3671
|
-
position:
|
|
3691
|
+
position: Ps(e, c, u) ? "inside" : "outside"
|
|
3672
3692
|
};
|
|
3673
3693
|
}, Ns = class extends re {
|
|
3674
3694
|
constructor(...e) {
|
|
@@ -3691,7 +3711,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3691
3711
|
},
|
|
3692
3712
|
hovered: {
|
|
3693
3713
|
stroke: f("hoverAffordance"),
|
|
3694
|
-
shadow:
|
|
3714
|
+
shadow: Kn
|
|
3695
3715
|
}
|
|
3696
3716
|
} }, this.defaultParams = {}, this.defaultPosition = "dodge", this.positionRoles = [
|
|
3697
3717
|
{
|
|
@@ -3741,15 +3761,15 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3741
3761
|
"cartesian",
|
|
3742
3762
|
"polar",
|
|
3743
3763
|
"flip"
|
|
3744
|
-
], this.spatialKind = "rects", this.resolveDataLabelDefaults = (t) => Ae(t) ? { justify: "center" } : {}, this.resolveBandFraction = (t, r) =>
|
|
3764
|
+
], this.spatialKind = "rects", this.resolveDataLabelDefaults = (t) => Ae(t) ? { justify: "center" } : {}, this.resolveBandFraction = (t, r) => Nt(t, r.type), this.resolveAnchorPosition = (t, { coordSystem: r, position: a, purpose: n, align: s }) => {
|
|
3745
3765
|
if (s !== void 0) {
|
|
3746
|
-
const h =
|
|
3766
|
+
const h = ya(t, r);
|
|
3747
3767
|
return h === null ? null : qt(h, s);
|
|
3748
3768
|
}
|
|
3749
|
-
if (r.type === "polar") return
|
|
3769
|
+
if (r.type === "polar") return Bs(t);
|
|
3750
3770
|
const i = Ae(a), o = {
|
|
3751
|
-
isSolo: !i ||
|
|
3752
|
-
isNegative: i &&
|
|
3771
|
+
isSolo: !i || fs(t) === "solo",
|
|
3772
|
+
isNegative: i && Vs(t),
|
|
3753
3773
|
purpose: n
|
|
3754
3774
|
};
|
|
3755
3775
|
if (r.mainAxis === "x") {
|
|
@@ -3772,7 +3792,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3772
3792
|
x: u,
|
|
3773
3793
|
y: (l + c) / 2
|
|
3774
3794
|
};
|
|
3775
|
-
}, this.getDataLabelPlacements = (t) => t.coordSystem.type === "polar" ?
|
|
3795
|
+
}, this.getDataLabelPlacements = (t) => t.coordSystem.type === "polar" ? Cs(t) : ys(t), this.resolvePercentageValueStrategy = (t, r) => r === "polar" ? Ds() : gs(t);
|
|
3776
3796
|
}
|
|
3777
3797
|
resolveParams(e) {
|
|
3778
3798
|
const { width: t, ...r } = super.resolveParams(e), a = this.resolveWidthParam(t, e.diagnostics);
|
|
@@ -3782,7 +3802,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3782
3802
|
};
|
|
3783
3803
|
}
|
|
3784
3804
|
compile({ data: e, mapping: t, params: r, coordType: a }) {
|
|
3785
|
-
const n =
|
|
3805
|
+
const n = Nt(r, a);
|
|
3786
3806
|
e = at(e, t), e.hasVariable(y.yMin) || (e = e.addConstantVariable(y.yMin, "numeric", 0));
|
|
3787
3807
|
const s = n / 2;
|
|
3788
3808
|
return e = e.addConstantVariable(y.xMin, "numeric", -s).addConstantVariable(y.xMax, "numeric", s), {
|
|
@@ -3807,11 +3827,11 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3807
3827
|
suggestion: "Set params.width to a fraction of the category band in (0, 1]."
|
|
3808
3828
|
}), a;
|
|
3809
3829
|
}
|
|
3810
|
-
},
|
|
3830
|
+
}, Nt = ({ width: e }, t) => e !== void 0 ? e : t === "polar" ? 1 : us, Bs = (e) => {
|
|
3811
3831
|
const t = Z(e), r = ee(e), a = H(e), n = K(e);
|
|
3812
3832
|
return t === null || r === null || a === null || n === null ? null : q((t + r) / 2, (a + n) / 2);
|
|
3813
|
-
},
|
|
3814
|
-
const t =
|
|
3833
|
+
}, Vs = (e) => {
|
|
3834
|
+
const t = fa(e);
|
|
3815
3835
|
return S(t) && t < 0;
|
|
3816
3836
|
}, Bt = (e) => {
|
|
3817
3837
|
const { lowerBound: t, upperBound: r, options: a } = e, n = a.isNegative ? t : r;
|
|
@@ -3819,13 +3839,13 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3819
3839
|
if (a.purpose === "value" || a.isSolo) return n;
|
|
3820
3840
|
const s = a.isNegative ? r : t;
|
|
3821
3841
|
return s === null ? null : (s + n) / 2;
|
|
3822
|
-
},
|
|
3842
|
+
}, Ws = (e) => {
|
|
3823
3843
|
const t = [];
|
|
3824
3844
|
if (!e.layer.dataLabels.showDataLabels) return {
|
|
3825
3845
|
labels: t,
|
|
3826
3846
|
droppedCount: 0
|
|
3827
3847
|
};
|
|
3828
|
-
const { offset: r } = e.layer.dataLabels, a =
|
|
3848
|
+
const { offset: r } = e.layer.dataLabels, a = Us(e.layer);
|
|
3829
3849
|
for (const n of e.layer.data) {
|
|
3830
3850
|
const s = Q(n), i = j(n);
|
|
3831
3851
|
if (s === null || i === null || !tt(s, i)) continue;
|
|
@@ -3864,7 +3884,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3864
3884
|
labels: t,
|
|
3865
3885
|
droppedCount: 0
|
|
3866
3886
|
};
|
|
3867
|
-
},
|
|
3887
|
+
}, Us = (e) => {
|
|
3868
3888
|
const { position: t, justify: r, align: a } = e.dataLabels;
|
|
3869
3889
|
return t === "auto" ? {
|
|
3870
3890
|
placement: "outside",
|
|
@@ -3872,10 +3892,10 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3872
3892
|
align: "center"
|
|
3873
3893
|
} : {
|
|
3874
3894
|
placement: t,
|
|
3875
|
-
justify:
|
|
3895
|
+
justify: Rr(e.data, e.mapping) ? st(r) : r,
|
|
3876
3896
|
align: a
|
|
3877
3897
|
};
|
|
3878
|
-
},
|
|
3898
|
+
}, Ys = class extends re {
|
|
3879
3899
|
constructor(...e) {
|
|
3880
3900
|
super(...e), this.type = "line", this.styleTarget = { observation: {
|
|
3881
3901
|
vocabulary: {
|
|
@@ -3939,7 +3959,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3939
3959
|
identity: !0,
|
|
3940
3960
|
fill: !0
|
|
3941
3961
|
}
|
|
3942
|
-
}, this.highlightStrategy = "overlay-anchor", this.spatialKind = "buckets", this.resolveAnchorPosition = nt, this.getDataLabelPlacements = (t) =>
|
|
3962
|
+
}, this.highlightStrategy = "overlay-anchor", this.spatialKind = "buckets", this.resolveAnchorPosition = nt, this.getDataLabelPlacements = (t) => Ws(t);
|
|
3943
3963
|
}
|
|
3944
3964
|
compile(e) {
|
|
3945
3965
|
return {
|
|
@@ -3947,13 +3967,13 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3947
3967
|
mapping: {}
|
|
3948
3968
|
};
|
|
3949
3969
|
}
|
|
3950
|
-
},
|
|
3970
|
+
}, Gs = (e) => {
|
|
3951
3971
|
const t = [];
|
|
3952
3972
|
if (!e.layer.dataLabels.showDataLabels) return {
|
|
3953
3973
|
labels: t,
|
|
3954
3974
|
droppedCount: 0
|
|
3955
3975
|
};
|
|
3956
|
-
const { offset: r } = e.layer.dataLabels, a =
|
|
3976
|
+
const { offset: r } = e.layer.dataLabels, a = zs(e.layer), n = a.justify === "panel-start" || a.justify === "panel-end", s = e.styleReaders;
|
|
3957
3977
|
for (const i of e.layer.data) {
|
|
3958
3978
|
const o = Q(i), l = j(i);
|
|
3959
3979
|
if (o === null || l === null || !tt(o, l)) continue;
|
|
@@ -3993,7 +4013,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
3993
4013
|
labels: t,
|
|
3994
4014
|
droppedCount: 0
|
|
3995
4015
|
};
|
|
3996
|
-
},
|
|
4016
|
+
}, zs = (e) => {
|
|
3997
4017
|
const { position: t, justify: r, align: a } = e.dataLabels;
|
|
3998
4018
|
return t === "auto" ? {
|
|
3999
4019
|
placement: "outside",
|
|
@@ -4004,7 +4024,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
4004
4024
|
justify: r,
|
|
4005
4025
|
align: a
|
|
4006
4026
|
};
|
|
4007
|
-
},
|
|
4027
|
+
}, $s = class extends re {
|
|
4008
4028
|
constructor(...e) {
|
|
4009
4029
|
super(...e), this.type = "point", this.styleTarget = { observation: {
|
|
4010
4030
|
vocabulary: {
|
|
@@ -4056,7 +4076,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
4056
4076
|
if (r !== "label") return null;
|
|
4057
4077
|
const a = D(t.size);
|
|
4058
4078
|
return a !== null ? { variable: a } : null;
|
|
4059
|
-
}, this.getDataLabelPlacements = (t) =>
|
|
4079
|
+
}, this.getDataLabelPlacements = (t) => Gs(t);
|
|
4060
4080
|
}
|
|
4061
4081
|
compile({ data: e }) {
|
|
4062
4082
|
return {
|
|
@@ -4064,7 +4084,7 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
4064
4084
|
mapping: {}
|
|
4065
4085
|
};
|
|
4066
4086
|
}
|
|
4067
|
-
},
|
|
4087
|
+
}, js = class extends re {
|
|
4068
4088
|
constructor(...e) {
|
|
4069
4089
|
super(...e), this.type = "rule", this.styleTarget = {
|
|
4070
4090
|
observation: {
|
|
@@ -4124,25 +4144,25 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
4124
4144
|
compile({ data: e, mapping: t }) {
|
|
4125
4145
|
const r = Vt(t.y, e);
|
|
4126
4146
|
if (r !== null) return {
|
|
4127
|
-
data: new oe({ [
|
|
4147
|
+
data: new oe({ [ve.y]: {
|
|
4128
4148
|
type: "numeric",
|
|
4129
4149
|
values: [r.value],
|
|
4130
4150
|
valueFormat: r.sourceFormat
|
|
4131
4151
|
} }),
|
|
4132
4152
|
mapping: {
|
|
4133
|
-
y:
|
|
4153
|
+
y: ve.y,
|
|
4134
4154
|
x: void 0
|
|
4135
4155
|
}
|
|
4136
4156
|
};
|
|
4137
4157
|
const a = Vt(t.x, e);
|
|
4138
4158
|
return a !== null ? {
|
|
4139
|
-
data: new oe({ [
|
|
4159
|
+
data: new oe({ [ve.x]: {
|
|
4140
4160
|
type: "numeric",
|
|
4141
4161
|
values: [a.value],
|
|
4142
4162
|
valueFormat: a.sourceFormat
|
|
4143
4163
|
} }),
|
|
4144
4164
|
mapping: {
|
|
4145
|
-
x:
|
|
4165
|
+
x: ve.x,
|
|
4146
4166
|
y: void 0
|
|
4147
4167
|
}
|
|
4148
4168
|
} : {
|
|
@@ -4160,29 +4180,29 @@ var Ls = " · ", U = 2, Rs = (e) => {
|
|
|
4160
4180
|
sourceFormat: void 0
|
|
4161
4181
|
};
|
|
4162
4182
|
const a = D(e);
|
|
4163
|
-
if (a === null || !
|
|
4183
|
+
if (a === null || !ha(a) || !t.hasVariable(a)) return null;
|
|
4164
4184
|
const [n] = t.getValues(a);
|
|
4165
4185
|
return S(n) ? {
|
|
4166
4186
|
value: n,
|
|
4167
4187
|
sourceFormat: t.getValueFormat(a)
|
|
4168
4188
|
} : null;
|
|
4169
4189
|
};
|
|
4170
|
-
function
|
|
4190
|
+
function Hs(e) {
|
|
4171
4191
|
return e[fe.color];
|
|
4172
4192
|
}
|
|
4173
|
-
function
|
|
4193
|
+
function Io(e) {
|
|
4174
4194
|
return e[fe.alpha];
|
|
4175
4195
|
}
|
|
4176
|
-
function
|
|
4196
|
+
function Po(e) {
|
|
4177
4197
|
return e[fe.size];
|
|
4178
4198
|
}
|
|
4179
|
-
function
|
|
4199
|
+
function Fo(e) {
|
|
4180
4200
|
return e[fe.strokeWidth];
|
|
4181
4201
|
}
|
|
4182
|
-
function
|
|
4202
|
+
function Oo(e) {
|
|
4183
4203
|
return e[fe.lineType];
|
|
4184
4204
|
}
|
|
4185
|
-
var
|
|
4205
|
+
var Ks = (e) => {
|
|
4186
4206
|
const t = Z(e), r = ee(e), a = H(e), n = K(e);
|
|
4187
4207
|
if (t === null || r === null || a === null || n === null) return null;
|
|
4188
4208
|
const s = Math.min(t, r), i = Math.abs(r - t), o = Math.max(a, n), l = Math.abs(n - a);
|
|
@@ -4192,17 +4212,17 @@ var Hs = (e) => {
|
|
|
4192
4212
|
width: i,
|
|
4193
4213
|
height: l
|
|
4194
4214
|
};
|
|
4195
|
-
},
|
|
4196
|
-
const t =
|
|
4215
|
+
}, Xs = (e) => {
|
|
4216
|
+
const t = Ks(e);
|
|
4197
4217
|
if (!t) return null;
|
|
4198
|
-
const r = t.width *
|
|
4218
|
+
const r = t.width * ds, a = t.height * hs;
|
|
4199
4219
|
return {
|
|
4200
4220
|
x: t.x + r,
|
|
4201
4221
|
y: t.y + a,
|
|
4202
4222
|
width: t.width - r * 2,
|
|
4203
4223
|
height: t.height - a * 2
|
|
4204
4224
|
};
|
|
4205
|
-
},
|
|
4225
|
+
}, qs = (e) => !!Hs(e), Js = (e) => qs(e) ? Xs(e) : null, Wt = 4, Qs = (e) => {
|
|
4206
4226
|
const t = [];
|
|
4207
4227
|
if (!e.layer.dataLabels.showDataLabels) return {
|
|
4208
4228
|
labels: t,
|
|
@@ -4210,7 +4230,7 @@ var Hs = (e) => {
|
|
|
4210
4230
|
};
|
|
4211
4231
|
const r = e.styleReaders;
|
|
4212
4232
|
for (const a of e.layer.data) {
|
|
4213
|
-
const n =
|
|
4233
|
+
const n = Js(a);
|
|
4214
4234
|
if (n === null) continue;
|
|
4215
4235
|
const s = e.formatLabel(a);
|
|
4216
4236
|
if (s === "") continue;
|
|
@@ -4232,10 +4252,10 @@ var Hs = (e) => {
|
|
|
4232
4252
|
labels: t,
|
|
4233
4253
|
droppedCount: 0
|
|
4234
4254
|
};
|
|
4235
|
-
},
|
|
4255
|
+
}, Zs = (e) => {
|
|
4236
4256
|
const t = D(e.color);
|
|
4237
4257
|
return t !== null ? { variable: t } : null;
|
|
4238
|
-
},
|
|
4258
|
+
}, ei = class extends re {
|
|
4239
4259
|
constructor(...e) {
|
|
4240
4260
|
super(...e), this.type = "tile", this.styleTarget = { observation: {
|
|
4241
4261
|
vocabulary: {
|
|
@@ -4300,13 +4320,13 @@ var Hs = (e) => {
|
|
|
4300
4320
|
}, this.grid = { cartesian: {
|
|
4301
4321
|
hideGridX: !0,
|
|
4302
4322
|
hideGridY: !0
|
|
4303
|
-
} }, this.legend = { suppressWhenSingleItem: !1 }, this.dataLabels = { cartesian: { showDataLabels: !0 } }, this.dataLabelCoordTypes = ["cartesian"], this.highlightStrategy = "observation-rerender", this.spatialKind = "cells", this.identityKey = "x-y", this.tooltip = [{ aes: "color" }], this.resolveValueSource =
|
|
4323
|
+
} }, this.legend = { suppressWhenSingleItem: !1 }, this.dataLabels = { cartesian: { showDataLabels: !0 } }, this.dataLabelCoordTypes = ["cartesian"], this.highlightStrategy = "observation-rerender", this.spatialKind = "cells", this.identityKey = "x-y", this.tooltip = [{ aes: "color" }], this.resolveValueSource = Zs, this.resolveAnchorPosition = (t) => {
|
|
4304
4324
|
const r = Z(t), a = ee(t), n = H(t), s = K(t);
|
|
4305
4325
|
return r === null || a === null || n === null || s === null ? null : {
|
|
4306
4326
|
x: (r + a) / 2,
|
|
4307
4327
|
y: (n + s) / 2
|
|
4308
4328
|
};
|
|
4309
|
-
}, this.getDataLabelPlacements = (t) =>
|
|
4329
|
+
}, this.getDataLabelPlacements = (t) => Qs(t);
|
|
4310
4330
|
}
|
|
4311
4331
|
compile({ data: e }) {
|
|
4312
4332
|
return {
|
|
@@ -4314,26 +4334,26 @@ var Hs = (e) => {
|
|
|
4314
4334
|
mapping: {}
|
|
4315
4335
|
};
|
|
4316
4336
|
}
|
|
4317
|
-
},
|
|
4337
|
+
}, ti = [
|
|
4318
4338
|
new Ns(),
|
|
4319
|
-
new zs(),
|
|
4320
|
-
new Us(),
|
|
4321
|
-
new ls(),
|
|
4322
4339
|
new $s(),
|
|
4323
|
-
new
|
|
4324
|
-
|
|
4340
|
+
new Ys(),
|
|
4341
|
+
new cs(),
|
|
4342
|
+
new js(),
|
|
4343
|
+
new ei()
|
|
4344
|
+
], No = class extends Lr {
|
|
4325
4345
|
constructor() {
|
|
4326
4346
|
super("geom");
|
|
4327
|
-
for (const e of
|
|
4347
|
+
for (const e of ti) this.register(e.type, e);
|
|
4328
4348
|
}
|
|
4329
|
-
},
|
|
4349
|
+
}, ri = class {
|
|
4330
4350
|
resolveComputedVariables(e, t) {
|
|
4331
4351
|
return this.computedVariables;
|
|
4332
4352
|
}
|
|
4333
4353
|
compute(e) {
|
|
4334
4354
|
return this.computeStat(e);
|
|
4335
4355
|
}
|
|
4336
|
-
},
|
|
4356
|
+
}, ai = class {
|
|
4337
4357
|
constructor() {
|
|
4338
4358
|
this.transformType = "aggregate";
|
|
4339
4359
|
}
|
|
@@ -4345,16 +4365,16 @@ var Hs = (e) => {
|
|
|
4345
4365
|
};
|
|
4346
4366
|
return e.groupBy(...r.groupby).rollup(a);
|
|
4347
4367
|
}
|
|
4348
|
-
},
|
|
4368
|
+
}, ni = {
|
|
4349
4369
|
numeric: { type: "decimal" },
|
|
4350
4370
|
categorical: { type: "text" },
|
|
4351
4371
|
temporal: { type: "datetime" }
|
|
4352
|
-
},
|
|
4372
|
+
}, si = class {
|
|
4353
4373
|
constructor() {
|
|
4354
4374
|
this.transformType = "constant";
|
|
4355
4375
|
}
|
|
4356
4376
|
apply(e, t) {
|
|
4357
|
-
const { options: r } = t, a = mr(r.value,
|
|
4377
|
+
const { options: r } = t, a = mr(r.value, ni[r.type], Ie);
|
|
4358
4378
|
if (r.value !== null && a === null) throw new de({
|
|
4359
4379
|
code: "INCOMPATIBLE_TYPE",
|
|
4360
4380
|
message: `Constant '${r.variableName}' cannot be read as ${r.type}`,
|
|
@@ -4369,7 +4389,7 @@ var Hs = (e) => {
|
|
|
4369
4389
|
const { options: t } = e;
|
|
4370
4390
|
return [t.variableName];
|
|
4371
4391
|
}
|
|
4372
|
-
},
|
|
4392
|
+
}, ii = class {
|
|
4373
4393
|
constructor() {
|
|
4374
4394
|
this.transformType = "filter";
|
|
4375
4395
|
}
|
|
@@ -4377,7 +4397,7 @@ var Hs = (e) => {
|
|
|
4377
4397
|
const { options: r } = t;
|
|
4378
4398
|
return e.filter(r.variableName, r.operator, r.value);
|
|
4379
4399
|
}
|
|
4380
|
-
},
|
|
4400
|
+
}, oi = class {
|
|
4381
4401
|
constructor() {
|
|
4382
4402
|
this.transformType = "reshape";
|
|
4383
4403
|
}
|
|
@@ -4394,7 +4414,7 @@ var Hs = (e) => {
|
|
|
4394
4414
|
const { options: t } = e;
|
|
4395
4415
|
return [t.keyName ?? "key"];
|
|
4396
4416
|
}
|
|
4397
|
-
},
|
|
4417
|
+
}, li = class {
|
|
4398
4418
|
constructor() {
|
|
4399
4419
|
this.transformType = "sort";
|
|
4400
4420
|
}
|
|
@@ -4402,27 +4422,27 @@ var Hs = (e) => {
|
|
|
4402
4422
|
const { options: r } = t;
|
|
4403
4423
|
return e.orderBy(r.variableName, r.direction ?? "asc");
|
|
4404
4424
|
}
|
|
4405
|
-
},
|
|
4406
|
-
new
|
|
4407
|
-
new ni(),
|
|
4425
|
+
}, ci = [
|
|
4426
|
+
new ai(),
|
|
4408
4427
|
new si(),
|
|
4409
4428
|
new ii(),
|
|
4410
|
-
new oi()
|
|
4411
|
-
|
|
4429
|
+
new oi(),
|
|
4430
|
+
new li()
|
|
4431
|
+
], Bo = class extends Lr {
|
|
4412
4432
|
constructor() {
|
|
4413
4433
|
super("transform");
|
|
4414
|
-
for (const e of
|
|
4434
|
+
for (const e of ci) this.register(e.transformType, e);
|
|
4415
4435
|
}
|
|
4416
4436
|
};
|
|
4417
|
-
function
|
|
4437
|
+
function ui(e) {
|
|
4418
4438
|
if ("definition" in e) return e.definition;
|
|
4419
|
-
if (
|
|
4439
|
+
if (Br(e) || Vr(e) || Wr(e)) return e;
|
|
4420
4440
|
}
|
|
4421
|
-
function
|
|
4441
|
+
function Vo(e) {
|
|
4422
4442
|
const t = [], r = [], a = [];
|
|
4423
4443
|
for (const n of e) {
|
|
4424
|
-
const s =
|
|
4425
|
-
s && (
|
|
4444
|
+
const s = ui(n);
|
|
4445
|
+
s && (Br(s) ? (t.push(s), s.defaultStat !== null && r.push(s.defaultStat)) : Vr(s) ? r.push(s) : Wr(s) && a.push(s));
|
|
4426
4446
|
}
|
|
4427
4447
|
return {
|
|
4428
4448
|
geoms: t,
|
|
@@ -4432,12 +4452,12 @@ function Oo(e) {
|
|
|
4432
4452
|
...$e("geom", t, (n) => n.type),
|
|
4433
4453
|
...$e("stat", r, (n) => n.type),
|
|
4434
4454
|
...$e("transform", a, (n) => n.transformType),
|
|
4435
|
-
...
|
|
4436
|
-
...
|
|
4455
|
+
...di(t),
|
|
4456
|
+
...hi(t)
|
|
4437
4457
|
]
|
|
4438
4458
|
};
|
|
4439
4459
|
}
|
|
4440
|
-
function
|
|
4460
|
+
function di(e) {
|
|
4441
4461
|
const t = [];
|
|
4442
4462
|
for (const r of e)
|
|
4443
4463
|
r.spatialKind === "render-hit-test" && (r.identityKey !== "x-group" && r.identityKey !== "x-y" || t.push({
|
|
@@ -4451,7 +4471,7 @@ function ui(e) {
|
|
|
4451
4471
|
}));
|
|
4452
4472
|
return t;
|
|
4453
4473
|
}
|
|
4454
|
-
function
|
|
4474
|
+
function hi(e) {
|
|
4455
4475
|
const t = [];
|
|
4456
4476
|
for (const r of e)
|
|
4457
4477
|
r.spatialKind !== "cells" || !r.supportedCoordTypes.includes("polar") || t.push({
|
|
@@ -4484,7 +4504,7 @@ function $e(e, t, r) {
|
|
|
4484
4504
|
});
|
|
4485
4505
|
return n;
|
|
4486
4506
|
}
|
|
4487
|
-
var
|
|
4507
|
+
var Br = (e) => e instanceof re, Vr = (e) => e instanceof ri, Wr = (e) => "transformType" in e && typeof e.apply == "function", Wo = [
|
|
4488
4508
|
"brick",
|
|
4489
4509
|
"gray",
|
|
4490
4510
|
"red",
|
|
@@ -4495,7 +4515,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4495
4515
|
"blue",
|
|
4496
4516
|
"purple",
|
|
4497
4517
|
"pink"
|
|
4498
|
-
],
|
|
4518
|
+
], Uo = [
|
|
4499
4519
|
"cyan",
|
|
4500
4520
|
"pink",
|
|
4501
4521
|
"purple",
|
|
@@ -4504,7 +4524,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4504
4524
|
"yellow",
|
|
4505
4525
|
"green",
|
|
4506
4526
|
"blue"
|
|
4507
|
-
],
|
|
4527
|
+
], fi = [
|
|
4508
4528
|
"#B84737",
|
|
4509
4529
|
"#BA7420",
|
|
4510
4530
|
"#0B8666",
|
|
@@ -4513,7 +4533,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4513
4533
|
"#E2BF6B",
|
|
4514
4534
|
"#95CBA6",
|
|
4515
4535
|
"#AABCE5"
|
|
4516
|
-
],
|
|
4536
|
+
], pi = "brick", O = {
|
|
4517
4537
|
red: "#E83562",
|
|
4518
4538
|
orange: "#F38650",
|
|
4519
4539
|
yellow: "#FBBC30",
|
|
@@ -4524,17 +4544,17 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4524
4544
|
dark_purple: "#6D48D2",
|
|
4525
4545
|
plum: "#C82184",
|
|
4526
4546
|
pink: "#FC8497"
|
|
4527
|
-
},
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4547
|
+
}, yi = [
|
|
4548
|
+
O.purple,
|
|
4549
|
+
O.pink,
|
|
4550
|
+
O.yellow,
|
|
4551
|
+
O.blue,
|
|
4552
|
+
O.red,
|
|
4553
|
+
O.cyan,
|
|
4554
|
+
O.orange,
|
|
4555
|
+
O.plum,
|
|
4556
|
+
O.green,
|
|
4557
|
+
O.dark_purple
|
|
4538
4558
|
], I = {
|
|
4539
4559
|
green: "#B2DDC9",
|
|
4540
4560
|
cyan: "#A2D5E2",
|
|
@@ -4545,7 +4565,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4545
4565
|
red: "#FFADAD",
|
|
4546
4566
|
orange: "#FFDEB4",
|
|
4547
4567
|
yellow: "#FDF7C3"
|
|
4548
|
-
},
|
|
4568
|
+
}, gi = [
|
|
4549
4569
|
I.green,
|
|
4550
4570
|
I.purple,
|
|
4551
4571
|
I.red,
|
|
@@ -4656,7 +4676,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4656
4676
|
pink200: "#FED0F3",
|
|
4657
4677
|
pink100: "#FFE8F9",
|
|
4658
4678
|
pink50: "#FFF4FC"
|
|
4659
|
-
},
|
|
4679
|
+
}, Yo = [Me.brick100, Me.brick900], mi = [
|
|
4660
4680
|
Me.gray200,
|
|
4661
4681
|
I.green,
|
|
4662
4682
|
I.red,
|
|
@@ -4778,7 +4798,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4778
4798
|
C.yellow,
|
|
4779
4799
|
C.green,
|
|
4780
4800
|
C.blue
|
|
4781
|
-
],
|
|
4801
|
+
], vi = [
|
|
4782
4802
|
C.cyan,
|
|
4783
4803
|
C.green,
|
|
4784
4804
|
C.red,
|
|
@@ -4793,7 +4813,7 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4793
4813
|
Re.positive,
|
|
4794
4814
|
Re.negative,
|
|
4795
4815
|
Re.total
|
|
4796
|
-
],
|
|
4816
|
+
], Go = {
|
|
4797
4817
|
transform: "linear",
|
|
4798
4818
|
reverse: !1,
|
|
4799
4819
|
nice: !0,
|
|
@@ -4804,16 +4824,16 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4804
4824
|
interpolate: "lab",
|
|
4805
4825
|
domainMid: null,
|
|
4806
4826
|
symmetric: !1
|
|
4807
|
-
},
|
|
4827
|
+
}, zo = {
|
|
4808
4828
|
size: [4, 20],
|
|
4809
4829
|
alpha: [0.1, 1],
|
|
4810
4830
|
strokeWidth: [1, 4]
|
|
4811
|
-
},
|
|
4831
|
+
}, $o = {
|
|
4812
4832
|
domainMin: null,
|
|
4813
4833
|
domainMax: null,
|
|
4814
4834
|
nice: !1,
|
|
4815
4835
|
reverse: !1
|
|
4816
|
-
},
|
|
4836
|
+
}, jo = {
|
|
4817
4837
|
range: null,
|
|
4818
4838
|
domain: null,
|
|
4819
4839
|
padding: 0.1,
|
|
@@ -4822,27 +4842,27 @@ var Or = (e) => e instanceof re, Br = (e) => e instanceof ti, Vr = (e) => "trans
|
|
|
4822
4842
|
function Gt(e, t = "light", r) {
|
|
4823
4843
|
return ((r !== void 0 ? Ut[t][r] : void 0) ?? Ut[t].default).map((a) => Me[`${e}${a}`]);
|
|
4824
4844
|
}
|
|
4825
|
-
function
|
|
4845
|
+
function Ai(e) {
|
|
4826
4846
|
const t = Le.indexOf(C[e]);
|
|
4827
4847
|
return t <= 0 ? Le : [...Le.slice(t), ...Le.slice(0, t)];
|
|
4828
4848
|
}
|
|
4829
|
-
function
|
|
4849
|
+
function Ho(e, t = {}) {
|
|
4830
4850
|
switch (e.type) {
|
|
4831
4851
|
case "default":
|
|
4832
|
-
return t.hasTouchingGeoms ? Gt(
|
|
4852
|
+
return t.defaultPalette !== void 0 && t.defaultPalette.length > 0 ? [...t.defaultPalette] : t.hasTouchingGeoms ? Gt(pi, t.colorScheme ?? "light", t.groupCount) : fi;
|
|
4833
4853
|
case "graphy":
|
|
4834
|
-
return e.variant === "waterfall" ? bi :
|
|
4854
|
+
return e.variant === "waterfall" ? bi : yi;
|
|
4835
4855
|
case "pastel":
|
|
4836
|
-
return e.variant === "waterfall" ?
|
|
4856
|
+
return e.variant === "waterfall" ? mi : gi;
|
|
4837
4857
|
case "neon":
|
|
4838
|
-
return e.variant === "waterfall" ?
|
|
4858
|
+
return e.variant === "waterfall" ? vi : Ai(e.base);
|
|
4839
4859
|
case "mono":
|
|
4840
4860
|
return Gt(e.base, e.variant ?? "light", t.groupCount);
|
|
4841
4861
|
case "custom":
|
|
4842
4862
|
return e.colors;
|
|
4843
4863
|
}
|
|
4844
4864
|
}
|
|
4845
|
-
function
|
|
4865
|
+
function Ko(e, t) {
|
|
4846
4866
|
if (!t) return e;
|
|
4847
4867
|
const r = [...e];
|
|
4848
4868
|
for (const [a, n] of Object.entries(t)) {
|
|
@@ -4853,7 +4873,7 @@ function jo(e, t) {
|
|
|
4853
4873
|
}
|
|
4854
4874
|
return r;
|
|
4855
4875
|
}
|
|
4856
|
-
function
|
|
4876
|
+
function Xo(e, t, r, a) {
|
|
4857
4877
|
if (!t) return;
|
|
4858
4878
|
const n = r?.type === "custom" ? a[r.id] : void 0, s = {};
|
|
4859
4879
|
for (const [i, o] of Object.entries(t)) {
|
|
@@ -4879,7 +4899,7 @@ function Ho(e, t, r, a) {
|
|
|
4879
4899
|
}
|
|
4880
4900
|
return Object.keys(s).length > 0 ? s : void 0;
|
|
4881
4901
|
}
|
|
4882
|
-
function
|
|
4902
|
+
function qo(e, t, r) {
|
|
4883
4903
|
if (!t) return Yt.palette;
|
|
4884
4904
|
if (t.type === "custom") {
|
|
4885
4905
|
const a = r[t.id];
|
|
@@ -4902,7 +4922,7 @@ function Ko(e, t, r) {
|
|
|
4902
4922
|
}
|
|
4903
4923
|
return t;
|
|
4904
4924
|
}
|
|
4905
|
-
function
|
|
4925
|
+
function Jo(e, t = {}) {
|
|
4906
4926
|
const r = t;
|
|
4907
4927
|
return {
|
|
4908
4928
|
type: "scale",
|
|
@@ -4921,7 +4941,7 @@ function Xo(e, t = {}) {
|
|
|
4921
4941
|
symmetric: r.symmetric
|
|
4922
4942
|
};
|
|
4923
4943
|
}
|
|
4924
|
-
function
|
|
4944
|
+
function Qo(e, t = {}) {
|
|
4925
4945
|
return {
|
|
4926
4946
|
type: "scale",
|
|
4927
4947
|
scaledAesthetic: e,
|
|
@@ -4933,7 +4953,7 @@ function qo(e, t = {}) {
|
|
|
4933
4953
|
clamp: t.clamp
|
|
4934
4954
|
};
|
|
4935
4955
|
}
|
|
4936
|
-
function
|
|
4956
|
+
function Zo(e, t = {}) {
|
|
4937
4957
|
return {
|
|
4938
4958
|
type: "scale",
|
|
4939
4959
|
scaledAesthetic: e,
|
|
@@ -4944,14 +4964,14 @@ function Jo(e, t = {}) {
|
|
|
4944
4964
|
reverse: t.reverse
|
|
4945
4965
|
};
|
|
4946
4966
|
}
|
|
4947
|
-
function
|
|
4967
|
+
function el(e, t = {}) {
|
|
4948
4968
|
return {
|
|
4949
4969
|
type: "scale",
|
|
4950
4970
|
scaledAesthetic: e,
|
|
4951
4971
|
scaleType: "identity"
|
|
4952
4972
|
};
|
|
4953
4973
|
}
|
|
4954
|
-
function
|
|
4974
|
+
function tl(e, t) {
|
|
4955
4975
|
return {
|
|
4956
4976
|
type: "scale",
|
|
4957
4977
|
scaledAesthetic: e,
|
|
@@ -4959,7 +4979,7 @@ function Zo(e, t) {
|
|
|
4959
4979
|
options: t
|
|
4960
4980
|
};
|
|
4961
4981
|
}
|
|
4962
|
-
function
|
|
4982
|
+
function rl(e, t = {}) {
|
|
4963
4983
|
return {
|
|
4964
4984
|
type: "scale",
|
|
4965
4985
|
scaledAesthetic: e,
|
|
@@ -4968,24 +4988,24 @@ function el(e, t = {}) {
|
|
|
4968
4988
|
overrides: t.overrides
|
|
4969
4989
|
};
|
|
4970
4990
|
}
|
|
4971
|
-
var
|
|
4991
|
+
var al = { labelCrossPosition: 0.5 }, nl = {
|
|
4972
4992
|
kind: "rectangle",
|
|
4973
4993
|
zOrder: "foreground"
|
|
4974
|
-
},
|
|
4994
|
+
}, sl = {
|
|
4975
4995
|
zOrder: "foreground",
|
|
4976
4996
|
fit: "contain"
|
|
4977
|
-
},
|
|
4997
|
+
}, il = {
|
|
4978
4998
|
x: 8,
|
|
4979
4999
|
y: 8,
|
|
4980
5000
|
unit: "px"
|
|
4981
|
-
},
|
|
5001
|
+
}, ol = { align: "center" }, ll = {
|
|
4982
5002
|
startArrowheadStyle: "none",
|
|
4983
5003
|
endArrowheadStyle: "line-arrow"
|
|
4984
|
-
},
|
|
5004
|
+
}, cl = {
|
|
4985
5005
|
thin: 2,
|
|
4986
5006
|
medium: 4,
|
|
4987
5007
|
thick: 8
|
|
4988
|
-
},
|
|
5008
|
+
}, ul = 0.5, dl = {
|
|
4989
5009
|
strokeWidth: 2,
|
|
4990
5010
|
shadow: {
|
|
4991
5011
|
offsetX: 0,
|
|
@@ -4993,7 +5013,7 @@ var tl = { labelCrossPosition: 0.5 }, rl = {
|
|
|
4993
5013
|
blur: 1.15,
|
|
4994
5014
|
color: "rgba(0, 0, 0, 0.16)"
|
|
4995
5015
|
}
|
|
4996
|
-
},
|
|
5016
|
+
}, hl = {
|
|
4997
5017
|
small: {
|
|
4998
5018
|
arrow: { strokeWidth: 2 },
|
|
4999
5019
|
label: {
|
|
@@ -5024,7 +5044,7 @@ var tl = { labelCrossPosition: 0.5 }, rl = {
|
|
|
5024
5044
|
strokeWidth: 2
|
|
5025
5045
|
}
|
|
5026
5046
|
}
|
|
5027
|
-
},
|
|
5047
|
+
}, fl = {
|
|
5028
5048
|
differenceArrow: "differenceArrows",
|
|
5029
5049
|
shape: "shapes",
|
|
5030
5050
|
arrow: "arrows",
|
|
@@ -5033,7 +5053,7 @@ var tl = { labelCrossPosition: 0.5 }, rl = {
|
|
|
5033
5053
|
sticker: "stickers",
|
|
5034
5054
|
pinnedNumber: "pinnedNumbers",
|
|
5035
5055
|
comment: "comments"
|
|
5036
|
-
},
|
|
5056
|
+
}, pl = {
|
|
5037
5057
|
differenceArrow(e) {
|
|
5038
5058
|
return {
|
|
5039
5059
|
type: "annotation",
|
|
@@ -5092,211 +5112,212 @@ var tl = { labelCrossPosition: 0.5 }, rl = {
|
|
|
5092
5112
|
}
|
|
5093
5113
|
};
|
|
5094
5114
|
export {
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5115
|
+
us as $,
|
|
5116
|
+
Xe as $n,
|
|
5117
|
+
cn as $t,
|
|
5118
|
+
Wo as A,
|
|
5119
|
+
Qt as An,
|
|
5120
|
+
Ri as Ar,
|
|
5121
|
+
Nn as At,
|
|
5122
|
+
Ks as B,
|
|
5123
|
+
ma as Bn,
|
|
5124
|
+
He as Br,
|
|
5125
|
+
Mn as Bt,
|
|
5126
|
+
Go as C,
|
|
5127
|
+
mr as Cn,
|
|
5128
|
+
da as Cr,
|
|
5129
|
+
So as Ct,
|
|
5130
|
+
fi as D,
|
|
5131
|
+
ba as Dn,
|
|
5132
|
+
Di as Dr,
|
|
5133
|
+
fo as Dt,
|
|
5134
|
+
zo as E,
|
|
5135
|
+
xa as En,
|
|
5136
|
+
ca as Er,
|
|
5137
|
+
ho as Et,
|
|
5138
|
+
ri as F,
|
|
5139
|
+
de as Fn,
|
|
5140
|
+
la as Fr,
|
|
5141
|
+
An as Ft,
|
|
5142
|
+
Po as G,
|
|
5143
|
+
De as Gn,
|
|
5144
|
+
wi as Gr,
|
|
5145
|
+
vn as Gt,
|
|
5146
|
+
Io as H,
|
|
5147
|
+
Ae as Hn,
|
|
5148
|
+
ea as Hr,
|
|
5149
|
+
En as Ht,
|
|
5150
|
+
ti as I,
|
|
5151
|
+
Jt as In,
|
|
5152
|
+
$t as Ir,
|
|
5153
|
+
Tr as It,
|
|
5154
|
+
_s as J,
|
|
5155
|
+
D as Jn,
|
|
5156
|
+
ro as Jt,
|
|
5157
|
+
Fo as K,
|
|
5138
5158
|
zi as Kn,
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5159
|
+
ta as Kr,
|
|
5160
|
+
no as Kt,
|
|
5161
|
+
No as L,
|
|
5162
|
+
Ie as Ln,
|
|
5163
|
+
_i as Lr,
|
|
5164
|
+
co as Lt,
|
|
5165
|
+
Vo as M,
|
|
5166
|
+
Ee as Mn,
|
|
5167
|
+
oa as Mr,
|
|
5168
|
+
Cn as Mt,
|
|
5169
|
+
ui as N,
|
|
5170
|
+
qi as Nn,
|
|
5171
|
+
ia as Nr,
|
|
5172
|
+
oe as Nt,
|
|
5173
|
+
pi as O,
|
|
5153
5174
|
Ki as On,
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5175
|
+
sa as Or,
|
|
5176
|
+
po as Ot,
|
|
5177
|
+
Bo as P,
|
|
5178
|
+
R as Pn,
|
|
5179
|
+
Ci as Pr,
|
|
5180
|
+
io as Pt,
|
|
5181
|
+
Do as Q,
|
|
5182
|
+
Wi as Qn,
|
|
5183
|
+
sn as Qt,
|
|
5184
|
+
Xs as R,
|
|
5185
|
+
W as Rn,
|
|
5186
|
+
ki as Rr,
|
|
5187
|
+
xn as Rt,
|
|
5188
|
+
Ho as S,
|
|
5189
|
+
ie as Sn,
|
|
5190
|
+
v as Sr,
|
|
5191
|
+
ko as St,
|
|
5192
|
+
jo as T,
|
|
5193
|
+
Ma as Tn,
|
|
5194
|
+
$ as Tr,
|
|
5195
|
+
Rr as Tt,
|
|
5196
|
+
Hs as U,
|
|
5197
|
+
ji as Un,
|
|
5198
|
+
Ti as Ur,
|
|
5199
|
+
tt as Ut,
|
|
5200
|
+
qs as V,
|
|
5201
|
+
Hi as Vn,
|
|
5202
|
+
Si as Vr,
|
|
5203
|
+
lo as Vt,
|
|
5204
|
+
Oo as W,
|
|
5205
|
+
Gi as Wn,
|
|
5206
|
+
Zr as Wr,
|
|
5207
|
+
bn as Wt,
|
|
5187
5208
|
ot as X,
|
|
5188
5209
|
Ui as Xn,
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5210
|
+
dn as Xt,
|
|
5211
|
+
Ls as Y,
|
|
5212
|
+
Y as Yn,
|
|
5213
|
+
so as Yt,
|
|
5214
|
+
fs as Z,
|
|
5215
|
+
Yi as Zn,
|
|
5216
|
+
to as Zt,
|
|
5217
|
+
Qo as _,
|
|
5218
|
+
an as _n,
|
|
5219
|
+
y as _r,
|
|
5220
|
+
vo as _t,
|
|
5221
|
+
cl as a,
|
|
5222
|
+
on as an,
|
|
5223
|
+
Q as ar,
|
|
5224
|
+
ts as at,
|
|
5225
|
+
qo as b,
|
|
5226
|
+
Ji as bn,
|
|
5227
|
+
fe as br,
|
|
5228
|
+
rt as bt,
|
|
5229
|
+
sl as c,
|
|
5230
|
+
yn as cn,
|
|
5231
|
+
Z as cr,
|
|
5232
|
+
jn as ct,
|
|
5233
|
+
ol as d,
|
|
5234
|
+
tn as dn,
|
|
5235
|
+
K as dr,
|
|
5236
|
+
Eo as dt,
|
|
5237
|
+
un as en,
|
|
5238
|
+
ga as er,
|
|
5218
5239
|
Te as et,
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5240
|
+
ul as f,
|
|
5241
|
+
en as fn,
|
|
5242
|
+
H as fr,
|
|
5243
|
+
wo as ft,
|
|
5244
|
+
Zo as g,
|
|
5245
|
+
Qi as gn,
|
|
5246
|
+
Ii as gr,
|
|
5247
|
+
bo as gt,
|
|
5248
|
+
el as h,
|
|
5249
|
+
Ar as hn,
|
|
5250
|
+
Ke as hr,
|
|
5251
|
+
Mo as ht,
|
|
5252
|
+
dl as i,
|
|
5253
|
+
ln as in,
|
|
5254
|
+
Bi as ir,
|
|
5255
|
+
Ro as it,
|
|
5256
|
+
Uo as j,
|
|
5257
|
+
Aa as jn,
|
|
5258
|
+
ue as jr,
|
|
5259
|
+
Lr as jt,
|
|
5260
|
+
Yo as k,
|
|
5261
|
+
Xi as kn,
|
|
5262
|
+
na as kr,
|
|
5263
|
+
uo as kt,
|
|
5264
|
+
il as l,
|
|
5265
|
+
At as ln,
|
|
5266
|
+
j as lr,
|
|
5267
|
+
go as lt,
|
|
5268
|
+
tl as m,
|
|
5269
|
+
rn as mn,
|
|
5270
|
+
Ht as mr,
|
|
5271
|
+
Ao as mt,
|
|
5272
|
+
pl as n,
|
|
5273
|
+
eo as nn,
|
|
5274
|
+
Vi as nr,
|
|
5254
5275
|
re as nt,
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5276
|
+
al as o,
|
|
5277
|
+
Fe as on,
|
|
5278
|
+
Oi as or,
|
|
5279
|
+
Lo as ot,
|
|
5280
|
+
rl as p,
|
|
5281
|
+
br as pn,
|
|
5282
|
+
fa as pr,
|
|
5283
|
+
To as pt,
|
|
5284
|
+
Nt as q,
|
|
5285
|
+
$i as qn,
|
|
5286
|
+
ao as qt,
|
|
5287
|
+
ll as r,
|
|
5288
|
+
Zi as rn,
|
|
5289
|
+
ya as rr,
|
|
5290
|
+
Co as rt,
|
|
5291
|
+
hl as s,
|
|
5292
|
+
xr as sn,
|
|
5293
|
+
ee as sr,
|
|
5294
|
+
mo as st,
|
|
5295
|
+
fl as t,
|
|
5275
5296
|
hn as tn,
|
|
5276
|
-
|
|
5297
|
+
qt as tr,
|
|
5277
5298
|
we as tt,
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5299
|
+
nl as u,
|
|
5300
|
+
f as un,
|
|
5301
|
+
Ni as ur,
|
|
5302
|
+
xo as ut,
|
|
5303
|
+
Jo as v,
|
|
5304
|
+
vr as vn,
|
|
5305
|
+
Xt as vr,
|
|
5306
|
+
yo as vt,
|
|
5307
|
+
$o as w,
|
|
5308
|
+
Na as wn,
|
|
5309
|
+
Li as wr,
|
|
5310
|
+
zn as wt,
|
|
5311
|
+
Xo as x,
|
|
5312
|
+
Ha as xn,
|
|
5313
|
+
Fi as xr,
|
|
5314
|
+
_o as xt,
|
|
5315
|
+
Ko as y,
|
|
5316
|
+
pe as yn,
|
|
5317
|
+
Kt as yr,
|
|
5318
|
+
$n as yt,
|
|
5319
|
+
Js as z,
|
|
5320
|
+
va as zn,
|
|
5321
|
+
S as zr,
|
|
5322
|
+
oo as zt
|
|
5302
5323
|
};
|