@astrato-io/visualizations 0.0.0-stage → 0.6.4

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.
Files changed (145) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +93 -0
  3. package/README.md +843 -2
  4. package/THIRD_PARTY_NOTICES.md +8387 -0
  5. package/VISUALIZATION_DEFINITIONS.md +2378 -0
  6. package/chunks/LinearProgress-CUZ0D8_t.js +253 -0
  7. package/chunks/Radio-Ciu-F4CU.js +957 -0
  8. package/chunks/ToggleButton-BCJc3Jlc.js +153 -0
  9. package/chunks/_baseFlatten-DPXPOrea.js +7076 -0
  10. package/chunks/accessors-DemrDevR.js +128 -0
  11. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +55 -0
  12. package/chunks/bar.compiler-oqaPzIut.js +370 -0
  13. package/chunks/color-settings-ZIvgNTq1.js +10 -0
  14. package/chunks/coloring-C16AUZEi.js +663 -0
  15. package/chunks/data-item-resolution-1lvYB5ln.js +53 -0
  16. package/chunks/debounce-fn-CUixuz45.js +7 -0
  17. package/chunks/escobar-BGqT1EsE.js +34580 -0
  18. package/chunks/event-bus-KiSiCJrC.js +2683 -0
  19. package/chunks/events-WZut5Ow6.js +4 -0
  20. package/chunks/extend-BKUkc4_i.js +37 -0
  21. package/chunks/filter.compiler-CuLtc_02.js +60 -0
  22. package/chunks/filtering-Yq4DEa0t.js +953 -0
  23. package/chunks/gauge-target-type-BkKXAqkX.js +4 -0
  24. package/chunks/grouping-type-BX_9Ix5q.js +3 -0
  25. package/chunks/interfaces-VUY4_yVO.js +8742 -0
  26. package/chunks/line-settings-DfYTUyPz.js +4 -0
  27. package/chunks/line.compiler-BpA_6Tc7.js +188 -0
  28. package/chunks/metadata-CPXdYoln.js +28 -0
  29. package/chunks/number.compiler-DbkWcG4S.js +44 -0
  30. package/chunks/pie-uv42Eqal.js +10 -0
  31. package/chunks/range-DrzdfBX4.js +22 -0
  32. package/chunks/registry-CExpGJ1N.js +920 -0
  33. package/chunks/requirements-DNhuShLS.js +6 -0
  34. package/chunks/rolldown-runtime-DleVn1XH.js +28 -0
  35. package/chunks/set-coloring-datafield-B3uIS1Pe.js +8 -0
  36. package/chunks/shared-CKDL4hx9.js +1171 -0
  37. package/chunks/src-BC7cGcJ-.js +2024 -0
  38. package/chunks/src-BOS6SqkZ.js +67 -0
  39. package/chunks/src-C0LgoUWY.js +26105 -0
  40. package/chunks/src-Cum_2NLV.js +12145 -0
  41. package/chunks/src-D9XogOrc.js +422 -0
  42. package/chunks/src-Dun_jXtz.js +10295 -0
  43. package/chunks/src-DvX5LU9T.js +14742 -0
  44. package/chunks/standalone-87YV_m9n.js +687 -0
  45. package/chunks/standalone-BDCwI6Hn.js +4619 -0
  46. package/chunks/standalone-BH5NqDwp.js +1763 -0
  47. package/chunks/standalone-BLVAWLNJ.js +385 -0
  48. package/chunks/standalone-BPomtAVs.js +2 -0
  49. package/chunks/standalone-BXyBcUOQ.js +2 -0
  50. package/chunks/standalone-BYm1UjLr.js +140 -0
  51. package/chunks/standalone-BllF4rDp.js +383 -0
  52. package/chunks/standalone-BmfMt74U.js +726 -0
  53. package/chunks/standalone-BqWyrnZI.js +281 -0
  54. package/chunks/standalone-C85u7U6I.js +340 -0
  55. package/chunks/standalone-CCNtaJ7s.js +741 -0
  56. package/chunks/standalone-CDQnr6qT.js +345 -0
  57. package/chunks/standalone-CNyNHKVx.js +674 -0
  58. package/chunks/standalone-CY57qwZ-.js +1129 -0
  59. package/chunks/standalone-CZynjFG7.js +12979 -0
  60. package/chunks/standalone-D5vnf-9y.js +3943 -0
  61. package/chunks/standalone-DFPva_ku.js +299 -0
  62. package/chunks/standalone-DQxxNwF8.js +675 -0
  63. package/chunks/standalone-DS9T0FZ-.js +830 -0
  64. package/chunks/standalone-Dx3MLlrO.js +512 -0
  65. package/chunks/standalone-DzixzZAL.js +411 -0
  66. package/chunks/standalone-QJ1kKMnO.js +6 -0
  67. package/chunks/standalone-jiz0L2Dg.js +3855 -0
  68. package/chunks/standalone-lBm9hQ-q.js +179 -0
  69. package/chunks/standalone-rJ45Zfl1.js +68 -0
  70. package/chunks/stroke-dash-UgMEcCS4.js +6 -0
  71. package/chunks/table.compiler-BrXkm4Fz.js +213 -0
  72. package/chunks/toInteger-DVZr-D1j.js +11 -0
  73. package/chunks/treemap-x_zmJoG7.js +23 -0
  74. package/chunks/typeof-CJDtcySz.js +13 -0
  75. package/chunks/types-dVVCsDWD.js +4 -0
  76. package/chunks/ui-D1HQNIBy.js +54039 -0
  77. package/chunks/url-utils-B17gj_mr.js +5501 -0
  78. package/chunks/useFieldName-oqQ3bvnO.js +7 -0
  79. package/chunks/utils-Ba9T0TqC.js +31097 -0
  80. package/chunks/view-CLqWMV7Z.js +156 -0
  81. package/definitions.js +3 -0
  82. package/docs/operations/astrato-app-filter-bar.md +161 -0
  83. package/docs/operations/bar.md +7050 -0
  84. package/docs/operations/combo.md +5825 -0
  85. package/docs/operations/date-picker.md +644 -0
  86. package/docs/operations/distribution-gauge.md +3218 -0
  87. package/docs/operations/dot.md +5662 -0
  88. package/docs/operations/filter.md +1507 -0
  89. package/docs/operations/gauge.md +3452 -0
  90. package/docs/operations/heatMap.md +6026 -0
  91. package/docs/operations/histogram.md +1870 -0
  92. package/docs/operations/iframe.md +56 -0
  93. package/docs/operations/image.md +177 -0
  94. package/docs/operations/index.md +46 -0
  95. package/docs/operations/line.md +6468 -0
  96. package/docs/operations/number.md +3969 -0
  97. package/docs/operations/pie.md +6089 -0
  98. package/docs/operations/radar.md +4646 -0
  99. package/docs/operations/sankey.md +3210 -0
  100. package/docs/operations/scatter.md +6075 -0
  101. package/docs/operations/shape.md +315 -0
  102. package/docs/operations/simpleTextObject.md +706 -0
  103. package/docs/operations/slider.md +230 -0
  104. package/docs/operations/table.md +8790 -0
  105. package/docs/operations/tree.md +2874 -0
  106. package/docs/operations/treemap.md +3619 -0
  107. package/docs/operations/waterfall.md +2938 -0
  108. package/docs/operations/word-cloud.md +3071 -0
  109. package/getters.js +18 -0
  110. package/index.js +1183 -0
  111. package/metadata.js +20 -0
  112. package/operations.js +64 -0
  113. package/package.json +191 -4
  114. package/src/definitions/index.d.ts +2 -0
  115. package/src/definitions/shared/index.d.ts +5 -0
  116. package/src/definitions/shared/lib/available-fields.d.ts +36 -0
  117. package/src/definitions/shared/lib/compilers/index.d.ts +7 -0
  118. package/src/definitions/shared/lib/registry/compile.d.ts +2 -0
  119. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +587 -0
  120. package/src/definitions/shared/lib/registry/index.d.ts +3 -0
  121. package/src/definitions/shared/lib/registry/validation.d.ts +3 -0
  122. package/src/definitions/shared/lib/schemas/app-filter-bar.schema.d.ts +22 -0
  123. package/src/definitions/shared/lib/schemas/bar.schema.d.ts +73 -0
  124. package/src/definitions/shared/lib/schemas/broad-chart.schema.d.ts +68 -0
  125. package/src/definitions/shared/lib/schemas/common.schema.d.ts +304 -0
  126. package/src/definitions/shared/lib/schemas/filter.schema.d.ts +22 -0
  127. package/src/definitions/shared/lib/schemas/index.d.ts +9 -0
  128. package/src/definitions/shared/lib/schemas/line.schema.d.ts +72 -0
  129. package/src/definitions/shared/lib/schemas/number.schema.d.ts +21 -0
  130. package/src/definitions/shared/lib/schemas/object.schema.d.ts +215 -0
  131. package/src/definitions/shared/lib/schemas/table.schema.d.ts +458 -0
  132. package/src/definitions/shared/lib/types/compilation.types.d.ts +36 -0
  133. package/src/definitions/shared/lib/types/definition.types.d.ts +2 -0
  134. package/src/definitions/shared/lib/types/descriptor.types.d.ts +39 -0
  135. package/src/definitions/shared/lib/types/index.d.ts +3 -0
  136. package/src/getters/index.d.ts +30 -0
  137. package/src/index.d.ts +4 -0
  138. package/src/metadata/index.d.ts +4 -0
  139. package/src/operations/index.d.ts +30 -0
  140. package/src/registry/index.d.ts +6 -0
  141. package/src/runtime/index.d.ts +2 -0
  142. package/src/types.d.ts +307 -0
  143. package/src/visualization-catalog.d.ts +82 -0
  144. package/src/web-components/index.d.ts +12 -0
  145. package/styles.css +2 -0
@@ -0,0 +1,512 @@
1
+ import "./rolldown-runtime-DleVn1XH.js";
2
+ import { Jo as e, No as t, Oa as n, Pn as r, Po as i, Ta as a, Ti as o, Yn as s, is as c, pc as l, qs as u, ti as d } from "./interfaces-VUY4_yVO.js";
3
+ import { I as f, Ki as p, P as m, Zt as h, o as ee, wi as g, xn as _ } from "./utils-Ba9T0TqC.js";
4
+ import { Rn as v } from "./event-bus-KiSiCJrC.js";
5
+ import { t as te } from "./stroke-dash-UgMEcCS4.js";
6
+ import { n as ne, v as re } from "./src-Cum_2NLV.js";
7
+ import { Bt as ie, Ft as y, G as b, Jt as ae, M as oe, N as se, Pt as ce, Qt as x, Rt as le, X as ue, Xt as de, Z as fe, Zt as S, et as pe, i as me, in as he, j as ge, mt as C, n as _e, nn as ve, rt as w, un as T, vt as ye, zt as E } from "./escobar-BGqT1EsE.js";
8
+ import { vt as D } from "./_baseFlatten-DPXPOrea.js";
9
+ p();
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) => `${u.Waterfall}.subTotal.${e}`, R = `${u.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: T.Box,
81
+ layout: { displayOrder: y.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: T.Box,
98
+ layout: { displayOrder: y.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, n, r) => ({
109
+ type: T.Box,
110
+ layout: { displayOrder: y.VisualizationElement },
111
+ key: C(e, t, u.Waterfall),
112
+ data: r,
113
+ settings: n,
114
+ animations: {
115
+ enabled: !0,
116
+ presetId: B
117
+ }
118
+ }), U = (e, t, a, o, s) => {
119
+ let c = {
120
+ orientation: e.orientation ?? i.Vertical,
121
+ major: a,
122
+ minor: o,
123
+ box: {
124
+ minWidthPx: 2,
125
+ ref: "",
126
+ rx: r(e.barSettings.barRadius, 0),
127
+ fill: s,
128
+ stacked: !1,
129
+ grouped: !1,
130
+ boxPadding: e.barSettings.barPadding ?? 0,
131
+ groupPadding: 0,
132
+ itemsInStackCount: 0,
133
+ roundAllEdges: e.barSettings.roundAllEdges ?? !1,
134
+ useCustomBoxRounding: e.barSettings.useCustomBoxRounding ?? !1,
135
+ ignoreOutOfBounds: e.barSettings.ignoreOutOfBounds ?? !1
136
+ }
137
+ };
138
+ return e.barSettings?.strokeEnabled ? (c.box.stroke = be(t, e.barSettings?.strokeColor), c.box.strokeWidth = e.barSettings?.strokeWidth) : c.box.stroke = n.transparent, c;
139
+ }, W = "collection-no-dimension", G = "onlyMeasures";
140
+ v.Inside, v.Outside, v.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, n, r, i, a, s, c, l) => {
151
+ r = le(e, n, r, i, a, s, c, l);
152
+ let u = [], f = [];
153
+ if ("axes" in e) {
154
+ let r = e.axes?.dimension || {};
155
+ if (!r.disabled) {
156
+ let i = S(e) ? t.Left : t.Bottom;
157
+ if (u.push(E(G, r, {
158
+ ...n.axis.measure,
159
+ ...n.fonts
160
+ }, i)), r.showAxisName) {
161
+ let t = e.measures.filter((e) => o(e)), a = t.length ? t : e.measures;
162
+ if (a.length) {
163
+ let t = d(e.measures, !!e.enableAlternate, s?.isPrintMode);
164
+ f.push(ie(a, t, i, {
165
+ ...n.axis.measure,
166
+ ...n.fonts
167
+ }, void 0, r.axisTitle ?? "Measures", r.titleFontSize, "waterfall-measures-axis-label"));
168
+ }
169
+ }
170
+ }
171
+ }
172
+ return {
173
+ ...r,
174
+ components: [
175
+ ...r.components,
176
+ ...u,
177
+ ...f
178
+ ]
179
+ };
180
+ }, Ee = (e, t, n, r, i) => {
181
+ let a = b(e, {});
182
+ (e.axes?.primaryMeasure?.axisRange?.axisRangeOption ?? c.Auto) === c.Auto && (S(e) ? a[x.XAxisScale].expand = .3 : a[x.YAxisScale].expand = .3);
183
+ let o = [];
184
+ return K(e, i).forEach((t, n) => {
185
+ let r = l(t.dataItem), i = s(t);
186
+ o.push({
187
+ value: r,
188
+ label: i || t.label || t.dataItem.name
189
+ });
190
+ let a = e.measureProps[r];
191
+ a?.subTotalEnabled && o.push({
192
+ value: F(n),
193
+ label: a?.subTotalLabel || "Sub-Total"
194
+ });
195
+ }), e.total.enabled && o.push({
196
+ value: I,
197
+ label: e.total.label || "Total"
198
+ }), a.onlyMeasures = {
199
+ data: { items: o },
200
+ padding: e.barSettings.barPadding ?? 0,
201
+ type: he.Band,
202
+ value: (e) => `${e.datum.value.value}`,
203
+ label: (e) => `${e.datum.value.label}`
204
+ }, {
205
+ ...n,
206
+ scales: a
207
+ };
208
+ }, q = "measures", De = (e, t, n, r, i) => {
209
+ let a = [], s, c = K(e, i), u = oe((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: de(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: v.Outside }, {
299
+ position: v.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: y.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: T.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: T.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, n, r) {
337
+ let i = C(e, n, u.Waterfall);
338
+ return {
339
+ ...Y,
340
+ type: T.Labels,
341
+ key: `bar-labels-normal-${r}`,
342
+ settings: X(e, t, i, z(n), n.dataLabels?.showBackdrop, n.dataLabels?.size)
343
+ };
344
+ }
345
+ function X(e, t, n, r, i = !1, a = D.dataPoint.valueFontSize) {
346
+ return { sources: [{
347
+ component: n,
348
+ selector: ve.Rect,
349
+ strategy: {
350
+ type: "bar",
351
+ settings: {
352
+ direction: Ne(e),
353
+ fontSize: ae(a),
354
+ fontFamily: t.fonts.general.fontFamily,
355
+ labels: [{
356
+ label: r,
357
+ placements: i ? J.map((n) => se(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: e.Linear,
372
+ line: {
373
+ stroke: n.grey1,
374
+ strokeWidth: 2,
375
+ strokeDasharray: te({
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, n) => {
388
+ if (!e.showLines) return n;
389
+ let r = n.collections[0].data.extract, i = "end", a = r.map((t, n) => {
390
+ if (n === r.length - 1) return;
391
+ let a = i;
392
+ return r[n + 1].props.subTotal || (i = i === "start" ? "end" : "start"), {
393
+ type: T.Line,
394
+ layout: { displayOrder: y.VisualizationElement },
395
+ key: `${u.Line}.${n}`,
396
+ data: {
397
+ collection: W,
398
+ filter: (e, t) => [n, n + 1].includes(t)
399
+ },
400
+ settings: Le(e, a),
401
+ animations: Ie
402
+ };
403
+ });
404
+ return {
405
+ ...n,
406
+ components: [...n.components, ...a.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, n) => {
424
+ let r = e.measures.filter(o), i = r.map((t) => C(e, t, u.Waterfall));
425
+ return ue(e, t, n, {
426
+ filter: (e) => e.filter((e) => e.data?.subTotal?.value || i.findIndex((t) => t === e.key) !== -1),
427
+ placement: {
428
+ type: "bounds",
429
+ area: "target"
430
+ },
431
+ extract: fe({
432
+ ...e,
433
+ measures: r
434
+ }, t, ze, () => "")
435
+ }, `tooltip-${T.Box}`);
436
+ }, ze = (e, t, n, r, i, a, o, c) => {
437
+ let { formatter: u } = n, d = t.data, f = pe(n), p = e.filter((e) => !f.has(l(e.dataItem))), m = e.filter((e) => f.has(l(e.dataItem))).flatMap((e) => {
438
+ let n = l(e.dataItem), r = Object.keys(t.data).find((e) => t.data[e]?.source?.field === n);
439
+ if (!r) return [];
440
+ let i = t.data[r]?.value, a = i;
441
+ return !c && e?.formatter && u ? a = u(e.formatter)(i) : c && u && (a = u(w(e?.formatter))(i)), [{
442
+ label: s(e) || e.label || e.dataItem.name || "",
443
+ value: a
444
+ }];
445
+ });
446
+ if (d.subTotal.value) {
447
+ let e = d.label, n = d.reverted.value ? d.start.value : d.end.value, r;
448
+ if (t.key === R) {
449
+ let e = p[p.length - 1];
450
+ r = !c && e?.formatter && u ? u(e.formatter)(n) : n;
451
+ } else {
452
+ let e = parseInt(t.data._configOrder, 10), i = e > 0 ? p[e - 1] : void 0;
453
+ r = !c && i?.formatter && u ? u(i.formatter)(n) : n;
454
+ }
455
+ return [{
456
+ label: e.value.toString(),
457
+ value: r
458
+ }, ...m];
459
+ } else {
460
+ let t = d.series.value.toString(), n = e.find((e) => l(e.dataItem) === t), r = (d.reverted.value ? -1 : 1) * (d.end.value - d.start.value), i = r;
461
+ return !c && n?.formatter && u ? i = u(n.formatter)(r) : c && u && (i = u(w(n?.formatter))(r)), [{
462
+ label: (n ? s(n) : "") || n?.label || n?.dataItem.name || "",
463
+ value: i
464
+ }, ...m];
465
+ }
466
+ }, Be = class extends ge {
467
+ constructor() {
468
+ super([
469
+ De,
470
+ Ee,
471
+ Te,
472
+ ye,
473
+ Oe,
474
+ ke,
475
+ Z,
476
+ Re,
477
+ ce
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 = re);
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 = g(), He = new Be(), Ue = h(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
495
+ let o = m(), { activeKey: s } = ee(), c = f(), l = _(), d = _e();
496
+ if (!i.isFetchingData && $(n)) return /* @__PURE__ */ (0, Q.jsx)(ne, { vBackendAPI: l });
497
+ if ($(n)) return null;
498
+ let p = {
499
+ ...i,
500
+ valuePickerMode: !!s
501
+ }, h = t || a, g = He.compile(e, h, structuredClone(n), r, p, u.Waterfall, o, c, d);
502
+ return g ? /* @__PURE__ */ (0, Q.jsx)(me, {
503
+ config: p,
504
+ definition: g,
505
+ size: r,
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 };