@graphysdk/viz-engine 1.9.0-beta.1791444651663 → 1.9.0-beta.1791458483540
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/graph-config.cjs +1 -1
- package/dist/graph-config.d.ts +4 -9
- package/dist/graph-config.mjs +212 -205
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +19 -1
- package/dist/index.mjs +1569 -1544
- package/package.json +4 -4
package/dist/graph-config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { d as g, f as
|
|
3
|
-
var
|
|
1
|
+
import { A as ae, At as le, Dn as ce, Hn as y, Ln as R, Mt as S, On as C, P as ue, S as de, Vn as N, a as fe, ct as pe, f as ve, hr as I, i as ye, j as he, jn as me, lr as _, pn as m, s as be, ut as G, zn as ge } from "./annotations-Dfcq_uPe.js";
|
|
2
|
+
import { d as g, f as ke, i as Q, n as a, p as Se, r as T, s as L } from "./spec-builder-T3d2Vbrm.js";
|
|
3
|
+
var lr = 10, Te = [
|
|
4
4
|
"normal",
|
|
5
5
|
"italic",
|
|
6
6
|
"oblique"
|
|
7
|
-
],
|
|
7
|
+
], Ae = /^(\d*\.?\d+)(px|em)$/, ee = /^\d*\.?\d+$/, Le = 1, xe = 1e3, Ne = {
|
|
8
8
|
normal: 400,
|
|
9
9
|
bold: 700
|
|
10
|
-
}, Ee = (e) =>
|
|
11
|
-
const t =
|
|
10
|
+
}, Ee = (e) => Te.includes(e), te = (e) => {
|
|
11
|
+
const t = Ae.exec(e.trim());
|
|
12
12
|
return t === null || t[1] === void 0 || t[2] === void 0 ? null : {
|
|
13
13
|
value: Number.parseFloat(t[1]),
|
|
14
14
|
unit: t[2] === "px" ? "px" : "em"
|
|
@@ -16,13 +16,13 @@ var sr = 10, Se = [
|
|
|
16
16
|
}, we = (e) => {
|
|
17
17
|
const t = e.trim(), r = Ne[t];
|
|
18
18
|
if (r !== void 0) return r;
|
|
19
|
-
if (!
|
|
19
|
+
if (!ee.test(t)) return null;
|
|
20
20
|
const o = Number.parseFloat(t);
|
|
21
|
-
return o >=
|
|
22
|
-
},
|
|
21
|
+
return o >= Le && o <= xe ? o : null;
|
|
22
|
+
}, Ve = (e) => {
|
|
23
23
|
const t = e.trim();
|
|
24
|
-
return
|
|
25
|
-
},
|
|
24
|
+
return ee.test(t) ? Number.parseFloat(t) : null;
|
|
25
|
+
}, re = (e) => e.unit === "em" ? e.value * 10 : e.value, _e = (e) => {
|
|
26
26
|
const t = e.trim().replace(/\s*\/\s*/g, "/").split(/\s+/);
|
|
27
27
|
let r = "normal", o = 400, i = 0;
|
|
28
28
|
for (; i < t.length; ) {
|
|
@@ -32,16 +32,16 @@ var sr = 10, Se = [
|
|
|
32
32
|
else if (Ee(f))
|
|
33
33
|
r = f, i++;
|
|
34
34
|
else {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
o =
|
|
35
|
+
const h = we(f);
|
|
36
|
+
if (h === null) break;
|
|
37
|
+
o = h, i++;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const n = t[i];
|
|
41
41
|
if (n === void 0) return null;
|
|
42
|
-
const [s = "", c] = n.split("/"), l =
|
|
42
|
+
const [s = "", c] = n.split("/"), l = te(s);
|
|
43
43
|
if (l === null) return null;
|
|
44
|
-
const u = c === void 0 ? null :
|
|
44
|
+
const u = c === void 0 ? null : Ve(c), p = t.slice(i + 1).join(" ").trim();
|
|
45
45
|
return p === "" ? null : {
|
|
46
46
|
style: r,
|
|
47
47
|
weight: o,
|
|
@@ -50,7 +50,7 @@ var sr = 10, Se = [
|
|
|
50
50
|
...u !== null ? { lineHeight: u } : {}
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
function
|
|
53
|
+
function Pe(e) {
|
|
54
54
|
const t = [];
|
|
55
55
|
for (const r of e ?? []) {
|
|
56
56
|
if (r.type === "shape" && t.push(a.annotation.shape({
|
|
@@ -59,10 +59,10 @@ function _e(e) {
|
|
|
59
59
|
strokeWidth: r.strokeWidth
|
|
60
60
|
}, { annotation: r.id })), r.type === "arrow" && (t.push(a.annotation.arrow({
|
|
61
61
|
...r.color === void 0 ? {} : { stroke: r.color },
|
|
62
|
-
strokeWidth:
|
|
63
|
-
dashArray:
|
|
64
|
-
}, { annotation: r.id })), r.hasStickerStyle && t.push(a.annotation.arrow.outline(
|
|
65
|
-
const o =
|
|
62
|
+
strokeWidth: fe[r.thickness],
|
|
63
|
+
dashArray: me.arrow[r.lineStyle]
|
|
64
|
+
}, { annotation: r.id })), r.hasStickerStyle && t.push(a.annotation.arrow.outline(ye, { annotation: r.id }))), r.type === "difference-arrow") {
|
|
65
|
+
const o = be[r.size];
|
|
66
66
|
t.push(a.annotation.differenceArrow({
|
|
67
67
|
...r.color === void 0 ? {} : { stroke: r.color },
|
|
68
68
|
...o.arrow
|
|
@@ -70,65 +70,67 @@ function _e(e) {
|
|
|
70
70
|
}
|
|
71
71
|
r.type === "text" && r.backgroundColor !== void 0 && t.push(a.annotation.text({
|
|
72
72
|
fill: r.backgroundColor,
|
|
73
|
-
...r.backgroundColorStyle === "fade" ? { fillAlpha:
|
|
73
|
+
...r.backgroundColorStyle === "fade" ? { fillAlpha: ve } : {}
|
|
74
74
|
}, { annotation: r.id })), r.type === "image" && r.opacity !== void 0 && t.push(a.annotation.image({ alpha: r.opacity }, { annotation: r.id }));
|
|
75
75
|
}
|
|
76
76
|
return t;
|
|
77
77
|
}
|
|
78
78
|
function Re(e) {
|
|
79
79
|
const t = [], r = e?.defaultAnnotationShapeFill;
|
|
80
|
-
|
|
80
|
+
typeof r == "string" && t.push(a.annotation.shape({ fill: r }));
|
|
81
|
+
const o = e?.annotationOutlineColor;
|
|
82
|
+
return typeof o == "string" && t.push(a.editOutline.selected({ stroke: o })), t;
|
|
81
83
|
}
|
|
82
|
-
function
|
|
84
|
+
function Ce(e) {
|
|
83
85
|
const t = e?.defaultAnnotationArrowStroke;
|
|
84
86
|
return typeof t == "string" ? { annotationArrow: t } : void 0;
|
|
85
87
|
}
|
|
86
|
-
var
|
|
87
|
-
if (!e.startsWith(
|
|
88
|
+
var De = "#%_ENCODED_%#", oe = (e) => {
|
|
89
|
+
if (!e.startsWith(De)) return e;
|
|
88
90
|
try {
|
|
89
91
|
const { value: t } = JSON.parse(e.slice(13));
|
|
90
92
|
return typeof t == "string" ? t : e;
|
|
91
93
|
} catch {
|
|
92
94
|
return e;
|
|
93
95
|
}
|
|
94
|
-
},
|
|
95
|
-
const i = [], n = [], s = [], c = [], l = [], u = [], p = [], f = [],
|
|
96
|
+
}, Fe = ({ annotations: e, dataset: t, mapping: r, seriesVariables: o }) => {
|
|
97
|
+
const i = [], n = [], s = [], c = [], l = [], u = [], p = [], f = [], h = {
|
|
96
98
|
dataset: t,
|
|
97
|
-
...
|
|
99
|
+
...Be(r, o)
|
|
98
100
|
};
|
|
99
101
|
for (const b of e ?? []) switch (b.type) {
|
|
100
102
|
case "difference-arrow": {
|
|
101
|
-
const d =
|
|
103
|
+
const d = Ie(b, h);
|
|
102
104
|
d !== null && i.push(d);
|
|
103
105
|
break;
|
|
104
106
|
}
|
|
105
107
|
case "shape":
|
|
106
|
-
n.push(
|
|
108
|
+
n.push(He(b));
|
|
107
109
|
break;
|
|
108
110
|
case "arrow":
|
|
109
|
-
s.push(
|
|
111
|
+
s.push(ze(b));
|
|
110
112
|
break;
|
|
111
113
|
case "highlight":
|
|
112
114
|
break;
|
|
113
115
|
case "text":
|
|
114
|
-
c.push(
|
|
116
|
+
c.push(Oe(b));
|
|
115
117
|
break;
|
|
116
118
|
case "image":
|
|
117
|
-
l.push(
|
|
119
|
+
l.push(We(b));
|
|
118
120
|
break;
|
|
119
121
|
case "sticker": {
|
|
120
|
-
const d =
|
|
122
|
+
const d = Me(b, h);
|
|
121
123
|
d !== null && u.push(d);
|
|
122
124
|
break;
|
|
123
125
|
}
|
|
124
126
|
case "tooltip": {
|
|
125
|
-
const d =
|
|
127
|
+
const d = Ge(b, h);
|
|
126
128
|
if (d === null) break;
|
|
127
129
|
d.kind === "pinnedNumber" ? p.push(d.value) : f.push(d.value);
|
|
128
130
|
break;
|
|
129
131
|
}
|
|
130
132
|
default:
|
|
131
|
-
throw new
|
|
133
|
+
throw new ce({ message: `Unsupported annotation type: ${b.type}` });
|
|
132
134
|
}
|
|
133
135
|
return {
|
|
134
136
|
differenceArrows: i,
|
|
@@ -140,14 +142,14 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
140
142
|
pinnedNumbers: p,
|
|
141
143
|
comments: f
|
|
142
144
|
};
|
|
143
|
-
},
|
|
144
|
-
const r =
|
|
145
|
+
}, Be = (e, t) => {
|
|
146
|
+
const r = N(e.x), o = N(e.group) ?? N(e.color), i = r !== null && r !== "", n = o === "key" || t.length >= 2;
|
|
145
147
|
return {
|
|
146
148
|
anchorVariable: i ? r : o,
|
|
147
149
|
groupIsSeriesKey: n
|
|
148
150
|
};
|
|
149
|
-
},
|
|
150
|
-
const r =
|
|
151
|
+
}, Ie = (e, t) => {
|
|
152
|
+
const r = P(t, e.start), o = P(t, e.end);
|
|
151
153
|
return r === null || o === null ? null : {
|
|
152
154
|
id: e.id,
|
|
153
155
|
start: r,
|
|
@@ -155,7 +157,7 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
155
157
|
label: e.show,
|
|
156
158
|
labelCrossPosition: e.labelPosition
|
|
157
159
|
};
|
|
158
|
-
},
|
|
160
|
+
}, He = (e) => ({
|
|
159
161
|
id: e.id,
|
|
160
162
|
kind: e.shape,
|
|
161
163
|
zOrder: e.layer === "abovePlot" ? "foreground" : "background",
|
|
@@ -166,7 +168,7 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
166
168
|
width: e.width,
|
|
167
169
|
height: e.height
|
|
168
170
|
}
|
|
169
|
-
}),
|
|
171
|
+
}), We = (e) => ({
|
|
170
172
|
id: e.id,
|
|
171
173
|
src: e.src,
|
|
172
174
|
zOrder: e.layer === "abovePlot" ? "foreground" : "background",
|
|
@@ -178,7 +180,7 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
178
180
|
height: e.height
|
|
179
181
|
},
|
|
180
182
|
fit: e.fit
|
|
181
|
-
}),
|
|
183
|
+
}), Oe = (e) => ({
|
|
182
184
|
id: e.id,
|
|
183
185
|
content: e.content,
|
|
184
186
|
at: {
|
|
@@ -188,8 +190,8 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
188
190
|
},
|
|
189
191
|
width: e.width,
|
|
190
192
|
align: "top-left"
|
|
191
|
-
}),
|
|
192
|
-
const r =
|
|
193
|
+
}), Me = (e, t) => {
|
|
194
|
+
const r = P(t, e);
|
|
193
195
|
return r === null ? null : {
|
|
194
196
|
id: e.id,
|
|
195
197
|
at: {
|
|
@@ -198,8 +200,8 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
198
200
|
},
|
|
199
201
|
sticker: e.sticker
|
|
200
202
|
};
|
|
201
|
-
},
|
|
202
|
-
const r =
|
|
203
|
+
}, Ge = (e, t) => {
|
|
204
|
+
const r = P(t, e);
|
|
203
205
|
return r === null ? null : e.caption === null || e.caption === void 0 ? {
|
|
204
206
|
kind: "pinnedNumber",
|
|
205
207
|
value: {
|
|
@@ -214,7 +216,7 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
214
216
|
content: e.caption
|
|
215
217
|
}
|
|
216
218
|
};
|
|
217
|
-
},
|
|
219
|
+
}, ze = (e) => ({
|
|
218
220
|
id: e.id,
|
|
219
221
|
start: {
|
|
220
222
|
anchorType: "panel",
|
|
@@ -228,21 +230,21 @@ var Ce = "#%_ENCODED_%#", re = (e) => {
|
|
|
228
230
|
},
|
|
229
231
|
startArrowheadStyle: e.startArrowheadStyle,
|
|
230
232
|
endArrowheadStyle: e.endArrowheadStyle
|
|
231
|
-
}),
|
|
232
|
-
if (!
|
|
233
|
+
}), P = (e, t) => {
|
|
234
|
+
if (!y(t)) return null;
|
|
233
235
|
const { dataset: r, anchorVariable: o, groupIsSeriesKey: i } = e;
|
|
234
236
|
if (o === null) return null;
|
|
235
|
-
const n =
|
|
236
|
-
return n === null ? null : i ?
|
|
237
|
+
const n = Ue(t, o, r);
|
|
238
|
+
return n === null ? null : i ? y(t.columnKey) ? {
|
|
237
239
|
anchorValue: n,
|
|
238
|
-
groupValue:
|
|
240
|
+
groupValue: oe(t.columnKey)
|
|
239
241
|
} : null : {
|
|
240
242
|
anchorValue: n,
|
|
241
243
|
groupValue: void 0
|
|
242
244
|
};
|
|
243
|
-
},
|
|
244
|
-
function
|
|
245
|
-
const o =
|
|
245
|
+
}, Ue = (e, t, r) => !y(e.rowIndex) || !r.hasVariable(t) ? null : r.getValues(t)[e.rowIndex] ?? null;
|
|
246
|
+
function Ye({ palette: e, overrides: t, ctx: r }) {
|
|
247
|
+
const o = ie(e, t, r);
|
|
246
248
|
if (o !== void 0)
|
|
247
249
|
return {
|
|
248
250
|
type: "styles",
|
|
@@ -255,7 +257,7 @@ function Ue({ palette: e, overrides: t, ctx: r }) {
|
|
|
255
257
|
]
|
|
256
258
|
};
|
|
257
259
|
}
|
|
258
|
-
function
|
|
260
|
+
function Ke(e, t, r = void 0) {
|
|
259
261
|
const o = [...e?.defaults ?? [], ...t ?? []], i = [...e?.overrides ?? [], ...r ?? []];
|
|
260
262
|
if (!(e === void 0 && o.length === 0 && i.length === 0))
|
|
261
263
|
return {
|
|
@@ -265,7 +267,7 @@ function Ye(e, t, r = void 0) {
|
|
|
265
267
|
...i.length === 0 ? {} : { overrides: i }
|
|
266
268
|
};
|
|
267
269
|
}
|
|
268
|
-
function
|
|
270
|
+
function z(e, t) {
|
|
269
271
|
return t === void 0 ? e : {
|
|
270
272
|
...e,
|
|
271
273
|
type: "styles",
|
|
@@ -275,13 +277,13 @@ function Ke(e, t) {
|
|
|
275
277
|
}
|
|
276
278
|
};
|
|
277
279
|
}
|
|
278
|
-
function
|
|
280
|
+
function je(e) {
|
|
279
281
|
return e?.highlightStyle === void 0 ? [] : e.highlightStyle === "gray" ? [a.geom({
|
|
280
282
|
saturation: 0,
|
|
281
283
|
alpha: 0.6
|
|
282
|
-
}, { state: "dimmed" })] : [a.geom({ alpha:
|
|
284
|
+
}, { state: "dimmed" })] : [a.geom({ alpha: pe }, { state: "dimmed" })];
|
|
283
285
|
}
|
|
284
|
-
function
|
|
286
|
+
function ie(e, t, r) {
|
|
285
287
|
const o = e.type === "custom" ? r.customPalettes?.[e.id] : void 0, i = t?.[1];
|
|
286
288
|
if (i?.hex !== void 0) return i.hex;
|
|
287
289
|
if (i?.id !== void 0) {
|
|
@@ -289,9 +291,9 @@ function oe(e, t, r) {
|
|
|
289
291
|
if (n !== void 0) return n;
|
|
290
292
|
}
|
|
291
293
|
if (e.type !== "default")
|
|
292
|
-
return e.type === "custom" ? o?.[0]?.hex :
|
|
294
|
+
return e.type === "custom" ? o?.[0]?.hex : de(e)[0];
|
|
293
295
|
}
|
|
294
|
-
var
|
|
296
|
+
var $e = [
|
|
295
297
|
"lilac",
|
|
296
298
|
"neon_pink",
|
|
297
299
|
"blackberry",
|
|
@@ -304,7 +306,7 @@ var je = [
|
|
|
304
306
|
"mint",
|
|
305
307
|
"cool",
|
|
306
308
|
"fresh"
|
|
307
|
-
], Xe = "#E5E5E5",
|
|
309
|
+
], Xe = "#E5E5E5", U = 0.1, Y = {
|
|
308
310
|
light: 0.05,
|
|
309
311
|
dark: 0.1
|
|
310
312
|
}, qe = {
|
|
@@ -322,7 +324,7 @@ var je = [
|
|
|
322
324
|
fresh: "#A4A4EE"
|
|
323
325
|
};
|
|
324
326
|
function Ze({ appearance: e, themeOverrides: t, palette: r, overrides: o, ctx: i }) {
|
|
325
|
-
const n =
|
|
327
|
+
const n = ie(r, o, i) ?? "#B84737", s = [], c = Qe(e?.border, n), l = Je(e, t, n), u = K(e?.textStyle?.body?.fontId, i.fontList), p = e?.textStyle?.body?.color, f = {
|
|
326
328
|
...l === void 0 ? {} : { fill: l },
|
|
327
329
|
...c,
|
|
328
330
|
...e?.hasRoundedCorners === !1 ? { cornerRadius: 0 } : {},
|
|
@@ -331,15 +333,15 @@ function Ze({ appearance: e, themeOverrides: t, palette: r, overrides: o, ctx: i
|
|
|
331
333
|
...e?.textScale === void 0 ? {} : { textScale: e.textScale }
|
|
332
334
|
};
|
|
333
335
|
Object.keys(f).length > 0 && s.push(a.graph(f));
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
+
const h = K(e?.textStyle?.heading?.fontId, i.fontList), b = e?.textStyle?.heading?.color;
|
|
337
|
+
h !== void 0 && s.push(a.heading({ fontFamily: h })), typeof b == "string" && s.push(a.heading.h1({ textColor: b })), typeof p == "string" && s.push(a.heading.h2({ textColor: p }), a.caption({ textColor: p }), a.source({ textColor: p }), a.source.link({ textColor: p }));
|
|
336
338
|
const d = t?.gridLineColor;
|
|
337
339
|
return typeof d == "string" && s.push(a.gridLine({ stroke: d }), a.tickLine({ stroke: d }), a.panelBorder({ stroke: d })), s;
|
|
338
340
|
}
|
|
339
341
|
function Je(e, t, r) {
|
|
340
342
|
if (e?.backgroundModifier === "tint") return {
|
|
341
|
-
light:
|
|
342
|
-
dark:
|
|
343
|
+
light: j(G.light, r, Y.light),
|
|
344
|
+
dark: j(G.dark, r, Y.dark)
|
|
343
345
|
};
|
|
344
346
|
const o = t?.graphBackground;
|
|
345
347
|
return typeof o == "string" ? o : void 0;
|
|
@@ -364,8 +366,8 @@ function Qe(e, t) {
|
|
|
364
366
|
const o = e.color ?? t;
|
|
365
367
|
return e.style === "tinted" ? {
|
|
366
368
|
stroke: {
|
|
367
|
-
light: tt(o,
|
|
368
|
-
dark: rt(o,
|
|
369
|
+
light: tt(o, U),
|
|
370
|
+
dark: rt(o, U)
|
|
369
371
|
},
|
|
370
372
|
strokeWidth: r
|
|
371
373
|
} : {
|
|
@@ -373,16 +375,16 @@ function Qe(e, t) {
|
|
|
373
375
|
strokeWidth: r
|
|
374
376
|
};
|
|
375
377
|
}
|
|
376
|
-
function
|
|
378
|
+
function K(e, t) {
|
|
377
379
|
if (!(e === void 0 || t === void 0))
|
|
378
380
|
return t.find((r) => r.id === e)?.fontFamily;
|
|
379
381
|
}
|
|
380
|
-
var et = (e) =>
|
|
382
|
+
var et = (e) => $e.includes(e), j = (e, t, r) => `color-mix(in srgb, ${e}, ${t} ${r * 100}%)`, tt = (e, t) => `hsl(from ${e} h s calc(l * ${1 + t}))`, rt = (e, t) => `hsl(from ${e} h s calc(l * ${1 - t}))`, ot = {
|
|
381
383
|
x: "top",
|
|
382
384
|
y: "left"
|
|
383
385
|
}, it = /* @__PURE__ */ new Set(["pie", "donut"]);
|
|
384
386
|
function nt(e, t = !1, r) {
|
|
385
|
-
return
|
|
387
|
+
return ke({
|
|
386
388
|
legend: st(e.legend, r?.legend),
|
|
387
389
|
axes: lt(e.axes, t, r?.axes),
|
|
388
390
|
headline: ct(e),
|
|
@@ -453,8 +455,8 @@ function pt(e) {
|
|
|
453
455
|
const t = {};
|
|
454
456
|
return e.label !== void 0 && (t.label = e.label), e.url !== void 0 && (t.url = e.url), Object.keys(t).length === 0 ? void 0 : t;
|
|
455
457
|
}
|
|
456
|
-
var H = I("constantY"), vt = 0.15,
|
|
457
|
-
const t =
|
|
458
|
+
var H = I("constantY"), vt = 0.15, yt = (e, t, r, o) => At[t](e, r, o), W = (e) => {
|
|
459
|
+
const t = R(e), { numeric: r } = e.groupVariableNamesByType(), o = r.filter((i) => i !== t);
|
|
458
460
|
return o.length <= 1 ? {
|
|
459
461
|
transforms: [],
|
|
460
462
|
mapping: {
|
|
@@ -481,7 +483,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
481
483
|
mapping: {},
|
|
482
484
|
scales: []
|
|
483
485
|
};
|
|
484
|
-
if (!e.seriesVariables.some((o) =>
|
|
486
|
+
if (!e.seriesVariables.some((o) => y(t[o]?.lineStyle))) return {
|
|
485
487
|
mapping: {},
|
|
486
488
|
scales: []
|
|
487
489
|
};
|
|
@@ -508,16 +510,16 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
508
510
|
range: r
|
|
509
511
|
})]
|
|
510
512
|
};
|
|
511
|
-
},
|
|
513
|
+
}, ht = (e) => {
|
|
512
514
|
const { categorical: t, temporal: r, numeric: o } = e.groupVariableNamesByType(), i = o[0];
|
|
513
|
-
if (!
|
|
515
|
+
if (!y(i)) throw new C({
|
|
514
516
|
code: "INVALID_DATA_SHAPE",
|
|
515
517
|
message: "No first numeric variable found",
|
|
516
518
|
suggestion: "Provide at least one numeric column for this chart type."
|
|
517
519
|
});
|
|
518
520
|
const n = o.slice(1);
|
|
519
521
|
return n.length === 0 ? {
|
|
520
|
-
...
|
|
522
|
+
...ne(),
|
|
521
523
|
mapping: {
|
|
522
524
|
x: i,
|
|
523
525
|
y: H,
|
|
@@ -549,7 +551,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
549
551
|
color: "key"
|
|
550
552
|
}
|
|
551
553
|
};
|
|
552
|
-
},
|
|
554
|
+
}, ne = () => ({
|
|
553
555
|
transforms: [T.constant({
|
|
554
556
|
variableName: H,
|
|
555
557
|
type: "categorical",
|
|
@@ -559,11 +561,11 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
559
561
|
}), mt = (e) => {
|
|
560
562
|
const { categorical: t, temporal: r, numeric: o } = e.groupVariableNamesByType();
|
|
561
563
|
let i, n;
|
|
562
|
-
if (
|
|
564
|
+
if (y(t[0]) && y(o[0]))
|
|
563
565
|
i = t[0], n = o[0];
|
|
564
|
-
else if (
|
|
566
|
+
else if (y(r[0]) && y(o[0]))
|
|
565
567
|
i = r[0], n = o[0];
|
|
566
|
-
else if (
|
|
568
|
+
else if (y(o[0]) && y(o[1]))
|
|
567
569
|
i = o[0], n = o[1];
|
|
568
570
|
else throw new C({
|
|
569
571
|
code: "INVALID_DATA_SHAPE",
|
|
@@ -575,7 +577,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
575
577
|
y: n,
|
|
576
578
|
color: i
|
|
577
579
|
};
|
|
578
|
-
},
|
|
580
|
+
}, se = (e, t, r) => {
|
|
579
581
|
const { transforms: o, mapping: i, seriesVariables: n } = W(e.dataset), s = O({
|
|
580
582
|
appearance: r,
|
|
581
583
|
seriesVariables: n
|
|
@@ -621,17 +623,17 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
621
623
|
seriesVariables: n,
|
|
622
624
|
styleDefaults: l
|
|
623
625
|
};
|
|
624
|
-
},
|
|
626
|
+
}, x = (e, t, r, o, i) => {
|
|
625
627
|
const { transforms: n, mapping: s, seriesVariables: c } = W(e.dataset), l = [...n];
|
|
626
628
|
if (o?.sortBars) {
|
|
627
|
-
const u =
|
|
629
|
+
const u = N(s.y);
|
|
628
630
|
u !== null && u !== "" && l.push(T.sort({
|
|
629
631
|
variableName: u,
|
|
630
632
|
direction: "desc"
|
|
631
633
|
}));
|
|
632
634
|
}
|
|
633
635
|
if (!i?.useSingleColorForBars) {
|
|
634
|
-
const u =
|
|
636
|
+
const u = R(e.dataset), { numeric: p } = e.dataset.groupVariableNamesByType();
|
|
635
637
|
p.filter((f) => f !== u).length === 1 && e.dataset.getType(u) === "categorical" && (s.color = u);
|
|
636
638
|
}
|
|
637
639
|
return {
|
|
@@ -642,7 +644,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
642
644
|
transforms: l,
|
|
643
645
|
seriesVariables: c
|
|
644
646
|
};
|
|
645
|
-
},
|
|
647
|
+
}, X = (e, t) => ({
|
|
646
648
|
layers: [m.bar({ position: "fill" })],
|
|
647
649
|
coords: g.polar({
|
|
648
650
|
theta: "y",
|
|
@@ -652,7 +654,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
652
654
|
scales: [],
|
|
653
655
|
seriesVariables: []
|
|
654
656
|
}), gt = (e) => {
|
|
655
|
-
const { transforms: t, scales: r, mapping: o } =
|
|
657
|
+
const { transforms: t, scales: r, mapping: o } = ht(e.dataset);
|
|
656
658
|
return {
|
|
657
659
|
layers: [m.point()],
|
|
658
660
|
coords: g.cartesian(),
|
|
@@ -663,21 +665,21 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
663
665
|
};
|
|
664
666
|
}, kt = (e) => {
|
|
665
667
|
const { numeric: t, categorical: r } = e.dataset.groupVariableNamesByType(), o = t[0];
|
|
666
|
-
if (!
|
|
668
|
+
if (!y(o)) throw new C({
|
|
667
669
|
code: "INVALID_DATA_SHAPE",
|
|
668
670
|
message: "No first numeric variable found",
|
|
669
671
|
suggestion: "Provide at least one numeric column for this chart type."
|
|
670
672
|
});
|
|
671
|
-
const i =
|
|
673
|
+
const i = y(t[1]) ? {
|
|
672
674
|
transforms: [],
|
|
673
675
|
scales: []
|
|
674
|
-
} :
|
|
676
|
+
} : ne(), n = {
|
|
675
677
|
x: o,
|
|
676
678
|
y: t[1] ?? H,
|
|
677
679
|
size: t[2],
|
|
678
680
|
label: r[0]
|
|
679
681
|
}, s = [...i.scales];
|
|
680
|
-
return
|
|
682
|
+
return y(n.size) && s.push(L.size.continuous()), {
|
|
681
683
|
layers: [m.point()],
|
|
682
684
|
coords: g.cartesian(),
|
|
683
685
|
mapping: n,
|
|
@@ -686,7 +688,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
686
688
|
seriesVariables: []
|
|
687
689
|
};
|
|
688
690
|
}, St = (e) => {
|
|
689
|
-
const t =
|
|
691
|
+
const t = R(e.dataset), { numeric: r } = e.dataset.groupVariableNamesByType(), o = r.filter((i) => i !== t);
|
|
690
692
|
return {
|
|
691
693
|
transforms: [T.reshape({
|
|
692
694
|
keep: [t],
|
|
@@ -730,12 +732,12 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
730
732
|
...t ? { yScaleType: "secondary" } : void 0
|
|
731
733
|
});
|
|
732
734
|
}, Tt = (e, t, r) => {
|
|
733
|
-
const { numeric: o } = e.dataset.groupVariableNamesByType(), i =
|
|
734
|
-
if (s.length === 1) return l ?
|
|
735
|
-
const u = e.axes?.hasDualYAxis === !0, p = l ? [] : s.slice(0, -1), f = l ? s : s.slice(-1),
|
|
735
|
+
const { numeric: o } = e.dataset.groupVariableNamesByType(), i = R(e.dataset), n = ge(e.dataset, i), s = o.filter((d) => d !== i), c = Se[t?.comboType ?? "grouped-bars"], l = c === null;
|
|
736
|
+
if (s.length === 1) return l ? se(e, t, r) : x(e, "dodge", g.cartesian(), t, r);
|
|
737
|
+
const u = e.axes?.hasDualYAxis === !0, p = l ? [] : s.slice(0, -1), f = l ? s : s.slice(-1), h = [], b = [];
|
|
736
738
|
if (c !== null && p.length > 0) {
|
|
737
739
|
const d = p.length === 1 ? p[0] : null;
|
|
738
|
-
|
|
740
|
+
y(d) ? h.push(m.bar({
|
|
739
741
|
transforms: [T.constant({
|
|
740
742
|
variableName: _.bar,
|
|
741
743
|
type: "categorical",
|
|
@@ -746,7 +748,7 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
746
748
|
color: _.bar
|
|
747
749
|
},
|
|
748
750
|
position: c
|
|
749
|
-
})) :
|
|
751
|
+
})) : h.push(m.bar({
|
|
750
752
|
transforms: [T.reshape({
|
|
751
753
|
keep: n,
|
|
752
754
|
reshape: p,
|
|
@@ -762,13 +764,13 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
762
764
|
}
|
|
763
765
|
if (l && f.length >= 2) {
|
|
764
766
|
const d = u ? f.slice(0, -1) : f, M = d.length === 1 ? d[0] : null;
|
|
765
|
-
if (
|
|
767
|
+
if (y(M)) h.push(D(M, !1, r));
|
|
766
768
|
else {
|
|
767
|
-
const
|
|
769
|
+
const E = O({
|
|
768
770
|
appearance: r,
|
|
769
771
|
seriesVariables: d
|
|
770
772
|
});
|
|
771
|
-
|
|
773
|
+
h.push(m.line({
|
|
772
774
|
transforms: [T.reshape({
|
|
773
775
|
keep: n,
|
|
774
776
|
reshape: d,
|
|
@@ -778,17 +780,17 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
778
780
|
aes: {
|
|
779
781
|
y: S,
|
|
780
782
|
color: "key",
|
|
781
|
-
...
|
|
783
|
+
...E.mapping
|
|
782
784
|
}
|
|
783
|
-
})), b.push(...
|
|
785
|
+
})), b.push(...E.scales);
|
|
784
786
|
}
|
|
785
787
|
if (u) {
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
+
const E = f[f.length - 1];
|
|
789
|
+
y(E) && h.push(D(E, !0, r));
|
|
788
790
|
}
|
|
789
|
-
} else for (const d of f)
|
|
791
|
+
} else for (const d of f) h.push(D(d, u, r));
|
|
790
792
|
return {
|
|
791
|
-
layers:
|
|
793
|
+
layers: h,
|
|
792
794
|
coords: g.cartesian(),
|
|
793
795
|
mapping: { x: i },
|
|
794
796
|
scales: b,
|
|
@@ -801,16 +803,16 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
801
803
|
context: { requested: e }
|
|
802
804
|
});
|
|
803
805
|
}, At = {
|
|
804
|
-
line: (e, t, r) =>
|
|
806
|
+
line: (e, t, r) => se(e, t, r),
|
|
805
807
|
areaStacked: (e, t, r) => bt(e, t, r),
|
|
806
|
-
bar: (e, t, r) =>
|
|
807
|
-
barStacked: (e, t, r) =>
|
|
808
|
-
barStackedFill: (e, t, r) =>
|
|
809
|
-
column: (e, t, r) =>
|
|
810
|
-
columnStacked: (e, t, r) =>
|
|
811
|
-
columnStackedFill: (e, t, r) =>
|
|
812
|
-
pie: (e) =>
|
|
813
|
-
donut: (e) =>
|
|
808
|
+
bar: (e, t, r) => x(e, "dodge", g.flip(), t, r),
|
|
809
|
+
barStacked: (e, t, r) => x(e, "stack", g.flip(), t, r),
|
|
810
|
+
barStackedFill: (e, t, r) => x(e, "fill", g.flip(), t, r),
|
|
811
|
+
column: (e, t, r) => x(e, "dodge", g.cartesian(), t, r),
|
|
812
|
+
columnStacked: (e, t, r) => x(e, "stack", g.cartesian(), t, r),
|
|
813
|
+
columnStackedFill: (e, t, r) => x(e, "fill", g.cartesian(), t, r),
|
|
814
|
+
pie: (e) => X(e, "pie"),
|
|
815
|
+
donut: (e) => X(e, "donut"),
|
|
814
816
|
scatter: (e) => gt(e),
|
|
815
817
|
bubble: (e) => kt(e),
|
|
816
818
|
combo: (e, t, r) => Tt(e, t, r),
|
|
@@ -819,13 +821,13 @@ var H = I("constantY"), vt = 0.15, ht = (e, t, r, o) => At[t](e, r, o), W = (e)
|
|
|
819
821
|
waterfall: V("waterfall"),
|
|
820
822
|
mekko: V("mekko"),
|
|
821
823
|
table: V("table")
|
|
822
|
-
}, Lt = new
|
|
824
|
+
}, Lt = new ue(), xt = [
|
|
823
825
|
"key",
|
|
824
826
|
I("lineSeriesLabel"),
|
|
825
827
|
I("barSeriesLabel")
|
|
826
828
|
];
|
|
827
|
-
function
|
|
828
|
-
const t = e.annotations ?? [], r =
|
|
829
|
+
function Nt(e) {
|
|
830
|
+
const t = e.annotations ?? [], r = wt(e.mapping), o = _t(e.dataset, e.transforms, e.layers), i = [];
|
|
829
831
|
for (const n of t) {
|
|
830
832
|
if (n.type !== "highlight") continue;
|
|
831
833
|
const s = Vt({
|
|
@@ -838,43 +840,43 @@ function Et(e) {
|
|
|
838
840
|
type: "highlight",
|
|
839
841
|
id: n.id,
|
|
840
842
|
predicate: s,
|
|
841
|
-
scope:
|
|
843
|
+
scope: Et(n.highlight, e.mapping)
|
|
842
844
|
});
|
|
843
845
|
}
|
|
844
846
|
return i;
|
|
845
847
|
}
|
|
846
|
-
function
|
|
847
|
-
const r =
|
|
848
|
+
function Et(e, t) {
|
|
849
|
+
const r = N(t.x);
|
|
848
850
|
return !(r !== null && r !== "") && e === "x-value" ? "series" : e;
|
|
849
851
|
}
|
|
850
|
-
function
|
|
851
|
-
const t =
|
|
852
|
-
return t !== null && t !== "" ? t :
|
|
852
|
+
function wt(e) {
|
|
853
|
+
const t = N(e.x);
|
|
854
|
+
return t !== null && t !== "" ? t : N(e.color);
|
|
853
855
|
}
|
|
854
856
|
function Vt({ annotation: e, rowIdentityVariable: t, dataset: r, compiledVariableNames: o }) {
|
|
855
857
|
switch (e.highlight) {
|
|
856
858
|
case "x-value":
|
|
857
|
-
return
|
|
859
|
+
return q(e, t, r);
|
|
858
860
|
case "series":
|
|
859
|
-
return
|
|
861
|
+
return Z(e, o);
|
|
860
862
|
case "data-point": {
|
|
861
|
-
const i =
|
|
863
|
+
const i = q(e, t, r), n = Z(e, o);
|
|
862
864
|
return i === null && n === null ? null : i === null ? n : n === null ? i : { and: [i, n] };
|
|
863
865
|
}
|
|
864
866
|
}
|
|
865
867
|
}
|
|
866
|
-
function
|
|
868
|
+
function q(e, t, r) {
|
|
867
869
|
if (t === null) return null;
|
|
868
|
-
const o =
|
|
870
|
+
const o = Pt(e, t, r);
|
|
869
871
|
return o === null ? null : {
|
|
870
872
|
variable: t,
|
|
871
873
|
eq: o
|
|
872
874
|
};
|
|
873
875
|
}
|
|
874
|
-
function
|
|
876
|
+
function Z(e, t) {
|
|
875
877
|
const r = e.columnKey;
|
|
876
|
-
if (!
|
|
877
|
-
const o =
|
|
878
|
+
if (!y(r)) return null;
|
|
879
|
+
const o = xt.filter((i) => t.includes(i));
|
|
878
880
|
return o.length === 0 ? null : { or: o.map((i) => ({
|
|
879
881
|
variable: i,
|
|
880
882
|
eq: r
|
|
@@ -891,10 +893,10 @@ function _t(e, t, r) {
|
|
|
891
893
|
for (const n of r) i(n.transforms ?? []);
|
|
892
894
|
return o;
|
|
893
895
|
}
|
|
894
|
-
function Rt(e, t, r) {
|
|
895
|
-
return e.rowValue !== void 0 ? e.rowValue : !h(e.rowIndex) || !r.getVariableNames().includes(t) ? null : r.getValues(t)[e.rowIndex] ?? null;
|
|
896
|
-
}
|
|
897
896
|
function Pt(e, t, r) {
|
|
897
|
+
return e.rowValue !== void 0 ? e.rowValue : !y(e.rowIndex) || !r.getVariableNames().includes(t) ? null : r.getValues(t)[e.rowIndex] ?? null;
|
|
898
|
+
}
|
|
899
|
+
function Rt(e, t, r) {
|
|
898
900
|
const { colorScheme: o, customPalettes: i } = r;
|
|
899
901
|
if (i && e && i[e]) return {
|
|
900
902
|
type: "custom",
|
|
@@ -930,19 +932,19 @@ function F(e) {
|
|
|
930
932
|
if (e === "waterfall") return "waterfall";
|
|
931
933
|
}
|
|
932
934
|
function Ct(e) {
|
|
933
|
-
return
|
|
935
|
+
return ae.includes(e);
|
|
934
936
|
}
|
|
935
937
|
function Dt(e) {
|
|
936
938
|
return he.includes(e);
|
|
937
939
|
}
|
|
938
940
|
function Ft({ axes: e, palette: t, overrides: r, isFlipped: o }) {
|
|
939
941
|
const i = [];
|
|
940
|
-
return i.push(
|
|
942
|
+
return i.push(J("x", o ? e?.y : e?.x)), i.push(J("y", o ? e?.x : e?.y)), i.push(L.color.palette({
|
|
941
943
|
palette: t,
|
|
942
944
|
overrides: r
|
|
943
945
|
})), i;
|
|
944
946
|
}
|
|
945
|
-
function
|
|
947
|
+
function J(e, t) {
|
|
946
948
|
return t?.scaleType === "logarithmic" || t?.min !== void 0 || t?.max !== void 0 ? t.scaleType === "logarithmic" ? L[e].log({
|
|
947
949
|
domainMin: t.min ?? void 0,
|
|
948
950
|
domainMax: t.max ?? void 0
|
|
@@ -972,33 +974,37 @@ function It(e) {
|
|
|
972
974
|
const o = $t(e);
|
|
973
975
|
o !== void 0 && t.push(a.tickLabel(o));
|
|
974
976
|
const i = A(e?.fontGoalLineLabel);
|
|
975
|
-
i !== void 0 && t.push(a.geom.rule.label(i)), t.push(...
|
|
977
|
+
i !== void 0 && t.push(a.geom.rule.label(i)), t.push(...Yt(e)), t.push(...Wt(e)), t.push(...Gt(e)), t.push(...Kt(e));
|
|
976
978
|
const n = k(e?.headlineRowGap);
|
|
977
979
|
return n !== void 0 && t.push(a.headlineItem({ gap: n })), t;
|
|
978
980
|
}
|
|
979
981
|
function Ht(e) {
|
|
980
|
-
const t =
|
|
982
|
+
const t = {}, r = e?.textPrimary, o = e?.textSecondary;
|
|
983
|
+
return typeof r == "string" && (t.textPrimary = r), typeof o == "string" && (t.textSecondary = o), Object.keys(t).length === 0 ? void 0 : t;
|
|
984
|
+
}
|
|
985
|
+
function Wt(e) {
|
|
986
|
+
const t = [], r = Mt(e);
|
|
981
987
|
r !== void 0 && t.push(a.tooltip(r));
|
|
982
|
-
const o =
|
|
988
|
+
const o = w(A(e?.fontTooltipHeading), v(e?.tooltipHeadingTextColor));
|
|
983
989
|
o !== void 0 && t.push(a.tooltip.heading(o));
|
|
984
|
-
const i = A(e?.fontTooltipLabel), n =
|
|
990
|
+
const i = A(e?.fontTooltipLabel), n = w(i, v(e?.tooltipLabelTextColor));
|
|
985
991
|
n !== void 0 && t.push(a.tooltip.label(n));
|
|
986
|
-
const s =
|
|
992
|
+
const s = w(i, v(e?.tooltipValueTextColor));
|
|
987
993
|
s !== void 0 && t.push(a.tooltip.value(s));
|
|
988
994
|
const c = v(e?.tooltipPrimaryRowColor);
|
|
989
995
|
c !== void 0 && t.push(a.tooltip.primaryRow({ fill: c }));
|
|
990
|
-
const l =
|
|
996
|
+
const l = Ot(e);
|
|
991
997
|
return l !== void 0 && t.push(a.annotation.pinnedNumber.label(l), a.annotation.comment.label(l)), t;
|
|
992
998
|
}
|
|
993
|
-
var
|
|
999
|
+
var Ot = (e) => {
|
|
994
1000
|
const t = v(e?.tooltipBackground), r = v(e?.tooltipBorderColor), o = {
|
|
995
|
-
...
|
|
1001
|
+
...w(A(e?.fontMiniTooltipLabel), v(e?.tooltipValueTextColor)),
|
|
996
1002
|
...t === void 0 ? {} : { fill: t },
|
|
997
1003
|
...r === void 0 ? {} : { stroke: r }
|
|
998
1004
|
};
|
|
999
1005
|
return Object.keys(o).length === 0 ? void 0 : o;
|
|
1000
|
-
},
|
|
1001
|
-
const t = v(e?.tooltipBackground), r = v(e?.tooltipBorderColor), o = k(e?.tooltipBorderWidth), i = k(e?.tooltipBorderRadius), n = k(e?.tooltipPaddingBlock), s = k(e?.tooltipPaddingInline), c = k(e?.tooltipRowGap), l = typeof e?.tooltipShadow == "string" ?
|
|
1006
|
+
}, Mt = (e) => {
|
|
1007
|
+
const t = v(e?.tooltipBackground), r = v(e?.tooltipBorderColor), o = k(e?.tooltipBorderWidth), i = k(e?.tooltipBorderRadius), n = k(e?.tooltipPaddingBlock), s = k(e?.tooltipPaddingInline), c = k(e?.tooltipRowGap), l = typeof e?.tooltipShadow == "string" ? jt(e.tooltipShadow) ?? void 0 : void 0, u = {
|
|
1002
1008
|
...t === void 0 ? {} : { fill: t },
|
|
1003
1009
|
...r === void 0 ? {} : { stroke: r },
|
|
1004
1010
|
...o === void 0 ? {} : { strokeWidth: o },
|
|
@@ -1010,17 +1016,17 @@ var Wt = (e) => {
|
|
|
1010
1016
|
};
|
|
1011
1017
|
return Object.keys(u).length === 0 ? void 0 : u;
|
|
1012
1018
|
};
|
|
1013
|
-
function
|
|
1019
|
+
function Gt(e) {
|
|
1014
1020
|
const t = [], r = k(e?.legendItemGap);
|
|
1015
1021
|
r !== void 0 && t.push(a.legend({ gap: r }));
|
|
1016
1022
|
const o = v(e?.legendFocusOutlineColor);
|
|
1017
1023
|
o !== void 0 && t.push(a.legend({ focusStroke: o }));
|
|
1018
|
-
const i = A(e?.fontLegendLabel), n = v(e?.legendTextColor), s =
|
|
1024
|
+
const i = A(e?.fontLegendLabel), n = v(e?.legendTextColor), s = w(i, n), c = zt(e, s);
|
|
1019
1025
|
c !== void 0 && t.push(a.legendItem(c));
|
|
1020
|
-
const l =
|
|
1026
|
+
const l = Ut(e);
|
|
1021
1027
|
return l !== void 0 && t.push(a.legendItem.swatch({ size: l })), s !== void 0 && t.push(a.directLabel(s)), t;
|
|
1022
1028
|
}
|
|
1023
|
-
var
|
|
1029
|
+
var zt = (e, t) => {
|
|
1024
1030
|
const r = v(e?.legendBackground), o = v(e?.legendBorderColor), i = k(e?.legendPillBorderWidth), n = k(e?.legendPillPaddingInline), s = k(e?.legendPillPaddingBlock), c = k(e?.legendSwatchGap), l = {
|
|
1025
1031
|
...t,
|
|
1026
1032
|
...r === void 0 ? {} : { fill: r },
|
|
@@ -1031,17 +1037,17 @@ var Gt = (e, t) => {
|
|
|
1031
1037
|
...c === void 0 ? {} : { gap: c }
|
|
1032
1038
|
};
|
|
1033
1039
|
return Object.keys(l).length === 0 ? void 0 : l;
|
|
1034
|
-
},
|
|
1040
|
+
}, Ut = (e) => {
|
|
1035
1041
|
const t = k(e?.legendSwatchWidth);
|
|
1036
1042
|
return k(e?.legendSwatchHeight) ?? t;
|
|
1037
|
-
},
|
|
1043
|
+
}, w = (e, t) => {
|
|
1038
1044
|
if (!(e === void 0 && t === void 0))
|
|
1039
1045
|
return {
|
|
1040
1046
|
...e,
|
|
1041
1047
|
...t === void 0 ? {} : { textColor: t }
|
|
1042
1048
|
};
|
|
1043
1049
|
};
|
|
1044
|
-
function
|
|
1050
|
+
function Yt(e) {
|
|
1045
1051
|
const t = v(e?.dataLabelTextColor), r = v(e?.stackTotalTextColor), o = [
|
|
1046
1052
|
[
|
|
1047
1053
|
"observation",
|
|
@@ -1074,7 +1080,7 @@ function Ut(e) {
|
|
|
1074
1080
|
...l === void 0 ? {} : { stroke: l }
|
|
1075
1081
|
})), i;
|
|
1076
1082
|
}
|
|
1077
|
-
function
|
|
1083
|
+
function Kt(e) {
|
|
1078
1084
|
const t = [], r = v(e?.trendPositiveColor), o = v(e?.trendNegativeColor), i = v(e?.trendNeutralColor);
|
|
1079
1085
|
return r !== void 0 && t.push(a.headlineItem.trend.up({ textColor: r })), o !== void 0 && t.push(a.headlineItem.trend.down({ textColor: o })), i !== void 0 && t.push(a.headlineItem.trend.flat({ textColor: i })), t;
|
|
1080
1086
|
}
|
|
@@ -1082,7 +1088,7 @@ function v(e) {
|
|
|
1082
1088
|
if (!(typeof e != "string" || e.trim().length === 0))
|
|
1083
1089
|
return e;
|
|
1084
1090
|
}
|
|
1085
|
-
function
|
|
1091
|
+
function jt(e) {
|
|
1086
1092
|
const t = e.trim();
|
|
1087
1093
|
if (t === "none") return "none";
|
|
1088
1094
|
const r = t.split(/\s+/), o = B(r[0]), i = B(r[1]), n = B(r[2]), s = r.slice(3).join(" ");
|
|
@@ -1102,11 +1108,11 @@ var B = (e) => {
|
|
|
1102
1108
|
};
|
|
1103
1109
|
function A(e) {
|
|
1104
1110
|
if (typeof e != "string") return;
|
|
1105
|
-
const t =
|
|
1111
|
+
const t = _e(e);
|
|
1106
1112
|
if (t !== null)
|
|
1107
1113
|
return {
|
|
1108
1114
|
fontFamily: t.family,
|
|
1109
|
-
fontSize:
|
|
1115
|
+
fontSize: re(t.size),
|
|
1110
1116
|
fontWeight: t.weight,
|
|
1111
1117
|
...t.lineHeight === void 0 ? {} : { lineHeight: t.lineHeight }
|
|
1112
1118
|
};
|
|
@@ -1122,10 +1128,10 @@ function $t(e) {
|
|
|
1122
1128
|
function k(e) {
|
|
1123
1129
|
if (typeof e == "number") return Number.isFinite(e) ? e : void 0;
|
|
1124
1130
|
if (typeof e != "string") return;
|
|
1125
|
-
const t =
|
|
1126
|
-
return t === null ? void 0 :
|
|
1131
|
+
const t = te(e);
|
|
1132
|
+
return t === null ? void 0 : re(t);
|
|
1127
1133
|
}
|
|
1128
|
-
var
|
|
1134
|
+
var Xt = /* @__PURE__ */ new Set([
|
|
1129
1135
|
"column",
|
|
1130
1136
|
"columnStacked",
|
|
1131
1137
|
"columnStackedFill",
|
|
@@ -1138,7 +1144,7 @@ var jt = /* @__PURE__ */ new Set([
|
|
|
1138
1144
|
"bubble",
|
|
1139
1145
|
"funnel",
|
|
1140
1146
|
"combo"
|
|
1141
|
-
]),
|
|
1147
|
+
]), qt = /* @__PURE__ */ new Set([
|
|
1142
1148
|
"column",
|
|
1143
1149
|
"columnStacked",
|
|
1144
1150
|
"columnStackedFill",
|
|
@@ -1149,49 +1155,49 @@ var jt = /* @__PURE__ */ new Set([
|
|
|
1149
1155
|
"areaStacked",
|
|
1150
1156
|
"combo"
|
|
1151
1157
|
]);
|
|
1152
|
-
function
|
|
1153
|
-
return
|
|
1158
|
+
function cr(e, t, r = {}) {
|
|
1159
|
+
return Zt(le(t), e, r);
|
|
1154
1160
|
}
|
|
1155
|
-
function
|
|
1156
|
-
const o = t.type ?? "column", i =
|
|
1161
|
+
function Zt(e, t, r = {}) {
|
|
1162
|
+
const o = t.type ?? "column", i = yt({
|
|
1157
1163
|
dataset: e,
|
|
1158
1164
|
axes: t.axes
|
|
1159
|
-
}, o, t.options ?? void 0, t.appearance ?? void 0), n = i.coords.coordType === "flip", s = i.transforms ?? [], c =
|
|
1165
|
+
}, o, t.options ?? void 0, t.appearance ?? void 0), n = i.coords.coordType === "flip", s = i.transforms ?? [], c = Rt(t.appearance?.paletteId, o, r), l = Bt(t.appearance?.seriesStyles), u = Jt(t);
|
|
1160
1166
|
return {
|
|
1161
1167
|
mapping: i.mapping,
|
|
1162
|
-
layers:
|
|
1168
|
+
layers: Qt(o, t, i.layers, i.coords, i.mapping, i.seriesVariables),
|
|
1163
1169
|
scales: [...Ft({
|
|
1164
1170
|
axes: t.axes,
|
|
1165
1171
|
palette: c,
|
|
1166
1172
|
overrides: l,
|
|
1167
1173
|
isFlipped: n
|
|
1168
1174
|
}), ...i.scales],
|
|
1169
|
-
styles: Ke(Ye(
|
|
1175
|
+
styles: z(z(Ke(Ye({
|
|
1170
1176
|
palette: c,
|
|
1171
1177
|
overrides: l,
|
|
1172
1178
|
ctx: r
|
|
1173
1179
|
}), [
|
|
1174
1180
|
...i.styleDefaults ?? [],
|
|
1175
|
-
|
|
1181
|
+
...je(t.appearance ?? void 0),
|
|
1176
1182
|
...Ze({
|
|
1177
1183
|
appearance: t.appearance ?? void 0,
|
|
1178
|
-
themeOverrides:
|
|
1184
|
+
themeOverrides: u,
|
|
1179
1185
|
palette: c,
|
|
1180
1186
|
overrides: l,
|
|
1181
1187
|
ctx: r
|
|
1182
1188
|
}),
|
|
1183
|
-
...It(
|
|
1184
|
-
...Re(
|
|
1185
|
-
],
|
|
1189
|
+
...It(u),
|
|
1190
|
+
...Re(u)
|
|
1191
|
+
], Pe(t.annotations)), Ce(u)), Ht(u)),
|
|
1186
1192
|
transforms: s,
|
|
1187
|
-
highlights:
|
|
1193
|
+
highlights: Nt({
|
|
1188
1194
|
annotations: t.annotations,
|
|
1189
1195
|
dataset: e,
|
|
1190
1196
|
mapping: i.mapping,
|
|
1191
1197
|
transforms: s,
|
|
1192
1198
|
layers: i.layers
|
|
1193
1199
|
}),
|
|
1194
|
-
annotations:
|
|
1200
|
+
annotations: Fe({
|
|
1195
1201
|
annotations: t.annotations,
|
|
1196
1202
|
dataset: e,
|
|
1197
1203
|
mapping: i.mapping,
|
|
@@ -1201,8 +1207,9 @@ function qt(e, t, r = {}) {
|
|
|
1201
1207
|
config: nt(t, n, i.config)
|
|
1202
1208
|
};
|
|
1203
1209
|
}
|
|
1204
|
-
|
|
1205
|
-
|
|
1210
|
+
var Jt = (e) => e.themeOverrides;
|
|
1211
|
+
function Qt(e, t, r, o, i, n) {
|
|
1212
|
+
const s = ir(t.dataLabels), c = s === void 0 ? r : r.map((u) => u.interactive === !1 ? u : {
|
|
1206
1213
|
...u,
|
|
1207
1214
|
dataLabels: {
|
|
1208
1215
|
...s,
|
|
@@ -1211,19 +1218,19 @@ function Zt(e, t, r, o, i, n) {
|
|
|
1211
1218
|
}), l = t.axes?.hasDualYAxis ?? !1;
|
|
1212
1219
|
return [
|
|
1213
1220
|
...c,
|
|
1214
|
-
...
|
|
1221
|
+
...er({
|
|
1215
1222
|
type: e,
|
|
1216
1223
|
trendline: t.referenceLines?.trendline,
|
|
1217
1224
|
coords: o,
|
|
1218
1225
|
mapping: i
|
|
1219
1226
|
}),
|
|
1220
|
-
...
|
|
1227
|
+
...tr({
|
|
1221
1228
|
type: e,
|
|
1222
1229
|
hasDualYAxis: l,
|
|
1223
1230
|
goalLine: t.referenceLines?.goalLine,
|
|
1224
1231
|
coords: o
|
|
1225
1232
|
}),
|
|
1226
|
-
...
|
|
1233
|
+
...or({
|
|
1227
1234
|
type: e,
|
|
1228
1235
|
hasDualYAxis: l,
|
|
1229
1236
|
averageLine: t.referenceLines?.averageLine,
|
|
@@ -1233,15 +1240,15 @@ function Zt(e, t, r, o, i, n) {
|
|
|
1233
1240
|
})
|
|
1234
1241
|
];
|
|
1235
1242
|
}
|
|
1236
|
-
function
|
|
1237
|
-
return t === void 0 ? [] :
|
|
1243
|
+
function er({ type: e, trendline: t, coords: r, mapping: o }) {
|
|
1244
|
+
return t === void 0 ? [] : Xt.has(e) ? r.coordType === "polar" ? [] : o.y === void 0 ? [] : [m.line({
|
|
1238
1245
|
aes: { lineType: { value: "dashed" } },
|
|
1239
|
-
stat:
|
|
1246
|
+
stat: Q.smooth({ method: t }),
|
|
1240
1247
|
interactive: !1
|
|
1241
1248
|
})] : [];
|
|
1242
1249
|
}
|
|
1243
|
-
function
|
|
1244
|
-
if (!
|
|
1250
|
+
function tr({ type: e, hasDualYAxis: t, goalLine: r, coords: o }) {
|
|
1251
|
+
if (!rr(r)) return [];
|
|
1245
1252
|
if (o.coordType === "polar") return [];
|
|
1246
1253
|
const i = o.coordType === "flip" ? "end" : "start";
|
|
1247
1254
|
return [m.rule({
|
|
@@ -1254,14 +1261,14 @@ function Qt({ type: e, hasDualYAxis: t, goalLine: r, coords: o }) {
|
|
|
1254
1261
|
interactive: !1
|
|
1255
1262
|
})];
|
|
1256
1263
|
}
|
|
1257
|
-
function
|
|
1264
|
+
function rr(e) {
|
|
1258
1265
|
return e !== void 0 && Number.isFinite(e.target);
|
|
1259
1266
|
}
|
|
1260
|
-
function
|
|
1267
|
+
function or({ type: e, hasDualYAxis: t, averageLine: r, coords: o, mapping: i, seriesVariables: n }) {
|
|
1261
1268
|
if (r === void 0) return [];
|
|
1262
|
-
if (!
|
|
1269
|
+
if (!qt.has(e)) return [];
|
|
1263
1270
|
if (o.coordType === "polar") return [];
|
|
1264
|
-
const s =
|
|
1271
|
+
const s = oe(r.columnKey);
|
|
1265
1272
|
if (!n.includes(s)) return [];
|
|
1266
1273
|
const c = i.color === "key", l = c ? S : s, u = c ? [T.filter({
|
|
1267
1274
|
variableName: "key",
|
|
@@ -1275,7 +1282,7 @@ function tr({ type: e, hasDualYAxis: t, averageLine: r, coords: o, mapping: i, s
|
|
|
1275
1282
|
group: void 0,
|
|
1276
1283
|
lineType: void 0
|
|
1277
1284
|
},
|
|
1278
|
-
stat:
|
|
1285
|
+
stat: Q.mean(),
|
|
1279
1286
|
transforms: u,
|
|
1280
1287
|
params: {
|
|
1281
1288
|
label: "Average",
|
|
@@ -1285,12 +1292,12 @@ function tr({ type: e, hasDualYAxis: t, averageLine: r, coords: o, mapping: i, s
|
|
|
1285
1292
|
interactive: !1
|
|
1286
1293
|
})];
|
|
1287
1294
|
}
|
|
1288
|
-
function
|
|
1295
|
+
function ir(e) {
|
|
1289
1296
|
if (!e) return;
|
|
1290
1297
|
const t = {};
|
|
1291
1298
|
return e.showDataLabels !== void 0 && (t.showDataLabels = e.showDataLabels), e.dataLabelFormat !== void 0 && (t.format = e.dataLabelFormat), e.showStackTotals !== void 0 && (t.showStackTotals = e.showStackTotals), e.showCategoryLabels !== void 0 && (t.showCategoryLabels = e.showCategoryLabels), Object.keys(t).length === 0 ? void 0 : t;
|
|
1292
1299
|
}
|
|
1293
|
-
var
|
|
1300
|
+
var ur = [
|
|
1294
1301
|
0.8,
|
|
1295
1302
|
1,
|
|
1296
1303
|
1.2,
|
|
@@ -1303,13 +1310,13 @@ var lr = [
|
|
|
1303
1310
|
4
|
|
1304
1311
|
];
|
|
1305
1312
|
export {
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1313
|
+
ur as CHART_TEXT_SCALES,
|
|
1314
|
+
lr as ROOT_FONT_SIZE_PX,
|
|
1315
|
+
cr as convertGraphConfig,
|
|
1309
1316
|
Ee as isFontStyle,
|
|
1310
|
-
|
|
1311
|
-
|
|
1317
|
+
te as parseFontLength,
|
|
1318
|
+
_e as parseFontShorthand,
|
|
1312
1319
|
we as parseFontWeight,
|
|
1313
|
-
|
|
1314
|
-
|
|
1320
|
+
Ve as parseUnitlessLineHeight,
|
|
1321
|
+
re as toPixels
|
|
1315
1322
|
};
|