@astrato-io/visualizations 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +307 -378
- package/chunks/{Button-BrGKp9Nm.js → Button-5CxPEACP.js} +11 -11
- package/chunks/CircularProgress-DFS-LQb7.js +765 -0
- package/chunks/FieldTypeIcon-pSVQFemC.js +22 -0
- package/chunks/LinearProgress-CjIQfkNA.js +327 -0
- package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-Cb7B7x6z.js} +1384 -1002
- package/chunks/Title-CtFw1bVg.js +1804 -0
- package/chunks/ToggleButton-Br9HCPCv.js +150 -0
- package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-B9775gLJ.js} +3 -3
- package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-B7wlH_Ro.js} +4 -4
- package/chunks/{builder-DEDvNq1k.js → builder-Dxo7D7c6.js} +118 -55
- package/chunks/{coloring-CncX_JRX.js → coloring-B-Wa8D5P.js} +3 -3
- package/chunks/contains-BK-sRXcB.js +21 -0
- package/chunks/{definitions-BPJQTx16.js → definitions-DNpzD9tY.js} +26 -26
- package/chunks/{escobar-DRhRMYRE.js → escobar-C4Nm3eJ7.js} +4436 -4802
- package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-BVKFtoe-.js} +46 -46
- package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-BlS3zoy_.js} +7 -7
- package/chunks/{filtering-cc7WqWpg.js → filtering-CGuLpg7u.js} +494 -270
- package/chunks/{handlers-TOT-7INo.js → handlers-CMbyj5y1.js} +1513 -1454
- package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-DYQgVEKG.js} +8 -8
- package/chunks/{isEqual-B8loyPsC.js → isEqual-DBg_b35N.js} +1 -1
- package/chunks/isFocusVisible-B1_z03UT.js +144 -0
- package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-Bo9i9qag.js} +7 -7
- package/chunks/{logger-DpQtYQnX.js → logger-3lng-wOw.js} +7 -3
- package/chunks/{metadata-WABZrt7Y.js → metadata-Fmx1swpK.js} +1 -1
- package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CdLd5aGW.js} +7 -7
- package/chunks/{operations-Dh4v1Ovt.js → operations-HSqnCRvv.js} +9156 -9112
- package/chunks/{range-Bi-7zT0k.js → range-CzO4isKK.js} +2 -2
- package/chunks/react-dom-BwZT0N3F.js +368 -0
- package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-CAuvgMxi.js} +1 -1
- package/chunks/{requirements-Dvd8jqYF.js → requirements-CYpVh65U.js} +52 -52
- package/chunks/responsive.styles-FItb913l.js +93 -0
- package/chunks/{shared-Bn4N5QcZ.js → shared-DFoJxjVN.js} +401 -401
- package/chunks/{standalone-D__XCp-h.js → standalone-530a5lvf.js} +306 -306
- package/chunks/{standalone-CXNP6-xD.js → standalone-5DnapeHH.js} +112 -112
- package/chunks/{standalone-XTgSsTAa.js → standalone-B4jrf4KE.js} +70 -70
- package/chunks/{standalone-Bes8srx1.js → standalone-B6s_xG2u.js} +14 -14
- package/chunks/{standalone-vBnBS2YC.js → standalone-BDrQMxLi.js} +98 -98
- package/chunks/standalone-BMoJXGYe.js +2 -0
- package/chunks/{standalone-CLmGb7nn2.js → standalone-BfvGggeM2.js} +76 -76
- package/chunks/{standalone-D5Q5ngsD.js → standalone-BvWdpUL3.js} +26 -26
- package/chunks/{standalone-we5D5MIn.js → standalone-C6XDHYAM.js} +31 -31
- package/chunks/standalone-CMJJIi9v.js +2 -0
- package/chunks/{standalone-C8ZAEutO.js → standalone-CNkHsynO.js} +28 -28
- package/chunks/{standalone-BMTCb10X.js → standalone-CPUiiWNP.js} +5 -5
- package/chunks/{standalone-XuGksArp.js → standalone-CXniic5x.js} +9 -9
- package/chunks/standalone-C_Jd4gkj.js +6 -0
- package/chunks/{standalone-DW6NT205.js → standalone-CiaaibTa.js} +142 -142
- package/chunks/standalone-CoQxJ6ov.js +3638 -0
- package/chunks/{standalone-CM5XcAN5.js → standalone-Cu73fzSr.js} +7660 -7534
- package/chunks/standalone-DBeXQrwH.js +468 -0
- package/chunks/{standalone-DMcI1afI.js → standalone-DMCwtebn.js} +81 -81
- package/chunks/{standalone-BlMIwpEe.js → standalone-DWPfdP0A.js} +800 -668
- package/chunks/{standalone-DLlyRIE6.js → standalone-DpSRmAWx.js} +59 -59
- package/chunks/{standalone-BGkmozIb.js → standalone-DuwTOBXH.js} +256 -256
- package/chunks/{standalone-BDhPQtzQ.js → standalone-LFVgLhia.js} +234 -234
- package/chunks/{standalone-B55oyW6c.js → standalone-kzAhwH19.js} +149 -149
- package/chunks/{standalone-DN4S1MjT.js → standalone-mb7LwEiq.js} +885 -885
- package/chunks/{standalone-CJvIXsQE.js → standalone-r4ObFvys.js} +155 -155
- package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-C1qjqXaT.js} +7 -7
- package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
- package/chunks/useFieldName-mWrD_uk_.js +7 -0
- package/chunks/{utils-vdmi_2PK.js → utils-DYYD4Zzf.js} +7593 -12707
- package/chunks/{view-BuwQugKb.js → view-7fH6mGmY.js} +2034 -2070
- package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-mVnsnvLP.js} +3581 -3555
- package/chunks/with-html-element-B0Clt4jY.js +15901 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +1 -1
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +1 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +1 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +2 -2
- package/docs/operations/line.md +1 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +1 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +66 -1
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +74 -68
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +67 -66
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +348 -348
- package/src/definitions/model/definitions/schema-registry.d.ts +101 -101
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +8 -8
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +29 -29
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
- package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
- package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
- package/src/visualization-catalog.d.ts +26 -26
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
- package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
- package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
- package/chunks/Title-CO5dP1ma.js +0 -1691
- package/chunks/ToggleButton-KOBAimC1.js +0 -112
- package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
- package/chunks/responsive.styles-DSiOGD7u.js +0 -82
- package/chunks/standalone-BXKRE_Se.js +0 -468
- package/chunks/standalone-BjZp0QMe.js +0 -2
- package/chunks/standalone-C8qAelL4.js +0 -2
- package/chunks/standalone-DT0wKji7.js +0 -6
- package/chunks/standalone-DYQIQH4c.js +0 -2095
- package/chunks/useFieldName-Cjn9KCVp.js +0 -7
- package/chunks/useSlotProps-DLbQp4lc.js +0 -166
- package/chunks/with-html-element-D0uY2zjI.js +0 -7328
- /package/chunks/{src-BOS6SqkZ.js → src-BOS6SqkZ2.js} +0 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { Bt as n, Ds as r, Gs as i, Gt as a, Ia as o, It as s, Kt as c, La as l, Tt as u, Us as d, Ut as f, Wt as p, Xa as m, Za as h, _t as g, ja as _, ls as v, ws as y, zi as b, zr as x } from "./visualization-filters-mVnsnvLP.js";
|
|
3
|
+
import { Bt as ee, F as S, N as C, Ot as w, ei as T, jr as E } from "./utils-DYYD4Zzf.js";
|
|
4
|
+
import { Nm as D } from "./handlers-CMbyj5y1.js";
|
|
5
|
+
import { t as O } from "./stroke-dash-UgMEcCS4.js";
|
|
6
|
+
import "./logger-3lng-wOw.js";
|
|
7
|
+
import { $ as k, At as A, Bt as j, Dt as te, Et as ne, F as re, G as ie, I as ae, Nt as oe, Q as se, St as ce, Ut as le, V as ue, W as M, Y as de, Yt as fe, Z as pe, Zt as N, _n as P, _t as F, an as I, cn as L, dt as R, et as z, fn as B, ft as me, gt as he, ht as V, i as ge, in as H, jt as _e, kt as ve, lt as ye, mt as be, n as xe, nt as Se, on as U, pt as Ce, q as we, rn as Te, sn as W, st as Ee, tt as De, ut as Oe, vt as G, xt as ke, yt as K, zt as Ae } from "./escobar-C4Nm3eJ7.js";
|
|
8
|
+
import { _ as q } from "./MenuOption-Cb7B7x6z.js";
|
|
9
|
+
import { t as je } from "./coloring-B-Wa8D5P.js";
|
|
10
|
+
import { t as Me, u as J } from "./src-77e3mC7i.js";
|
|
11
|
+
import { t as Ne } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
12
|
+
var Y = /* @__PURE__ */ e(T()), Pe = (e) => {
|
|
13
|
+
let { coloring: t } = e || {}, n = e.dimensions.filter(x);
|
|
14
|
+
switch (t?.type) {
|
|
15
|
+
case r.Categorical: return te(e, [], n[1] || n[0]);
|
|
16
|
+
case r.Gradient: return ve(e);
|
|
17
|
+
case r.Single: return d(n[0].dataItem);
|
|
18
|
+
default: return null;
|
|
19
|
+
}
|
|
20
|
+
}, Fe = (e, t, r) => {
|
|
21
|
+
let o = e.dimensions.filter(x), c = e.measures.filter(x), l = o[0], f = n(e.lineSettings, e.dimensions, e.measures), m = !1, h = {};
|
|
22
|
+
if (l && e?.axes?.dimension?.continuousAxis) {
|
|
23
|
+
let e = i(l.dataItem), t = !!l.datePart, n = e !== null && (u(e) || s(e));
|
|
24
|
+
m = !t && n;
|
|
25
|
+
}
|
|
26
|
+
let g = Pe(e);
|
|
27
|
+
if (h = ne(g ? Ne(e, g) : e, t, h), h = de(e, h, r.collections, m, !0), f) {
|
|
28
|
+
let t = c[0]?.secondaryAxis ? e?.axes?.secondaryMeasure : e?.axes?.primaryMeasure;
|
|
29
|
+
h[I(e, c[0])] = {
|
|
30
|
+
invert: we(!0, t),
|
|
31
|
+
data: { collection: "collection" },
|
|
32
|
+
...ie(t)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return a(e) && c.forEach((e) => {
|
|
36
|
+
let t = d(e.dataItem);
|
|
37
|
+
t && (h[W.YAxisScale]?.data)?.fields?.push(p(t));
|
|
38
|
+
}), {
|
|
39
|
+
...r,
|
|
40
|
+
scales: h
|
|
41
|
+
};
|
|
42
|
+
}, Ie = (e, t, r, i) => {
|
|
43
|
+
let o = _e(e, t, r, i), s = [], c = e.dimensions.filter(x), l = e.measures.filter(x), u = ae((e.supportingMeasures ?? []).filter(x)), f = n(e.lineSettings, e.dimensions, e.measures), m = a(e);
|
|
44
|
+
if (o.collections[0]?.data.extract[0] && (o.collections[0].data.extract[0].props = {
|
|
45
|
+
...o.collections[0].data.extract[0].props,
|
|
46
|
+
...u
|
|
47
|
+
}), c.length === 1 && l.length > 1 && f) {
|
|
48
|
+
let e = d(c[0].dataItem), t = l.map((e) => {
|
|
49
|
+
let t = d(e.dataItem);
|
|
50
|
+
return m ? p(t) : t;
|
|
51
|
+
});
|
|
52
|
+
o.collections[0].data.extract = l.map((n, r) => {
|
|
53
|
+
let i = d(n.dataItem), a = t[r];
|
|
54
|
+
return {
|
|
55
|
+
field: d(c[0].dataItem),
|
|
56
|
+
props: {
|
|
57
|
+
[e]: { field: e },
|
|
58
|
+
end: { field: a },
|
|
59
|
+
...t.reduce((e, t, n) => (e[`measure${n}`] = { field: t }, e), {}),
|
|
60
|
+
series: i,
|
|
61
|
+
color: i,
|
|
62
|
+
...u
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (c[1] && !f) {
|
|
68
|
+
let e = {
|
|
69
|
+
key: A.LineSeries,
|
|
70
|
+
data: { extract: [{
|
|
71
|
+
field: d(c[1].dataItem),
|
|
72
|
+
props: {
|
|
73
|
+
[d(c[1].dataItem)]: { field: d(c[1].dataItem) },
|
|
74
|
+
...u
|
|
75
|
+
}
|
|
76
|
+
}] }
|
|
77
|
+
};
|
|
78
|
+
s.push(e);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
...o,
|
|
82
|
+
collections: [...o.collections, ...s]
|
|
83
|
+
};
|
|
84
|
+
}, X = (e) => ({
|
|
85
|
+
enabled: e.dataLabels?.show || !1,
|
|
86
|
+
fontSize: Te(e.dataLabels?.size),
|
|
87
|
+
backdropColor: e.dataLabels?.backdropColor,
|
|
88
|
+
textColor: e.dataLabels?.textColor,
|
|
89
|
+
isColored: e.dataLabels?.isColored,
|
|
90
|
+
colorType: e.dataLabels?.showBackdrop ? o.Backdrop : o.Text,
|
|
91
|
+
density: e.dataLabels?.density || l.Medium
|
|
92
|
+
}), Le = (e, t, n, r, i) => {
|
|
93
|
+
let a = e.dimensions.find(x);
|
|
94
|
+
if (!a) return [];
|
|
95
|
+
let o = {
|
|
96
|
+
scale: H(e),
|
|
97
|
+
ref: d(a.dataItem)
|
|
98
|
+
}, s = {
|
|
99
|
+
scale: I(e, i),
|
|
100
|
+
ref: "end"
|
|
101
|
+
}, c = U(e);
|
|
102
|
+
return r.map((r, i) => {
|
|
103
|
+
let a = d(r.dataItem), l = he(e, t, n, r, !0, W.Collection, (e) => e.series?.value === a);
|
|
104
|
+
return {
|
|
105
|
+
...l,
|
|
106
|
+
key: `line-stacked-label-points-${i}`,
|
|
107
|
+
settings: {
|
|
108
|
+
...l.settings,
|
|
109
|
+
x: c ? s : o,
|
|
110
|
+
y: c ? o : s
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}, Re = (e, t, n, r) => {
|
|
115
|
+
let i = e.measures.filter(x), a = i.filter((e) => e.dataLabels?.show), o = i[0];
|
|
116
|
+
if (!o || !a.length || !e.dimensions.find(x)) return n;
|
|
117
|
+
let s = Le(e, t, n, a, o), c = {}, l = /* @__PURE__ */ new Map(), u = M({
|
|
118
|
+
componentKey: "line-stacked-labels",
|
|
119
|
+
targetComponentKeys: s.map((e, t) => {
|
|
120
|
+
let n = e.key, r = a[t];
|
|
121
|
+
return c[n] = X(r), l.set(n, r), n;
|
|
122
|
+
}),
|
|
123
|
+
targetSelector: `.${V}`,
|
|
124
|
+
label: ({ data: e, formatter: t, node: n }) => {
|
|
125
|
+
let r = l.get(n.key);
|
|
126
|
+
if (!r || e.series?.value !== d(r.dataItem)) return "";
|
|
127
|
+
let a = e[`measure${i.indexOf(r)}`]?.value;
|
|
128
|
+
return typeof a == "number" ? r.formatter ? t(r.formatter)(a, void 0, e) : String(a) : "";
|
|
129
|
+
},
|
|
130
|
+
skipBrush: !0
|
|
131
|
+
}, c, r, t);
|
|
132
|
+
return {
|
|
133
|
+
...n,
|
|
134
|
+
components: [
|
|
135
|
+
...n.components,
|
|
136
|
+
...s,
|
|
137
|
+
u
|
|
138
|
+
]
|
|
139
|
+
};
|
|
140
|
+
}, ze = (e, t, n, r) => {
|
|
141
|
+
let i = {}, a = {}, o = M({
|
|
142
|
+
targetComponentKeys: e.measures.filter(x).map((t) => {
|
|
143
|
+
let n = d(t.dataItem), r = G(e, t, y.Point);
|
|
144
|
+
return a[r] = n, i[r] = X(t), r;
|
|
145
|
+
}).filter((e) => i[e].enabled),
|
|
146
|
+
targetSelector: `.${V}`,
|
|
147
|
+
label: ({ data: e, node: t }) => e[a[t.key]]?.label,
|
|
148
|
+
skipBrush: !0
|
|
149
|
+
}, i, r, t);
|
|
150
|
+
return {
|
|
151
|
+
...n,
|
|
152
|
+
components: [...n.components, o]
|
|
153
|
+
};
|
|
154
|
+
}, Be = (e, t, n, r) => {
|
|
155
|
+
let i = e.measures.find(x);
|
|
156
|
+
if (!i?.dataLabels?.show) return n;
|
|
157
|
+
let o = d(i.dataItem), s = a(e), c = p(o);
|
|
158
|
+
s && K(n, 0, { [c]: { field: c } });
|
|
159
|
+
let l = G(e, i, y.Point), u = X(i), f = { [l]: u }, m = M({
|
|
160
|
+
componentKey: "line-dimension-stacked-labels",
|
|
161
|
+
targetComponentKeys: [l],
|
|
162
|
+
targetSelector: `.${V}`,
|
|
163
|
+
label: ({ data: e, formatter: t }) => {
|
|
164
|
+
let n = e[s ? c : o]?.value;
|
|
165
|
+
return typeof n == "number" ? i.formatter ? t(i.formatter)(n, void 0, e) : String(n) : "";
|
|
166
|
+
},
|
|
167
|
+
skipBrush: !0
|
|
168
|
+
}, f, r, t);
|
|
169
|
+
return {
|
|
170
|
+
...n,
|
|
171
|
+
components: [...n.components, m]
|
|
172
|
+
};
|
|
173
|
+
}, Ve = (e, t, r, i, a, o) => {
|
|
174
|
+
if (!v(e)) return r;
|
|
175
|
+
let s = n(e.lineSettings, e.dimensions, e.measures), c = s && e.dimensions.filter(x).length === 1 && e.measures.filter(x).length > 1, l = s && e.dimensions.filter(x).length > 1 && e.measures.filter(x).length === 1;
|
|
176
|
+
return s && !c && !l ? r : c ? Re(e, t, r, o) : l ? Be(e, t, r, o) : ze(e, t, r, o);
|
|
177
|
+
}, He = "line-end-labels", Ue = 6, We = 160, Ge = [2, 2], Ke = (e) => Object.values(B).includes(e.type) && e.layout?.dock === m.Right, qe = (e, t, r, i, a, o) => {
|
|
178
|
+
if (!e.lineSettings?.endLabels?.show || U(e) || n(e.lineSettings, e.dimensions, e.measures)) return r;
|
|
179
|
+
let s = e.dimensions.filter(x), c = e.measures.filter(x);
|
|
180
|
+
if (!s[0] || !c.length) return r;
|
|
181
|
+
let l = s[1], u = l ? d(l.dataItem) : void 0, p = c.length > 1, h = e.lineSettings.endLabels.showBackdrop ?? !1, g = (e.lineSettings.endLabels.position ?? D.Plot) === D.Right, _ = t.fonts.general.color ?? L.fontDark, v = ({ node: e }) => e?.attrs?.fill ?? _, b = (e) => new q(v(e)).betterContrast(new q(_), new q(L.fontLight), new q(L.fontDark)).rgb(), S = (e) => {
|
|
182
|
+
let t = String(e?.label ?? e?.value ?? "");
|
|
183
|
+
return l?.formatter?.format ? String(ee(l.formatter, e?.value)) : t;
|
|
184
|
+
}, C = c.map((n) => {
|
|
185
|
+
let r = f(n), i = ({ data: e }) => u ? e?.[u] : void 0;
|
|
186
|
+
return {
|
|
187
|
+
component: G(e, n, y.Point),
|
|
188
|
+
selector: `.${V}`,
|
|
189
|
+
strategy: {
|
|
190
|
+
type: "end",
|
|
191
|
+
settings: {
|
|
192
|
+
fontFamily: t.fonts.general.fontFamily,
|
|
193
|
+
fontSize: L.dataPoint.valueFontSize,
|
|
194
|
+
spacing: !0,
|
|
195
|
+
label: {
|
|
196
|
+
series: u,
|
|
197
|
+
label: u ? (e) => {
|
|
198
|
+
let t = S(i(e));
|
|
199
|
+
return p ? `${t} · ${r}` : t;
|
|
200
|
+
} : () => r,
|
|
201
|
+
linkData: u ? ({ data: e }) => e : void 0,
|
|
202
|
+
fontWeight: "bold",
|
|
203
|
+
offset: Ue,
|
|
204
|
+
maxWidth: We,
|
|
205
|
+
...h ? {
|
|
206
|
+
fill: b,
|
|
207
|
+
backdrop: (e) => ({
|
|
208
|
+
fill: v(e),
|
|
209
|
+
padding: Ge
|
|
210
|
+
})
|
|
211
|
+
} : {}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}), w = {
|
|
217
|
+
type: P.Labels,
|
|
218
|
+
key: He,
|
|
219
|
+
brush: u && !o?.disable?.interactions ? N(fe([""], {
|
|
220
|
+
...o,
|
|
221
|
+
disable: { brushing: o?.disable?.brushing }
|
|
222
|
+
})) : void 0,
|
|
223
|
+
layout: g ? {
|
|
224
|
+
dock: m.Right,
|
|
225
|
+
displayOrder: j.Labels
|
|
226
|
+
} : { displayOrder: j.Labels },
|
|
227
|
+
settings: { sources: C }
|
|
228
|
+
}, T = g ? r.components.map((e) => Ke(e) ? {
|
|
229
|
+
...e,
|
|
230
|
+
layout: {
|
|
231
|
+
...e.layout,
|
|
232
|
+
displayOrder: j.LegendOutsideLabels
|
|
233
|
+
}
|
|
234
|
+
} : e) : r.components;
|
|
235
|
+
return {
|
|
236
|
+
...r,
|
|
237
|
+
components: [...T, w]
|
|
238
|
+
};
|
|
239
|
+
}, Je = (e, t, n) => n.components.some((e) => e.key === "line-end-labels") ? {
|
|
240
|
+
...n,
|
|
241
|
+
components: n.components.map((e) => {
|
|
242
|
+
if (e.type !== P.Tooltip || !e.settings?.filter) return e;
|
|
243
|
+
let t = e.settings.filter;
|
|
244
|
+
return {
|
|
245
|
+
...e,
|
|
246
|
+
settings: {
|
|
247
|
+
...e.settings,
|
|
248
|
+
filter: (e) => e.some((e) => e.key === "line-end-labels") ? [] : t(e)
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
})
|
|
252
|
+
} : n;
|
|
253
|
+
Me();
|
|
254
|
+
var Ye = (e, t, n, r, a) => {
|
|
255
|
+
let o = e.dimensions.filter(x), c = e.measures.filter(x), l = o[0], u = c.some((e) => !!e.forecasts?.length), d = i(l?.dataItem), f = !!l.datePart;
|
|
256
|
+
return !u || !s(d) || !l || f ? n : [
|
|
257
|
+
se,
|
|
258
|
+
Xe,
|
|
259
|
+
Z,
|
|
260
|
+
Ze,
|
|
261
|
+
$e,
|
|
262
|
+
Qe
|
|
263
|
+
].reduce((n, i) => i(e, t, n, r, a), n);
|
|
264
|
+
}, Xe = (e, t, n) => {
|
|
265
|
+
let r = e.measures.filter(x).filter((e) => !!e.forecasts).reduce((r, i) => {
|
|
266
|
+
let a = i.forecasts.map((r, a) => {
|
|
267
|
+
let o = Q(e, t, n, i, r), s = g(i.dataItem, r, `${a}`), c = G(e, i, y.Line, `-forecast-line-${a}`), l = H(e), u = I(e, i);
|
|
268
|
+
return Ce({
|
|
269
|
+
coordinates: {
|
|
270
|
+
major: { scale: l },
|
|
271
|
+
minor: {
|
|
272
|
+
scale: u,
|
|
273
|
+
ref: s
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
layers: {
|
|
277
|
+
curve: e.lineSettings?.lineCurve,
|
|
278
|
+
line: {
|
|
279
|
+
stroke: o,
|
|
280
|
+
strokeWidth: r.strokeWidth,
|
|
281
|
+
strokeDasharray: O(r.strokeDash),
|
|
282
|
+
show: !0
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
orientation: U(e) ? h.Vertical : void 0
|
|
286
|
+
}, n, s, c);
|
|
287
|
+
});
|
|
288
|
+
return [...r, ...a];
|
|
289
|
+
}, []);
|
|
290
|
+
return {
|
|
291
|
+
...n,
|
|
292
|
+
components: [...r, ...n.components]
|
|
293
|
+
};
|
|
294
|
+
}, Z = (e, t, n) => {
|
|
295
|
+
let r = e.dimensions.filter(x), i = e.measures.filter(x), a = d(r[0]?.dataItem), o = i.filter((e) => !!e.forecasts).map((r) => r.forecasts.map((i, o) => {
|
|
296
|
+
let s = Q(e, t, n, r, i), c = g(r.dataItem, i, `${o}`), l = [], u = (e) => e[c]?.value === null || e[d(r.dataItem)]?.value === null;
|
|
297
|
+
if (K(n, 0, {
|
|
298
|
+
[c]: { field: c },
|
|
299
|
+
[a]: { field: a }
|
|
300
|
+
}), i.showDataPoints) {
|
|
301
|
+
let t = G(e, r, y.Point, `-forecast-line-${o}`);
|
|
302
|
+
l.push(F(e, r, c, s, t, !1, u));
|
|
303
|
+
}
|
|
304
|
+
let f = G(e, r, y.Point, `-forecast-line-${o}-tooltip`);
|
|
305
|
+
return l.push(F(e, r, c, s, f, !0, u)), l;
|
|
306
|
+
}).reduce((e, t) => [...e, ...t], [])).reduce((e, t) => [...e, ...t], []);
|
|
307
|
+
return {
|
|
308
|
+
...n,
|
|
309
|
+
components: [...n.components, ...o]
|
|
310
|
+
};
|
|
311
|
+
}, Ze = (e, t, n, r, i) => {
|
|
312
|
+
let a = e.dimensions.filter(x), o = e.measures.filter(x).find((e) => !!e.forecasts && !!e.forecasts[0]?.showForecastStart);
|
|
313
|
+
if (!i || !o) return n;
|
|
314
|
+
let s = d(a[0].dataItem), c = g(o.dataItem, o.forecasts[0], "0"), l = i[0].items.find((e) => e[c] !== null && e[c] !== void 0);
|
|
315
|
+
if (!l) return n;
|
|
316
|
+
let u = {
|
|
317
|
+
value: l[s],
|
|
318
|
+
label: {
|
|
319
|
+
text: o.forecasts[0].refLineLabel ?? "",
|
|
320
|
+
showValue: !1,
|
|
321
|
+
fill: "#4c4c3e"
|
|
322
|
+
},
|
|
323
|
+
stroke: "#96969680"
|
|
324
|
+
}, f = H(e), p = {
|
|
325
|
+
type: P.RefLine,
|
|
326
|
+
layout: { displayOrder: j.ForecastLine },
|
|
327
|
+
lines: { x: [Oe(u, f, t, a[0].formatter)] }
|
|
328
|
+
};
|
|
329
|
+
return {
|
|
330
|
+
...n,
|
|
331
|
+
components: [...n.components, p]
|
|
332
|
+
};
|
|
333
|
+
}, Qe = (e, t, n) => {
|
|
334
|
+
let r = e.measures.filter(x), i = e.coloring?.type;
|
|
335
|
+
if (!i || !n.scales[i]) return n;
|
|
336
|
+
let a = { ...n.scales }, o = a[i];
|
|
337
|
+
return r.forEach((r) => {
|
|
338
|
+
r.forecasts?.forEach((i, a) => {
|
|
339
|
+
let s = Q(e, t, n, r, i);
|
|
340
|
+
if (i.label && typeof s == "string") {
|
|
341
|
+
let e = g(r.dataItem, i, `${a}`);
|
|
342
|
+
o.data.push(e), o.range.push(s);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}), o.label = (e) => {
|
|
346
|
+
let t = "";
|
|
347
|
+
return r.forEach((n) => {
|
|
348
|
+
d(n.dataItem) === e.datum.value?.toString() ? t = c(n) ?? n.label ?? n.dataItem?.name : n.forecasts?.forEach((r, i) => {
|
|
349
|
+
g(n.dataItem, r, `${i}`) === e.datum.value && (t = r.label ?? "");
|
|
350
|
+
});
|
|
351
|
+
}), t;
|
|
352
|
+
}, {
|
|
353
|
+
...n,
|
|
354
|
+
scales: a
|
|
355
|
+
};
|
|
356
|
+
}, $e = (e, t, n, r, i) => {
|
|
357
|
+
let a = e.measures.filter(x).reduce((t, n) => {
|
|
358
|
+
let r = (n.forecasts ?? []).map((t, r) => G(e, n, y.Point, `-forecast-line-${r}-tooltip`));
|
|
359
|
+
return t.concat(r);
|
|
360
|
+
}, []);
|
|
361
|
+
return z(e, t, n, {
|
|
362
|
+
filter: (e) => e.filter((e) => a.findIndex((t) => t === e.key) !== -1),
|
|
363
|
+
placement: {
|
|
364
|
+
type: "pointer",
|
|
365
|
+
area: "target"
|
|
366
|
+
},
|
|
367
|
+
extract: De(e, t, et, Se)
|
|
368
|
+
}, `tooltip-${P.Point}-forecast`, i);
|
|
369
|
+
}, et = (e, t, n, r, i, a, o) => {
|
|
370
|
+
let s = [];
|
|
371
|
+
return e.forEach((e) => {
|
|
372
|
+
e.forecasts?.forEach((r, i) => {
|
|
373
|
+
let a = g(e.dataItem, r, `${i}`), l = t.data[a];
|
|
374
|
+
if (!l) return;
|
|
375
|
+
let u = l.value, d = c(e), f = r.label || d || e.label || e.dataItem.name || "", p = u;
|
|
376
|
+
!o && e.formatter ? p = n.formatter(e.formatter)(u) : o && e.formatter && (p = n.formatter(Ee(e.formatter))(u)), s.push({
|
|
377
|
+
label: f,
|
|
378
|
+
value: p
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
}), s;
|
|
382
|
+
}, Q = (e, t, n, r, i) => {
|
|
383
|
+
let a = new je(e, t).getMeasureColor(n, r);
|
|
384
|
+
switch (i.inheritColor) {
|
|
385
|
+
case _.Lighter: return J(a).brighter().toString();
|
|
386
|
+
case _.Darker: return J(a).darker().toString();
|
|
387
|
+
default: return a;
|
|
388
|
+
}
|
|
389
|
+
}, tt = (e, t, n) => pe(e, t, n), $ = class extends re {
|
|
390
|
+
constructor() {
|
|
391
|
+
super([
|
|
392
|
+
Ie,
|
|
393
|
+
Fe,
|
|
394
|
+
le,
|
|
395
|
+
ce,
|
|
396
|
+
R,
|
|
397
|
+
me,
|
|
398
|
+
ke,
|
|
399
|
+
Ve,
|
|
400
|
+
qe,
|
|
401
|
+
ye,
|
|
402
|
+
k,
|
|
403
|
+
Je,
|
|
404
|
+
tt,
|
|
405
|
+
oe,
|
|
406
|
+
Ye,
|
|
407
|
+
Ae,
|
|
408
|
+
be,
|
|
409
|
+
ue
|
|
410
|
+
]);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
function nt(e, t) {
|
|
414
|
+
let n = e.dimensions.filter(x).map((e) => d(e.dataItem)), r = n[0], i = e.measures.filter((e) => {
|
|
415
|
+
let t = e.advancedCalculation;
|
|
416
|
+
return x(e) && t?.type === "growth" && t.startFromZero && typeof t.offset == "number" && t.offset < 0 && !t.nonTimePeriod;
|
|
417
|
+
}).map((e) => d(e.dataItem)).filter((e) => e !== null);
|
|
418
|
+
return !t || !r || i.length === 0 || e.querySettings?.hideZeroValues ? t : t.map((e) => {
|
|
419
|
+
let t = e.items[0];
|
|
420
|
+
if (!t || t[r] == null) return e;
|
|
421
|
+
let a = t[r], o = n.slice(1).filter((e) => e !== null), s = (e) => JSON.stringify(o.map((t) => e[t])), c = /* @__PURE__ */ new Set(), l = e.items.map((e) => e[r] === a ? (c.add(s(e)), {
|
|
422
|
+
...e,
|
|
423
|
+
...Object.fromEntries(i.map((e) => [e, 0]))
|
|
424
|
+
}) : e), u = [];
|
|
425
|
+
e.items.forEach((t) => {
|
|
426
|
+
let n = s(t);
|
|
427
|
+
if (c.has(n)) return;
|
|
428
|
+
c.add(n);
|
|
429
|
+
let l = Object.fromEntries(e.fields.map((e) => [e.dataItemId, null]));
|
|
430
|
+
o.forEach((e) => {
|
|
431
|
+
l[e] = t[e];
|
|
432
|
+
}), l[r] = a, i.forEach((e) => {
|
|
433
|
+
l[e] = 0;
|
|
434
|
+
}), u.push(l);
|
|
435
|
+
});
|
|
436
|
+
let d = l.findIndex((e) => e[r] !== a), f = d === -1 ? l.length : d, p = e.groupings ? Object.fromEntries(Object.entries(e.groupings).map(([e, t]) => [Number(e) < f ? e : Number(e) + u.length, t])) : void 0;
|
|
437
|
+
return {
|
|
438
|
+
...e,
|
|
439
|
+
items: [
|
|
440
|
+
...l.slice(0, f),
|
|
441
|
+
...u,
|
|
442
|
+
...l.slice(f)
|
|
443
|
+
],
|
|
444
|
+
...p ? { groupings: p } : {}
|
|
445
|
+
};
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
var rt = E(), it = w(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
|
|
449
|
+
let a = C(), [o] = (0, Y.useState)(() => new $()), s = S(), c = (0, Y.useMemo)(() => ({
|
|
450
|
+
...i,
|
|
451
|
+
disable: {
|
|
452
|
+
...i.disable,
|
|
453
|
+
brushingAxis: !0
|
|
454
|
+
}
|
|
455
|
+
}), [i]), l = t || b, u = xe();
|
|
456
|
+
if (!e || !n || !r || !v(e)) return null;
|
|
457
|
+
let d = o.compile(e, l, nt(e, n), r, c, y.Line, a, s, u);
|
|
458
|
+
return d ? /* @__PURE__ */ (0, rt.jsx)(ge, {
|
|
459
|
+
config: i,
|
|
460
|
+
definition: d,
|
|
461
|
+
size: r,
|
|
462
|
+
vSpec: e
|
|
463
|
+
}) : null;
|
|
464
|
+
}), at = /* @__PURE__ */ t({
|
|
465
|
+
LineChart: () => it,
|
|
466
|
+
LineChartCompiler: () => $
|
|
467
|
+
});
|
|
468
|
+
export { $ as n, at as t };
|