@astrato-io/visualizations 0.6.4 → 0.6.5

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 (149) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/THIRD_PARTY_NOTICES.md +94 -4
  3. package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
  4. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
  5. package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
  6. package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
  7. package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
  8. package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
  9. package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
  10. package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
  11. package/chunks/filter.compiler-DBsyRBJt.js +70 -0
  12. package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
  13. package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
  14. package/chunks/handlers-VTBfIZYZ.js +13072 -0
  15. package/chunks/isEqual-BDxAhUo8.js +7514 -0
  16. package/chunks/line.compiler-CzdM5Ld0.js +198 -0
  17. package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
  18. package/chunks/number.compiler-G-R7y16P.js +53 -0
  19. package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
  20. package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
  21. package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
  22. package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
  23. package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
  24. package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
  25. package/chunks/standalone-0ashe9w1.js +411 -0
  26. package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
  27. package/chunks/standalone-BK0VYU-l.js +463 -0
  28. package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
  29. package/chunks/standalone-BZV5vOwA.js +6 -0
  30. package/chunks/standalone-BhDrWj4p.js +1980 -0
  31. package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
  32. package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
  33. package/chunks/standalone-BwtM31-f.js +2 -0
  34. package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
  35. package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
  36. package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
  37. package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
  38. package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
  39. package/chunks/standalone-DCtRoTWg.js +675 -0
  40. package/chunks/standalone-DUDFTBqL.js +833 -0
  41. package/chunks/standalone-DhZkX9Td.js +2 -0
  42. package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
  43. package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
  44. package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
  45. package/chunks/standalone-_DeX21JJ.js +383 -0
  46. package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
  47. package/chunks/standalone-tDNy-SFH.js +281 -0
  48. package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
  49. package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
  50. package/chunks/table.compiler-tb914oj3.js +222 -0
  51. package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
  52. package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
  53. package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
  54. package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
  55. package/definitions.js +3 -3
  56. package/docs/operations/astrato-app-filter-bar.md +17 -17
  57. package/docs/operations/bar.md +989 -1071
  58. package/docs/operations/combo.md +717 -738
  59. package/docs/operations/date-picker.md +25 -25
  60. package/docs/operations/distribution-gauge.md +471 -607
  61. package/docs/operations/dot.md +787 -879
  62. package/docs/operations/filter.md +139 -163
  63. package/docs/operations/gauge.md +491 -627
  64. package/docs/operations/heatMap.md +834 -916
  65. package/docs/operations/histogram.md +166 -180
  66. package/docs/operations/iframe.md +5 -5
  67. package/docs/operations/image.md +16 -16
  68. package/docs/operations/index.md +12 -12
  69. package/docs/operations/line.md +811 -888
  70. package/docs/operations/number.md +470 -536
  71. package/docs/operations/pie.md +825 -958
  72. package/docs/operations/radar.md +599 -679
  73. package/docs/operations/sankey.md +462 -584
  74. package/docs/operations/scatter.md +823 -929
  75. package/docs/operations/shape.md +34 -34
  76. package/docs/operations/simpleTextObject.md +18 -25
  77. package/docs/operations/slider.md +33 -43
  78. package/docs/operations/table.md +1160 -1150
  79. package/docs/operations/tree.md +354 -361
  80. package/docs/operations/treemap.md +545 -637
  81. package/docs/operations/waterfall.md +369 -379
  82. package/docs/operations/word-cloud.md +512 -583
  83. package/getters.js +3 -3
  84. package/index.js +51 -51
  85. package/metadata.js +3 -3
  86. package/operations.js +7 -7
  87. package/package.json +80 -86
  88. package/src/definitions/index.d.ts +2 -2
  89. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  90. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  91. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  92. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
  93. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  94. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  95. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  96. package/src/definitions/model/definitions/index.d.ts +23 -0
  97. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  98. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  99. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  100. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  101. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  102. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  103. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
  104. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  105. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  106. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  107. package/chunks/Radio-Ciu-F4CU.js +0 -957
  108. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  109. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  110. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  111. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  112. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  113. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  114. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  115. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  116. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  117. package/chunks/line-settings-DfYTUyPz.js +0 -4
  118. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  119. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  120. package/chunks/pie-uv42Eqal.js +0 -10
  121. package/chunks/src-Dun_jXtz.js +0 -10295
  122. package/chunks/standalone-87YV_m9n.js +0 -687
  123. package/chunks/standalone-BLVAWLNJ.js +0 -385
  124. package/chunks/standalone-BPomtAVs.js +0 -2
  125. package/chunks/standalone-BXyBcUOQ.js +0 -2
  126. package/chunks/standalone-BllF4rDp.js +0 -383
  127. package/chunks/standalone-BqWyrnZI.js +0 -281
  128. package/chunks/standalone-DQxxNwF8.js +0 -675
  129. package/chunks/standalone-DS9T0FZ-.js +0 -830
  130. package/chunks/standalone-DzixzZAL.js +0 -411
  131. package/chunks/standalone-QJ1kKMnO.js +0 -6
  132. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  133. package/chunks/toInteger-DVZr-D1j.js +0 -11
  134. package/chunks/treemap-x_zmJoG7.js +0 -23
  135. package/chunks/types-dVVCsDWD.js +0 -4
  136. package/chunks/view-CLqWMV7Z.js +0 -156
  137. package/src/definitions/shared/index.d.ts +0 -5
  138. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  139. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  140. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  141. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  143. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  144. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  145. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  146. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  147. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  148. /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
  149. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,383 +0,0 @@
1
- import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Do as n, Lt as r, Oa as i, Po as a, Rt as o, Ta as s, Ti as c, U as l, Wt as u, Xs as d, ln as f, pc as p, qs as m, tn as h } from "./interfaces-VUY4_yVO.js";
3
- import { I as g, Ki as _, Kn as v, P as ee, Zt as te, o as ne, wi as re } from "./utils-Ba9T0TqC.js";
4
- import { At as ie, Ct as y, Et as b, Ft as x, H as S, M as ae, Mt as oe, Nt as se, Ot as C, Qt as ce, Rt as le, St as ue, Tt as w, U as T, Ut as E, Wt as D, X as O, Xt as k, Yt as A, Z as j, Zt as M, an as N, gt as P, ht as F, i as I, in as L, j as R, jt as z, ln as B, n as V, nn as H, ot as U, rt as W, st as de, un as G, ut as fe, vt as pe, xt as me } from "./escobar-BGqT1EsE.js";
5
- import { t as he } from "./coloring-C16AUZEi.js";
6
- import { t as ge } from "./toInteger-DVZr-D1j.js";
7
- import { t as K } from "./set-coloring-datafield-B3uIS1Pe.js";
8
- import { t as _e } from "./range-DrzdfBX4.js";
9
- _();
10
- var q = (e, t, n, r, i, a, o) => {
11
- let s = e.dimensions.filter((e) => c(e)), l = e.measures.filter((e) => c(e)), u = ve(e, t, n, o);
12
- return s[0] && (n.collections.push({
13
- key: b.DimensionDomain,
14
- data: { extract: [{ field: p(s[0].dataItem) }] }
15
- }), u[A(e)] = {
16
- data: { collection: b.DimensionDomain },
17
- type: L.Band
18
- }), l[0] && (u[k(e, l[0])] = {
19
- data: { field: p(l[0].dataItem) },
20
- expand: .02,
21
- invert: T(!1, e.axes?.primaryMeasure),
22
- ...S(e.axes?.primaryMeasure?.axisRange, !0)
23
- }), {
24
- ...n,
25
- scales: u
26
- };
27
- };
28
- function ve(e, t, n, r) {
29
- let i = e.dimensions.filter((e) => c(e)), a = e.measures.filter((e) => c(e));
30
- switch (e.coloring?.type) {
31
- case d.Categorical: {
32
- let a = y(e, r, i[1]);
33
- return F(n, 1, { color: { field: a } }), { categorical: me(K(e, a), t, a, {
34
- customPalette: e.coloring.customPalette,
35
- palette: e.coloring.palette,
36
- sortOrder: e.coloring.sortOrder
37
- }, n.collections) };
38
- }
39
- case d.Gradient: {
40
- let r = w(e);
41
- return F(n, 1, { color: { field: r } }), ue(K(e, r), t, {});
42
- }
43
- case d.Single: {
44
- let r = p(a[0]?.dataItem);
45
- r && F(n, 1, { color: { field: r } });
46
- let i = e?.coloring?.color ?? t.colors.brandColors[0];
47
- return { [d.Single]: {
48
- data: [],
49
- unknown: i,
50
- type: L.CategoricalColor,
51
- range: [i]
52
- } };
53
- }
54
- default: return {};
55
- }
56
- }
57
- var ye = (e, t, n) => {
58
- let r = e.dimensions.filter((e) => c(e)), i = e.measures.filter((e) => c(e)), a = (e.supportingMeasures ?? []).filter((e) => c(e)), [o, s] = r, l = p(o?.dataItem), u = p(s?.dataItem), d = p(i[0]?.dataItem), f = ae(a), m = {
59
- key: b.DotBarCollection,
60
- data: { extract: [{
61
- field: l,
62
- trackBy: (e) => e,
63
- reduce: "first",
64
- props: {
65
- start: {
66
- field: d,
67
- reduce: "min"
68
- },
69
- med: {
70
- field: d,
71
- reduce: "avg"
72
- },
73
- end: {
74
- field: d,
75
- reduce: "max"
76
- }
77
- }
78
- }] }
79
- }, h = {
80
- key: b.DotPointsCollection,
81
- data: { extract: [{
82
- field: u,
83
- props: {
84
- x: { field: d },
85
- group: { field: l },
86
- [d]: { field: d },
87
- ...f
88
- }
89
- }] }
90
- };
91
- return {
92
- ...n,
93
- collections: [m, h]
94
- };
95
- }, be = /* @__PURE__ */ t(((e, t) => {
96
- var n = Math.floor, r = Math.random;
97
- function i(e, t) {
98
- return e + n(r() * (t - e + 1));
99
- }
100
- t.exports = i;
101
- })), J = /* @__PURE__ */ t(((e, t) => {
102
- var n = be();
103
- function r(e, t) {
104
- var r = -1, i = e.length, a = i - 1;
105
- for (t = t === void 0 ? i : t; ++r < t;) {
106
- var o = n(r, a), s = e[o];
107
- e[o] = e[r], e[r] = s;
108
- }
109
- return e.length = t, e;
110
- }
111
- t.exports = r;
112
- })), xe = /* @__PURE__ */ t(((e, t) => {
113
- var n = l(), r = J();
114
- function i(e) {
115
- return r(n(e));
116
- }
117
- t.exports = i;
118
- })), Se = /* @__PURE__ */ t(((e, t) => {
119
- var n = o();
120
- function r(e, t) {
121
- return n(t, function(t) {
122
- return e[t];
123
- });
124
- }
125
- t.exports = r;
126
- })), Ce = /* @__PURE__ */ t(((e, t) => {
127
- var n = Se(), r = u();
128
- function i(e) {
129
- return e == null ? [] : n(e, r(e));
130
- }
131
- t.exports = i;
132
- })), we = /* @__PURE__ */ t(((e, t) => {
133
- var n = J(), r = Ce();
134
- function i(e) {
135
- return n(r(e));
136
- }
137
- t.exports = i;
138
- })), Te = /* @__PURE__ */ t(((e, t) => {
139
- var n = xe(), r = we(), i = h();
140
- function a(e) {
141
- return (i(e) ? n : r)(e);
142
- }
143
- t.exports = a;
144
- })), Ee = /* @__PURE__ */ e(_e()), De = /* @__PURE__ */ e(Te()), Y = (e) => 1 - (e.barSettings.barPadding ?? 0);
145
- function Oe(e, t, n) {
146
- let r = new he(e, t, n?.[0]?.itemsNotAffectedByFiltering);
147
- return r.getColorDefinition({
148
- overwriteSources: [r.MAIN_FIELD],
149
- ref: "color"
150
- });
151
- }
152
- function ke(e) {
153
- let t = D([""], e, { valuePickerMode: e?.valuePickerMode }), n = t?.consume?.[1]?.style?.active?.strokeWidth;
154
- return typeof n == "function" && (t.consume[1].style.active.strokeWidth = (e) => e.type === H.Line ? 1 : n(e)), t;
155
- }
156
- function X(e) {
157
- return E({
158
- triggerData: [""],
159
- consumeData: ["", "group"],
160
- consumerMode: B.Or
161
- }, e, { valuePickerMode: e?.valuePickerMode });
162
- }
163
- var Z = 100, Q = .1, $ = .9, Ae = (0, De.default)((0, Ee.default)(Q, $, ($ - Q) / Z));
164
- function je(e, t) {
165
- return ({ datum: n, resources: { scale: r } }, i) => {
166
- let a = r(A(t)), o = t.jitterPoints ? Ae[i % Z] : .5;
167
- return a(n.group.value) + .5 * (1 - e) * a.bandwidth() + e * a.bandwidth() * o;
168
- };
169
- }
170
- var Me = (e, t, n, r, i, a) => {
171
- let o = Ne(e, t, a), s = Pe(e, Oe(e, t, i), a);
172
- return {
173
- ...n,
174
- components: [
175
- ...n.components,
176
- o,
177
- s
178
- ]
179
- };
180
- };
181
- function Ne(e, t, n) {
182
- let r = {
183
- orientation: e.orientation,
184
- major: { scale: A(e) },
185
- minor: { scale: k(e, e.measures.filter((e) => c(e))[0]) },
186
- box: {
187
- width: Y(e),
188
- fill: e.barColor ?? "rgba(100, 100, 100, 0.2)",
189
- rx: e.barSettings?.barRadius ?? 0,
190
- roundAllEdges: !0
191
- },
192
- median: {
193
- stroke: i.mainDarkNavy,
194
- strokeWidth: 2
195
- }
196
- };
197
- return e.barSettings?.strokeEnabled ? (r.box.stroke = e.barSettings?.strokeColor || t.colors.brandColors[0], r.box.strokeWidth = e.barSettings?.strokeWidth) : r.box.stroke = i.transparent, {
198
- type: G.Box,
199
- layout: { displayOrder: x.VisualizationElement },
200
- key: "min-max-box",
201
- data: { collection: b.DotBarCollection },
202
- settings: r,
203
- animations: {
204
- enabled: !0,
205
- presetId: "bar-chart"
206
- },
207
- brush: ke(n)
208
- };
209
- }
210
- function Pe(e, t, r) {
211
- let i = je(Y(e) * .9, e);
212
- return {
213
- type: G.Point,
214
- key: "dot-point",
215
- layout: { displayOrder: x.VisualizationElement },
216
- data: { collection: b.DotPointsCollection },
217
- settings: {
218
- x: { scale: k(e, e.measures.filter((e) => c(e))[0]) },
219
- y: {
220
- scale: A(e),
221
- fn: i
222
- },
223
- shape: n.Circle,
224
- size: e.pointSize,
225
- strokeWidth: 2,
226
- opacity: .8,
227
- fill: t,
228
- id: ({ datum: e }) => `${e.group.value}::${e.value}`
229
- },
230
- animations: { enabled: !0 },
231
- brush: X(r)
232
- };
233
- }
234
- function Fe(e, t, n) {
235
- if (!e.refLines?.x) return n;
236
- let r = e.refLines.x.map((e) => U(e, ce.XAxisScale, t)), i = {
237
- type: G.RefLine,
238
- layout: { displayOrder: x.RefLine },
239
- lines: { x: r }
240
- };
241
- return {
242
- ...n,
243
- components: [...n.components, i]
244
- };
245
- }
246
- var Ie = /* @__PURE__ */ t(((e, t) => {
247
- var n = f(), i = ge(), a = v(), o = r(), s = n.isFinite, c = Math.min;
248
- function l(e) {
249
- var t = Math[e];
250
- return function(e, n) {
251
- if (e = a(e), n = n == null ? 0 : c(i(n), 292), n && s(e)) {
252
- var r = (o(e) + "e").split("e");
253
- return r = (o(t(r[0] + "e" + (+r[1] + n))) + "e").split("e"), +(r[0] + "e" + (+r[1] - n));
254
- }
255
- return t(e);
256
- };
257
- }
258
- t.exports = l;
259
- })), Le = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
260
- t.exports = Ie()("round");
261
- })))());
262
- function Re(e, t, n) {
263
- let r = e.measures.filter((e) => c(e))[0];
264
- return O(e, t, n, {
265
- filter: ze,
266
- placement: {
267
- type: "bounds",
268
- area: "target"
269
- },
270
- extract: j(e, t, Be(r?.formatter), Ve)
271
- }, "tooltip", void 0, {
272
- componentKeys: ["dot-point"],
273
- yieldToComponentKeys: ["min-max-box"]
274
- });
275
- }
276
- function ze(e) {
277
- if (e.length === 0) return [];
278
- let t = e[0];
279
- return ["dot-point", "min-max-box"].includes(t.key) ? [t] : [];
280
- }
281
- function Be(e) {
282
- return (t, n, r, i, a, o, s, c) => {
283
- if (n.key === "dot-point") {
284
- let t = n.data.x.value;
285
- return !c && e ? t = r.formatter(e)(t, void 0, n.data) : c && (t = r.formatter(W(e))(n.data.x.value, void 0, n.data)), [{
286
- label: n.data.label,
287
- value: t
288
- }];
289
- } else if (n.key === "min-max-box") {
290
- let t = n.data.start.value, i = (0, Le.default)(n.data.med.value, 2), a = n.data.end.value;
291
- return !c && e ? (t = r.formatter(e)(t), i = r.formatter(e)(i), a = r.formatter(e)(a)) : c && (t = r.formatter(W(e))(t), i = r.formatter(W(e))(i), a = r.formatter(W(e))(a)), [
292
- {
293
- label: "Min",
294
- value: t
295
- },
296
- {
297
- label: "Avg",
298
- value: i
299
- },
300
- {
301
- label: "Max",
302
- value: a
303
- }
304
- ];
305
- }
306
- return [];
307
- };
308
- }
309
- function Ve(e) {
310
- return e.filter((e) => c(e))[1]?.label ?? "";
311
- }
312
- var He = (e, t, n) => {
313
- let r = e.dimensions.filter((e) => c(e)), i = e.measures.filter((e) => c(e)), o = {
314
- showAxisTooltip: e?.axes?.dimension?.showAxisTooltip,
315
- formatter: r[0]?.formatter || {
316
- type: "string",
317
- format: ""
318
- },
319
- scale: A(e),
320
- key: `${C.Dimension}-${e.orientation ?? a.Vertical}`,
321
- settings: { direction: ie(e) }
322
- }, s = i[0], [l, u] = se([o, {
323
- showAxisTooltip: e?.axes?.primaryMeasure?.showAxisTooltip,
324
- formatter: s?.formatter,
325
- scale: k(e, s),
326
- key: `${C.Measure}-${e.orientation ?? a.Vertical}`,
327
- settings: {
328
- direction: oe(e),
329
- labelDock: z(M(e), s?.secondaryAxis)
330
- }
331
- }]);
332
- return {
333
- ...n,
334
- components: [...n.components ?? [], ...l],
335
- interactions: [...n.interactions ?? [], ...u]
336
- };
337
- };
338
- function Ue(e, t, n, r, i, a) {
339
- let { components: o, interactions: s } = P(e, t, n, r, i, a);
340
- if (!e.coloring || e.coloring.type === d.Single) return {
341
- ...n,
342
- components: o,
343
- interactions: s
344
- };
345
- let c = e.dimensions?.find((t) => e.coloring.fieldId === t.dataItem.internalKey), l = o.map((e) => (e.type === N.CategoricalLegend || e.type === N.SequentialLegend) && c ? {
346
- ...e,
347
- brush: X(a)
348
- } : e);
349
- return {
350
- ...n,
351
- components: l,
352
- interactions: s
353
- };
354
- }
355
- var We = class extends R {
356
- constructor() {
357
- super([
358
- ye,
359
- q,
360
- le,
361
- pe,
362
- Ue,
363
- de,
364
- Me,
365
- Fe,
366
- Re,
367
- He,
368
- fe
369
- ]);
370
- }
371
- }, Ge = re(), Ke = new We(), qe = te(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
372
- let a = ee(), { activeKey: o } = ne(), c = g(), l = {
373
- ...i,
374
- valuePickerMode: !!o
375
- }, u = t || s, d = Ke.compile(e, u, n, r, l, m.Dot, a, c, V());
376
- return d ? /* @__PURE__ */ (0, Ge.jsx)(I, {
377
- config: l,
378
- definition: d,
379
- size: r,
380
- vSpec: e
381
- }) : null;
382
- });
383
- export { qe as DotChart };
@@ -1,281 +0,0 @@
1
- import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Oa as t, On as n, Pn as r, Po as i, Ta as a, Ti as o, Xs as s, bo as c, hc as l, pc as u, qs as d, yo as f, zn as p } from "./interfaces-VUY4_yVO.js";
3
- import { I as m, Ki as h, P as g, Zt as _, wi as v } from "./utils-Ba9T0TqC.js";
4
- import { Hn as y, Rn as b } from "./event-bus-KiSiCJrC.js";
5
- import { t as x } from "./stroke-dash-UgMEcCS4.js";
6
- import { B as S, Et as C, Ft as w, G as T, I as E, Jt as D, L as O, M as k, N as ee, Pt as A, Rt as j, St as M, Wt as N, Xt as P, Y as F, Yt as I, Zt as L, at as R, dt as z, ft as B, gt as V, ht as H, i as U, j as W, kt as G, mt as K, n as q, nn as J, on as Y, st as te, un as X, ut as Z, vt as Q } from "./escobar-BGqT1EsE.js";
7
- import { o as ne, t as re } from "./coloring-C16AUZEi.js";
8
- import { t as ie } from "./set-coloring-datafield-B3uIS1Pe.js";
9
- var ae = /* @__PURE__ */ e(h()), oe = (e, t, r) => {
10
- let i = e.dimensions.filter((e) => o(e)), a = e.measures.filter((e) => o(e)), c = i[0], f = a[0], m = !1, h = {}, { coloring: g } = e || {}, _ = g?.fieldId;
11
- if (g?.type === s.Categorical && (_ ||= u(c.dataItem)), g?.type === s.Gradient && (_ ||= u(f.dataItem)), _ && H(r, 0, { color: { field: _ } }), c && e?.axes?.dimension?.continuousAxis) {
12
- let e = l(c.dataItem), t = !!c.datePart, r = n(e) || p(e);
13
- m = !t && r;
14
- }
15
- if (h = M(ie(e, _), t, h), h = T(e, h, r.collections, m, !0), a.filter((e) => e.graphType === d.Bar).length > 1 && !e.barSettings?.grouped) {
16
- let t = P(e, a.find((e) => e.graphType === d.Bar));
17
- h[t].data = { collection: C.ComboChartCollection };
18
- }
19
- return {
20
- ...r,
21
- scales: h
22
- };
23
- }, $ = (e, t, n) => {
24
- let r = e.measures.filter((e) => o(e)), i = e.dimensions.filter((e) => o(e)), a = (e.supportingMeasures ?? []).filter((e) => o(e)), s = r.reduce((e, t) => {
25
- let n = u(t.dataItem);
26
- return e[n] = { field: n }, e;
27
- }, {}), c = k(a), l = i.reduce((e, t) => {
28
- let n = u(t.dataItem);
29
- return e[n] = { field: n }, e;
30
- }, {}), f = i[0];
31
- if (!f) return n;
32
- let p = u(f.dataItem), m = {
33
- key: C.ComboChartCollection,
34
- data: { extract: [] }
35
- };
36
- if (m.data.extract = r.map((e, t) => {
37
- let n = u(e.dataItem);
38
- return {
39
- field: p,
40
- props: {
41
- end: { field: n },
42
- ...s,
43
- ...c,
44
- ...l,
45
- start: 0,
46
- graphType: e.graphType,
47
- measureIndex: t,
48
- fieldId: n
49
- }
50
- };
51
- }), r.filter((e) => e.graphType === d.Bar).length > 1) {
52
- let t = !!r.find((e) => e.graphType === d.Bar)?.secondaryAxis, n = new Map(r.map((e) => [u(e.dataItem), !!e.secondaryAxis]));
53
- e.barSettings?.grouped || (m.data.stack = {
54
- stackKey: (e) => e.graphType.value === d.Bar ? `${e.value}` : `${e.value}-${e.graphType.value}-${e.measureIndex.value}`,
55
- value: (e) => {
56
- let r = e.fieldId?.value;
57
- return typeof r != "string" || n.get(r) !== t ? null : e.end.value;
58
- },
59
- offset: y.Diverging
60
- });
61
- }
62
- return {
63
- ...n,
64
- collections: [...n.collections, m]
65
- };
66
- }, se = (e, t, n, r, i, a) => {
67
- let s = [];
68
- return e.measures.filter((e) => o(e)).forEach((r) => {
69
- let o = u(r.dataItem), c = (e) => e.fieldId.value === o;
70
- switch (r.graphType || e.type) {
71
- case d.Bar:
72
- s.push(le(e, t, i, n, r, a, c));
73
- break;
74
- case d.Point:
75
- s.push(B(e, t, n, r, !1, C.ComboChartCollection, c));
76
- break;
77
- default: s.push(ce(e, t, n, r, c)), s.push(B(e, t, n, r, !r.showDataPoints, C.ComboChartCollection, c));
78
- }
79
- }), s.sort((e) => e.type === X.Box ? -1 : 0), {
80
- ...n,
81
- components: [...n.components, ...s]
82
- };
83
- };
84
- function ce(e, t, n, r, a) {
85
- let s = e.dimensions.filter((e) => o(e));
86
- if (!s[0]) throw Error("Combo chart without dimension is not supported.");
87
- if (s.length > 1) throw Error("Combo chart currently support only one dimension.");
88
- let c = x(r.strokeDash), l = u(r.dataItem), f = ne(e, n, t, r, l);
89
- return {
90
- type: X.Line,
91
- layout: { displayOrder: w.VisualizationElement },
92
- key: K(e, r, d.Line),
93
- data: {
94
- collection: C.ComboChartCollection,
95
- filter: a
96
- },
97
- settings: {
98
- orientation: e.orientation === i.Horizontal ? i.Vertical : i.Horizontal,
99
- coordinates: {
100
- major: { scale: I(e) },
101
- minor: {
102
- scale: P(e, r),
103
- ref: l
104
- }
105
- },
106
- layers: {
107
- curve: e.lineSettings?.lineCurve,
108
- skipCollisions: !0,
109
- line: {
110
- stroke: f,
111
- strokeWidth: r.strokeWidth,
112
- strokeDasharray: c
113
- }
114
- }
115
- },
116
- animations: {
117
- enabled: !0,
118
- presetId: "simple-opacity"
119
- }
120
- };
121
- }
122
- function le(e, t, n, a, s, c, l) {
123
- let f = e.dimensions.filter((e) => o(e)), p = e.measures.filter((e) => o(e) && e.graphType === d.Bar);
124
- if (!f[0]) throw Error("Combo chart without dimension is not supported.");
125
- let m = { scale: I(e) }, h = {
126
- scale: P(e, s),
127
- end: { ref: "end" }
128
- }, g = {
129
- minWidthPx: 2,
130
- rx: r(e?.barSettings.barRadius, 0),
131
- roundAllEdges: e?.barSettings?.roundAllEdges,
132
- useCustomBoxRounding: !0,
133
- boxPadding: e?.barSettings?.barPadding ?? Y.scale.padding
134
- };
135
- g.fill = new re(e, t, n?.[0]?.itemsNotAffectedByFiltering).getColorDefinition({ ref: "fieldId" });
136
- let _ = {
137
- enabled: !0,
138
- presetId: "bar-chart"
139
- }, v = s?.graphType !== d.Bar;
140
- if (p.length > 1 && e.barSettings?.grouped) {
141
- let t = 1 * (1 / p.length), n = (1 - (e.barSettings?.barPadding ?? 0)) * t, r = .5 / p.length, i = (1 + 0 * (p.length - 1)) * r, a = p.findIndex((e) => u(e.dataItem) === u(s.dataItem));
142
- m.fn = (n) => {
143
- let r = n.resources.scale(I(e));
144
- return r(n.datum.value) + i * r.bandwidth?.() + a * r.bandwidth?.() * t;
145
- }, g.width = n;
146
- }
147
- return {
148
- type: X.Box,
149
- layout: { displayOrder: w.VisualizationElement },
150
- key: K(e, s, d.Bar),
151
- data: {
152
- collection: C.ComboChartCollection,
153
- filter: l
154
- },
155
- settings: {
156
- orientation: e.orientation ?? i.Vertical,
157
- major: m,
158
- minor: h,
159
- box: g
160
- },
161
- animations: _,
162
- brush: v ? null : N([""], c)
163
- };
164
- }
165
- var ue = (e, t) => {
166
- let n = t ? [b.Inside] : [
167
- b.Inside,
168
- b.Outside,
169
- b.Opposite
170
- ];
171
- return (e || [
172
- {
173
- position: b.Inside,
174
- justify: 1
175
- },
176
- { position: b.Outside },
177
- { position: b.Opposite }
178
- ]).map((e) => ({
179
- ...e,
180
- possible: n.includes(e.position)
181
- }));
182
- }, de = ({ data: e }) => e ? e.end.value > e.start.value ? "up" : "down" : null, fe = ({ data: e }) => e ? e.end.value > e.start.value ? "right" : "left" : null, pe = (e, n, r, i, a, s) => {
183
- let l = e.measures.filter((e) => o(e)), p = l.filter((e) => e.graphType === d.Bar), m = p.filter((e) => e.dataLabels?.show), h = p.length >= 2 && !("barSettings" in e && e.barSettings?.grouped), g = L(e), _ = m.map((r) => {
184
- let i = !!r.dataLabels?.barLabelPlacements, a = ue(r.dataLabels?.barLabelPlacements, h).filter((e) => e.possible).map((e) => ({
185
- position: e.position,
186
- fill: e.position === b.Inside ? t.white : "#242424",
187
- ...e.justify === void 0 ? {} : { justify: e.justify },
188
- ...i ? { overflow: [b.Outside, b.Opposite].includes(e.position) } : {}
189
- }));
190
- return r.dataLabels?.showBackdrop && !h && (a = a.map((e) => ee(e, n, g))), {
191
- key: `combo-bar-labels-${r.dataItem.uniqueSignature}`,
192
- type: X.Labels,
193
- layout: { displayOrder: w.Labels },
194
- settings: { sources: [{
195
- component: K(e, r, d.Bar),
196
- selector: J.Rect,
197
- strategy: {
198
- type: "bar",
199
- settings: {
200
- direction: g ? fe : de,
201
- fontSize: D(r.dataLabels?.size),
202
- fontFamily: n.fonts.general.fontFamily,
203
- labels: [{
204
- label: E(r),
205
- placements: a
206
- }]
207
- }
208
- }
209
- }] },
210
- animations: {
211
- enabled: !0,
212
- presetId: "chart-labels"
213
- }
214
- };
215
- }), v = {}, y = {}, x = l.filter((e) => e.graphType !== d.Bar).map((t) => {
216
- let n = u(t.dataItem), r = K(e, t, d.Point);
217
- return y[r] = n, v[r] = {
218
- enabled: t.dataLabels?.show || !1,
219
- fontSize: D(t.dataLabels?.size),
220
- backdropColor: t.dataLabels?.backdropColor,
221
- textColor: t.dataLabels?.textColor,
222
- isColored: t.dataLabels?.isColored,
223
- colorType: t.dataLabels?.showBackdrop ? f.Backdrop : f.Text,
224
- density: t.dataLabels?.density || c.Medium
225
- }, r;
226
- }).filter((e) => v[e].enabled), C = x.length ? [S({
227
- targetComponentKeys: x,
228
- targetSelector: `.${z}`,
229
- label: ({ data: e, node: t }) => e[y[t.key]]?.label,
230
- skipBrush: !0
231
- }, v, s, n)] : [];
232
- if (_.length && C.length) {
233
- let e = {
234
- ...C[0],
235
- settings: {
236
- ...C[0].settings,
237
- sources: [..._.flatMap((e) => e.settings.sources), ...C[0].settings.sources]
238
- }
239
- };
240
- return {
241
- ...r,
242
- components: [...r.components, e]
243
- };
244
- }
245
- return {
246
- ...r,
247
- components: [
248
- ...r.components,
249
- ..._,
250
- ...C
251
- ]
252
- };
253
- }, me = class extends W {
254
- constructor() {
255
- super([
256
- $,
257
- oe,
258
- j,
259
- Q,
260
- se,
261
- te,
262
- V,
263
- pe,
264
- R,
265
- F,
266
- G,
267
- A,
268
- Z,
269
- O
270
- ]);
271
- }
272
- }, he = v(), ge = _(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
273
- let o = g(), [s] = (0, ae.useState)(() => new me()), c = m(), l = t || a, u = s.compile(e, l, n, r, i, d.Combo, o, c, q());
274
- return u ? /* @__PURE__ */ (0, he.jsx)(U, {
275
- config: i,
276
- definition: u,
277
- size: r,
278
- vSpec: e
279
- }) : null;
280
- });
281
- export { ge as ComboChart };