@astrato-io/visualizations 0.6.5 → 0.7.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 +32 -2
- package/THIRD_PARTY_NOTICES.md +2 -229
- package/VISUALIZATION_DEFINITIONS.md +68 -114
- package/chunks/Button-BrGKp9Nm.js +110 -0
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
- package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
- package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
- package/chunks/MenuOption-ByRqhRdX.js +3934 -0
- package/chunks/Title-CO5dP1ma.js +1691 -0
- package/chunks/ToggleButton-KOBAimC1.js +112 -0
- package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
- package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
- package/chunks/builder-DEDvNq1k.js +201 -0
- package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
- package/chunks/color-settings-3VRlf_Vw.js +6 -0
- package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
- package/chunks/coloring-CncX_JRX.js +278 -0
- package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
- package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
- package/chunks/event-bus-CrLB-Y8z.js +3 -0
- package/chunks/extend-preset-CUFNpmPe.js +4398 -0
- package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
- package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
- package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
- package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
- package/chunks/isEqual-B8loyPsC.js +12 -0
- package/chunks/label-format-type-weq1XfcX.js +8 -0
- package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
- package/chunks/logger-DpQtYQnX.js +1163 -0
- package/chunks/lookup-BWllin0q.js +36 -0
- package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
- package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
- package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
- package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
- package/chunks/registry-KervaxqJ.js +31 -0
- package/chunks/render-wrappers-OEmtaM8g.js +2 -0
- package/chunks/{registry-CsQQzukD.js → requirements-PAoRaJyb.js} +304 -336
- package/chunks/responsive.styles-DSiOGD7u.js +82 -0
- package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
- package/chunks/src-77e3mC7i.js +391 -0
- package/chunks/standalone-B55oyW6c.js +689 -0
- package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
- package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
- package/chunks/standalone-BMTCb10X.js +179 -0
- package/chunks/standalone-BXKRE_Se.js +468 -0
- package/chunks/standalone-Bes8srx1.js +354 -0
- package/chunks/standalone-BjZp0QMe.js +2 -0
- package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
- package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
- package/chunks/standalone-C8qAelL4.js +2 -0
- package/chunks/standalone-CJvIXsQE.js +743 -0
- package/chunks/standalone-CLmGb7nn2.js +355 -0
- package/chunks/standalone-CM5XcAN5.js +52327 -0
- package/chunks/standalone-CXNP6-xD.js +420 -0
- package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
- package/chunks/standalone-DLlyRIE6.js +287 -0
- package/chunks/standalone-DMcI1afI.js +396 -0
- package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
- package/chunks/standalone-DT0wKji7.js +6 -0
- package/chunks/{standalone-0M4HlmDW2.js → standalone-DVTJwsTY.js} +1109 -1035
- package/chunks/standalone-DW6NT205.js +518 -0
- package/chunks/standalone-DYQIQH4c.js +2095 -0
- package/chunks/standalone-D__XCp-h.js +1003 -0
- package/chunks/standalone-XTgSsTAa.js +354 -0
- package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
- package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
- package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
- package/chunks/useFieldName-Cjn9KCVp.js +7 -0
- package/chunks/useSlotProps-DLbQp4lc.js +166 -0
- package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
- package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
- package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
- package/chunks/web-components-DqClFkgO.js +1185 -0
- package/chunks/with-html-element-D0uY2zjI.js +7328 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +31 -14
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +3 -3
- package/docs/operations/distribution-gauge.md +13 -13
- package/docs/operations/dot.md +13 -13
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +13 -13
- package/docs/operations/heatMap.md +13 -13
- 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 +3 -3
- package/docs/operations/line.md +7 -7
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +13 -13
- package/docs/operations/radar.md +7 -7
- package/docs/operations/sankey.md +13 -13
- package/docs/operations/scatter.md +13 -13
- 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 +18 -1
- package/docs/operations/tree.md +51 -37
- package/docs/operations/treemap.md +63 -49
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +13 -13
- package/getters.js +7 -7
- package/index.js +3 -1183
- package/metadata.js +18 -18
- package/operations.js +13 -13
- package/package.json +106 -55
- package/render.js +10 -0
- package/src/charts/bar.d.ts +1 -0
- package/src/charts/combo.d.ts +1 -0
- package/src/charts/dot.d.ts +1 -0
- package/src/charts/gauge-distribution.d.ts +1 -0
- package/src/charts/gauge.d.ts +1 -0
- package/src/charts/heat-map.d.ts +1 -0
- package/src/charts/histogram.d.ts +1 -0
- package/src/charts/line.d.ts +1 -0
- package/src/charts/pie.d.ts +1 -0
- package/src/charts/radar.d.ts +1 -0
- package/src/charts/sankey.d.ts +1 -0
- package/src/charts/scatter.d.ts +1 -0
- package/src/charts/table.d.ts +1 -0
- package/src/charts/tree.d.ts +1 -0
- package/src/charts/treemap.d.ts +1 -0
- package/src/charts/waterfall.d.ts +1 -0
- package/src/charts/word-cloud.d.ts +1 -0
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
- package/src/definitions/model/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
- package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/getters/index.d.ts +3 -3
- package/src/index.d.ts +1 -1
- package/src/objects/app-filter-bar.d.ts +1 -0
- package/src/objects/date-picker.d.ts +1 -0
- package/src/objects/filter.d.ts +1 -0
- package/src/objects/iframe.d.ts +1 -0
- package/src/objects/image.d.ts +1 -0
- package/src/objects/number.d.ts +1 -0
- package/src/objects/shape.d.ts +1 -0
- package/src/objects/slider.d.ts +1 -0
- package/src/objects/text.d.ts +1 -0
- package/src/operations/index.d.ts +3 -3
- package/src/registry/create-visualization-registry.d.ts +5 -0
- package/src/render/index.d.ts +34 -0
- package/src/runtime/index.d.ts +2 -2
- package/src/types.d.ts +9 -4
- package/src/web-components/index.d.ts +3 -3
- package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
- package/chunks/builder-B6dWSIdD.js +0 -12289
- package/chunks/coloring-B1XAfg6b.js +0 -664
- package/chunks/events-WZut5Ow6.js +0 -4
- package/chunks/grouping-type-On4s9Thj.js +0 -3
- package/chunks/requirements-DYjZCFyf.js +0 -6
- package/chunks/standalone-0ashe9w1.js +0 -411
- package/chunks/standalone-B7jax8wa.js +0 -339
- package/chunks/standalone-BK0VYU-l.js +0 -463
- package/chunks/standalone-BZV5vOwA.js +0 -6
- package/chunks/standalone-BhDrWj4p.js +0 -1980
- package/chunks/standalone-BvaKdky9.js +0 -344
- package/chunks/standalone-BwtM31-f.js +0 -2
- package/chunks/standalone-CC1VUjO32.js +0 -299
- package/chunks/standalone-CoLrAxRV.js +0 -13198
- package/chunks/standalone-DCtRoTWg.js +0 -675
- package/chunks/standalone-DUDFTBqL.js +0 -833
- package/chunks/standalone-DhZkX9Td.js +0 -2
- package/chunks/standalone-DtLElfuM.js +0 -512
- package/chunks/standalone-G9Q4Uczu.js +0 -726
- package/chunks/standalone-_DeX21JJ.js +0 -383
- package/chunks/standalone-gFhKZh8m.js +0 -179
- package/chunks/standalone-tDNy-SFH.js +0 -281
- package/chunks/ui-DQWtv2iM.js +0 -63551
- package/chunks/useFieldName-BvdcoJRl.js +0 -7
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
import "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import { An as e, Gn as t, Ks as n, Mo as r, No as i, Sa as a, Si as o, Ta as s, Zr as c, fc as l, qo as u, rs as d } from "./isEqual-BDxAhUo8.js";
|
|
3
|
-
import { $t as f, Cn as p, Ei as m, I as ee, P as te, Yi as h, o as ne } from "./utils-Bg7K-t6K.js";
|
|
4
|
-
import { Pm as g } from "./handlers-VTBfIZYZ.js";
|
|
5
|
-
import { t as re } from "./stroke-dash-UgMEcCS4.js";
|
|
6
|
-
import { Vt as ie } from "./ui-DQWtv2iM.js";
|
|
7
|
-
import { b as _, l as v } from "./builder-B6dWSIdD.js";
|
|
8
|
-
import { Bt as y, Ft as b, G as ae, Jt as oe, M as se, N as ce, Pt as le, Qt as x, Rt as ue, X as de, Xt as fe, Z as pe, Zt as S, an as me, dn as C, et as he, i as ge, j as _e, mt as w, n as ve, rn as ye, rt as T, vt as E, zt as D } from "./escobar-eDjtGpkC.js";
|
|
9
|
-
h();
|
|
10
|
-
function O(e) {
|
|
11
|
-
let { measureProps: t, index: n, items: r, vSpec: i } = e, { positive: a, negative: o } = k(t, i), s;
|
|
12
|
-
return s = n === 0 ? r[0] > 0 ? a : o : r[n] > r[n - 1] ? a : o, s;
|
|
13
|
-
}
|
|
14
|
-
function k(e, t) {
|
|
15
|
-
let n = t.colors;
|
|
16
|
-
if (!e?.customColorEnabled) return j({ ...n }, t);
|
|
17
|
-
let { customColor: r } = e;
|
|
18
|
-
return j({
|
|
19
|
-
positive: r.positive ?? n.positive,
|
|
20
|
-
negative: r.negative ?? n.negative,
|
|
21
|
-
subTotal: r.subTotal ?? n.subTotal
|
|
22
|
-
}, t);
|
|
23
|
-
}
|
|
24
|
-
function A(e, t) {
|
|
25
|
-
let n = e.measureProps[t];
|
|
26
|
-
return n?.customColorEnabled && n?.customColor.subTotal ? n?.customColor.subTotal : e.colors.subTotal;
|
|
27
|
-
}
|
|
28
|
-
function j(e, t) {
|
|
29
|
-
return t.barSettings.translucentBars ? {
|
|
30
|
-
positive: P(e.positive, t),
|
|
31
|
-
negative: P(e.negative, t),
|
|
32
|
-
subTotal: P(e.subTotal, t)
|
|
33
|
-
} : e;
|
|
34
|
-
}
|
|
35
|
-
var M = .65, N = 1;
|
|
36
|
-
function P(e, t) {
|
|
37
|
-
return (n) => {
|
|
38
|
-
if (typeof n.datum.end.value != "number" || typeof n.datum.start.value != "number") return null;
|
|
39
|
-
let r = n.datum.end.value - n.datum.start.value;
|
|
40
|
-
n.datum.reverted.value && (r *= -1);
|
|
41
|
-
let i = [{
|
|
42
|
-
color: e,
|
|
43
|
-
opacity: N,
|
|
44
|
-
offset: +(r < 0)
|
|
45
|
-
}, {
|
|
46
|
-
color: e,
|
|
47
|
-
opacity: M,
|
|
48
|
-
offset: r < 0 ? 0 : 1
|
|
49
|
-
}];
|
|
50
|
-
return r < 0 && i.reverse(), {
|
|
51
|
-
type: "gradient",
|
|
52
|
-
degree: S(t) ? 0 : 90,
|
|
53
|
-
stops: i
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
var be = (e, t) => t || e.colors.brandColors[0], xe = "subTotal-measure", F = (e) => `${xe}-${e}`, I = "total-measure", L = (e) => `${n.Waterfall}.subTotal.${e}`, R = `${n.Waterfall}.total`;
|
|
58
|
-
function z(e) {
|
|
59
|
-
return ({ data: t, formatter: n }) => {
|
|
60
|
-
let r = t?.end.value - t?.start.value;
|
|
61
|
-
return t?.reverted?.value && (r *= -1), e.formatter && r && n ? n(e.formatter)(`${r}`) : `${r}`;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
var B = "waterfall-chart", V = {
|
|
65
|
-
scale: "onlyMeasures",
|
|
66
|
-
ref: "series"
|
|
67
|
-
};
|
|
68
|
-
function H(e) {
|
|
69
|
-
return {
|
|
70
|
-
collection: "collection-no-dimension",
|
|
71
|
-
filter: (t) => t?.source?.field === e
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function Se(e, t, n) {
|
|
75
|
-
let r = H(F(n)), a = {
|
|
76
|
-
scale: e.orientation === i.Horizontal ? x.XAxisScale : x.YAxisScale,
|
|
77
|
-
ref: "end"
|
|
78
|
-
}, o = A(e, n);
|
|
79
|
-
return {
|
|
80
|
-
type: C.Box,
|
|
81
|
-
layout: { displayOrder: b.VisualizationElement },
|
|
82
|
-
key: L(n),
|
|
83
|
-
data: r,
|
|
84
|
-
settings: U(e, t, V, a, o),
|
|
85
|
-
animations: {
|
|
86
|
-
enabled: !0,
|
|
87
|
-
presetId: B
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function Ce(e, t) {
|
|
92
|
-
let n = H(I), r = {
|
|
93
|
-
scale: e.orientation === i.Horizontal ? x.XAxisScale : x.YAxisScale,
|
|
94
|
-
ref: "end"
|
|
95
|
-
}, a = e.total.color;
|
|
96
|
-
return {
|
|
97
|
-
type: C.Box,
|
|
98
|
-
layout: { displayOrder: b.VisualizationElement },
|
|
99
|
-
key: R,
|
|
100
|
-
data: n,
|
|
101
|
-
settings: U(e, t, V, r, a),
|
|
102
|
-
animations: {
|
|
103
|
-
enabled: !0,
|
|
104
|
-
presetId: B
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
var we = (e, t, r, i) => ({
|
|
109
|
-
type: C.Box,
|
|
110
|
-
layout: { displayOrder: b.VisualizationElement },
|
|
111
|
-
key: w(e, t, n.Waterfall),
|
|
112
|
-
data: i,
|
|
113
|
-
settings: r,
|
|
114
|
-
animations: {
|
|
115
|
-
enabled: !0,
|
|
116
|
-
presetId: B
|
|
117
|
-
}
|
|
118
|
-
}), U = (t, n, r, a, o) => {
|
|
119
|
-
let c = {
|
|
120
|
-
orientation: t.orientation ?? i.Vertical,
|
|
121
|
-
major: r,
|
|
122
|
-
minor: a,
|
|
123
|
-
box: {
|
|
124
|
-
minWidthPx: 2,
|
|
125
|
-
ref: "",
|
|
126
|
-
rx: e(t.barSettings.barRadius, 0),
|
|
127
|
-
fill: o,
|
|
128
|
-
stacked: !1,
|
|
129
|
-
grouped: !1,
|
|
130
|
-
boxPadding: t.barSettings.barPadding ?? 0,
|
|
131
|
-
groupPadding: 0,
|
|
132
|
-
itemsInStackCount: 0,
|
|
133
|
-
roundAllEdges: t.barSettings.roundAllEdges ?? !1,
|
|
134
|
-
useCustomBoxRounding: t.barSettings.useCustomBoxRounding ?? !1,
|
|
135
|
-
ignoreOutOfBounds: t.barSettings.ignoreOutOfBounds ?? !1
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
return t.barSettings?.strokeEnabled ? (c.box.stroke = be(n, t.barSettings?.strokeColor), c.box.strokeWidth = t.barSettings?.strokeWidth) : c.box.stroke = s.transparent, c;
|
|
139
|
-
}, W = "collection-no-dimension", G = "onlyMeasures";
|
|
140
|
-
g.Inside, g.Outside, g.Opposite;
|
|
141
|
-
function K(e, t) {
|
|
142
|
-
let n = e.measures.filter((e) => o(e));
|
|
143
|
-
return n.filter((r, i) => {
|
|
144
|
-
let a = l(r.dataItem), o = t[0].items[0][a], s = e.measureProps[a];
|
|
145
|
-
if (i === 0) return !!o || !s?.hideIfEmpty;
|
|
146
|
-
let c = l(n[i - 1].dataItem);
|
|
147
|
-
return o !== t[0].items[0][c] || !s?.hideIfEmpty;
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
var Te = (e, t, n, i, a, s, l, u) => {
|
|
151
|
-
n = ue(e, t, n, i, a, s, l, u);
|
|
152
|
-
let d = [], f = [];
|
|
153
|
-
if ("axes" in e) {
|
|
154
|
-
let n = e.axes?.dimension || {};
|
|
155
|
-
if (!n.disabled) {
|
|
156
|
-
let i = S(e) ? r.Left : r.Bottom;
|
|
157
|
-
if (d.push(D(G, n, {
|
|
158
|
-
...t.axis.measure,
|
|
159
|
-
...t.fonts
|
|
160
|
-
}, i)), n.showAxisName) {
|
|
161
|
-
let r = e.measures.filter((e) => o(e)), a = r.length ? r : e.measures;
|
|
162
|
-
if (a.length) {
|
|
163
|
-
let r = c(e.measures, !!e.enableAlternate, s?.isPrintMode);
|
|
164
|
-
f.push(y(a, r, i, {
|
|
165
|
-
...t.axis.measure,
|
|
166
|
-
...t.fonts
|
|
167
|
-
}, void 0, n.axisTitle ?? "Measures", n.titleFontSize, "waterfall-measures-axis-label"));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
...n,
|
|
174
|
-
components: [
|
|
175
|
-
...n.components,
|
|
176
|
-
...d,
|
|
177
|
-
...f
|
|
178
|
-
]
|
|
179
|
-
};
|
|
180
|
-
}, Ee = (e, n, r, i, a) => {
|
|
181
|
-
let o = ae(e, {});
|
|
182
|
-
(e.axes?.primaryMeasure?.axisRange?.axisRangeOption ?? d.Auto) === d.Auto && (S(e) ? o[x.XAxisScale].expand = .3 : o[x.YAxisScale].expand = .3);
|
|
183
|
-
let s = [];
|
|
184
|
-
return K(e, a).forEach((n, r) => {
|
|
185
|
-
let i = l(n.dataItem), a = t(n);
|
|
186
|
-
s.push({
|
|
187
|
-
value: i,
|
|
188
|
-
label: a || n.label || n.dataItem.name
|
|
189
|
-
});
|
|
190
|
-
let o = e.measureProps[i];
|
|
191
|
-
o?.subTotalEnabled && s.push({
|
|
192
|
-
value: F(r),
|
|
193
|
-
label: o?.subTotalLabel || "Sub-Total"
|
|
194
|
-
});
|
|
195
|
-
}), e.total.enabled && s.push({
|
|
196
|
-
value: I,
|
|
197
|
-
label: e.total.label || "Total"
|
|
198
|
-
}), o.onlyMeasures = {
|
|
199
|
-
data: { items: s },
|
|
200
|
-
padding: e.barSettings.barPadding ?? 0,
|
|
201
|
-
type: me.Band,
|
|
202
|
-
value: (e) => `${e.datum.value.value}`,
|
|
203
|
-
label: (e) => `${e.datum.value.label}`
|
|
204
|
-
}, {
|
|
205
|
-
...r,
|
|
206
|
-
scales: o
|
|
207
|
-
};
|
|
208
|
-
}, q = "measures", De = (e, t, n, r, i) => {
|
|
209
|
-
let a = [], s, c = K(e, i), u = se((e.supportingMeasures ?? []).filter((e) => o(e)));
|
|
210
|
-
if (c.forEach((t, n) => {
|
|
211
|
-
let r = l(t.dataItem), i, o;
|
|
212
|
-
if (n === 0) i = 0, o = { field: r }, s = "end";
|
|
213
|
-
else if (s === "start") i = { field: l(c[n - 1].dataItem) }, o = { field: r }, s = "end";
|
|
214
|
-
else {
|
|
215
|
-
let e = l(c[n - 1].dataItem);
|
|
216
|
-
i = { field: r }, o = { field: e }, s = "start";
|
|
217
|
-
}
|
|
218
|
-
a.push({
|
|
219
|
-
field: r,
|
|
220
|
-
props: {
|
|
221
|
-
stackKey: q,
|
|
222
|
-
[r]: { field: r },
|
|
223
|
-
...u,
|
|
224
|
-
series: r,
|
|
225
|
-
start: i,
|
|
226
|
-
color: r,
|
|
227
|
-
end: o,
|
|
228
|
-
secondaryAxis: t.secondaryAxis,
|
|
229
|
-
isMultipleMeasures: !0,
|
|
230
|
-
subTotal: !1,
|
|
231
|
-
reverted: s === "start"
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
let d = e.measureProps[r];
|
|
235
|
-
if (d?.subTotalEnabled) {
|
|
236
|
-
let e = F(n), t, i;
|
|
237
|
-
s === "end" ? (t = 0, i = { field: r }) : (t = { field: r }, i = 0), a.push({
|
|
238
|
-
field: e,
|
|
239
|
-
props: {
|
|
240
|
-
stackKey: q,
|
|
241
|
-
...u,
|
|
242
|
-
series: e,
|
|
243
|
-
start: t,
|
|
244
|
-
color: e,
|
|
245
|
-
end: i,
|
|
246
|
-
secondaryAxis: !1,
|
|
247
|
-
isMultipleMeasures: !0,
|
|
248
|
-
label: d?.subTotalLabel || "Sub-Total",
|
|
249
|
-
subTotal: !0,
|
|
250
|
-
reverted: s === "start"
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}), e.total.enabled) {
|
|
255
|
-
let t = l(c[c.length - 1].dataItem), n, r;
|
|
256
|
-
s === "end" ? (n = 0, r = { field: t }) : (n = { field: t }, r = 0), a.push({
|
|
257
|
-
field: I,
|
|
258
|
-
props: {
|
|
259
|
-
stackKey: q,
|
|
260
|
-
...u,
|
|
261
|
-
series: I,
|
|
262
|
-
start: n,
|
|
263
|
-
color: I,
|
|
264
|
-
end: r,
|
|
265
|
-
secondaryAxis: !1,
|
|
266
|
-
isMultipleMeasures: !0,
|
|
267
|
-
label: e.total.label || "Total",
|
|
268
|
-
subTotal: !0,
|
|
269
|
-
reverted: s === "start"
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
let d = {
|
|
274
|
-
key: W,
|
|
275
|
-
data: { extract: a }
|
|
276
|
-
};
|
|
277
|
-
return {
|
|
278
|
-
...n,
|
|
279
|
-
collections: [d]
|
|
280
|
-
};
|
|
281
|
-
}, Oe = (e, t, n, r, i) => {
|
|
282
|
-
let a = Object.values(i[0].items[0]), o = K(e, i).reduce((n, r, i) => {
|
|
283
|
-
let o = l(r.dataItem), s = H(o), c = {
|
|
284
|
-
scale: fe(e, r),
|
|
285
|
-
ref: "end"
|
|
286
|
-
}, u = O({
|
|
287
|
-
measureProps: e.measureProps[o],
|
|
288
|
-
index: i,
|
|
289
|
-
items: a,
|
|
290
|
-
vSpec: e
|
|
291
|
-
}), d = [...n], f = U(e, t, V, c, u);
|
|
292
|
-
return d.push(we(e, r, f, s)), e.measureProps[o]?.subTotalEnabled && d.push(Se(e, t, i)), d;
|
|
293
|
-
}, []);
|
|
294
|
-
return e.total.enabled && o.push(Ce(e, t)), {
|
|
295
|
-
...n,
|
|
296
|
-
components: [...n.components, ...o]
|
|
297
|
-
};
|
|
298
|
-
}, J = [{ position: g.Outside }, {
|
|
299
|
-
position: g.Inside,
|
|
300
|
-
justify: 1
|
|
301
|
-
}], ke = (e, t, n, r, i) => {
|
|
302
|
-
let a = [], o = K(e, i);
|
|
303
|
-
return o.forEach((n, r) => {
|
|
304
|
-
if (!n.dataLabels?.show) return;
|
|
305
|
-
a.push(Me(e, t, n, r));
|
|
306
|
-
let i = l(n.dataItem);
|
|
307
|
-
e.measureProps[i]?.subTotalEnabled && a.push(je(e, t, n, r));
|
|
308
|
-
}), e.total.enabled && e.total.showDataLabel && a.push(Ae(e, t, o)), {
|
|
309
|
-
...n,
|
|
310
|
-
components: [...n.components, ...a]
|
|
311
|
-
};
|
|
312
|
-
}, Y = {
|
|
313
|
-
layout: { displayOrder: b.Labels },
|
|
314
|
-
animations: {
|
|
315
|
-
enabled: !0,
|
|
316
|
-
presetId: "chart-labels"
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
function Ae(e, t, n) {
|
|
320
|
-
let r = n[n.length - 1], i = z(r);
|
|
321
|
-
return {
|
|
322
|
-
...Y,
|
|
323
|
-
type: C.Labels,
|
|
324
|
-
key: "bar-labels-normal-total",
|
|
325
|
-
settings: X(e, t, R, i, e.total?.showLabelBackdrop, e.total?.labelFontSize)
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
function je(e, t, n, r) {
|
|
329
|
-
return {
|
|
330
|
-
...Y,
|
|
331
|
-
type: C.Labels,
|
|
332
|
-
key: `bar-labels-normal-${r}-sub`,
|
|
333
|
-
settings: X(e, t, L(r), z(n), n.dataLabels?.showBackdrop, n.dataLabels?.size)
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
function Me(e, t, r, i) {
|
|
337
|
-
let a = w(e, r, n.Waterfall);
|
|
338
|
-
return {
|
|
339
|
-
...Y,
|
|
340
|
-
type: C.Labels,
|
|
341
|
-
key: `bar-labels-normal-${i}`,
|
|
342
|
-
settings: X(e, t, a, z(r), r.dataLabels?.showBackdrop, r.dataLabels?.size)
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
function X(e, t, n, r, i = !1, a = ie.dataPoint.valueFontSize) {
|
|
346
|
-
return { sources: [{
|
|
347
|
-
component: n,
|
|
348
|
-
selector: ye.Rect,
|
|
349
|
-
strategy: {
|
|
350
|
-
type: "bar",
|
|
351
|
-
settings: {
|
|
352
|
-
direction: Ne(e),
|
|
353
|
-
fontSize: oe(a),
|
|
354
|
-
fontFamily: t.fonts.general.fontFamily,
|
|
355
|
-
labels: [{
|
|
356
|
-
label: r,
|
|
357
|
-
placements: i ? J.map((n) => ce(n, t, S(e))) : J
|
|
358
|
-
}]
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}] };
|
|
362
|
-
}
|
|
363
|
-
function Ne(e) {
|
|
364
|
-
return ({ data: t }) => {
|
|
365
|
-
if (!t) return null;
|
|
366
|
-
let n = t.end.value > t.start.value;
|
|
367
|
-
return (t.reverted?.value ? !n : n) ? S(e) ? "right" : "up" : S(e) ? "left" : "down";
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
var Pe = {
|
|
371
|
-
curve: u.Linear,
|
|
372
|
-
line: {
|
|
373
|
-
stroke: s.grey1,
|
|
374
|
-
strokeWidth: 2,
|
|
375
|
-
strokeDasharray: re({
|
|
376
|
-
space: 1,
|
|
377
|
-
width: 4
|
|
378
|
-
}),
|
|
379
|
-
show: !0
|
|
380
|
-
}
|
|
381
|
-
}, Fe = {
|
|
382
|
-
scale: G,
|
|
383
|
-
ref: "series"
|
|
384
|
-
}, Ie = {
|
|
385
|
-
enabled: !0,
|
|
386
|
-
presetId: "simple-opacity"
|
|
387
|
-
}, Z = (e, t, r) => {
|
|
388
|
-
if (!e.showLines) return r;
|
|
389
|
-
let i = r.collections[0].data.extract, a = "end", o = i.map((t, r) => {
|
|
390
|
-
if (r === i.length - 1) return;
|
|
391
|
-
let o = a;
|
|
392
|
-
return i[r + 1].props.subTotal || (a = a === "start" ? "end" : "start"), {
|
|
393
|
-
type: C.Line,
|
|
394
|
-
layout: { displayOrder: b.VisualizationElement },
|
|
395
|
-
key: `${n.Line}.${r}`,
|
|
396
|
-
data: {
|
|
397
|
-
collection: W,
|
|
398
|
-
filter: (e, t) => [r, r + 1].includes(t)
|
|
399
|
-
},
|
|
400
|
-
settings: Le(e, o),
|
|
401
|
-
animations: Ie
|
|
402
|
-
};
|
|
403
|
-
});
|
|
404
|
-
return {
|
|
405
|
-
...r,
|
|
406
|
-
components: [...r.components, ...o.filter(Boolean)]
|
|
407
|
-
};
|
|
408
|
-
};
|
|
409
|
-
function Le(e, t) {
|
|
410
|
-
let n = S(e);
|
|
411
|
-
return {
|
|
412
|
-
layers: Pe,
|
|
413
|
-
coordinates: {
|
|
414
|
-
major: Fe,
|
|
415
|
-
minor: {
|
|
416
|
-
scale: n ? x.XAxisScale : x.YAxisScale,
|
|
417
|
-
ref: t
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
orientation: n ? i.Vertical : i.Horizontal
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
var Re = (e, t, r) => {
|
|
424
|
-
let i = e.measures.filter(o), a = i.map((t) => w(e, t, n.Waterfall));
|
|
425
|
-
return de(e, t, r, {
|
|
426
|
-
filter: (e) => e.filter((e) => e.data?.subTotal?.value || a.findIndex((t) => t === e.key) !== -1),
|
|
427
|
-
placement: {
|
|
428
|
-
type: "bounds",
|
|
429
|
-
area: "target"
|
|
430
|
-
},
|
|
431
|
-
extract: pe({
|
|
432
|
-
...e,
|
|
433
|
-
measures: i
|
|
434
|
-
}, t, ze, () => "")
|
|
435
|
-
}, `tooltip-${C.Box}`);
|
|
436
|
-
}, ze = (e, n, r, i, a, o, s, c) => {
|
|
437
|
-
let { formatter: u } = r, d = n.data, f = he(r), p = e.filter((e) => !f.has(l(e.dataItem))), m = e.filter((e) => f.has(l(e.dataItem))).flatMap((e) => {
|
|
438
|
-
let r = l(e.dataItem), i = Object.keys(n.data).find((e) => n.data[e]?.source?.field === r);
|
|
439
|
-
if (!i) return [];
|
|
440
|
-
let a = n.data[i]?.value, o = a;
|
|
441
|
-
return !c && e?.formatter && u ? o = u(e.formatter)(a) : c && u && (o = u(T(e?.formatter))(a)), [{
|
|
442
|
-
label: t(e) || e.label || e.dataItem.name || "",
|
|
443
|
-
value: o
|
|
444
|
-
}];
|
|
445
|
-
});
|
|
446
|
-
if (d.subTotal.value) {
|
|
447
|
-
let e = d.label, t = d.reverted.value ? d.start.value : d.end.value, r;
|
|
448
|
-
if (n.key === R) {
|
|
449
|
-
let e = p[p.length - 1];
|
|
450
|
-
r = !c && e?.formatter && u ? u(e.formatter)(t) : t;
|
|
451
|
-
} else {
|
|
452
|
-
let e = parseInt(n.data._configOrder, 10), i = e > 0 ? p[e - 1] : void 0;
|
|
453
|
-
r = !c && i?.formatter && u ? u(i.formatter)(t) : t;
|
|
454
|
-
}
|
|
455
|
-
return [{
|
|
456
|
-
label: e.value.toString(),
|
|
457
|
-
value: r
|
|
458
|
-
}, ...m];
|
|
459
|
-
} else {
|
|
460
|
-
let n = d.series.value.toString(), r = e.find((e) => l(e.dataItem) === n), i = (d.reverted.value ? -1 : 1) * (d.end.value - d.start.value), a = i;
|
|
461
|
-
return !c && r?.formatter && u ? a = u(r.formatter)(i) : c && u && (a = u(T(r?.formatter))(i)), [{
|
|
462
|
-
label: (r ? t(r) : "") || r?.label || r?.dataItem.name || "",
|
|
463
|
-
value: a
|
|
464
|
-
}, ...m];
|
|
465
|
-
}
|
|
466
|
-
}, Be = class extends _e {
|
|
467
|
-
constructor() {
|
|
468
|
-
super([
|
|
469
|
-
De,
|
|
470
|
-
Ee,
|
|
471
|
-
Te,
|
|
472
|
-
E,
|
|
473
|
-
Oe,
|
|
474
|
-
ke,
|
|
475
|
-
Z,
|
|
476
|
-
Re,
|
|
477
|
-
le
|
|
478
|
-
]);
|
|
479
|
-
}
|
|
480
|
-
preCompile(e, t) {
|
|
481
|
-
let n = [];
|
|
482
|
-
Object.entries(t[0].items[0]).forEach(([e, t]) => {
|
|
483
|
-
if (n.length === 0) n.push([e, t]);
|
|
484
|
-
else {
|
|
485
|
-
let r = t + n[n.length - 1][1];
|
|
486
|
-
n.push([e, r]);
|
|
487
|
-
}
|
|
488
|
-
}), t[0].items[0] = Object.fromEntries(n), Ve(e) && (e.measureProps = _);
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
function Ve(e) {
|
|
492
|
-
return e.measures.filter((e) => o(e)).every((e) => e.dataItem.internalKey.startsWith("internalKeyMeasure"));
|
|
493
|
-
}
|
|
494
|
-
var Q = m(), He = new Be(), Ue = f(({ vSpec: e, vTheme: t, data: r, elementSize: i, vizProperties: o }) => {
|
|
495
|
-
let s = te(), { activeKey: c } = ne(), l = ee(), u = p(), d = ve();
|
|
496
|
-
if (!o.isFetchingData && $(r)) return /* @__PURE__ */ (0, Q.jsx)(v, { vBackendAPI: u });
|
|
497
|
-
if ($(r)) return null;
|
|
498
|
-
let f = {
|
|
499
|
-
...o,
|
|
500
|
-
valuePickerMode: !!c
|
|
501
|
-
}, m = t || a, h = He.compile(e, m, structuredClone(r), i, f, n.Waterfall, s, l, d);
|
|
502
|
-
return h ? /* @__PURE__ */ (0, Q.jsx)(ge, {
|
|
503
|
-
config: f,
|
|
504
|
-
definition: h,
|
|
505
|
-
size: i,
|
|
506
|
-
vSpec: e
|
|
507
|
-
}) : null;
|
|
508
|
-
});
|
|
509
|
-
function $(e) {
|
|
510
|
-
return e?.[0].items.length === 0 || !Object.values(e[0].items[0]).some(Boolean);
|
|
511
|
-
}
|
|
512
|
-
export { Ue as WaterfallChart };
|