@graphysdk/viz-engine 2.0.0-beta.1786440210947 → 2.0.0-beta.1787130761469
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/README.md +7 -7
- package/dist/{config.types-DnU7Dr0S.js → config.types-C9Rwz29h.js} +906 -605
- package/dist/config.types-_BpZP1A3.cjs +1 -0
- package/dist/graph-config.cjs +1 -1
- package/dist/graph-config.d.ts +253 -133
- package/dist/graph-config.mjs +649 -467
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +769 -409
- package/dist/index.mjs +4195 -3711
- package/licenses/PolyForm-Free-Trial-1.0.0.md +93 -0
- package/licenses/PolyForm-NonCommercial-1.0.0.md +131 -0
- package/licenses/PolyForm-Small-Business-1.0.0.md +121 -0
- package/package.json +7 -1
- package/dist/config.types-DnPx8Xzn.cjs +0 -1
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { differenceInDays as
|
|
2
|
-
import { isEqual as
|
|
3
|
-
import { desc as
|
|
4
|
-
var
|
|
5
|
-
function
|
|
1
|
+
import { differenceInDays as Be, isBefore as je, isValid as m, isWithinInterval as Ue, parse as O } from "date-fns";
|
|
2
|
+
import { isEqual as Pe, isInteger as $e } from "lodash-es";
|
|
3
|
+
import { desc as ze, op as se, table as S } from "arquero";
|
|
4
|
+
var wr = (e) => e.length > 0;
|
|
5
|
+
function oe(e) {
|
|
6
6
|
return e != null;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Rr(e) {
|
|
9
9
|
if (e === null || typeof e != "object") return !1;
|
|
10
10
|
const t = Object.getPrototypeOf(e);
|
|
11
11
|
return t === Object.prototype || t === null;
|
|
12
12
|
}
|
|
13
|
-
var
|
|
14
|
-
count:
|
|
15
|
-
mean:
|
|
16
|
-
sum:
|
|
17
|
-
},
|
|
18
|
-
x:
|
|
19
|
-
y:
|
|
20
|
-
xMin:
|
|
21
|
-
xMax:
|
|
22
|
-
yMin:
|
|
23
|
-
yMax:
|
|
24
|
-
yRaw:
|
|
25
|
-
},
|
|
26
|
-
color:
|
|
27
|
-
size:
|
|
28
|
-
alpha:
|
|
29
|
-
strokeWidth:
|
|
30
|
-
lineType:
|
|
31
|
-
},
|
|
32
|
-
y:
|
|
33
|
-
x:
|
|
34
|
-
},
|
|
35
|
-
...ie,
|
|
13
|
+
var ie = "\0graphy\0_", y = (e) => `${ie}${e}`, le = { x: y("constantX") }, ce = {
|
|
14
|
+
count: y("count"),
|
|
15
|
+
mean: y("mean"),
|
|
16
|
+
sum: y("sum")
|
|
17
|
+
}, Ye = { group: y("group") }, We = {
|
|
18
|
+
x: y("x"),
|
|
19
|
+
y: y("y"),
|
|
20
|
+
xMin: y("xMin"),
|
|
21
|
+
xMax: y("xMax"),
|
|
22
|
+
yMin: y("yMin"),
|
|
23
|
+
yMax: y("yMax"),
|
|
24
|
+
yRaw: y("yRaw")
|
|
25
|
+
}, Ge = { role: y("stackRole") }, He = {
|
|
26
|
+
color: y("color"),
|
|
27
|
+
size: y("size"),
|
|
28
|
+
alpha: y("alpha"),
|
|
29
|
+
strokeWidth: y("strokeWidth"),
|
|
30
|
+
lineType: y("lineType")
|
|
31
|
+
}, Ke = {
|
|
32
|
+
y: y("ruleY"),
|
|
33
|
+
x: y("ruleX")
|
|
34
|
+
}, Cr = {
|
|
36
35
|
...le,
|
|
37
|
-
|
|
36
|
+
...ce,
|
|
38
37
|
...Ye,
|
|
39
|
-
...ze,
|
|
40
38
|
...We,
|
|
41
|
-
...Ge
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
...Ge,
|
|
40
|
+
...He,
|
|
41
|
+
...Ke
|
|
42
|
+
}, qe = new Set(Object.values(ce)), Ir = (e) => y(`scaled_${e}`), xr = (e) => e.startsWith(ie), Vr = (e) => qe.has(e);
|
|
43
|
+
function Br(e) {
|
|
44
44
|
const { numeric: t, categorical: r, temporal: a } = e.groupVariableNamesByType();
|
|
45
45
|
return a[0] ?? r[0] ?? t[0] ?? "";
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function jr(e) {
|
|
48
48
|
const t = ue(e.x);
|
|
49
|
-
return t === null || t ===
|
|
49
|
+
return t === null || t === le.x ? "" : t;
|
|
50
50
|
}
|
|
51
51
|
function ue(e) {
|
|
52
|
-
return
|
|
52
|
+
return oe(e) ? typeof e == "string" ? e : "variable" in e ? e.variable : null : null;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
if (!(!
|
|
54
|
+
function Xe(e) {
|
|
55
|
+
if (!(!oe(e) || typeof e == "string") && "value" in e)
|
|
56
56
|
return e.value;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((r) =>
|
|
58
|
+
function Ur(e, t) {
|
|
59
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((r) => J(e[r]) === J(t[r]));
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function J(e) {
|
|
62
62
|
const t = ue(e);
|
|
63
63
|
if (t !== null) return `variable:${t}`;
|
|
64
|
-
const r =
|
|
64
|
+
const r = Xe(e);
|
|
65
65
|
return r === void 0 ? "" : r === null ? "value:null" : r instanceof Date ? `value:date:${r.getTime()}` : `value:${typeof r}:${r}`;
|
|
66
66
|
}
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
},
|
|
67
|
+
var H = (e) => e instanceof Date && m(e), Pr = (e) => H(e) || e === null, $r = (e) => typeof e == "string", Je = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e), zr = (e) => Je(e) || e === null, de = (e) => (Array.isArray(e) ? e : [e]).map((t) => t instanceof Date ? t.toISOString() : String(t ?? "<null>")).join("\0"), Yr = (e, t) => e === t ? !0 : H(e) && H(t) ? e.getTime() === t.getTime() : !1, N = process.env.NODE_ENV !== "production", U = !0, Wr = (e) => {
|
|
68
|
+
U = e;
|
|
69
|
+
}, Gr = () => U, Hr = () => {
|
|
70
70
|
let e = null;
|
|
71
71
|
const t = {
|
|
72
72
|
hits: 0,
|
|
73
73
|
misses: 0
|
|
74
74
|
};
|
|
75
75
|
return Object.assign((a, n) => {
|
|
76
|
-
if (!
|
|
77
|
-
return
|
|
78
|
-
if (e &&
|
|
79
|
-
return
|
|
80
|
-
|
|
76
|
+
if (!U)
|
|
77
|
+
return N && (t.misses += 1), n();
|
|
78
|
+
if (e && ye(e.args, a))
|
|
79
|
+
return N && (t.hits += 1), e.out;
|
|
80
|
+
N && (t.misses += 1);
|
|
81
81
|
const s = n();
|
|
82
82
|
return e = {
|
|
83
83
|
args: a,
|
|
@@ -89,20 +89,20 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
89
89
|
e = null;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
},
|
|
92
|
+
}, Qe = () => {
|
|
93
93
|
const e = /* @__PURE__ */ new WeakMap(), t = {
|
|
94
94
|
hits: 0,
|
|
95
95
|
misses: 0
|
|
96
96
|
};
|
|
97
97
|
return Object.assign((a, n, s) => {
|
|
98
|
-
if (!
|
|
99
|
-
return
|
|
98
|
+
if (!U)
|
|
99
|
+
return N && (t.misses += 1), s();
|
|
100
100
|
const o = e.get(a);
|
|
101
101
|
if (o) {
|
|
102
|
-
for (const l of o) if (
|
|
103
|
-
return
|
|
102
|
+
for (const l of o) if (ye(l.args, n))
|
|
103
|
+
return N && (t.hits += 1), l.out;
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
N && (t.misses += 1);
|
|
106
106
|
const i = s();
|
|
107
107
|
return o ? o.push({
|
|
108
108
|
args: n,
|
|
@@ -112,19 +112,19 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
112
112
|
out: i
|
|
113
113
|
}]), i;
|
|
114
114
|
}, { stats: t });
|
|
115
|
-
},
|
|
115
|
+
}, Kr = (...e) => e.reduce((t, r) => ({
|
|
116
116
|
hits: t.hits + r.hits,
|
|
117
117
|
misses: t.misses + r.misses
|
|
118
118
|
}), {
|
|
119
119
|
hits: 0,
|
|
120
120
|
misses: 0
|
|
121
|
-
}),
|
|
121
|
+
}), ye = (e, t) => {
|
|
122
122
|
if (e.length !== t.length) return !1;
|
|
123
123
|
for (let r = 0; r < e.length; r += 1) if (e[r] !== t[r]) return !1;
|
|
124
124
|
return !0;
|
|
125
|
-
},
|
|
125
|
+
}, Ze = class {
|
|
126
126
|
constructor() {
|
|
127
|
-
this.memo =
|
|
127
|
+
this.memo = Qe(), this.singletonKey = {};
|
|
128
128
|
}
|
|
129
129
|
get stats() {
|
|
130
130
|
return this.memo.stats;
|
|
@@ -135,38 +135,38 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
135
135
|
key(e) {
|
|
136
136
|
return this.singletonKey;
|
|
137
137
|
}
|
|
138
|
-
},
|
|
138
|
+
}, fe = class extends Error {
|
|
139
139
|
constructor(e) {
|
|
140
140
|
super(e.message, e.cause !== void 0 ? { cause: e.cause } : void 0), this.name = new.target.name, this.code = e.code, this.context = e.context, this.suggestion = e.suggestion;
|
|
141
141
|
}
|
|
142
|
-
},
|
|
142
|
+
}, j = class extends fe {
|
|
143
143
|
constructor(e) {
|
|
144
144
|
super(e), this.kind = "user-input";
|
|
145
145
|
}
|
|
146
|
-
},
|
|
146
|
+
}, _ = class extends fe {
|
|
147
147
|
constructor(e) {
|
|
148
148
|
super({
|
|
149
149
|
...e,
|
|
150
150
|
code: e.code ?? "INTERNAL_INVARIANT"
|
|
151
151
|
}), this.kind = "internal";
|
|
152
152
|
}
|
|
153
|
-
},
|
|
154
|
-
if (
|
|
155
|
-
if (
|
|
156
|
-
if (
|
|
157
|
-
if (
|
|
158
|
-
throw new
|
|
159
|
-
},
|
|
153
|
+
}, ge = (e) => e.type === "lookup", et = (e) => e.type === "text", P = (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", tt = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", qr = (e) => e.type === "currency", Xr = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", me = (e) => {
|
|
154
|
+
if (ge(e)) return me(e.fallback);
|
|
155
|
+
if (P(e)) return "temporal";
|
|
156
|
+
if (tt(e)) return "numeric";
|
|
157
|
+
if (et(e)) return "categorical";
|
|
158
|
+
throw new _({ message: `No data type found for value format: ${e.type}` });
|
|
159
|
+
}, Jr = (e) => ge(e) ? e.fallback : e, rt = {
|
|
160
160
|
k: 1e3,
|
|
161
161
|
m: 1e6,
|
|
162
162
|
b: 1e9,
|
|
163
163
|
t: 1e12
|
|
164
|
-
},
|
|
164
|
+
}, X = [
|
|
165
165
|
"k",
|
|
166
166
|
"m",
|
|
167
167
|
"b",
|
|
168
168
|
"t"
|
|
169
|
-
],
|
|
169
|
+
], at = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${X.join("|")})?$`, "i"), nt = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, D = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? at.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${X.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), pe = (e) => D(e) ? !0 : typeof e == "string" ? nt.test(e) : !1, be = {
|
|
170
170
|
$: "usd",
|
|
171
171
|
"£": "gbp",
|
|
172
172
|
"€": "eur",
|
|
@@ -198,37 +198,37 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
198
198
|
C$: "cad",
|
|
199
199
|
NZ$: "nzd",
|
|
200
200
|
MX$: "mxn"
|
|
201
|
-
},
|
|
201
|
+
}, he = (e) => {
|
|
202
202
|
if (typeof e == "string") {
|
|
203
|
-
const t =
|
|
204
|
-
return t.length ?
|
|
203
|
+
const t = ve(e);
|
|
204
|
+
return t.length ? D(t) : !1;
|
|
205
205
|
}
|
|
206
|
-
return
|
|
207
|
-
},
|
|
208
|
-
const t =
|
|
209
|
-
if (!r) throw new
|
|
206
|
+
return D(e);
|
|
207
|
+
}, st = (e) => {
|
|
208
|
+
const t = Me(e), r = t ? be[t] : void 0;
|
|
209
|
+
if (!r) throw new _({ message: "Could not get currency ISO" });
|
|
210
210
|
return r;
|
|
211
|
-
},
|
|
212
|
-
const t =
|
|
211
|
+
}, ve = (e) => {
|
|
212
|
+
const t = Me(e);
|
|
213
213
|
let r = e;
|
|
214
214
|
if (t) {
|
|
215
215
|
const a = e.indexOf(t);
|
|
216
216
|
a === 0 ? r = e.slice(t.length) : a === e.length - t.length ? r = e.slice(0, e.length - t.length) : e[0] === "-" && a === 1 && (r = `-${e.slice(t.length + 1)}`);
|
|
217
217
|
}
|
|
218
|
-
return
|
|
219
|
-
},
|
|
218
|
+
return D(r) ? r.split(",").join("") : "";
|
|
219
|
+
}, Me = (e) => Object.keys(be).sort((t, r) => r.length - t.length).find((t) => e.includes(t)), Ee = (e) => {
|
|
220
220
|
const t = Object.entries(e);
|
|
221
|
-
return !t.length || !t.some(([, r]) => !
|
|
222
|
-
},
|
|
221
|
+
return !t.length || !t.some(([, r]) => !C(r));
|
|
222
|
+
}, C = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", _e = "en-GB", ot = class {
|
|
223
223
|
constructor() {
|
|
224
224
|
this.currentYear = (/* @__PURE__ */ new Date()).getUTCFullYear(), this.previousDate = null, this.previousYear = null;
|
|
225
225
|
}
|
|
226
226
|
incrementYearIfNeeded(e) {
|
|
227
|
-
this.previousYear === null ? this.previousYear = e.getUTCFullYear() : this.previousDate !== null &&
|
|
227
|
+
this.previousYear === null ? this.previousYear = e.getUTCFullYear() : this.previousDate !== null && je(new Date(this.currentYear, e.getUTCMonth(), e.getUTCDate()), new Date(this.currentYear, this.previousDate.getUTCMonth(), this.previousDate.getUTCDate())) && this.previousYear++;
|
|
228
228
|
const t = new Date(e.getTime());
|
|
229
229
|
return t.setUTCFullYear(this.previousYear), this.previousDate = t, t;
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, it = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, lt = /^\s*(19\d{2}|2[01]\d{2})\s*$/, ct = [
|
|
232
232
|
[/\bJan\b/i, "January"],
|
|
233
233
|
[/\bFeb\b/i, "February"],
|
|
234
234
|
[/\bMar\b/i, "March"],
|
|
@@ -240,12 +240,12 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
240
240
|
[/\bOct\b/i, "October"],
|
|
241
241
|
[/\bNov\b/i, "November"],
|
|
242
242
|
[/\bDec\b/i, "December"]
|
|
243
|
-
],
|
|
243
|
+
], ut = {
|
|
244
244
|
"en-US": "MDY",
|
|
245
245
|
"en-GB": "DMY",
|
|
246
246
|
"pt-PT": "DMY",
|
|
247
247
|
ar: "DMY"
|
|
248
|
-
},
|
|
248
|
+
}, Te = [
|
|
249
249
|
"/",
|
|
250
250
|
"-",
|
|
251
251
|
".",
|
|
@@ -321,7 +321,7 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
321
321
|
"MMMM",
|
|
322
322
|
"yyyy"
|
|
323
323
|
]
|
|
324
|
-
],
|
|
324
|
+
], Z = [
|
|
325
325
|
[
|
|
326
326
|
"M",
|
|
327
327
|
"d",
|
|
@@ -392,7 +392,7 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
392
392
|
"do",
|
|
393
393
|
"yyyy"
|
|
394
394
|
]
|
|
395
|
-
],
|
|
395
|
+
], ee = [
|
|
396
396
|
[
|
|
397
397
|
"yyyy",
|
|
398
398
|
"M",
|
|
@@ -428,14 +428,14 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
428
428
|
"MMMM",
|
|
429
429
|
"do"
|
|
430
430
|
]
|
|
431
|
-
],
|
|
431
|
+
], Ae = [
|
|
432
432
|
["d", "MMMM"],
|
|
433
433
|
["dd", "MMMM"],
|
|
434
434
|
["do", "MMMM"],
|
|
435
435
|
["MMMM", "d"],
|
|
436
436
|
["MMMM", "dd"],
|
|
437
437
|
["MMMM", "do"]
|
|
438
|
-
],
|
|
438
|
+
], dt = [
|
|
439
439
|
{
|
|
440
440
|
dateFormat: "MMMM d, yyyy",
|
|
441
441
|
type: "date"
|
|
@@ -452,82 +452,82 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
452
452
|
dateFormat: "yyyy-MM",
|
|
453
453
|
type: "month_year"
|
|
454
454
|
}
|
|
455
|
-
],
|
|
456
|
-
const r =
|
|
457
|
-
return !t &&
|
|
458
|
-
},
|
|
455
|
+
], Fe = 1900, De = 2199, yt = 3, ft = 6, gt = 5, mt = 1, pt = 28, bt = /\s*[–—]\s*|\s-\s/, ht = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= Fe && e <= De : typeof e == "string" ? lt.test(e) : !1, Le = (e, t) => {
|
|
456
|
+
const r = R(e);
|
|
457
|
+
return !t && D(r) ? Et(r) : typeof r == "string" ? t ? m(O(r, t, /* @__PURE__ */ new Date())) : !!Ne(r) || $(r) && m(new Date(r)) : m(r);
|
|
458
|
+
}, R = (e) => {
|
|
459
459
|
if (typeof e != "string") return e;
|
|
460
460
|
let t = e;
|
|
461
|
-
for (const [r, a] of
|
|
461
|
+
for (const [r, a] of ct) t = t.replace(r, a);
|
|
462
462
|
return t;
|
|
463
|
-
}, Ne = (e, t =
|
|
464
|
-
const r =
|
|
465
|
-
return
|
|
466
|
-
},
|
|
467
|
-
if (e instanceof Date) return
|
|
468
|
-
if (typeof e != "string" ||
|
|
463
|
+
}, Ne = (e, t = _e) => {
|
|
464
|
+
const r = R(e);
|
|
465
|
+
return $(r) ? { type: "datetime" } : Oe(t).find((a) => !P(a) || a.type === "month" && r.length < yt ? !1 : a.dateFormat && m(O(r, a.dateFormat, /* @__PURE__ */ new Date())));
|
|
466
|
+
}, $ = (e) => it.test(e.trim()), Qr = (e) => {
|
|
467
|
+
if (e instanceof Date) return m(e) ? e : null;
|
|
468
|
+
if (typeof e != "string" || !$(e)) return null;
|
|
469
469
|
const t = new Date(e.trim());
|
|
470
|
-
return
|
|
471
|
-
},
|
|
472
|
-
const [r, a] = e.split(
|
|
470
|
+
return m(t) ? t : null;
|
|
471
|
+
}, vt = (e, t = _e) => {
|
|
472
|
+
const [r, a] = e.split(bt);
|
|
473
473
|
if (!r || !a) return;
|
|
474
|
-
const n =
|
|
475
|
-
return
|
|
476
|
-
if (!
|
|
477
|
-
const i =
|
|
478
|
-
if (!
|
|
479
|
-
const u = new
|
|
480
|
-
return
|
|
481
|
-
start:
|
|
482
|
-
end:
|
|
483
|
-
}) &&
|
|
474
|
+
const n = R(r).trim(), s = R(a).trim();
|
|
475
|
+
return Mt(t).find((o) => {
|
|
476
|
+
if (!P(o) || !o.dateFormat) return !1;
|
|
477
|
+
const i = O(n, o.dateFormat, /* @__PURE__ */ new Date()), l = O(s, o.dateFormat, /* @__PURE__ */ new Date());
|
|
478
|
+
if (!m(i) || !m(l)) return !1;
|
|
479
|
+
const u = new ot(), f = u.incrementYearIfNeeded(i), T = u.incrementYearIfNeeded(l), g = Be(T, f);
|
|
480
|
+
return Ue(new Date(f.getFullYear(), mt, pt), {
|
|
481
|
+
start: f,
|
|
482
|
+
end: T
|
|
483
|
+
}) && g === gt ? !0 : g === ft;
|
|
484
484
|
});
|
|
485
|
-
},
|
|
485
|
+
}, Oe = (e) => {
|
|
486
486
|
const t = {
|
|
487
|
-
date:
|
|
487
|
+
date: ke(e),
|
|
488
488
|
year: [["yyyy"]],
|
|
489
|
-
day_month:
|
|
489
|
+
day_month: Ae,
|
|
490
490
|
month_year: [["MMMM", "yyyy"], ["yyyy", "MMMM"]],
|
|
491
491
|
month: [["MMMM"]],
|
|
492
492
|
quarter: [["QQQ", "yyyy"], ["yyyy", "QQQ"]]
|
|
493
493
|
};
|
|
494
|
-
return [...
|
|
494
|
+
return [...dt, ...Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => Te.map((s) => ({
|
|
495
495
|
dateFormat: n.join(s),
|
|
496
496
|
type: r
|
|
497
497
|
}))))];
|
|
498
|
-
},
|
|
499
|
-
...
|
|
498
|
+
}, ke = (e) => ut[e] === "MDY" ? [
|
|
499
|
+
...Z,
|
|
500
500
|
...Q,
|
|
501
|
-
...
|
|
501
|
+
...ee
|
|
502
502
|
] : [
|
|
503
503
|
...Q,
|
|
504
|
-
...
|
|
505
|
-
...
|
|
506
|
-
],
|
|
504
|
+
...Z,
|
|
505
|
+
...ee
|
|
506
|
+
], Mt = (e) => {
|
|
507
507
|
const t = {
|
|
508
|
-
weekly_date_range:
|
|
509
|
-
weekly_date_range_with_year:
|
|
508
|
+
weekly_date_range: Ae,
|
|
509
|
+
weekly_date_range_with_year: ke(e)
|
|
510
510
|
};
|
|
511
|
-
return Object.entries(t).flatMap(([r, a]) => a.flatMap((n) =>
|
|
511
|
+
return Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => Te.map((s) => ({
|
|
512
512
|
dateFormat: n.join(s),
|
|
513
513
|
type: r
|
|
514
514
|
}))));
|
|
515
|
-
},
|
|
515
|
+
}, Et = (e) => {
|
|
516
516
|
const t = Number(e);
|
|
517
|
-
if (
|
|
518
|
-
const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (s) =>
|
|
517
|
+
if (!$e(t)) return !1;
|
|
518
|
+
const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (s) => m(s) && s.getFullYear() >= Fe && s.getFullYear() <= De;
|
|
519
519
|
return n(r) || n(a);
|
|
520
|
-
},
|
|
521
|
-
if (
|
|
520
|
+
}, _t = /\s*[–—]\s*|\s-\s/, Tt = (e, t, r) => {
|
|
521
|
+
if (C(e)) return null;
|
|
522
522
|
switch (t.type) {
|
|
523
523
|
case "decimal":
|
|
524
524
|
case "integer":
|
|
525
525
|
case "duration":
|
|
526
|
-
return
|
|
526
|
+
return we(e);
|
|
527
527
|
case "percentage":
|
|
528
|
-
return
|
|
528
|
+
return At(e);
|
|
529
529
|
case "currency":
|
|
530
|
-
return
|
|
530
|
+
return Ft(e);
|
|
531
531
|
case "datetime":
|
|
532
532
|
case "date":
|
|
533
533
|
case "year":
|
|
@@ -536,73 +536,73 @@ var G = (e) => e instanceof Date && f(e), Ir = (e) => G(e) || e === null, Vr = (
|
|
|
536
536
|
case "day_month":
|
|
537
537
|
case "quarter":
|
|
538
538
|
case "time":
|
|
539
|
-
return
|
|
539
|
+
return Se(e, t.dateFormat, r);
|
|
540
540
|
case "weekly_date_range":
|
|
541
541
|
case "weekly_date_range_with_year":
|
|
542
|
-
return
|
|
542
|
+
return Dt(e, t.dateFormat, r);
|
|
543
543
|
case "text":
|
|
544
|
-
return
|
|
544
|
+
return Lt(e);
|
|
545
545
|
case "lookup":
|
|
546
|
-
throw new
|
|
546
|
+
throw new _({ message: "Cannot parse: lookup value formats are produced by transforms, not raw input" });
|
|
547
547
|
default:
|
|
548
|
-
throw new
|
|
548
|
+
throw new _({ message: `Unhandled value format: ${t.type}` });
|
|
549
549
|
}
|
|
550
|
-
},
|
|
551
|
-
if (e instanceof Date) return
|
|
552
|
-
const a =
|
|
550
|
+
}, Se = (e, t, r) => {
|
|
551
|
+
if (e instanceof Date) return m(e) ? e : null;
|
|
552
|
+
const a = R(String(e).trim());
|
|
553
553
|
if (a.length === 0) return null;
|
|
554
554
|
const n = /* @__PURE__ */ new Date();
|
|
555
555
|
if (t) {
|
|
556
|
-
const o =
|
|
557
|
-
return
|
|
556
|
+
const o = O(a, t, n);
|
|
557
|
+
return m(o) ? Y(o) : null;
|
|
558
558
|
}
|
|
559
|
-
for (const o of
|
|
560
|
-
if (!
|
|
561
|
-
const i =
|
|
562
|
-
if (
|
|
559
|
+
for (const o of Oe(r)) {
|
|
560
|
+
if (!P(o) || !o.dateFormat) continue;
|
|
561
|
+
const i = O(a, o.dateFormat, n);
|
|
562
|
+
if (m(i)) return Y(i);
|
|
563
563
|
}
|
|
564
564
|
const s = new Date(a);
|
|
565
|
-
return
|
|
566
|
-
},
|
|
565
|
+
return Le(s) ? $(a) ? s : Y(s) : null;
|
|
566
|
+
}, we = (e) => {
|
|
567
567
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
568
568
|
if (typeof e != "string") return null;
|
|
569
569
|
let t = e.trim();
|
|
570
|
-
if (!
|
|
570
|
+
if (!D(t)) return null;
|
|
571
571
|
let r = 1;
|
|
572
|
-
for (const a of
|
|
573
|
-
r =
|
|
572
|
+
for (const a of X) if (new RegExp(`${a}$`, "i").test(t)) {
|
|
573
|
+
r = rt[a], t = t.slice(0, -1);
|
|
574
574
|
break;
|
|
575
575
|
}
|
|
576
576
|
return Number(t.split(",").join("")) * r;
|
|
577
|
-
},
|
|
577
|
+
}, At = (e) => {
|
|
578
578
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
579
579
|
if (typeof e != "string") return null;
|
|
580
580
|
const t = e.trim();
|
|
581
581
|
if (!pe(t)) return null;
|
|
582
582
|
const r = Number(t.replace(/%/g, "").replace(/,/g, "")) / 100;
|
|
583
583
|
return Number.isNaN(r) ? null : r;
|
|
584
|
-
},
|
|
584
|
+
}, Ft = (e) => {
|
|
585
585
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
586
586
|
if (typeof e != "string") return null;
|
|
587
587
|
const t = e.trim();
|
|
588
|
-
return
|
|
589
|
-
},
|
|
590
|
-
const a = String(e).trim().split(
|
|
591
|
-
return !n || !s ? null :
|
|
592
|
-
},
|
|
588
|
+
return he(t) ? we(ve(t)) : null;
|
|
589
|
+
}, Dt = (e, t, r) => {
|
|
590
|
+
const a = String(e).trim().split(_t), [n, s] = [a[0]?.trim(), a[1]?.trim()];
|
|
591
|
+
return !n || !s ? null : Se(n, t, r);
|
|
592
|
+
}, Lt = (e) => String(e).trim(), Y = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), Nt = /* @__PURE__ */ new Set([
|
|
593
593
|
"count",
|
|
594
594
|
"sum",
|
|
595
595
|
"mean",
|
|
596
596
|
"median"
|
|
597
597
|
]);
|
|
598
|
-
function
|
|
599
|
-
return
|
|
598
|
+
function Re(e, t) {
|
|
599
|
+
return Nt.has(e) ? "numeric" : t;
|
|
600
600
|
}
|
|
601
|
-
var
|
|
601
|
+
var Ot = "value", te = "\0__rowMaskIndex", w = {
|
|
602
602
|
numeric: { type: "decimal" },
|
|
603
603
|
categorical: { type: "text" },
|
|
604
604
|
temporal: { type: "datetime" }
|
|
605
|
-
},
|
|
605
|
+
}, kt = {
|
|
606
606
|
eq: (e, t) => e[t.__variableName] === t.__value,
|
|
607
607
|
neq: (e, t) => e[t.__variableName] !== t.__value,
|
|
608
608
|
gt: (e, t) => e[t.__variableName] > t.__value,
|
|
@@ -616,13 +616,13 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
616
616
|
gte: (e, t) => e !== null && t !== null && e >= t,
|
|
617
617
|
lt: (e, t) => e !== null && t !== null && e < t,
|
|
618
618
|
lte: (e, t) => e !== null && t !== null && e <= t
|
|
619
|
-
},
|
|
619
|
+
}, re = (e) => e === null ? null : e instanceof Date ? e.getTime() : new Date(e).getTime(), Ce = (e, t) => e === "count" ? { type: "integer" } : t, K = class v {
|
|
620
620
|
constructor(t = {}) {
|
|
621
621
|
const { table: r, variableMetadata: a } = this.parseVariableMap(t);
|
|
622
622
|
this.table = r, this.variableMetadata = a;
|
|
623
623
|
}
|
|
624
624
|
static fromTrusted(t, r) {
|
|
625
|
-
const a = Object.create(
|
|
625
|
+
const a = Object.create(v.prototype);
|
|
626
626
|
return a.table = t, a.variableMetadata = r, a;
|
|
627
627
|
}
|
|
628
628
|
size() {
|
|
@@ -641,8 +641,8 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
641
641
|
type: r,
|
|
642
642
|
valueFormat: this.resolveAddedVariableFormat(t, r, n)
|
|
643
643
|
}
|
|
644
|
-
}, o = this.normalizeRawValues(r, a), i = this.table.assign(
|
|
645
|
-
return
|
|
644
|
+
}, o = this.normalizeRawValues(r, a), i = this.table.assign(S({ [t]: o }));
|
|
645
|
+
return v.fromTrusted(i, s);
|
|
646
646
|
}
|
|
647
647
|
addConstantVariable(t, r, a, n) {
|
|
648
648
|
const s = {
|
|
@@ -652,8 +652,8 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
652
652
|
valueFormat: this.resolveAddedVariableFormat(t, r, n),
|
|
653
653
|
constant: { value: a }
|
|
654
654
|
}
|
|
655
|
-
}, [o] = this.normalizeRawValues(r, [a]), i = this.table.assign(
|
|
656
|
-
return
|
|
655
|
+
}, [o] = this.normalizeRawValues(r, [a]), i = this.table.assign(S({ [t]: Array(this.size()).fill(o) }));
|
|
656
|
+
return v.fromTrusted(i, s);
|
|
657
657
|
}
|
|
658
658
|
getConstant(t) {
|
|
659
659
|
return this.variableMetadata[t]?.constant;
|
|
@@ -664,25 +664,25 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
664
664
|
}
|
|
665
665
|
renameVariable(t, r) {
|
|
666
666
|
const a = this.variableMetadata[t];
|
|
667
|
-
if (!a) throw new
|
|
667
|
+
if (!a) throw new _({ message: `Variable ${t} not defined` });
|
|
668
668
|
const n = this.table.rename({ [t]: r }), { [t]: s, ...o } = this.variableMetadata, i = {
|
|
669
669
|
...o,
|
|
670
670
|
[r]: a
|
|
671
671
|
};
|
|
672
|
-
return
|
|
672
|
+
return v.fromTrusted(n, i);
|
|
673
673
|
}
|
|
674
674
|
selectVariables(...t) {
|
|
675
675
|
const r = this.table.select(...t), a = Object.fromEntries(Object.entries(this.variableMetadata).filter(([n]) => t.includes(n)));
|
|
676
|
-
return
|
|
676
|
+
return v.fromTrusted(r, a);
|
|
677
677
|
}
|
|
678
678
|
getType(t) {
|
|
679
679
|
const r = this.variableMetadata[t];
|
|
680
|
-
if (!r) throw new
|
|
680
|
+
if (!r) throw new _({ message: `Variable ${t} not defined` });
|
|
681
681
|
return r.type;
|
|
682
682
|
}
|
|
683
683
|
getValueFormat(t) {
|
|
684
684
|
const r = this.variableMetadata[t];
|
|
685
|
-
if (!r) throw new
|
|
685
|
+
if (!r) throw new _({ message: `Variable ${t} not defined` });
|
|
686
686
|
return r.valueFormat;
|
|
687
687
|
}
|
|
688
688
|
groupVariableNamesByType() {
|
|
@@ -695,31 +695,31 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
695
695
|
return t;
|
|
696
696
|
}
|
|
697
697
|
getValues(t, r) {
|
|
698
|
-
if (!this.hasVariable(t)) throw new
|
|
698
|
+
if (!this.hasVariable(t)) throw new _({ message: `Variable '${t}' not defined` });
|
|
699
699
|
const a = this.getType(t);
|
|
700
|
-
if (r?.type !== void 0 && a !== r.type) throw new
|
|
700
|
+
if (r?.type !== void 0 && a !== r.type) throw new _({ message: `Variable '${t}' has type '${a}', expected '${r.type}'` });
|
|
701
701
|
let n = this.table.array(t);
|
|
702
702
|
return r?.distinct && (n = this.getDistinctValues(a, n)), r?.skipNulls && (n = this.skipNulls(n)), n;
|
|
703
703
|
}
|
|
704
704
|
filter(t, r, a) {
|
|
705
705
|
if (this.hasVariable(t) && this.getType(t) === "temporal") return this.filterByTimestamp(t, r, a);
|
|
706
|
-
const n =
|
|
706
|
+
const n = kt[r], s = this.table.params({
|
|
707
707
|
__variableName: t,
|
|
708
708
|
__value: a
|
|
709
709
|
}).filter(n);
|
|
710
|
-
return
|
|
710
|
+
return v.fromTrusted(s, this.variableMetadata);
|
|
711
711
|
}
|
|
712
712
|
filterByMask(t) {
|
|
713
|
-
if (t.length !== this.size()) throw new
|
|
714
|
-
const r = Array.from({ length: t.length }, (n, s) => s), a = this.table.assign(
|
|
715
|
-
__indexColumnName:
|
|
713
|
+
if (t.length !== this.size()) throw new _({ message: `Row mask length ${t.length} does not match dataset size ${this.size()}` });
|
|
714
|
+
const r = Array.from({ length: t.length }, (n, s) => s), a = this.table.assign(S({ [te]: r })).params({
|
|
715
|
+
__indexColumnName: te,
|
|
716
716
|
__mask: t
|
|
717
717
|
}).filter((n, s) => s.__mask[n[s.__indexColumnName]] === 1).select(...this.table.columnNames());
|
|
718
|
-
return
|
|
718
|
+
return v.fromTrusted(a, this.variableMetadata);
|
|
719
719
|
}
|
|
720
720
|
orderBy(t, r = "asc") {
|
|
721
|
-
const a = this.table.orderby(r === "asc" ? t :
|
|
722
|
-
return
|
|
721
|
+
const a = this.table.orderby(r === "asc" ? t : ze(t));
|
|
722
|
+
return v.fromTrusted(a, this.variableMetadata);
|
|
723
723
|
}
|
|
724
724
|
getAt(t) {
|
|
725
725
|
return t < 0 || t >= this.size() ? null : this.table.object(t);
|
|
@@ -739,61 +739,61 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
739
739
|
}
|
|
740
740
|
groupBy(...t) {
|
|
741
741
|
const r = this.table.groupby(...t);
|
|
742
|
-
return new
|
|
742
|
+
return new wt(t, r, this.variableMetadata);
|
|
743
743
|
}
|
|
744
744
|
rollup(t) {
|
|
745
|
-
const r = this.table.rollup(Object.fromEntries(Object.entries(t).map(([n, s]) => [n,
|
|
745
|
+
const r = this.table.rollup(Object.fromEntries(Object.entries(t).map(([n, s]) => [n, se[s.aggregation](s.variableName)]))), a = {};
|
|
746
746
|
for (const [n, { variableName: s, aggregation: o }] of Object.entries(t)) {
|
|
747
|
-
const i = this.variableMetadata[s], l = i?.type ?? "numeric", u = i?.valueFormat ??
|
|
747
|
+
const i = this.variableMetadata[s], l = i?.type ?? "numeric", u = i?.valueFormat ?? w[l];
|
|
748
748
|
a[n] = {
|
|
749
|
-
type:
|
|
750
|
-
valueFormat:
|
|
749
|
+
type: Re(o, l),
|
|
750
|
+
valueFormat: Ce(o, u)
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
|
-
return
|
|
753
|
+
return v.fromTrusted(r, a);
|
|
754
754
|
}
|
|
755
|
-
reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n =
|
|
756
|
-
const { numeric: s, categorical: o, temporal: i } = this.groupVariableNamesByType(), l = t ?? [...o, ...i], u = r ?? s.filter((
|
|
757
|
-
if (l.includes(a) || l.includes(n)) throw new
|
|
755
|
+
reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n = Ot } = {}) {
|
|
756
|
+
const { numeric: s, categorical: o, temporal: i } = this.groupVariableNamesByType(), l = t ?? [...o, ...i], u = r ?? s.filter((g) => !l.includes(g));
|
|
757
|
+
if (l.includes(a) || l.includes(n)) throw new j({
|
|
758
758
|
code: "INVALID_DATA_SHAPE",
|
|
759
759
|
message: `The variables to keep includes the variables '${a}' or '${n}' to create the key and value variables`
|
|
760
760
|
});
|
|
761
761
|
if (u.length === 0) {
|
|
762
|
-
const
|
|
763
|
-
for (const
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
type:
|
|
762
|
+
const g = {};
|
|
763
|
+
for (const k of l) {
|
|
764
|
+
const z = this.variableMetadata[k];
|
|
765
|
+
z && (g[k] = {
|
|
766
|
+
type: z.type,
|
|
767
767
|
values: [],
|
|
768
|
-
valueFormat:
|
|
768
|
+
valueFormat: z.valueFormat
|
|
769
769
|
});
|
|
770
770
|
}
|
|
771
|
-
return
|
|
771
|
+
return g[a] = {
|
|
772
772
|
type: "categorical",
|
|
773
773
|
values: [],
|
|
774
774
|
valueFormat: { type: "text" }
|
|
775
|
-
},
|
|
775
|
+
}, g[n] = {
|
|
776
776
|
type: "numeric",
|
|
777
777
|
values: [],
|
|
778
778
|
valueFormat: { type: "decimal" }
|
|
779
|
-
}, new g
|
|
779
|
+
}, new v(g);
|
|
780
780
|
}
|
|
781
|
-
if (u.filter((
|
|
781
|
+
if (u.filter((g) => this.variableMetadata[g]?.type !== "numeric").length > 0) throw new j({
|
|
782
782
|
code: "INVALID_DATA_SHAPE",
|
|
783
783
|
message: "Only numeric variables can be reshaped"
|
|
784
784
|
});
|
|
785
|
-
const
|
|
786
|
-
for (const
|
|
787
|
-
const
|
|
788
|
-
|
|
785
|
+
const f = this.table.select([...l, ...u]).fold(u, { as: [a, n] }), T = {};
|
|
786
|
+
for (const g of l) {
|
|
787
|
+
const k = this.variableMetadata[g];
|
|
788
|
+
k && (T[g] = k);
|
|
789
789
|
}
|
|
790
|
-
return
|
|
790
|
+
return T[a] = {
|
|
791
791
|
type: "categorical",
|
|
792
792
|
valueFormat: { type: "text" }
|
|
793
|
-
},
|
|
793
|
+
}, T[n] = {
|
|
794
794
|
type: "numeric",
|
|
795
795
|
valueFormat: Rt(this.variableMetadata, u, a)
|
|
796
|
-
},
|
|
796
|
+
}, v.fromTrusted(f, T);
|
|
797
797
|
}
|
|
798
798
|
print() {
|
|
799
799
|
console.table(this.variableMetadata), this.table.print();
|
|
@@ -802,25 +802,25 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
802
802
|
return this.table[Symbol.iterator]();
|
|
803
803
|
}
|
|
804
804
|
filterByTimestamp(t, r, a) {
|
|
805
|
-
const n = St[r], s =
|
|
805
|
+
const n = St[r], s = re(a), o = this.getValues(t, { type: "temporal" }), i = new Uint8Array(o.length);
|
|
806
806
|
return o.forEach((l, u) => {
|
|
807
|
-
i[u] = n(
|
|
807
|
+
i[u] = n(re(l), s) ? 1 : 0;
|
|
808
808
|
}), this.filterByMask(i);
|
|
809
809
|
}
|
|
810
810
|
resolveAddedVariableFormat(t, r, a) {
|
|
811
811
|
if (a !== void 0) return a;
|
|
812
812
|
const n = this.variableMetadata[t];
|
|
813
|
-
return n ? n.valueFormat :
|
|
813
|
+
return n ? n.valueFormat : w[r];
|
|
814
814
|
}
|
|
815
815
|
parseVariableMap(t) {
|
|
816
816
|
const r = {}, a = {};
|
|
817
817
|
for (const [n, { type: s, values: o, valueFormat: i }] of Object.entries(t))
|
|
818
818
|
r[n] = o, a[n] = {
|
|
819
819
|
type: s,
|
|
820
|
-
valueFormat: i ??
|
|
820
|
+
valueFormat: i ?? w[s]
|
|
821
821
|
};
|
|
822
822
|
return {
|
|
823
|
-
table:
|
|
823
|
+
table: S(r),
|
|
824
824
|
variableMetadata: a
|
|
825
825
|
};
|
|
826
826
|
}
|
|
@@ -831,9 +831,9 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
831
831
|
case "categorical":
|
|
832
832
|
return r.map((a) => typeof a != "string" ? null : a);
|
|
833
833
|
case "temporal":
|
|
834
|
-
return r.map((a) => !(a instanceof Date) || !
|
|
834
|
+
return r.map((a) => !(a instanceof Date) || !m(a) ? null : a);
|
|
835
835
|
default:
|
|
836
|
-
throw new
|
|
836
|
+
throw new _({ message: `Cannot normalize raw value of unknown type: ${t}` });
|
|
837
837
|
}
|
|
838
838
|
}
|
|
839
839
|
skipNulls(t) {
|
|
@@ -847,7 +847,7 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
847
847
|
}
|
|
848
848
|
return s;
|
|
849
849
|
}
|
|
850
|
-
},
|
|
850
|
+
}, wt = class {
|
|
851
851
|
constructor(e, t, r) {
|
|
852
852
|
this.groupedBy = e, this.grouped = t, this.variableMetadata = r;
|
|
853
853
|
}
|
|
@@ -857,46 +857,46 @@ var Nt = "value", ee = "\0__rowMaskIndex", R = {
|
|
|
857
857
|
for (const s of t) {
|
|
858
858
|
const o = s[0];
|
|
859
859
|
if (o === void 0) continue;
|
|
860
|
-
const i = this.getStableKey(a, o), l =
|
|
861
|
-
const
|
|
862
|
-
return [u, s.map((
|
|
860
|
+
const i = this.getStableKey(a, o), l = S(Object.fromEntries(r.map((u) => {
|
|
861
|
+
const f = this.grouped.column(u);
|
|
862
|
+
return [u, s.map((T) => f?.get(T))];
|
|
863
863
|
})));
|
|
864
864
|
e(K.fromTrusted(l, this.variableMetadata), i, n++);
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
867
|
rollup(e) {
|
|
868
|
-
const t = this.grouped.rollup(Object.fromEntries(Object.entries(e).map(([a, n]) => [a,
|
|
868
|
+
const t = this.grouped.rollup(Object.fromEntries(Object.entries(e).map(([a, n]) => [a, se[n.aggregation](n.variableName)]))), r = Object.fromEntries(this.groupedBy.map((a) => {
|
|
869
869
|
const n = this.variableMetadata[a], s = n?.type ?? "categorical";
|
|
870
870
|
return [a, {
|
|
871
871
|
type: s,
|
|
872
|
-
valueFormat: n?.valueFormat ??
|
|
872
|
+
valueFormat: n?.valueFormat ?? w[s]
|
|
873
873
|
}];
|
|
874
874
|
}));
|
|
875
875
|
for (const [a, { variableName: n, aggregation: s }] of Object.entries(e)) {
|
|
876
|
-
const o = this.variableMetadata[n], i = o?.type ?? "numeric", l = o?.valueFormat ??
|
|
876
|
+
const o = this.variableMetadata[n], i = o?.type ?? "numeric", l = o?.valueFormat ?? w[i];
|
|
877
877
|
r[a] = {
|
|
878
|
-
type:
|
|
879
|
-
valueFormat:
|
|
878
|
+
type: Re(s, i),
|
|
879
|
+
valueFormat: Ce(s, l)
|
|
880
880
|
};
|
|
881
881
|
}
|
|
882
882
|
return K.fromTrusted(t, r);
|
|
883
883
|
}
|
|
884
884
|
getStableKey(e, t) {
|
|
885
|
-
return
|
|
885
|
+
return de(e.map((r) => r.get(t)));
|
|
886
886
|
}
|
|
887
887
|
};
|
|
888
888
|
function Rt(e, t, r) {
|
|
889
889
|
const a = t.map((i) => e[i]?.valueFormat ?? { type: "decimal" }), [n, ...s] = a;
|
|
890
890
|
if (!n) return { type: "decimal" };
|
|
891
|
-
for (const i of a) if (i.type === "lookup") throw new
|
|
891
|
+
for (const i of a) if (i.type === "lookup") throw new j({
|
|
892
892
|
code: "INVALID_DATA_SHAPE",
|
|
893
893
|
message: "Cannot reshape: a source column has a lookup format and lookups cannot nest"
|
|
894
894
|
});
|
|
895
|
-
if (s.every((i) =>
|
|
895
|
+
if (s.every((i) => Pe(i, n)) || n.type === "lookup") return n;
|
|
896
896
|
const o = {};
|
|
897
897
|
for (const [i, l] of t.entries()) {
|
|
898
|
-
const u =
|
|
899
|
-
|
|
898
|
+
const u = de([l]), f = a[i];
|
|
899
|
+
f && f.type !== "lookup" && (o[u] = f);
|
|
900
900
|
}
|
|
901
901
|
return {
|
|
902
902
|
type: "lookup",
|
|
@@ -905,7 +905,7 @@ function Rt(e, t, r) {
|
|
|
905
905
|
fallback: n
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
|
-
var
|
|
908
|
+
var Ct = class {
|
|
909
909
|
constructor(e) {
|
|
910
910
|
this.label = e, this.items = /* @__PURE__ */ new Map();
|
|
911
911
|
}
|
|
@@ -915,7 +915,7 @@ var kt = class {
|
|
|
915
915
|
get(e) {
|
|
916
916
|
if (!this.items.has(e)) {
|
|
917
917
|
const t = [...this.items.keys()].map((r) => `'${r}'`).join(", ");
|
|
918
|
-
throw new
|
|
918
|
+
throw new j({
|
|
919
919
|
code: "UNKNOWN_REGISTERED_TYPE",
|
|
920
920
|
message: `Unknown ${this.label}: '${e}' (available: ${t})`,
|
|
921
921
|
context: {
|
|
@@ -934,62 +934,62 @@ var kt = class {
|
|
|
934
934
|
has(e) {
|
|
935
935
|
return this.items.has(e);
|
|
936
936
|
}
|
|
937
|
-
},
|
|
937
|
+
}, It = (e, t) => {
|
|
938
938
|
const r = typeof e == "string" ? e.trim() : e;
|
|
939
|
-
if (
|
|
939
|
+
if (D(r)) return { type: "decimal" };
|
|
940
940
|
const a = typeof r == "string" && Ne(r, t);
|
|
941
941
|
if (a) return a;
|
|
942
|
-
const n = typeof r == "string" &&
|
|
943
|
-
return n || (
|
|
942
|
+
const n = typeof r == "string" && vt(r, t);
|
|
943
|
+
return n || (Le(e) ? { type: "date" } : pe(e) ? { type: "percentage" } : he(e) && typeof e == "string" ? {
|
|
944
944
|
type: "currency",
|
|
945
|
-
iso:
|
|
945
|
+
iso: st(e)
|
|
946
946
|
} : { type: "text" });
|
|
947
|
-
},
|
|
947
|
+
}, xt = {
|
|
948
948
|
type: "year",
|
|
949
949
|
dateFormat: "yyyy"
|
|
950
|
-
},
|
|
951
|
-
const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a =
|
|
950
|
+
}, Vt = (e) => {
|
|
951
|
+
const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a = Ut(e), n = Bt(e);
|
|
952
952
|
for (const [s, o] of e.columns.entries()) {
|
|
953
953
|
if (o._metadata?.isHidden) continue;
|
|
954
954
|
const i = a.get(o.key);
|
|
955
|
-
if (
|
|
956
|
-
const l = s === n ?
|
|
957
|
-
r[o.key] =
|
|
955
|
+
if (C(i)) continue;
|
|
956
|
+
const l = s === n ? xt : It(i, t), u = me(l);
|
|
957
|
+
r[o.key] = jt(o.key, e.rows, l, u, t);
|
|
958
958
|
}
|
|
959
959
|
return new K(r);
|
|
960
|
-
},
|
|
960
|
+
}, Zr = class extends Ze {
|
|
961
961
|
dependencies(e) {
|
|
962
962
|
return [e];
|
|
963
963
|
}
|
|
964
964
|
run(e) {
|
|
965
|
-
return
|
|
965
|
+
return Vt(e);
|
|
966
966
|
}
|
|
967
|
-
},
|
|
968
|
-
const t =
|
|
967
|
+
}, Bt = (e) => {
|
|
968
|
+
const t = Pt(e.rows, 5);
|
|
969
969
|
return e.columns.findIndex((r) => {
|
|
970
|
-
const a = t.map((n) => n[r.key]).filter((n) => !
|
|
971
|
-
return a.length >= 2 && a.every(
|
|
970
|
+
const a = t.map((n) => n[r.key]).filter((n) => !C(n));
|
|
971
|
+
return a.length >= 2 && a.every(ht);
|
|
972
972
|
});
|
|
973
|
-
},
|
|
973
|
+
}, jt = (e, t, r, a, n) => ({
|
|
974
974
|
type: a,
|
|
975
|
-
values: t.reduce((s, o) => (
|
|
975
|
+
values: t.reduce((s, o) => (Ee(o) || s.push(Tt(o[e], r, n)), s), []),
|
|
976
976
|
valueFormat: r
|
|
977
|
-
}),
|
|
977
|
+
}), Ut = (e) => {
|
|
978
978
|
const t = /* @__PURE__ */ new Map(), r = new Set(e.columns.map((a) => a.key));
|
|
979
979
|
for (const a of e.rows) {
|
|
980
980
|
for (const n of r) {
|
|
981
981
|
const s = a[n];
|
|
982
|
-
|
|
982
|
+
C(s) || (t.set(n, s), r.delete(n));
|
|
983
983
|
}
|
|
984
984
|
if (r.size === 0) break;
|
|
985
985
|
}
|
|
986
986
|
return t;
|
|
987
|
-
},
|
|
987
|
+
}, Pt = (e, t) => {
|
|
988
988
|
const r = [];
|
|
989
989
|
for (const a of e)
|
|
990
|
-
if (
|
|
990
|
+
if (Ee(a) || r.push(a), r.length === t) return r;
|
|
991
991
|
return r;
|
|
992
|
-
},
|
|
992
|
+
}, $t = class {
|
|
993
993
|
constructor() {
|
|
994
994
|
this.transformType = "aggregate";
|
|
995
995
|
}
|
|
@@ -1001,7 +1001,7 @@ var kt = class {
|
|
|
1001
1001
|
};
|
|
1002
1002
|
return e.groupBy(...r.groupby).rollup(a);
|
|
1003
1003
|
}
|
|
1004
|
-
},
|
|
1004
|
+
}, zt = class {
|
|
1005
1005
|
constructor() {
|
|
1006
1006
|
this.transformType = "constant";
|
|
1007
1007
|
}
|
|
@@ -1013,7 +1013,7 @@ var kt = class {
|
|
|
1013
1013
|
const { options: t } = e;
|
|
1014
1014
|
return [t.variableName];
|
|
1015
1015
|
}
|
|
1016
|
-
},
|
|
1016
|
+
}, Yt = class {
|
|
1017
1017
|
constructor() {
|
|
1018
1018
|
this.transformType = "filter";
|
|
1019
1019
|
}
|
|
@@ -1021,7 +1021,7 @@ var kt = class {
|
|
|
1021
1021
|
const { options: r } = t;
|
|
1022
1022
|
return e.filter(r.variableName, r.operator, r.value);
|
|
1023
1023
|
}
|
|
1024
|
-
},
|
|
1024
|
+
}, Wt = class {
|
|
1025
1025
|
constructor() {
|
|
1026
1026
|
this.transformType = "reshape";
|
|
1027
1027
|
}
|
|
@@ -1038,7 +1038,7 @@ var kt = class {
|
|
|
1038
1038
|
const { options: t } = e;
|
|
1039
1039
|
return [t.keyName ?? "key"];
|
|
1040
1040
|
}
|
|
1041
|
-
},
|
|
1041
|
+
}, Gt = class {
|
|
1042
1042
|
constructor() {
|
|
1043
1043
|
this.transformType = "sort";
|
|
1044
1044
|
}
|
|
@@ -1046,18 +1046,18 @@ var kt = class {
|
|
|
1046
1046
|
const { options: r } = t;
|
|
1047
1047
|
return e.orderBy(r.variableName, r.direction ?? "asc");
|
|
1048
1048
|
}
|
|
1049
|
-
},
|
|
1050
|
-
new Ut(),
|
|
1051
|
-
new Pt(),
|
|
1049
|
+
}, Ht = [
|
|
1052
1050
|
new $t(),
|
|
1051
|
+
new zt(),
|
|
1053
1052
|
new Yt(),
|
|
1054
|
-
new
|
|
1055
|
-
|
|
1053
|
+
new Wt(),
|
|
1054
|
+
new Gt()
|
|
1055
|
+
], ea = class extends Ct {
|
|
1056
1056
|
constructor() {
|
|
1057
1057
|
super("transform");
|
|
1058
|
-
for (const e of
|
|
1058
|
+
for (const e of Ht) this.register(e.transformType, e);
|
|
1059
1059
|
}
|
|
1060
|
-
},
|
|
1060
|
+
}, ta = [
|
|
1061
1061
|
"grey",
|
|
1062
1062
|
"red",
|
|
1063
1063
|
"orange",
|
|
@@ -1067,7 +1067,7 @@ var kt = class {
|
|
|
1067
1067
|
"blue",
|
|
1068
1068
|
"purple",
|
|
1069
1069
|
"pink"
|
|
1070
|
-
],
|
|
1070
|
+
], ra = [
|
|
1071
1071
|
"cyan",
|
|
1072
1072
|
"pink",
|
|
1073
1073
|
"purple",
|
|
@@ -1076,7 +1076,7 @@ var kt = class {
|
|
|
1076
1076
|
"yellow",
|
|
1077
1077
|
"green",
|
|
1078
1078
|
"blue"
|
|
1079
|
-
],
|
|
1079
|
+
], Ie = [
|
|
1080
1080
|
"#B399FE",
|
|
1081
1081
|
"#FC7E91",
|
|
1082
1082
|
"#33B6E0",
|
|
@@ -1089,7 +1089,7 @@ var kt = class {
|
|
|
1089
1089
|
"#58C8D8",
|
|
1090
1090
|
"#F35074",
|
|
1091
1091
|
"#6EA0DA"
|
|
1092
|
-
],
|
|
1092
|
+
], M = {
|
|
1093
1093
|
red: "#E83562",
|
|
1094
1094
|
orange: "#F38650",
|
|
1095
1095
|
yellow: "#FBBC30",
|
|
@@ -1100,18 +1100,18 @@ var kt = class {
|
|
|
1100
1100
|
dark_purple: "#6D48D2",
|
|
1101
1101
|
plum: "#C82184",
|
|
1102
1102
|
pink: "#FC8497"
|
|
1103
|
-
},
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
],
|
|
1103
|
+
}, aa = [M.purple, M.dark_purple], Kt = [
|
|
1104
|
+
M.purple,
|
|
1105
|
+
M.pink,
|
|
1106
|
+
M.yellow,
|
|
1107
|
+
M.blue,
|
|
1108
|
+
M.red,
|
|
1109
|
+
M.cyan,
|
|
1110
|
+
M.orange,
|
|
1111
|
+
M.plum,
|
|
1112
|
+
M.green,
|
|
1113
|
+
M.dark_purple
|
|
1114
|
+
], E = {
|
|
1115
1115
|
green: "#B2DDC9",
|
|
1116
1116
|
cyan: "#A2D5E2",
|
|
1117
1117
|
blue: "#AAC4FF",
|
|
@@ -1121,17 +1121,17 @@ var kt = class {
|
|
|
1121
1121
|
red: "#FFADAD",
|
|
1122
1122
|
orange: "#FFDEB4",
|
|
1123
1123
|
yellow: "#FDF7C3"
|
|
1124
|
-
},
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
],
|
|
1124
|
+
}, qt = [
|
|
1125
|
+
E.green,
|
|
1126
|
+
E.purple,
|
|
1127
|
+
E.red,
|
|
1128
|
+
E.cyan,
|
|
1129
|
+
E.pink,
|
|
1130
|
+
E.blue,
|
|
1131
|
+
E.orange,
|
|
1132
|
+
E.plum,
|
|
1133
|
+
E.yellow
|
|
1134
|
+
], q = {
|
|
1135
1135
|
grey900: "#1c1917",
|
|
1136
1136
|
grey800: "#292524",
|
|
1137
1137
|
grey700: "#44403c",
|
|
@@ -1222,12 +1222,12 @@ var kt = class {
|
|
|
1222
1222
|
pink200: "#FED0F3",
|
|
1223
1223
|
pink100: "#FFE8F9",
|
|
1224
1224
|
pink50: "#FFF4FC"
|
|
1225
|
-
},
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
],
|
|
1225
|
+
}, Xt = [
|
|
1226
|
+
q.grey200,
|
|
1227
|
+
E.green,
|
|
1228
|
+
E.red,
|
|
1229
|
+
q.grey200
|
|
1230
|
+
], ae = {
|
|
1231
1231
|
dark: {
|
|
1232
1232
|
1: [500],
|
|
1233
1233
|
2: [600, 400],
|
|
@@ -1326,7 +1326,7 @@ var kt = class {
|
|
|
1326
1326
|
200
|
|
1327
1327
|
]
|
|
1328
1328
|
}
|
|
1329
|
-
},
|
|
1329
|
+
}, b = {
|
|
1330
1330
|
cyan: "#22D3EE",
|
|
1331
1331
|
pink: "#F377EF",
|
|
1332
1332
|
purple: "#6528F7",
|
|
@@ -1335,31 +1335,31 @@ var kt = class {
|
|
|
1335
1335
|
yellow: "#FBFF00",
|
|
1336
1336
|
green: "#06FF00",
|
|
1337
1337
|
blue: "#0079FF"
|
|
1338
|
-
},
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
],
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1338
|
+
}, x = [
|
|
1339
|
+
b.cyan,
|
|
1340
|
+
b.pink,
|
|
1341
|
+
b.purple,
|
|
1342
|
+
b.red,
|
|
1343
|
+
b.orange,
|
|
1344
|
+
b.yellow,
|
|
1345
|
+
b.green,
|
|
1346
|
+
b.blue
|
|
1347
|
+
], Jt = [
|
|
1348
|
+
b.cyan,
|
|
1349
|
+
b.green,
|
|
1350
|
+
b.red,
|
|
1351
|
+
b.cyan
|
|
1352
1352
|
], V = {
|
|
1353
1353
|
start: "#84D1FC",
|
|
1354
1354
|
positive: "#84FC89",
|
|
1355
1355
|
negative: "#FC8497",
|
|
1356
1356
|
total: "#84D1FC"
|
|
1357
|
-
},
|
|
1357
|
+
}, Qt = [
|
|
1358
1358
|
V.start,
|
|
1359
1359
|
V.positive,
|
|
1360
1360
|
V.negative,
|
|
1361
1361
|
V.total
|
|
1362
|
-
],
|
|
1362
|
+
], na = {
|
|
1363
1363
|
transform: "linear",
|
|
1364
1364
|
reverse: !1,
|
|
1365
1365
|
nice: !0,
|
|
@@ -1371,45 +1371,45 @@ var kt = class {
|
|
|
1371
1371
|
interpolate: "lab",
|
|
1372
1372
|
domainMid: null,
|
|
1373
1373
|
symmetric: !1
|
|
1374
|
-
},
|
|
1374
|
+
}, sa = {
|
|
1375
1375
|
size: [4, 20],
|
|
1376
1376
|
alpha: [0.1, 1],
|
|
1377
1377
|
strokeWidth: [1, 4]
|
|
1378
|
-
},
|
|
1378
|
+
}, oa = {
|
|
1379
1379
|
domainMin: null,
|
|
1380
1380
|
domainMax: null,
|
|
1381
1381
|
nice: !1,
|
|
1382
1382
|
reverse: !1
|
|
1383
|
-
},
|
|
1383
|
+
}, ia = {
|
|
1384
1384
|
range: null,
|
|
1385
1385
|
domain: null,
|
|
1386
1386
|
padding: 0.1,
|
|
1387
1387
|
reverse: !1
|
|
1388
|
-
},
|
|
1389
|
-
function
|
|
1390
|
-
return ((r !== void 0 ?
|
|
1388
|
+
}, ne = { palette: { type: "default" } };
|
|
1389
|
+
function Zt(e, t = "light", r) {
|
|
1390
|
+
return ((r !== void 0 ? ae[t][r] : void 0) ?? ae[t].default).map((a) => q[`${e}${a}`]);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1393
|
-
const t =
|
|
1394
|
-
return t <= 0 ?
|
|
1392
|
+
function er(e) {
|
|
1393
|
+
const t = x.indexOf(b[e]);
|
|
1394
|
+
return t <= 0 ? x : [...x.slice(t), ...x.slice(0, t)];
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function la(e, t) {
|
|
1397
1397
|
switch (e.type) {
|
|
1398
1398
|
case "default":
|
|
1399
|
-
return
|
|
1399
|
+
return Ie;
|
|
1400
1400
|
case "graphy":
|
|
1401
|
-
return e.variant === "waterfall" ?
|
|
1401
|
+
return e.variant === "waterfall" ? Qt : Kt;
|
|
1402
1402
|
case "pastel":
|
|
1403
|
-
return e.variant === "waterfall" ?
|
|
1403
|
+
return e.variant === "waterfall" ? Xt : qt;
|
|
1404
1404
|
case "neon":
|
|
1405
|
-
return e.variant === "waterfall" ?
|
|
1405
|
+
return e.variant === "waterfall" ? Jt : er(e.base);
|
|
1406
1406
|
case "mono":
|
|
1407
|
-
return
|
|
1407
|
+
return Zt(e.base, e.variant ?? "light", t);
|
|
1408
1408
|
case "custom":
|
|
1409
1409
|
return e.colors;
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function ca(e, t) {
|
|
1413
1413
|
if (!t) return e;
|
|
1414
1414
|
const r = [...e];
|
|
1415
1415
|
for (const [a, n] of Object.entries(t)) {
|
|
@@ -1420,7 +1420,7 @@ function aa(e, t) {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
return r;
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function ua(e, t, r, a) {
|
|
1424
1424
|
if (!t) return;
|
|
1425
1425
|
const n = r?.type === "custom" ? a[r.id] : void 0, s = {};
|
|
1426
1426
|
for (const [o, i] of Object.entries(t)) {
|
|
@@ -1431,13 +1431,13 @@ function na(e, t, r, a) {
|
|
|
1431
1431
|
continue;
|
|
1432
1432
|
}
|
|
1433
1433
|
if (i.id !== void 0) {
|
|
1434
|
-
const u = n?.find((
|
|
1434
|
+
const u = n?.find((f) => f.id === i.id)?.hex;
|
|
1435
1435
|
u !== void 0 ? s[l] = u : e.diagnostics.addWarning({
|
|
1436
1436
|
code: "PALETTE_NOT_FOUND",
|
|
1437
1437
|
message: `Palette override at slot ${l} with id '${i.id}' did not resolve against the active palette — falling back to palette color.`,
|
|
1438
1438
|
context: {
|
|
1439
1439
|
requested: i.id,
|
|
1440
|
-
available: n?.map((
|
|
1440
|
+
available: n?.map((f) => f.id) ?? []
|
|
1441
1441
|
},
|
|
1442
1442
|
suggestion: "Define the override id in the active custom palette, or use a hex value instead."
|
|
1443
1443
|
});
|
|
@@ -1446,8 +1446,8 @@ function na(e, t, r, a) {
|
|
|
1446
1446
|
}
|
|
1447
1447
|
return Object.keys(s).length > 0 ? s : void 0;
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1450
|
-
if (!t) return
|
|
1449
|
+
function da(e, t, r) {
|
|
1450
|
+
if (!t) return ne.palette;
|
|
1451
1451
|
if (t.type === "custom") {
|
|
1452
1452
|
const a = r[t.id];
|
|
1453
1453
|
if (!a)
|
|
@@ -1459,7 +1459,7 @@ function sa(e, t, r) {
|
|
|
1459
1459
|
available: Object.keys(r)
|
|
1460
1460
|
},
|
|
1461
1461
|
suggestion: "Register the palette in customPalettes, or reference an existing palette id."
|
|
1462
|
-
}),
|
|
1462
|
+
}), ne.palette;
|
|
1463
1463
|
const n = a.map((s) => s.hex);
|
|
1464
1464
|
return {
|
|
1465
1465
|
type: "custom",
|
|
@@ -1469,7 +1469,7 @@ function sa(e, t, r) {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
return t;
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function p(e, t = {}) {
|
|
1473
1473
|
const r = t;
|
|
1474
1474
|
return {
|
|
1475
1475
|
type: "scale",
|
|
@@ -1489,7 +1489,7 @@ function m(e, t = {}) {
|
|
|
1489
1489
|
symmetric: r.symmetric
|
|
1490
1490
|
};
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function W(e, t = {}) {
|
|
1493
1493
|
return {
|
|
1494
1494
|
type: "scale",
|
|
1495
1495
|
scaledAesthetic: e,
|
|
@@ -1501,7 +1501,7 @@ function z(e, t = {}) {
|
|
|
1501
1501
|
clamp: t.clamp
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function A(e, t = {}) {
|
|
1505
1505
|
return {
|
|
1506
1506
|
type: "scale",
|
|
1507
1507
|
scaledAesthetic: e,
|
|
@@ -1512,14 +1512,14 @@ function _(e, t = {}) {
|
|
|
1512
1512
|
reverse: t.reverse
|
|
1513
1513
|
};
|
|
1514
1514
|
}
|
|
1515
|
-
function
|
|
1515
|
+
function B(e, t = {}) {
|
|
1516
1516
|
return {
|
|
1517
1517
|
type: "scale",
|
|
1518
1518
|
scaledAesthetic: e,
|
|
1519
1519
|
scaleType: "identity"
|
|
1520
1520
|
};
|
|
1521
1521
|
}
|
|
1522
|
-
function
|
|
1522
|
+
function G(e, t) {
|
|
1523
1523
|
return {
|
|
1524
1524
|
type: "scale",
|
|
1525
1525
|
scaledAesthetic: e,
|
|
@@ -1527,7 +1527,7 @@ function W(e, t) {
|
|
|
1527
1527
|
options: t
|
|
1528
1528
|
};
|
|
1529
1529
|
}
|
|
1530
|
-
function
|
|
1530
|
+
function tr(e, t = {}) {
|
|
1531
1531
|
return {
|
|
1532
1532
|
type: "scale",
|
|
1533
1533
|
scaledAesthetic: e,
|
|
@@ -1536,7 +1536,7 @@ function Zt(e, t = {}) {
|
|
|
1536
1536
|
overrides: t.overrides
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
|
-
var
|
|
1539
|
+
var rr = [
|
|
1540
1540
|
"none",
|
|
1541
1541
|
"xs",
|
|
1542
1542
|
"sm",
|
|
@@ -1544,14 +1544,14 @@ var er = [
|
|
|
1544
1544
|
"lg",
|
|
1545
1545
|
"xl",
|
|
1546
1546
|
"full"
|
|
1547
|
-
],
|
|
1548
|
-
point:
|
|
1549
|
-
line:
|
|
1550
|
-
area:
|
|
1551
|
-
bar:
|
|
1552
|
-
rule:
|
|
1553
|
-
},
|
|
1554
|
-
function
|
|
1547
|
+
], ya = {
|
|
1548
|
+
point: ar,
|
|
1549
|
+
line: nr,
|
|
1550
|
+
area: sr,
|
|
1551
|
+
bar: or,
|
|
1552
|
+
rule: ir
|
|
1553
|
+
}, fa = (e) => typeof e == "string" && rr.includes(e);
|
|
1554
|
+
function I(e, t) {
|
|
1555
1555
|
return {
|
|
1556
1556
|
type: "layer",
|
|
1557
1557
|
id: t.id,
|
|
@@ -1566,32 +1566,41 @@ function C(e, t) {
|
|
|
1566
1566
|
dataLabels: t.dataLabels
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
1569
|
-
function tr(e = {}) {
|
|
1570
|
-
return C("point", e);
|
|
1571
|
-
}
|
|
1572
|
-
function rr(e = {}) {
|
|
1573
|
-
return C("line", e);
|
|
1574
|
-
}
|
|
1575
1569
|
function ar(e = {}) {
|
|
1576
|
-
return
|
|
1570
|
+
return I("point", e);
|
|
1577
1571
|
}
|
|
1578
1572
|
function nr(e = {}) {
|
|
1579
|
-
return
|
|
1573
|
+
return I("line", e);
|
|
1580
1574
|
}
|
|
1581
1575
|
function sr(e = {}) {
|
|
1582
|
-
return
|
|
1576
|
+
return I("area", e);
|
|
1577
|
+
}
|
|
1578
|
+
function or(e = {}) {
|
|
1579
|
+
return I("bar", e);
|
|
1580
|
+
}
|
|
1581
|
+
function ir(e = {}) {
|
|
1582
|
+
return I("rule", e);
|
|
1583
1583
|
}
|
|
1584
|
-
var
|
|
1585
|
-
|
|
1584
|
+
var ga = [
|
|
1585
|
+
"observation",
|
|
1586
|
+
"category",
|
|
1587
|
+
"aggregate"
|
|
1588
|
+
], ma = ["inside", "outside"], pa = [
|
|
1589
|
+
"top",
|
|
1590
|
+
"right",
|
|
1591
|
+
"bottom",
|
|
1592
|
+
"left"
|
|
1593
|
+
], ba = ["dimmed", "hovered"], ha = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", va = (e) => typeof e == "object" && e !== null && typeof e.token == "string";
|
|
1594
|
+
function Ma(e) {
|
|
1586
1595
|
return {
|
|
1587
1596
|
type: "styles",
|
|
1588
1597
|
...e
|
|
1589
1598
|
};
|
|
1590
1599
|
}
|
|
1591
|
-
function
|
|
1600
|
+
function h(e) {
|
|
1592
1601
|
return { token: e };
|
|
1593
1602
|
}
|
|
1594
|
-
var
|
|
1603
|
+
var L = (e) => {
|
|
1595
1604
|
const t = {
|
|
1596
1605
|
...e?.where === void 0 ? {} : { where: e.where },
|
|
1597
1606
|
...e?.state === void 0 ? {} : { state: e.state }
|
|
@@ -1600,110 +1609,407 @@ var A = (e) => {
|
|
|
1600
1609
|
...e?.id === void 0 ? {} : { id: e.id },
|
|
1601
1610
|
...Object.keys(t).length === 0 ? {} : { when: t }
|
|
1602
1611
|
};
|
|
1603
|
-
}, F = (e) => e?.layer === void 0 ? {} : { layer: e.layer },
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
target: "geom",
|
|
1607
|
-
...F(t)
|
|
1608
|
-
},
|
|
1609
|
-
declarations: e
|
|
1610
|
-
}), {
|
|
1611
|
-
bar: (e, t) => ({
|
|
1612
|
-
...A(t),
|
|
1612
|
+
}, F = (e) => e?.layer === void 0 ? {} : { layer: e.layer }, c = (e) => e?.id === void 0 ? {} : { id: e.id }, d = {
|
|
1613
|
+
geom: Object.assign((e, t) => ({
|
|
1614
|
+
...L(t),
|
|
1613
1615
|
select: {
|
|
1614
1616
|
target: "geom",
|
|
1615
|
-
kind: "bar",
|
|
1616
1617
|
...F(t)
|
|
1617
1618
|
},
|
|
1618
1619
|
declarations: e
|
|
1620
|
+
}), {
|
|
1621
|
+
bar: (e, t) => ({
|
|
1622
|
+
...L(t),
|
|
1623
|
+
select: {
|
|
1624
|
+
target: "geom",
|
|
1625
|
+
kind: "bar",
|
|
1626
|
+
...F(t)
|
|
1627
|
+
},
|
|
1628
|
+
declarations: e
|
|
1629
|
+
}),
|
|
1630
|
+
line: (e, t) => ({
|
|
1631
|
+
...L(t),
|
|
1632
|
+
select: {
|
|
1633
|
+
target: "geom",
|
|
1634
|
+
kind: "line",
|
|
1635
|
+
...F(t)
|
|
1636
|
+
},
|
|
1637
|
+
declarations: e
|
|
1638
|
+
}),
|
|
1639
|
+
area: (e, t) => ({
|
|
1640
|
+
...L(t),
|
|
1641
|
+
select: {
|
|
1642
|
+
target: "geom",
|
|
1643
|
+
kind: "area",
|
|
1644
|
+
...F(t)
|
|
1645
|
+
},
|
|
1646
|
+
declarations: e
|
|
1647
|
+
}),
|
|
1648
|
+
point: (e, t) => ({
|
|
1649
|
+
...L(t),
|
|
1650
|
+
select: {
|
|
1651
|
+
target: "geom",
|
|
1652
|
+
kind: "point",
|
|
1653
|
+
...F(t)
|
|
1654
|
+
},
|
|
1655
|
+
declarations: e
|
|
1656
|
+
}),
|
|
1657
|
+
rule: Object.assign((e, t) => ({
|
|
1658
|
+
...L(t),
|
|
1659
|
+
select: {
|
|
1660
|
+
target: "geom",
|
|
1661
|
+
kind: "rule",
|
|
1662
|
+
...F(t)
|
|
1663
|
+
},
|
|
1664
|
+
declarations: e
|
|
1665
|
+
}), { label: (e, t) => ({
|
|
1666
|
+
...c(t),
|
|
1667
|
+
select: {
|
|
1668
|
+
target: "ruleLabel",
|
|
1669
|
+
...F(t)
|
|
1670
|
+
},
|
|
1671
|
+
declarations: e
|
|
1672
|
+
}) })
|
|
1619
1673
|
}),
|
|
1620
|
-
|
|
1621
|
-
...
|
|
1622
|
-
select: {
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1674
|
+
panelBorder: Object.assign((e, t) => ({
|
|
1675
|
+
...c(t),
|
|
1676
|
+
select: { target: "panelBorder" },
|
|
1677
|
+
declarations: e
|
|
1678
|
+
}), {
|
|
1679
|
+
top: (e, t) => ({
|
|
1680
|
+
...c(t),
|
|
1681
|
+
select: {
|
|
1682
|
+
target: "panelBorder",
|
|
1683
|
+
edge: "top"
|
|
1684
|
+
},
|
|
1685
|
+
declarations: e
|
|
1686
|
+
}),
|
|
1687
|
+
right: (e, t) => ({
|
|
1688
|
+
...c(t),
|
|
1689
|
+
select: {
|
|
1690
|
+
target: "panelBorder",
|
|
1691
|
+
edge: "right"
|
|
1692
|
+
},
|
|
1693
|
+
declarations: e
|
|
1694
|
+
}),
|
|
1695
|
+
bottom: (e, t) => ({
|
|
1696
|
+
...c(t),
|
|
1697
|
+
select: {
|
|
1698
|
+
target: "panelBorder",
|
|
1699
|
+
edge: "bottom"
|
|
1700
|
+
},
|
|
1701
|
+
declarations: e
|
|
1702
|
+
}),
|
|
1703
|
+
left: (e, t) => ({
|
|
1704
|
+
...c(t),
|
|
1705
|
+
select: {
|
|
1706
|
+
target: "panelBorder",
|
|
1707
|
+
edge: "left"
|
|
1708
|
+
},
|
|
1709
|
+
declarations: e
|
|
1710
|
+
})
|
|
1711
|
+
}),
|
|
1712
|
+
gridLine: Object.assign((e, t) => ({
|
|
1713
|
+
...c(t),
|
|
1714
|
+
select: { target: "gridLine" },
|
|
1627
1715
|
declarations: e
|
|
1716
|
+
}), {
|
|
1717
|
+
x: (e, t) => ({
|
|
1718
|
+
...c(t),
|
|
1719
|
+
select: {
|
|
1720
|
+
target: "gridLine",
|
|
1721
|
+
axis: "x"
|
|
1722
|
+
},
|
|
1723
|
+
declarations: e
|
|
1724
|
+
}),
|
|
1725
|
+
y: (e, t) => ({
|
|
1726
|
+
...c(t),
|
|
1727
|
+
select: {
|
|
1728
|
+
target: "gridLine",
|
|
1729
|
+
axis: "y"
|
|
1730
|
+
},
|
|
1731
|
+
declarations: e
|
|
1732
|
+
})
|
|
1628
1733
|
}),
|
|
1629
|
-
|
|
1630
|
-
...
|
|
1631
|
-
select: {
|
|
1632
|
-
target: "geom",
|
|
1633
|
-
kind: "area",
|
|
1634
|
-
...F(t)
|
|
1635
|
-
},
|
|
1734
|
+
tickLine: Object.assign((e, t) => ({
|
|
1735
|
+
...c(t),
|
|
1736
|
+
select: { target: "tickLine" },
|
|
1636
1737
|
declarations: e
|
|
1738
|
+
}), {
|
|
1739
|
+
x: (e, t) => ({
|
|
1740
|
+
...c(t),
|
|
1741
|
+
select: {
|
|
1742
|
+
target: "tickLine",
|
|
1743
|
+
axis: "x"
|
|
1744
|
+
},
|
|
1745
|
+
declarations: e
|
|
1746
|
+
}),
|
|
1747
|
+
y: (e, t) => ({
|
|
1748
|
+
...c(t),
|
|
1749
|
+
select: {
|
|
1750
|
+
target: "tickLine",
|
|
1751
|
+
axis: "y"
|
|
1752
|
+
},
|
|
1753
|
+
declarations: e
|
|
1754
|
+
})
|
|
1637
1755
|
}),
|
|
1638
|
-
|
|
1639
|
-
...
|
|
1640
|
-
select: {
|
|
1641
|
-
target: "geom",
|
|
1642
|
-
kind: "point",
|
|
1643
|
-
...F(t)
|
|
1644
|
-
},
|
|
1756
|
+
axisLabel: Object.assign((e, t) => ({
|
|
1757
|
+
...c(t),
|
|
1758
|
+
select: { target: "axisLabel" },
|
|
1645
1759
|
declarations: e
|
|
1760
|
+
}), {
|
|
1761
|
+
x: (e, t) => ({
|
|
1762
|
+
...c(t),
|
|
1763
|
+
select: {
|
|
1764
|
+
target: "axisLabel",
|
|
1765
|
+
axis: "x"
|
|
1766
|
+
},
|
|
1767
|
+
declarations: e
|
|
1768
|
+
}),
|
|
1769
|
+
y: (e, t) => ({
|
|
1770
|
+
...c(t),
|
|
1771
|
+
select: {
|
|
1772
|
+
target: "axisLabel",
|
|
1773
|
+
axis: "y"
|
|
1774
|
+
},
|
|
1775
|
+
declarations: e
|
|
1776
|
+
})
|
|
1646
1777
|
}),
|
|
1647
|
-
|
|
1648
|
-
...
|
|
1649
|
-
select: {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1778
|
+
tickLabel: Object.assign((e, t) => ({
|
|
1779
|
+
...c(t),
|
|
1780
|
+
select: { target: "tickLabel" },
|
|
1781
|
+
declarations: e
|
|
1782
|
+
}), {
|
|
1783
|
+
x: (e, t) => ({
|
|
1784
|
+
...c(t),
|
|
1785
|
+
select: {
|
|
1786
|
+
target: "tickLabel",
|
|
1787
|
+
axis: "x"
|
|
1788
|
+
},
|
|
1789
|
+
declarations: e
|
|
1790
|
+
}),
|
|
1791
|
+
y: (e, t) => ({
|
|
1792
|
+
...c(t),
|
|
1793
|
+
select: {
|
|
1794
|
+
target: "tickLabel",
|
|
1795
|
+
axis: "y"
|
|
1796
|
+
},
|
|
1797
|
+
declarations: e
|
|
1798
|
+
})
|
|
1799
|
+
}),
|
|
1800
|
+
dataLabel: Object.assign((e, t) => ({
|
|
1801
|
+
...c(t),
|
|
1802
|
+
select: { target: "dataLabel" },
|
|
1803
|
+
declarations: e
|
|
1804
|
+
}), {
|
|
1805
|
+
observation: Object.assign((e, t) => ({
|
|
1806
|
+
...c(t),
|
|
1807
|
+
select: {
|
|
1808
|
+
target: "dataLabel",
|
|
1809
|
+
role: "observation"
|
|
1810
|
+
},
|
|
1811
|
+
declarations: e
|
|
1812
|
+
}), {
|
|
1813
|
+
inside: (e, t) => ({
|
|
1814
|
+
...c(t),
|
|
1815
|
+
select: {
|
|
1816
|
+
target: "dataLabel",
|
|
1817
|
+
role: "observation",
|
|
1818
|
+
position: "inside"
|
|
1819
|
+
},
|
|
1820
|
+
declarations: e
|
|
1821
|
+
}),
|
|
1822
|
+
outside: (e, t) => ({
|
|
1823
|
+
...c(t),
|
|
1824
|
+
select: {
|
|
1825
|
+
target: "dataLabel",
|
|
1826
|
+
role: "observation",
|
|
1827
|
+
position: "outside"
|
|
1828
|
+
},
|
|
1829
|
+
declarations: e
|
|
1830
|
+
})
|
|
1831
|
+
}),
|
|
1832
|
+
category: Object.assign((e, t) => ({
|
|
1833
|
+
...c(t),
|
|
1834
|
+
select: {
|
|
1835
|
+
target: "dataLabel",
|
|
1836
|
+
role: "category"
|
|
1837
|
+
},
|
|
1838
|
+
declarations: e
|
|
1839
|
+
}), {
|
|
1840
|
+
inside: (e, t) => ({
|
|
1841
|
+
...c(t),
|
|
1842
|
+
select: {
|
|
1843
|
+
target: "dataLabel",
|
|
1844
|
+
role: "category",
|
|
1845
|
+
position: "inside"
|
|
1846
|
+
},
|
|
1847
|
+
declarations: e
|
|
1848
|
+
}),
|
|
1849
|
+
outside: (e, t) => ({
|
|
1850
|
+
...c(t),
|
|
1851
|
+
select: {
|
|
1852
|
+
target: "dataLabel",
|
|
1853
|
+
role: "category",
|
|
1854
|
+
position: "outside"
|
|
1855
|
+
},
|
|
1856
|
+
declarations: e
|
|
1857
|
+
})
|
|
1858
|
+
}),
|
|
1859
|
+
aggregate: (e, t) => ({
|
|
1860
|
+
...c(t),
|
|
1861
|
+
select: {
|
|
1862
|
+
target: "dataLabel",
|
|
1863
|
+
role: "aggregate"
|
|
1864
|
+
},
|
|
1865
|
+
declarations: e
|
|
1866
|
+
})
|
|
1867
|
+
}),
|
|
1868
|
+
graph: (e, t) => ({
|
|
1869
|
+
...c(t),
|
|
1870
|
+
select: { target: "graph" },
|
|
1654
1871
|
declarations: e
|
|
1655
1872
|
})
|
|
1656
|
-
}
|
|
1873
|
+
}, lr = Ie[0], cr = Object.freeze({
|
|
1657
1874
|
light: "#1D2129",
|
|
1658
1875
|
dark: "#FFFFFF"
|
|
1659
|
-
}),
|
|
1660
|
-
|
|
1661
|
-
|
|
1876
|
+
}), ur = "#ffffff", dr = 0.4, xe = Object.freeze({
|
|
1877
|
+
light: "rgba(29, 33, 41, 0.1)",
|
|
1878
|
+
dark: "rgba(255, 255, 255, 0.1)"
|
|
1879
|
+
}), yr = xe, Ea = 6, fr = Object.freeze({
|
|
1880
|
+
light: "#FFFFFF",
|
|
1881
|
+
dark: "#1A1A1A"
|
|
1882
|
+
}), gr = Object.freeze({
|
|
1883
|
+
light: "#000000",
|
|
1884
|
+
dark: "#FFFFFF"
|
|
1885
|
+
}), mr = Object.freeze({
|
|
1886
|
+
light: "rgba(0, 0, 0, 0.6)",
|
|
1887
|
+
dark: "rgba(255, 255, 255, 0.8)"
|
|
1888
|
+
}), _a = 10, Ta = "sm", Aa = 1, Fa = 2, pr = 0.3, Da = 8, br = {
|
|
1889
|
+
geomColor: lr,
|
|
1890
|
+
ruleColor: cr,
|
|
1662
1891
|
pointBorderColor: "#ffffff",
|
|
1663
|
-
hoverAffordanceColor:
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1892
|
+
hoverAffordanceColor: ur,
|
|
1893
|
+
gridLineColor: xe,
|
|
1894
|
+
tickLineColor: yr,
|
|
1895
|
+
graphBackground: fr,
|
|
1896
|
+
textPrimary: gr,
|
|
1897
|
+
textSecondary: mr
|
|
1898
|
+
}, Ve = [
|
|
1899
|
+
d.geom({
|
|
1900
|
+
color: h("geomColor"),
|
|
1667
1901
|
alpha: 1
|
|
1668
1902
|
}),
|
|
1669
|
-
|
|
1903
|
+
d.geom.bar({
|
|
1670
1904
|
borderRadius: "sm",
|
|
1671
1905
|
borderWidth: 1
|
|
1672
1906
|
}),
|
|
1673
|
-
|
|
1907
|
+
d.geom.line({
|
|
1674
1908
|
strokeWidth: 2,
|
|
1675
1909
|
lineType: "solid"
|
|
1676
1910
|
}),
|
|
1677
|
-
|
|
1678
|
-
alpha:
|
|
1911
|
+
d.geom.area({
|
|
1912
|
+
alpha: pr,
|
|
1679
1913
|
strokeWidth: 2,
|
|
1680
1914
|
lineType: "solid",
|
|
1681
1915
|
strokeAlpha: 1
|
|
1682
1916
|
}),
|
|
1683
|
-
|
|
1917
|
+
d.geom.point({
|
|
1684
1918
|
size: 8,
|
|
1685
|
-
borderColor:
|
|
1919
|
+
borderColor: h("pointBorderColor"),
|
|
1686
1920
|
borderWidth: 1
|
|
1687
1921
|
}),
|
|
1688
|
-
|
|
1689
|
-
color:
|
|
1922
|
+
d.geom.rule({
|
|
1923
|
+
color: h("ruleColor"),
|
|
1924
|
+
strokeWidth: 1,
|
|
1925
|
+
lineType: "dashed"
|
|
1926
|
+
}),
|
|
1927
|
+
d.geom({ alpha: dr }, { state: "dimmed" }),
|
|
1928
|
+
d.geom.point({ borderColor: h("hoverAffordanceColor") }, { state: "hovered" }),
|
|
1929
|
+
d.geom.bar({ borderColor: h("hoverAffordanceColor") }, { state: "hovered" }),
|
|
1930
|
+
d.gridLine({
|
|
1931
|
+
color: h("gridLineColor"),
|
|
1690
1932
|
strokeWidth: 1,
|
|
1691
1933
|
lineType: "dashed"
|
|
1692
1934
|
}),
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1935
|
+
d.tickLine({
|
|
1936
|
+
color: h("tickLineColor"),
|
|
1937
|
+
strokeWidth: 1,
|
|
1938
|
+
lineType: "solid",
|
|
1939
|
+
length: 6
|
|
1940
|
+
}),
|
|
1941
|
+
d.panelBorder({
|
|
1942
|
+
color: h("gridLineColor"),
|
|
1943
|
+
strokeWidth: 1,
|
|
1944
|
+
lineType: "dashed",
|
|
1945
|
+
borderRadius: 8
|
|
1946
|
+
}),
|
|
1947
|
+
d.graph({
|
|
1948
|
+
background: h("graphBackground"),
|
|
1949
|
+
borderWidth: 0,
|
|
1950
|
+
borderRadius: 8
|
|
1951
|
+
}),
|
|
1952
|
+
d.axisLabel({
|
|
1953
|
+
fontSize: 12,
|
|
1954
|
+
fontWeight: 500,
|
|
1955
|
+
lineHeight: 1,
|
|
1956
|
+
textColor: h("textPrimary")
|
|
1957
|
+
}),
|
|
1958
|
+
d.tickLabel({
|
|
1959
|
+
fontSize: 12,
|
|
1960
|
+
fontWeight: 500,
|
|
1961
|
+
lineHeight: 1,
|
|
1962
|
+
textColor: h("textSecondary"),
|
|
1963
|
+
offset: 10
|
|
1964
|
+
}),
|
|
1965
|
+
d.geom.rule.label({
|
|
1966
|
+
fontSize: 11,
|
|
1967
|
+
fontWeight: 500,
|
|
1968
|
+
lineHeight: 1
|
|
1969
|
+
}),
|
|
1970
|
+
d.dataLabel({
|
|
1971
|
+
fontSize: 11,
|
|
1972
|
+
fontWeight: 500,
|
|
1973
|
+
lineHeight: 1,
|
|
1974
|
+
textColor: h("textPrimary"),
|
|
1975
|
+
paddingInline: 6,
|
|
1976
|
+
paddingBlock: 2,
|
|
1977
|
+
borderRadius: 4
|
|
1978
|
+
}),
|
|
1979
|
+
d.dataLabel.aggregate({
|
|
1980
|
+
fontWeight: 600,
|
|
1981
|
+
paddingInline: 4,
|
|
1982
|
+
background: {
|
|
1983
|
+
light: "#FFFFFF",
|
|
1984
|
+
dark: "#000000"
|
|
1985
|
+
},
|
|
1986
|
+
borderColor: {
|
|
1987
|
+
light: "#CCCCCC",
|
|
1988
|
+
dark: "#494949"
|
|
1989
|
+
},
|
|
1990
|
+
borderWidth: 1
|
|
1991
|
+
}),
|
|
1992
|
+
d.dataLabel.observation.inside({ textColor: "#FFFFFF" }),
|
|
1993
|
+
d.dataLabel.category.inside({ textColor: "#FFFFFF" }),
|
|
1994
|
+
d.dataLabel.observation.outside({ background: {
|
|
1995
|
+
light: "rgba(0, 0, 0, 0.1)",
|
|
1996
|
+
dark: "rgba(255, 255, 255, 0.1)"
|
|
1997
|
+
} }),
|
|
1998
|
+
d.dataLabel.category.outside({ background: {
|
|
1999
|
+
light: "rgba(0, 0, 0, 0.1)",
|
|
2000
|
+
dark: "rgba(255, 255, 255, 0.1)"
|
|
2001
|
+
} })
|
|
1696
2002
|
];
|
|
1697
|
-
for (const e of
|
|
2003
|
+
for (const e of Ve) {
|
|
1698
2004
|
Object.freeze(e.select);
|
|
1699
2005
|
for (const t of Object.values(e.declarations)) typeof t == "object" && Object.freeze(t);
|
|
1700
2006
|
Object.freeze(e.declarations), e.when !== void 0 && Object.freeze(e.when), Object.freeze(e);
|
|
1701
2007
|
}
|
|
1702
|
-
var
|
|
1703
|
-
tokens: Object.freeze(
|
|
1704
|
-
defaults: Object.freeze(
|
|
2008
|
+
var La = Object.freeze({
|
|
2009
|
+
tokens: Object.freeze(br),
|
|
2010
|
+
defaults: Object.freeze(Ve),
|
|
1705
2011
|
overrides: Object.freeze([])
|
|
1706
|
-
}),
|
|
2012
|
+
}), Na = {
|
|
1707
2013
|
cartesian: (e = {}) => ({
|
|
1708
2014
|
type: "coord",
|
|
1709
2015
|
coordType: "cartesian",
|
|
@@ -1719,78 +2025,78 @@ var ga = Object.freeze({
|
|
|
1719
2025
|
coordType: "polar",
|
|
1720
2026
|
params: e
|
|
1721
2027
|
})
|
|
1722
|
-
},
|
|
1723
|
-
x: Object.assign((e) =>
|
|
1724
|
-
continuous: (e) =>
|
|
1725
|
-
discrete: (e) =>
|
|
1726
|
-
datetime: (e) =>
|
|
1727
|
-
log: (e) =>
|
|
2028
|
+
}, Oa = {
|
|
2029
|
+
x: Object.assign((e) => G("x", e), {
|
|
2030
|
+
continuous: (e) => p("x", e),
|
|
2031
|
+
discrete: (e) => A("x", e),
|
|
2032
|
+
datetime: (e) => W("x", e),
|
|
2033
|
+
log: (e) => p("x", {
|
|
1728
2034
|
...e,
|
|
1729
2035
|
transform: "log"
|
|
1730
2036
|
}),
|
|
1731
|
-
sqrt: (e) =>
|
|
2037
|
+
sqrt: (e) => p("x", {
|
|
1732
2038
|
...e,
|
|
1733
2039
|
transform: "sqrt"
|
|
1734
2040
|
})
|
|
1735
2041
|
}),
|
|
1736
|
-
y: Object.assign((e) =>
|
|
1737
|
-
continuous: (e) =>
|
|
1738
|
-
discrete: (e) =>
|
|
1739
|
-
datetime: (e) =>
|
|
1740
|
-
log: (e) =>
|
|
2042
|
+
y: Object.assign((e) => G("y", e), {
|
|
2043
|
+
continuous: (e) => p("y", e),
|
|
2044
|
+
discrete: (e) => A("y", e),
|
|
2045
|
+
datetime: (e) => W("y", e),
|
|
2046
|
+
log: (e) => p("y", {
|
|
1741
2047
|
...e,
|
|
1742
2048
|
transform: "log"
|
|
1743
2049
|
}),
|
|
1744
|
-
sqrt: (e) =>
|
|
2050
|
+
sqrt: (e) => p("y", {
|
|
1745
2051
|
...e,
|
|
1746
2052
|
transform: "sqrt"
|
|
1747
2053
|
})
|
|
1748
2054
|
}),
|
|
1749
|
-
ySecondary: Object.assign((e) =>
|
|
1750
|
-
continuous: (e) =>
|
|
1751
|
-
discrete: (e) =>
|
|
1752
|
-
datetime: (e) =>
|
|
1753
|
-
log: (e) =>
|
|
2055
|
+
ySecondary: Object.assign((e) => G("ySecondary", e), {
|
|
2056
|
+
continuous: (e) => p("ySecondary", e),
|
|
2057
|
+
discrete: (e) => A("ySecondary", e),
|
|
2058
|
+
datetime: (e) => W("ySecondary", e),
|
|
2059
|
+
log: (e) => p("ySecondary", {
|
|
1754
2060
|
...e,
|
|
1755
2061
|
transform: "log"
|
|
1756
2062
|
}),
|
|
1757
|
-
sqrt: (e) =>
|
|
2063
|
+
sqrt: (e) => p("ySecondary", {
|
|
1758
2064
|
...e,
|
|
1759
2065
|
transform: "sqrt"
|
|
1760
2066
|
})
|
|
1761
2067
|
}),
|
|
1762
2068
|
color: {
|
|
1763
|
-
continuous: (e) =>
|
|
1764
|
-
discrete: (e) =>
|
|
1765
|
-
palette: (e) =>
|
|
2069
|
+
continuous: (e) => p("color", e),
|
|
2070
|
+
discrete: (e) => A("color", e),
|
|
2071
|
+
palette: (e) => tr("color", e)
|
|
1766
2072
|
},
|
|
1767
2073
|
size: {
|
|
1768
|
-
continuous: (e) =>
|
|
1769
|
-
discrete: (e) =>
|
|
1770
|
-
identity: (e) =>
|
|
2074
|
+
continuous: (e) => p("size", e),
|
|
2075
|
+
discrete: (e) => A("size", e),
|
|
2076
|
+
identity: (e) => B("size", e)
|
|
1771
2077
|
},
|
|
1772
2078
|
alpha: {
|
|
1773
|
-
continuous: (e) =>
|
|
1774
|
-
discrete: (e) =>
|
|
1775
|
-
identity: (e) =>
|
|
2079
|
+
continuous: (e) => p("alpha", e),
|
|
2080
|
+
discrete: (e) => A("alpha", e),
|
|
2081
|
+
identity: (e) => B("alpha", e)
|
|
1776
2082
|
},
|
|
1777
2083
|
strokeWidth: {
|
|
1778
|
-
continuous: (e) =>
|
|
1779
|
-
discrete: (e) =>
|
|
1780
|
-
identity: (e) =>
|
|
2084
|
+
continuous: (e) => p("strokeWidth", e),
|
|
2085
|
+
discrete: (e) => A("strokeWidth", e),
|
|
2086
|
+
identity: (e) => B("strokeWidth", e)
|
|
1781
2087
|
},
|
|
1782
2088
|
lineType: {
|
|
1783
|
-
discrete: (e) =>
|
|
1784
|
-
identity: (e) =>
|
|
1785
|
-
}
|
|
1786
|
-
},
|
|
1787
|
-
identity:
|
|
1788
|
-
count:
|
|
1789
|
-
smooth:
|
|
1790
|
-
mean:
|
|
1791
|
-
sum:
|
|
2089
|
+
discrete: (e) => A("lineType", e),
|
|
2090
|
+
identity: (e) => B("lineType", e)
|
|
2091
|
+
}
|
|
2092
|
+
}, ka = {
|
|
2093
|
+
identity: vr,
|
|
2094
|
+
count: Mr,
|
|
2095
|
+
smooth: hr,
|
|
2096
|
+
mean: Er,
|
|
2097
|
+
sum: _r
|
|
1792
2098
|
};
|
|
1793
|
-
function
|
|
2099
|
+
function hr(e) {
|
|
1794
2100
|
return {
|
|
1795
2101
|
type: "smooth",
|
|
1796
2102
|
method: e.method,
|
|
@@ -1798,61 +2104,61 @@ function yr(e) {
|
|
|
1798
2104
|
bandwidth: e.bandwidth
|
|
1799
2105
|
};
|
|
1800
2106
|
}
|
|
1801
|
-
function
|
|
2107
|
+
function vr() {
|
|
1802
2108
|
return { type: "identity" };
|
|
1803
2109
|
}
|
|
1804
|
-
function
|
|
2110
|
+
function Mr() {
|
|
1805
2111
|
return { type: "count" };
|
|
1806
2112
|
}
|
|
1807
|
-
function
|
|
2113
|
+
function Er() {
|
|
1808
2114
|
return { type: "mean" };
|
|
1809
2115
|
}
|
|
1810
|
-
function
|
|
2116
|
+
function _r() {
|
|
1811
2117
|
return { type: "sum" };
|
|
1812
2118
|
}
|
|
1813
|
-
var
|
|
1814
|
-
reshape:
|
|
1815
|
-
filter:
|
|
1816
|
-
sort:
|
|
1817
|
-
aggregate:
|
|
1818
|
-
constant:
|
|
2119
|
+
var Sa = {
|
|
2120
|
+
reshape: Tr,
|
|
2121
|
+
filter: Ar,
|
|
2122
|
+
sort: Fr,
|
|
2123
|
+
aggregate: Dr,
|
|
2124
|
+
constant: Lr
|
|
1819
2125
|
};
|
|
1820
|
-
function
|
|
2126
|
+
function Tr(e = {}) {
|
|
1821
2127
|
return {
|
|
1822
2128
|
type: "transform",
|
|
1823
2129
|
transformType: "reshape",
|
|
1824
2130
|
options: e
|
|
1825
2131
|
};
|
|
1826
2132
|
}
|
|
1827
|
-
function
|
|
2133
|
+
function Ar(e) {
|
|
1828
2134
|
return {
|
|
1829
2135
|
type: "transform",
|
|
1830
2136
|
transformType: "filter",
|
|
1831
2137
|
options: e
|
|
1832
2138
|
};
|
|
1833
2139
|
}
|
|
1834
|
-
function
|
|
2140
|
+
function Fr(e) {
|
|
1835
2141
|
return {
|
|
1836
2142
|
type: "transform",
|
|
1837
2143
|
transformType: "sort",
|
|
1838
2144
|
options: e
|
|
1839
2145
|
};
|
|
1840
2146
|
}
|
|
1841
|
-
function
|
|
2147
|
+
function Dr(e) {
|
|
1842
2148
|
return {
|
|
1843
2149
|
type: "transform",
|
|
1844
2150
|
transformType: "aggregate",
|
|
1845
2151
|
options: e
|
|
1846
2152
|
};
|
|
1847
2153
|
}
|
|
1848
|
-
function
|
|
2154
|
+
function Lr(e) {
|
|
1849
2155
|
return {
|
|
1850
2156
|
type: "transform",
|
|
1851
2157
|
transformType: "constant",
|
|
1852
2158
|
options: e
|
|
1853
2159
|
};
|
|
1854
2160
|
}
|
|
1855
|
-
function
|
|
2161
|
+
function Nr(e) {
|
|
1856
2162
|
const t = e.layout?.gaps;
|
|
1857
2163
|
if (t === void 0) return e;
|
|
1858
2164
|
const r = {};
|
|
@@ -1868,121 +2174,116 @@ function _r(e) {
|
|
|
1868
2174
|
}
|
|
1869
2175
|
};
|
|
1870
2176
|
}
|
|
1871
|
-
|
|
1872
|
-
"lilac",
|
|
1873
|
-
"neon_pink",
|
|
1874
|
-
"blackberry",
|
|
1875
|
-
"sun",
|
|
1876
|
-
"iceland",
|
|
1877
|
-
"sunset",
|
|
1878
|
-
"ultraviolet",
|
|
1879
|
-
"purple",
|
|
1880
|
-
"ice_cream",
|
|
1881
|
-
"mint",
|
|
1882
|
-
"cool",
|
|
1883
|
-
"fresh"
|
|
1884
|
-
];
|
|
1885
|
-
function _a(e) {
|
|
2177
|
+
function wa(e) {
|
|
1886
2178
|
return {
|
|
1887
2179
|
type: "config",
|
|
1888
|
-
config:
|
|
2180
|
+
config: Nr(e)
|
|
1889
2181
|
};
|
|
1890
2182
|
}
|
|
1891
2183
|
export {
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
C,
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2184
|
+
ea as $,
|
|
2185
|
+
h as A,
|
|
2186
|
+
Je as At,
|
|
2187
|
+
p as B,
|
|
2188
|
+
We as Bt,
|
|
2189
|
+
ga as C,
|
|
2190
|
+
Wr as Ct,
|
|
2191
|
+
va as D,
|
|
2192
|
+
de as Dt,
|
|
2193
|
+
ha as E,
|
|
2194
|
+
Yr as Et,
|
|
2195
|
+
tr as F,
|
|
2196
|
+
ue as Ft,
|
|
2197
|
+
na as G,
|
|
2198
|
+
xr as Gt,
|
|
2199
|
+
da as H,
|
|
2200
|
+
Ge as Ht,
|
|
2201
|
+
G as I,
|
|
2202
|
+
Br as It,
|
|
2203
|
+
sa as J,
|
|
2204
|
+
Ir as Jt,
|
|
2205
|
+
oa as K,
|
|
2206
|
+
Vr as Kt,
|
|
2207
|
+
B as L,
|
|
2208
|
+
jr as Lt,
|
|
2209
|
+
I as M,
|
|
2210
|
+
Pr as Mt,
|
|
2211
|
+
ya as N,
|
|
2212
|
+
Ur as Nt,
|
|
2213
|
+
d as O,
|
|
2214
|
+
zr as Ot,
|
|
2215
|
+
fa as P,
|
|
2216
|
+
Xe as Pt,
|
|
2217
|
+
ra as Q,
|
|
2218
|
+
A as R,
|
|
2219
|
+
le as Rt,
|
|
2220
|
+
ma as S,
|
|
2221
|
+
Gr as St,
|
|
2222
|
+
ba as T,
|
|
2223
|
+
N as Tt,
|
|
2224
|
+
ua as U,
|
|
2225
|
+
ce as Ut,
|
|
2226
|
+
ca as V,
|
|
2227
|
+
Ke as Vt,
|
|
2228
|
+
la as W,
|
|
2229
|
+
He as Wt,
|
|
2230
|
+
aa as X,
|
|
2231
|
+
wr as Xt,
|
|
2232
|
+
Ie as Y,
|
|
2233
|
+
oe as Yt,
|
|
2234
|
+
ta as Z,
|
|
2235
|
+
Rr as Zt,
|
|
2236
|
+
gr as _,
|
|
2237
|
+
j as _t,
|
|
2238
|
+
Na as a,
|
|
2239
|
+
Qr as at,
|
|
2240
|
+
yr as b,
|
|
2241
|
+
Qe as bt,
|
|
2242
|
+
Ta as c,
|
|
2243
|
+
rt as ct,
|
|
2244
|
+
lr as d,
|
|
2245
|
+
Xr as dt,
|
|
2246
|
+
Zr as et,
|
|
2247
|
+
fr as f,
|
|
2248
|
+
ge as ft,
|
|
2249
|
+
Fa as g,
|
|
2250
|
+
_ as gt,
|
|
2251
|
+
Da as h,
|
|
2252
|
+
Jr as ht,
|
|
2253
|
+
Oa as i,
|
|
2254
|
+
Tt as it,
|
|
2255
|
+
rr as j,
|
|
2256
|
+
H as jt,
|
|
2257
|
+
Ma as k,
|
|
2258
|
+
$r as kt,
|
|
2259
|
+
Aa as l,
|
|
2260
|
+
et as lt,
|
|
2261
|
+
ur as m,
|
|
2262
|
+
P as mt,
|
|
2263
|
+
Sa as n,
|
|
2264
|
+
Ct as nt,
|
|
2265
|
+
La as o,
|
|
2266
|
+
ot,
|
|
2267
|
+
xe as p,
|
|
2268
|
+
tt as pt,
|
|
2269
|
+
ia as q,
|
|
2270
|
+
y as qt,
|
|
2271
|
+
ka as r,
|
|
2272
|
+
K as rt,
|
|
2273
|
+
pr as s,
|
|
2274
|
+
_e as st,
|
|
2275
|
+
wa as t,
|
|
2276
|
+
Vt as tt,
|
|
2277
|
+
dr as u,
|
|
2278
|
+
qr as ut,
|
|
2279
|
+
mr as v,
|
|
2280
|
+
fe as vt,
|
|
2281
|
+
pa as w,
|
|
2282
|
+
Kr as wt,
|
|
2283
|
+
Ea as x,
|
|
2284
|
+
Hr as xt,
|
|
2285
|
+
_a as y,
|
|
2286
|
+
Ze as yt,
|
|
2287
|
+
W as z,
|
|
2288
|
+
Ye as zt
|
|
1988
2289
|
};
|