@astrato-io/visualizations 0.10.0 → 0.11.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/CHANGELOG.md +21 -1
- package/README.md +22 -4
- package/THIRD_PARTY_NOTICES.md +494 -0
- package/VISUALIZATION_DEFINITIONS.md +59 -145
- package/chunks/{Button-CCF851ea.js → Button-CPG4WX8X.js} +3 -3
- package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-PSLW8HmD.js} +12 -12
- package/chunks/FieldTypeIcon-5k2bkqd0.js +22 -0
- package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-KQ2EQlGL.js} +16 -16
- package/chunks/{MenuOption-CQpT79AP.js → MenuOption-B-6K7kks.js} +151 -151
- package/chunks/{Title-C-p4ZarD.js → Title-BmvwZYkh.js} +32 -32
- package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-CFmH6gUN.js} +11 -11
- package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-BY5-T16I.js} +8 -8
- package/chunks/{bar-layout-DStC-GNV.js → bar-layout-BNou0dZF.js} +2 -2
- package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-BkhO7sDd.js} +55 -53
- package/chunks/{builder-CScg1TOS.js → builder-CNjuqD2z.js} +107 -56
- package/chunks/category-axis-D1OVyMrr.js +20 -0
- package/chunks/{coloring-9jU3s_-p.js → coloring-BOiP0rmn.js} +54 -54
- package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter-BkgQ7MFE.js} +166 -166
- package/chunks/defaults-B5_8S-J-.js +3 -0
- package/chunks/{definitions-C4grxhye.js → definitions-AS9GcavE.js} +263 -242
- package/chunks/{escobar-CjirINHP.js → escobar-cQ1eQ64G.js} +8528 -8461
- package/chunks/{extend-preset-D-l9u_we.js → extend-preset-BlCbcXKR.js} +421 -421
- package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CI7dDNM1.js} +12 -12
- package/chunks/{filtering-C1zakrrX.js → filtering-Dwi7hDPZ.js} +263 -263
- package/chunks/handlers-C63NVo7i.js +15433 -0
- package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-CBlxEu3s.js} +8 -8
- package/chunks/{isEqual-Ch9OEye3.js → isEqual-BdHo6wqq.js} +1 -1
- package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-C1nlVUwL.js} +9 -9
- package/chunks/line.compiler-DCv3h42f.js +198 -0
- package/chunks/linear-Bq_r9l5S.js +264 -0
- package/chunks/{logger-CKRjhSHQ.js → logger-Bc-DqDM_.js} +72 -72
- package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
- package/chunks/{map.compiler-CKzorLgK.js → map.compiler-CRO6XpdI.js} +43 -45
- package/chunks/measure-format-default-B6ghxih7.js +22 -0
- package/chunks/{metadata-Bb9pTXrq.js → metadata-CtkvZEhS.js} +1 -1
- package/chunks/number.compiler-kV4lobCZ.js +57 -0
- package/chunks/{operations-DZoY50VX.js → operations-COl9wgqi.js} +9893 -9831
- package/chunks/{range-D1BTmFMp.js → range-CMJ5yc5Z.js} +2 -2
- package/chunks/{react-dom-Dgv2azN2.js → react-dom-BjsCbYHq.js} +76 -76
- package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-DFHi3Wkr.js} +1 -1
- package/chunks/{requirements-NHNrR8Ie.js → requirements-C5YLmHKe.js} +251 -227
- package/chunks/{shared-UitWpq1J.js → shared-DyqxOie0.js} +290 -278
- package/chunks/standalone-06i1wmIX.js +6 -0
- package/chunks/{standalone-DtBk_iUz.js → standalone-9jrQ3zJT.js} +10 -10
- package/chunks/standalone-B6zUvxNQ.js +357 -0
- package/chunks/{standalone-Bnnr87pc.js → standalone-BYK2U0Vd.js} +418 -679
- package/chunks/standalone-Be5APcVv.js +762 -0
- package/chunks/standalone-Bp4G3MDx.js +396 -0
- package/chunks/{standalone-CbPk8bKn.js → standalone-BrjtMIdd.js} +132 -132
- package/chunks/{standalone-BOzHA_d4.js → standalone-Bsfz5vnJ.js} +57 -57
- package/chunks/standalone-BuXpKMnc.js +2 -0
- package/chunks/standalone-CIjNYyya.js +8378 -0
- package/chunks/{standalone-B0U6c3su.js → standalone-CS5VGoja.js} +358 -358
- package/chunks/standalone-CUGt2FUF.js +2 -0
- package/chunks/{standalone-BapqaniK.js → standalone-ChfEHb28.js} +2299 -1072
- package/chunks/standalone-CnF2OYLQ.js +355 -0
- package/chunks/standalone-CznEEiq3.js +422 -0
- package/chunks/{standalone-Ck63MZzj.js → standalone-D9k5SCd8.js} +165 -165
- package/chunks/{standalone-CRdDZYeM.js → standalone-DYVYccmY.js} +855 -855
- package/chunks/{standalone-CVknVdUC.js → standalone-DaNxWIKn.js} +27 -27
- package/chunks/{standalone-swGs70tD.js → standalone-Db_HNuWx.js} +50 -50
- package/chunks/standalone-DcuE8KBa.js +287 -0
- package/chunks/{standalone-U0WJwFlG.js → standalone-I5kRIsp8.js} +97 -97
- package/chunks/{standalone-BBu90BhK.js → standalone-K2OvRAQM.js} +125 -125
- package/chunks/{standalone-DCFY1MAV.js → standalone-c4CPN6ug.js} +4634 -4633
- package/chunks/{standalone-ByKKqT5L.js → standalone-iOnJhCvA.js} +302 -302
- package/chunks/standalone-pCrzBiTy.js +773 -0
- package/chunks/standalone-qrZaimgC.js +689 -0
- package/chunks/standalone-yqDJ8h3K.js +1012 -0
- package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-CMH_dtYs.js} +29 -29
- package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-BfxBzhhH.js} +1 -1
- package/chunks/{utils-3Igg6xmO.js → utils-BdJrEeIQ.js} +4037 -4015
- package/chunks/{view-DdMLZySj.js → view-Q-_XIrWE.js} +1615 -1615
- package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-BwS0xUqs.js} +1723 -1693
- package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-D_ooGNWI.js} +4006 -3994
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +30 -1
- package/docs/operations/combo.md +30 -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 +5 -4
- package/docs/operations/line.md +48 -1
- package/docs/operations/map.md +5274 -0
- 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 +1 -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 +3 -3
- package/index.js +528 -504
- package/metadata.js +2 -2
- package/operations.js +6 -6
- package/package.json +73 -68
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +34 -53
- package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +1 -1
- package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +14 -2
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +1 -1
- package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
- package/src/types.d.ts +28 -28
- package/src/visualization-catalog.d.ts +3 -0
- package/styles.css +1 -1
- package/chunks/FieldTypeIcon-D_MzsdfY.js +0 -22
- package/chunks/defaults-cyNhn37t.js +0 -3
- package/chunks/handlers-ZviIUC-j.js +0 -15387
- package/chunks/line.compiler-De5fiKuR.js +0 -198
- package/chunks/number.compiler-CaTmJkmi.js +0 -53
- package/chunks/standalone-BEekPuA12.js +0 -357
- package/chunks/standalone-BR2JuRIC.js +0 -422
- package/chunks/standalone-BwJqDj2Z.js +0 -396
- package/chunks/standalone-CRfDOO1x.js +0 -287
- package/chunks/standalone-DZDGX3aa.js +0 -518
- package/chunks/standalone-DhfgeJIk.js +0 -1012
- package/chunks/standalone-DibjA73M.js +0 -6
- package/chunks/standalone-DxBAyqAu.js +0 -772
- package/chunks/standalone-KMQPsNsq.js +0 -2
- package/chunks/standalone-MBLSvsrY.js +0 -2
- package/chunks/standalone-wgFAVnnm.js +0 -355
- package/chunks/standalone-xGV0dqPV.js +0 -689
|
@@ -1,518 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import { Da as e, Fo as t, Io as n, Pc as r, Qr as i, Ut as a, es as o, hc as s, in as c, mc as l, oa as u, rr as d, us as f } from "./visualization-filters-CzvFHE6M.js";
|
|
3
|
-
import { F as p, N as m, Zt as ee, ci as h, jt as g, s as te, zr as _ } from "./utils-3Igg6xmO.js";
|
|
4
|
-
import { h_ as v } from "./handlers-ZviIUC-j.js";
|
|
5
|
-
import { t as ne } from "./stroke-dash-UgMEcCS4.js";
|
|
6
|
-
import "./logger-CKRjhSHQ.js";
|
|
7
|
-
import { r as y } from "./extend-preset-D-l9u_we.js";
|
|
8
|
-
import { Bt as b, Ct as re, Gt as ie, I as ae, Kt as oe, L as se, R as ce, Vt as x, Wt as S, X as le, at as ue, cn as C, ct as w, fn as de, i as fe, in as pe, ln as me, n as he, nt as ge, on as _e, sn as T, tt as ve, un as ye, vn as E, yt as D } from "./escobar-CjirINHP.js";
|
|
9
|
-
import { p as O } from "./with-html-element-DOfkR3C1.js";
|
|
10
|
-
import "./builder-CScg1TOS.js";
|
|
11
|
-
h();
|
|
12
|
-
function k(e) {
|
|
13
|
-
let { measureProps: t, index: n, items: r, vSpec: i } = e, { positive: a, negative: o } = A(t, i), s;
|
|
14
|
-
return s = n === 0 ? r[0] > 0 ? a : o : r[n] > r[n - 1] ? a : o, s;
|
|
15
|
-
}
|
|
16
|
-
function A(e, t) {
|
|
17
|
-
let n = t.colors;
|
|
18
|
-
if (!e?.customColorEnabled) return M({ ...n }, t);
|
|
19
|
-
let { customColor: r } = e;
|
|
20
|
-
return M({
|
|
21
|
-
positive: r.positive ?? n.positive,
|
|
22
|
-
negative: r.negative ?? n.negative,
|
|
23
|
-
subTotal: r.subTotal ?? n.subTotal
|
|
24
|
-
}, t);
|
|
25
|
-
}
|
|
26
|
-
function j(e, t) {
|
|
27
|
-
let n = e.measureProps[t];
|
|
28
|
-
return n?.customColorEnabled && n?.customColor.subTotal ? n?.customColor.subTotal : e.colors.subTotal;
|
|
29
|
-
}
|
|
30
|
-
function M(e, t) {
|
|
31
|
-
return t.barSettings.translucentBars ? {
|
|
32
|
-
positive: F(e.positive, t),
|
|
33
|
-
negative: F(e.negative, t),
|
|
34
|
-
subTotal: F(e.subTotal, t)
|
|
35
|
-
} : e;
|
|
36
|
-
}
|
|
37
|
-
var N = .65, P = 1;
|
|
38
|
-
function F(e, t) {
|
|
39
|
-
return (n) => {
|
|
40
|
-
if (typeof n.datum.end.value != "number" || typeof n.datum.start.value != "number") return null;
|
|
41
|
-
let r = n.datum.end.value - n.datum.start.value;
|
|
42
|
-
n.datum.reverted.value && (r *= -1);
|
|
43
|
-
let i = [{
|
|
44
|
-
color: e,
|
|
45
|
-
opacity: P,
|
|
46
|
-
offset: +(r < 0)
|
|
47
|
-
}, {
|
|
48
|
-
color: e,
|
|
49
|
-
opacity: N,
|
|
50
|
-
offset: r < 0 ? 0 : 1
|
|
51
|
-
}];
|
|
52
|
-
return r < 0 && i.reverse(), {
|
|
53
|
-
type: "gradient",
|
|
54
|
-
degree: T(t) ? 0 : 90,
|
|
55
|
-
stops: i
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
var be = (e, t) => t || e.colors.brandColors[0], xe = "subTotal-measure", I = (e) => `${xe}-${e}`, L = "total-measure", R = (e) => `${s.Waterfall}.subTotal.${e}`, z = `${s.Waterfall}.total`;
|
|
60
|
-
function B(e) {
|
|
61
|
-
return ({ data: t, formatter: n }) => {
|
|
62
|
-
let r = t?.end.value - t?.start.value;
|
|
63
|
-
return t?.reverted?.value && (r *= -1), e.formatter && r && n ? n(e.formatter)(`${r}`) : `${r}`;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
var V = "waterfall-chart", H = {
|
|
67
|
-
scale: "onlyMeasures",
|
|
68
|
-
ref: "series"
|
|
69
|
-
};
|
|
70
|
-
function U(e) {
|
|
71
|
-
return {
|
|
72
|
-
collection: "collection-no-dimension",
|
|
73
|
-
filter: (t) => t?.source?.field === e
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function Se(e, t, r) {
|
|
77
|
-
let i = U(I(r)), a = {
|
|
78
|
-
scale: e.orientation === n.Horizontal ? C.XAxisScale : C.YAxisScale,
|
|
79
|
-
ref: "end"
|
|
80
|
-
}, o = j(e, r);
|
|
81
|
-
return {
|
|
82
|
-
type: E.Box,
|
|
83
|
-
layout: { displayOrder: x.VisualizationElement },
|
|
84
|
-
key: R(r),
|
|
85
|
-
data: i,
|
|
86
|
-
settings: W(e, t, H, a, o),
|
|
87
|
-
animations: {
|
|
88
|
-
enabled: !0,
|
|
89
|
-
presetId: V
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function Ce(e, t) {
|
|
94
|
-
let r = U(L), i = {
|
|
95
|
-
scale: e.orientation === n.Horizontal ? C.XAxisScale : C.YAxisScale,
|
|
96
|
-
ref: "end"
|
|
97
|
-
}, a = e.total.color;
|
|
98
|
-
return {
|
|
99
|
-
type: E.Box,
|
|
100
|
-
layout: { displayOrder: x.VisualizationElement },
|
|
101
|
-
key: z,
|
|
102
|
-
data: r,
|
|
103
|
-
settings: W(e, t, H, i, a),
|
|
104
|
-
animations: {
|
|
105
|
-
enabled: !0,
|
|
106
|
-
presetId: V
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
var we = (e, t, n, r) => ({
|
|
111
|
-
type: E.Box,
|
|
112
|
-
layout: { displayOrder: x.VisualizationElement },
|
|
113
|
-
key: D(e, t, s.Waterfall),
|
|
114
|
-
data: r,
|
|
115
|
-
settings: n,
|
|
116
|
-
animations: {
|
|
117
|
-
enabled: !0,
|
|
118
|
-
presetId: V
|
|
119
|
-
}
|
|
120
|
-
}), W = (t, r, i, o, s) => {
|
|
121
|
-
let c = {
|
|
122
|
-
orientation: t.orientation ?? n.Vertical,
|
|
123
|
-
major: i,
|
|
124
|
-
minor: o,
|
|
125
|
-
box: {
|
|
126
|
-
minWidthPx: 2,
|
|
127
|
-
ref: "",
|
|
128
|
-
rx: a(t.barSettings.barRadius, 0),
|
|
129
|
-
fill: s,
|
|
130
|
-
stacked: !1,
|
|
131
|
-
grouped: !1,
|
|
132
|
-
boxPadding: t.barSettings.barPadding ?? 0,
|
|
133
|
-
groupPadding: 0,
|
|
134
|
-
itemsInStackCount: 0,
|
|
135
|
-
roundAllEdges: t.barSettings.roundAllEdges ?? !1,
|
|
136
|
-
useCustomBoxRounding: t.barSettings.useCustomBoxRounding ?? !1,
|
|
137
|
-
ignoreOutOfBounds: t.barSettings.ignoreOutOfBounds ?? !1
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
return t.barSettings?.strokeEnabled ? (c.box.stroke = be(r, t.barSettings?.strokeColor ?? ""), c.box.strokeWidth = t.barSettings?.strokeWidth) : c.box.stroke = e.transparent, c;
|
|
141
|
-
}, G = "collection-no-dimension", K = "onlyMeasures";
|
|
142
|
-
v.Inside, v.Outside, v.Opposite;
|
|
143
|
-
function q(e, t) {
|
|
144
|
-
let n = e.measures.filter((e) => i(e));
|
|
145
|
-
return n.filter((i, a) => {
|
|
146
|
-
let o = r(i.dataItem), s = t[0].items[0][o], c = e.measureProps[o];
|
|
147
|
-
if (a === 0) return !!s || !c?.hideIfEmpty;
|
|
148
|
-
let l = r(n[a - 1].dataItem);
|
|
149
|
-
return s !== t[0].items[0][l] || !c?.hideIfEmpty;
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
var Te = (e, n, r, a, o, s, c, l) => {
|
|
153
|
-
r = S(e, n, r, a, o, s, c, l);
|
|
154
|
-
let u = [], f = [];
|
|
155
|
-
if ("axes" in e) {
|
|
156
|
-
let r = e.axes?.dimension || {};
|
|
157
|
-
if (!r.disabled) {
|
|
158
|
-
let a = T(e) ? t.Left : t.Bottom;
|
|
159
|
-
if (u.push(ie(K, r, {
|
|
160
|
-
...n.axis.measure,
|
|
161
|
-
...n.fonts
|
|
162
|
-
}, a)), r.showAxisName) {
|
|
163
|
-
let t = e.measures.filter((e) => i(e)), o = t.length ? t : e.measures;
|
|
164
|
-
if (o.length) {
|
|
165
|
-
let t = d(e.measures, !!e.enableAlternate, s?.isPrintMode);
|
|
166
|
-
f.push(oe(o, t, a, {
|
|
167
|
-
...n.axis.measure,
|
|
168
|
-
...n.fonts
|
|
169
|
-
}, void 0, r.axisTitle ?? "Measures", r.titleFontSize, "waterfall-measures-axis-label"));
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
...r,
|
|
176
|
-
components: [
|
|
177
|
-
...r.components,
|
|
178
|
-
...u,
|
|
179
|
-
...f
|
|
180
|
-
]
|
|
181
|
-
};
|
|
182
|
-
}, Ee = (e, t, n, i, a) => {
|
|
183
|
-
if (!a) return n;
|
|
184
|
-
let o = le(e, {});
|
|
185
|
-
(e.axes?.primaryMeasure?.axisRange?.axisRangeOption ?? f.Auto) === f.Auto && (T(e) ? o[C.XAxisScale].expand = .3 : o[C.YAxisScale].expand = .3);
|
|
186
|
-
let s = [];
|
|
187
|
-
return q(e, a).forEach((t, n) => {
|
|
188
|
-
let i = r(t.dataItem), a = c(t);
|
|
189
|
-
s.push({
|
|
190
|
-
value: i,
|
|
191
|
-
label: a || t.label || t.dataItem.name
|
|
192
|
-
});
|
|
193
|
-
let o = e.measureProps[i];
|
|
194
|
-
o?.subTotalEnabled && s.push({
|
|
195
|
-
value: I(n),
|
|
196
|
-
label: o?.subTotalLabel || "Sub-Total"
|
|
197
|
-
});
|
|
198
|
-
}), e.total.enabled && s.push({
|
|
199
|
-
value: L,
|
|
200
|
-
label: e.total.label || "Total"
|
|
201
|
-
}), o.onlyMeasures = {
|
|
202
|
-
data: { items: s },
|
|
203
|
-
padding: e.barSettings.barPadding ?? 0,
|
|
204
|
-
type: de.Band,
|
|
205
|
-
value: (e) => `${e.datum.value.value}`,
|
|
206
|
-
label: (e) => `${e.datum.value.label}`
|
|
207
|
-
}, {
|
|
208
|
-
...n,
|
|
209
|
-
scales: o
|
|
210
|
-
};
|
|
211
|
-
}, J = "measures", De = (e, t, n, a, o) => {
|
|
212
|
-
if (!o) return n;
|
|
213
|
-
let s = [], c, l = q(e, o), u = se((e.supportingMeasures ?? []).filter((e) => i(e)));
|
|
214
|
-
if (l.forEach((t, n) => {
|
|
215
|
-
let i = r(t.dataItem), a, o;
|
|
216
|
-
if (n === 0) a = 0, o = { field: i }, c = "end";
|
|
217
|
-
else if (c === "start") a = { field: r(l[n - 1].dataItem) }, o = { field: i }, c = "end";
|
|
218
|
-
else {
|
|
219
|
-
let e = r(l[n - 1].dataItem);
|
|
220
|
-
a = { field: i }, o = { field: e }, c = "start";
|
|
221
|
-
}
|
|
222
|
-
s.push({
|
|
223
|
-
field: i,
|
|
224
|
-
props: {
|
|
225
|
-
stackKey: J,
|
|
226
|
-
[i]: { field: i },
|
|
227
|
-
...u,
|
|
228
|
-
series: i,
|
|
229
|
-
start: a,
|
|
230
|
-
color: i,
|
|
231
|
-
end: o,
|
|
232
|
-
secondaryAxis: t.secondaryAxis,
|
|
233
|
-
isMultipleMeasures: !0,
|
|
234
|
-
subTotal: !1,
|
|
235
|
-
reverted: c === "start"
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
let d = e.measureProps[i];
|
|
239
|
-
if (d?.subTotalEnabled) {
|
|
240
|
-
let e = I(n), t, r;
|
|
241
|
-
c === "end" ? (t = 0, r = { field: i }) : (t = { field: i }, r = 0), s.push({
|
|
242
|
-
field: e,
|
|
243
|
-
props: {
|
|
244
|
-
stackKey: J,
|
|
245
|
-
...u,
|
|
246
|
-
series: e,
|
|
247
|
-
start: t,
|
|
248
|
-
color: e,
|
|
249
|
-
end: r,
|
|
250
|
-
secondaryAxis: !1,
|
|
251
|
-
isMultipleMeasures: !0,
|
|
252
|
-
label: d?.subTotalLabel || "Sub-Total",
|
|
253
|
-
subTotal: !0,
|
|
254
|
-
reverted: c === "start"
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}), e.total.enabled) {
|
|
259
|
-
let t = r(l[l.length - 1].dataItem), n, i;
|
|
260
|
-
c === "end" ? (n = 0, i = { field: t }) : (n = { field: t }, i = 0), s.push({
|
|
261
|
-
field: L,
|
|
262
|
-
props: {
|
|
263
|
-
stackKey: J,
|
|
264
|
-
...u,
|
|
265
|
-
series: L,
|
|
266
|
-
start: n,
|
|
267
|
-
color: L,
|
|
268
|
-
end: i,
|
|
269
|
-
secondaryAxis: !1,
|
|
270
|
-
isMultipleMeasures: !0,
|
|
271
|
-
label: e.total.label || "Total",
|
|
272
|
-
subTotal: !0,
|
|
273
|
-
reverted: c === "start"
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
let d = {
|
|
278
|
-
key: G,
|
|
279
|
-
data: { extract: s }
|
|
280
|
-
};
|
|
281
|
-
return {
|
|
282
|
-
...n,
|
|
283
|
-
collections: [d]
|
|
284
|
-
};
|
|
285
|
-
}, Oe = (e, t, n, i, a) => {
|
|
286
|
-
if (!a) return n;
|
|
287
|
-
let o = Object.values(a[0].items[0]), s = q(e, a).reduce((n, i, a) => {
|
|
288
|
-
let s = r(i.dataItem), c = U(s), l = {
|
|
289
|
-
scale: _e(e, i),
|
|
290
|
-
ref: "end"
|
|
291
|
-
}, u = k({
|
|
292
|
-
measureProps: e.measureProps[s],
|
|
293
|
-
index: a,
|
|
294
|
-
items: o,
|
|
295
|
-
vSpec: e
|
|
296
|
-
}), d = [...n], f = W(e, t, H, l, u);
|
|
297
|
-
return d.push(we(e, i, f, c)), e.measureProps[s]?.subTotalEnabled && d.push(Se(e, t, a)), d;
|
|
298
|
-
}, []);
|
|
299
|
-
return e.total.enabled && s.push(Ce(e, t)), {
|
|
300
|
-
...n,
|
|
301
|
-
components: [...n.components, ...s]
|
|
302
|
-
};
|
|
303
|
-
}, Y = [{ position: v.Outside }, {
|
|
304
|
-
position: v.Inside,
|
|
305
|
-
justify: 1
|
|
306
|
-
}], ke = (e, t, n, i, a) => {
|
|
307
|
-
if (!a) return n;
|
|
308
|
-
let o = [], s = q(e, a);
|
|
309
|
-
return s.forEach((n, i) => {
|
|
310
|
-
if (!n.dataLabels?.show) return;
|
|
311
|
-
o.push(Me(e, t, n, i));
|
|
312
|
-
let a = r(n.dataItem);
|
|
313
|
-
e.measureProps[a]?.subTotalEnabled && o.push(je(e, t, n, i));
|
|
314
|
-
}), e.total.enabled && e.total.showDataLabel && o.push(Ae(e, t, s)), {
|
|
315
|
-
...n,
|
|
316
|
-
components: [...n.components, ...o]
|
|
317
|
-
};
|
|
318
|
-
}, X = {
|
|
319
|
-
layout: { displayOrder: x.Labels },
|
|
320
|
-
animations: {
|
|
321
|
-
enabled: !0,
|
|
322
|
-
presetId: "chart-labels"
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
function Ae(e, t, n) {
|
|
326
|
-
let r = n[n.length - 1], i = B(r);
|
|
327
|
-
return {
|
|
328
|
-
...X,
|
|
329
|
-
type: E.Labels,
|
|
330
|
-
key: "bar-labels-normal-total",
|
|
331
|
-
settings: Z(e, t, z, i, e.total?.showLabelBackdrop, e.total?.labelFontSize)
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
function je(e, t, n, r) {
|
|
335
|
-
return {
|
|
336
|
-
...X,
|
|
337
|
-
type: E.Labels,
|
|
338
|
-
key: `bar-labels-normal-${r}-sub`,
|
|
339
|
-
settings: Z(e, t, R(r), B(n), n.dataLabels?.showBackdrop, n.dataLabels?.size)
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
function Me(e, t, n, r) {
|
|
343
|
-
let i = D(e, n, s.Waterfall);
|
|
344
|
-
return {
|
|
345
|
-
...X,
|
|
346
|
-
type: E.Labels,
|
|
347
|
-
key: `bar-labels-normal-${r}`,
|
|
348
|
-
settings: Z(e, t, i, B(n), n.dataLabels?.showBackdrop, n.dataLabels?.size)
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
function Z(e, t, n, r, i = !1, a = me.dataPoint.valueFontSize) {
|
|
352
|
-
return { sources: [{
|
|
353
|
-
component: n,
|
|
354
|
-
selector: ye.Rect,
|
|
355
|
-
strategy: {
|
|
356
|
-
type: "bar",
|
|
357
|
-
settings: {
|
|
358
|
-
direction: Ne(e),
|
|
359
|
-
fontSize: pe(a),
|
|
360
|
-
fontFamily: t.fonts.general.fontFamily,
|
|
361
|
-
labels: [{
|
|
362
|
-
label: r,
|
|
363
|
-
placements: i ? Y.map((n) => ce(n, t, T(e))) : Y
|
|
364
|
-
}]
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}] };
|
|
368
|
-
}
|
|
369
|
-
function Ne(e) {
|
|
370
|
-
return ({ data: t }) => {
|
|
371
|
-
if (!t) return null;
|
|
372
|
-
let n = t.end.value > t.start.value;
|
|
373
|
-
return (t.reverted?.value ? !n : n) ? T(e) ? "right" : "up" : T(e) ? "left" : "down";
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
var Pe = {
|
|
377
|
-
curve: o.Linear,
|
|
378
|
-
line: {
|
|
379
|
-
stroke: e.grey1,
|
|
380
|
-
strokeWidth: 2,
|
|
381
|
-
strokeDasharray: ne({
|
|
382
|
-
space: 1,
|
|
383
|
-
width: 4
|
|
384
|
-
}),
|
|
385
|
-
show: !0
|
|
386
|
-
}
|
|
387
|
-
}, Fe = {
|
|
388
|
-
scale: K,
|
|
389
|
-
ref: "series"
|
|
390
|
-
}, Ie = {
|
|
391
|
-
enabled: !0,
|
|
392
|
-
presetId: "simple-opacity"
|
|
393
|
-
}, Le = (e, t, n) => {
|
|
394
|
-
if (!e.showLines || !n.collections) return n;
|
|
395
|
-
let r = n.collections[0].data.extract, i = "end", a = r.slice(0, -1).map((t, n) => {
|
|
396
|
-
let a = i;
|
|
397
|
-
return r[n + 1].props?.subTotal || (i = i === "start" ? "end" : "start"), {
|
|
398
|
-
type: E.Line,
|
|
399
|
-
layout: { displayOrder: x.VisualizationElement },
|
|
400
|
-
key: `${s.Line}.${n}`,
|
|
401
|
-
data: {
|
|
402
|
-
collection: G,
|
|
403
|
-
filter: (e, t) => [n, n + 1].includes(t)
|
|
404
|
-
},
|
|
405
|
-
settings: Re(e, a),
|
|
406
|
-
animations: Ie
|
|
407
|
-
};
|
|
408
|
-
});
|
|
409
|
-
return {
|
|
410
|
-
...n,
|
|
411
|
-
components: [...n.components, ...a]
|
|
412
|
-
};
|
|
413
|
-
};
|
|
414
|
-
function Re(e, t) {
|
|
415
|
-
let r = T(e);
|
|
416
|
-
return {
|
|
417
|
-
layers: Pe,
|
|
418
|
-
coordinates: {
|
|
419
|
-
major: Fe,
|
|
420
|
-
minor: {
|
|
421
|
-
scale: r ? C.XAxisScale : C.YAxisScale,
|
|
422
|
-
ref: t
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
orientation: r ? n.Vertical : n.Horizontal
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
var ze = (e, t, n) => {
|
|
429
|
-
let r = e.measures.filter(i), a = r.map((t) => D(e, t, s.Waterfall));
|
|
430
|
-
return ve(e, t, n, {
|
|
431
|
-
filter: (e) => e.filter((e) => e.data?.subTotal?.value || a.findIndex((t) => t === e.key) !== -1),
|
|
432
|
-
placement: {
|
|
433
|
-
type: "bounds",
|
|
434
|
-
area: "target"
|
|
435
|
-
},
|
|
436
|
-
extract: ge({
|
|
437
|
-
...e,
|
|
438
|
-
measures: r
|
|
439
|
-
}, t, Be, () => "")
|
|
440
|
-
}, `tooltip-${E.Box}`);
|
|
441
|
-
}, Be = (e, t, n, i, a, o, s, l) => {
|
|
442
|
-
let { formatter: u } = n, d = t.data, f = ue(n), p = e.filter((e) => !f.has(r(e.dataItem))), m = e.filter((e) => f.has(r(e.dataItem))).flatMap((e) => {
|
|
443
|
-
let n = r(e.dataItem), i = Object.keys(t.data).find((e) => t.data[e]?.source?.field === n);
|
|
444
|
-
if (!i) return [];
|
|
445
|
-
let a = t.data[i]?.value, o = a;
|
|
446
|
-
return !l && e?.formatter && u ? o = u(e.formatter)(a) : l && u && (o = u(w(e?.formatter))(a)), [{
|
|
447
|
-
label: c(e) || e.label || e.dataItem.name || "",
|
|
448
|
-
value: o
|
|
449
|
-
}];
|
|
450
|
-
});
|
|
451
|
-
if (d.subTotal.value) {
|
|
452
|
-
let e = d.label, n = d.reverted.value ? d.start.value : d.end.value, r;
|
|
453
|
-
if (t.key === z) {
|
|
454
|
-
let e = p[p.length - 1];
|
|
455
|
-
r = !l && e?.formatter && u ? u(e.formatter)(n) : n;
|
|
456
|
-
} else {
|
|
457
|
-
let e = parseInt(t.data._configOrder, 10), i = e > 0 ? p[e - 1] : void 0;
|
|
458
|
-
r = !l && i?.formatter && u ? u(i.formatter)(n) : n;
|
|
459
|
-
}
|
|
460
|
-
return [{
|
|
461
|
-
label: e.value.toString(),
|
|
462
|
-
value: r
|
|
463
|
-
}, ...m];
|
|
464
|
-
} else {
|
|
465
|
-
let t = d.series.value.toString(), n = e.find((e) => r(e.dataItem) === t), i = (d.reverted.value ? -1 : 1) * (d.end.value - d.start.value), a = i;
|
|
466
|
-
return !l && n?.formatter && u ? a = u(n.formatter)(i) : l && u && (a = u(w(n?.formatter))(i)), [{
|
|
467
|
-
label: (n ? c(n) : "") || n?.label || n?.dataItem.name || "",
|
|
468
|
-
value: a
|
|
469
|
-
}, ...m];
|
|
470
|
-
}
|
|
471
|
-
}, Ve = class extends ae {
|
|
472
|
-
constructor() {
|
|
473
|
-
super([
|
|
474
|
-
De,
|
|
475
|
-
Ee,
|
|
476
|
-
Te,
|
|
477
|
-
re,
|
|
478
|
-
Oe,
|
|
479
|
-
ke,
|
|
480
|
-
Le,
|
|
481
|
-
ze,
|
|
482
|
-
b
|
|
483
|
-
]);
|
|
484
|
-
}
|
|
485
|
-
preCompile(e, t) {
|
|
486
|
-
let n = [];
|
|
487
|
-
Object.entries(t[0].items[0]).forEach(([e, t]) => {
|
|
488
|
-
if (n.length === 0) n.push([e, t]);
|
|
489
|
-
else {
|
|
490
|
-
let r = t + n[n.length - 1][1];
|
|
491
|
-
n.push([e, r]);
|
|
492
|
-
}
|
|
493
|
-
}), t[0].items[0] = Object.fromEntries(n), He(e) && (e.measureProps = y);
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
function He(e) {
|
|
497
|
-
return e.measures.filter((e) => i(e)).every((e) => e.dataItem.internalKey.startsWith("internalKeyMeasure"));
|
|
498
|
-
}
|
|
499
|
-
var Q = _(), Ue = new Ve(), We = g(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
|
|
500
|
-
let a = m(), { activeKey: o } = te(), c = p(), d = ee(), f = he();
|
|
501
|
-
if (!n) return null;
|
|
502
|
-
if (!i.isFetchingData && $(n)) return /* @__PURE__ */ (0, Q.jsx)(O, { vBackendAPI: d });
|
|
503
|
-
if ($(n) || !e || !l(e) || !r) return null;
|
|
504
|
-
let h = {
|
|
505
|
-
...i,
|
|
506
|
-
valuePickerMode: !!o
|
|
507
|
-
}, g = t || u, _ = Ue.compile(e, g, structuredClone(n), r, h, s.Waterfall, a, c, f);
|
|
508
|
-
return _ ? /* @__PURE__ */ (0, Q.jsx)(fe, {
|
|
509
|
-
config: h,
|
|
510
|
-
definition: _,
|
|
511
|
-
size: r,
|
|
512
|
-
vSpec: e
|
|
513
|
-
}) : null;
|
|
514
|
-
});
|
|
515
|
-
function $(e) {
|
|
516
|
-
return e?.[0].items.length === 0 || !Object.values(e[0].items[0]).some(Boolean);
|
|
517
|
-
}
|
|
518
|
-
export { We as WaterfallChart };
|