@astrato-io/visualizations 0.11.0 → 0.12.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.
Files changed (135) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +129 -4
  3. package/VISUALIZATION_DEFINITIONS.md +3 -1
  4. package/chunks/{Button-CPG4WX8X.js → Button-CQdoKSXX.js} +3 -3
  5. package/chunks/{CircularProgress-PSLW8HmD.js → CircularProgress-DpT1lwWw.js} +18 -18
  6. package/chunks/FieldTypeIcon-Cg4F9Q5D.js +22 -0
  7. package/chunks/{LinearProgress-KQ2EQlGL.js → LinearProgress-B7S0Q26A.js} +8 -8
  8. package/chunks/{MenuOption-B-6K7kks.js → MenuOption-DpKFJxmo.js} +133 -133
  9. package/chunks/{Title-BmvwZYkh.js → Title-m5damhc0.js} +10 -10
  10. package/chunks/{_createAggregator-CFmH6gUN.js → _createAggregator-BA8_iU9q.js} +7 -7
  11. package/chunks/{app-filter-bar.compiler-BY5-T16I.js → app-filter-bar.compiler--T4Qz3Wu.js} +3 -3
  12. package/chunks/{bar-layout-BNou0dZF.js → bar-layout-OFhxn2Go.js} +2 -2
  13. package/chunks/{bar.compiler-BkhO7sDd.js → bar.compiler-hWZBYYvV.js} +62 -62
  14. package/chunks/{builder-CNjuqD2z.js → builder-7w_bgV_h.js} +31 -31
  15. package/chunks/{coloring-BOiP0rmn.js → coloring-Cd6p0GQJ.js} +88 -83
  16. package/chunks/{createSimplePaletteValueFilter-BkgQ7MFE.js → createSimplePaletteValueFilter-CiJT8s1s.js} +55 -55
  17. package/chunks/defaults-CMFqXvaJ.js +3 -0
  18. package/chunks/{definitions-AS9GcavE.js → definitions-DTauTjIX.js} +412 -406
  19. package/chunks/{escobar-cQ1eQ64G.js → escobar-CMvphKSK.js} +4787 -4717
  20. package/chunks/{extend-preset-BlCbcXKR.js → extend-preset-BpXttHFk.js} +371 -372
  21. package/chunks/{filter.compiler-CI7dDNM1.js → filter.compiler-DOGFweJz.js} +4 -4
  22. package/chunks/{filtering-Dwi7hDPZ.js → filtering-NOnDcGbo.js} +183 -183
  23. package/chunks/handlers-CyYFSfhM.js +15393 -0
  24. package/chunks/{icon-picker-styles-CBlxEu3s.js → icon-picker-styles-DuSERhBU.js} +2 -2
  25. package/chunks/{isEqual-BdHo6wqq.js → isEqual-4f8yUUtC.js} +1 -1
  26. package/chunks/{isFocusVisible-C1nlVUwL.js → isFocusVisible-Czm70MGc.js} +1 -1
  27. package/chunks/line.compiler-B-4H55_T.js +203 -0
  28. package/chunks/{logger-Bc-DqDM_.js → logger-Cioob-QV.js} +71 -70
  29. package/chunks/{map.compiler-CRO6XpdI.js → map.compiler-Cv5V6EhF.js} +13 -13
  30. package/chunks/measure-axis-label-format-COy8U_dd.js +27 -0
  31. package/chunks/{measure-format-default-B6ghxih7.js → measure-format-default-B_kuGSzi.js} +7 -3
  32. package/chunks/{metadata-CtkvZEhS.js → metadata-dGSe5UWy.js} +5 -5
  33. package/chunks/{number.compiler-kV4lobCZ.js → number.compiler-D7nMcEMv.js} +8 -8
  34. package/chunks/{operations-COl9wgqi.js → operations-CgfehCad.js} +11462 -11223
  35. package/chunks/{range-CMJ5yc5Z.js → range-Dmwp9kVB.js} +2 -2
  36. package/chunks/{react-dom-BjsCbYHq.js → react-dom-CfuL-m78.js} +24 -24
  37. package/chunks/{render-wrappers-DFHi3Wkr.js → render-wrappers--g-zPFBW.js} +1 -1
  38. package/chunks/{requirements-C5YLmHKe.js → requirements-DHayNJ2C.js} +83 -83
  39. package/chunks/{shared-DyqxOie0.js → shared-DoEN9nNM.js} +282 -277
  40. package/chunks/standalone-B3hRGgYi.js +773 -0
  41. package/chunks/{standalone-BYK2U0Vd.js → standalone-BPNXgFft.js} +380 -380
  42. package/chunks/standalone-BPTT8XEu.js +424 -0
  43. package/chunks/standalone-BgAeHROc.js +2 -0
  44. package/chunks/{standalone-I5kRIsp8.js → standalone-BkQxag7M.js} +81 -81
  45. package/chunks/{standalone-DYVYccmY.js → standalone-Bxa3x6dg.js} +913 -913
  46. package/chunks/standalone-C0If-V6O.js +773 -0
  47. package/chunks/standalone-C1TOyflX.js +287 -0
  48. package/chunks/{standalone-DaNxWIKn.js → standalone-CE5PwJN0.js} +21 -21
  49. package/chunks/{standalone-K2OvRAQM.js → standalone-CG7IFN6n.js} +121 -121
  50. package/chunks/{standalone-Db_HNuWx.js → standalone-CKlgGu80.js} +44 -44
  51. package/chunks/standalone-CNf-oA2U.js +355 -0
  52. package/chunks/{standalone-9jrQ3zJT.js → standalone-CXPdWFlw.js} +10 -10
  53. package/chunks/{standalone-c4CPN6ug.js → standalone-Cf0_5tbu.js} +5783 -5785
  54. package/chunks/{standalone-Bp4G3MDx.js → standalone-DMi4-Vp3.js} +118 -118
  55. package/chunks/{standalone-BrjtMIdd.js → standalone-DTEX67C8.js} +108 -108
  56. package/chunks/{standalone-iOnJhCvA.js → standalone-DU46-kYv.js} +181 -181
  57. package/chunks/standalone-Dbn3jSH6.js +690 -0
  58. package/chunks/{standalone-CS5VGoja.js → standalone-DdcAL_k_.js} +833 -837
  59. package/chunks/standalone-DwCIA0UG.js +1057 -0
  60. package/chunks/standalone-Dz13tl3P.js +357 -0
  61. package/chunks/{standalone-CIjNYyya.js → standalone-H9GFzFk_.js} +937 -938
  62. package/chunks/{standalone-ChfEHb28.js → standalone-MduR0qre.js} +1279 -1279
  63. package/chunks/standalone-ejTz66P3.js +2 -0
  64. package/chunks/{standalone-D9k5SCd8.js → standalone-keB-0wK3.js} +189 -189
  65. package/chunks/{standalone-Bsfz5vnJ.js → standalone-nnkuQd0K.js} +35 -35
  66. package/chunks/standalone-vGGR6Vcn.js +6 -0
  67. package/chunks/{table.compiler-CMH_dtYs.js → table.compiler-mS4UvhLT.js} +12 -12
  68. package/chunks/theme-MYp6Rj1J.js +232 -0
  69. package/chunks/{useFieldName-BfxBzhhH.js → useFieldName-AdSak4Ch.js} +1 -1
  70. package/chunks/{utils-BdJrEeIQ.js → utils-CUKgR7it.js} +3265 -3133
  71. package/chunks/{view-Q-_XIrWE.js → view-BeYwpcVD.js} +478 -478
  72. package/chunks/{visualization-filters-BwS0xUqs.js → visualization-filters-B9qik5_K.js} +2706 -2384
  73. package/chunks/{with-html-element-D_ooGNWI.js → with-html-element-1GSeLT59.js} +3888 -3870
  74. package/definitions.js +2 -2
  75. package/docs/operations/astrato-app-filter-bar.md +1 -1
  76. package/docs/operations/bar.md +115 -32
  77. package/docs/operations/combo.md +50 -17
  78. package/docs/operations/date-picker.md +4 -4
  79. package/docs/operations/distribution-gauge.md +18 -16
  80. package/docs/operations/dot.md +107 -24
  81. package/docs/operations/filter.md +10 -8
  82. package/docs/operations/gauge.md +20 -18
  83. package/docs/operations/heatMap.md +73 -21
  84. package/docs/operations/histogram.md +45 -12
  85. package/docs/operations/iframe.md +1 -1
  86. package/docs/operations/image.md +1 -1
  87. package/docs/operations/index.md +11 -11
  88. package/docs/operations/line.md +57 -24
  89. package/docs/operations/map.md +16 -16
  90. package/docs/operations/number.md +10 -9
  91. package/docs/operations/pie.md +23 -21
  92. package/docs/operations/radar.md +13 -11
  93. package/docs/operations/sankey.md +19 -17
  94. package/docs/operations/scatter.md +111 -28
  95. package/docs/operations/shape.md +5 -5
  96. package/docs/operations/simpleTextObject.md +4 -4
  97. package/docs/operations/slider.md +1 -1
  98. package/docs/operations/table.md +27 -25
  99. package/docs/operations/tree.md +5 -3
  100. package/docs/operations/treemap.md +70 -18
  101. package/docs/operations/waterfall.md +40 -7
  102. package/docs/operations/word-cloud.md +69 -17
  103. package/getters.js +2 -2
  104. package/index.js +474 -525
  105. package/metadata.js +2 -2
  106. package/operations.js +24 -17
  107. package/package.json +71 -72
  108. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1 -1
  109. package/src/definitions/model/definitions/schema-registry.d.ts +13 -12
  110. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -2
  111. package/src/definitions/model/definitions/schemas/common.schema.d.ts +5 -4
  112. package/src/definitions/model/definitions/schemas/line.schema.d.ts +3 -2
  113. package/src/definitions/model/definitions/schemas/number.schema.d.ts +1 -1
  114. package/src/definitions/model/definitions/schemas/table.schema.d.ts +14 -14
  115. package/src/index.d.ts +1 -1
  116. package/src/operations/index.d.ts +11 -1
  117. package/src/types.d.ts +166 -1
  118. package/chunks/FieldTypeIcon-5k2bkqd0.js +0 -22
  119. package/chunks/category-axis-D1OVyMrr.js +0 -20
  120. package/chunks/color-rules-DYJL4fIW.js +0 -15
  121. package/chunks/color-settings-DJFoFTip.js +0 -5
  122. package/chunks/defaults-B5_8S-J-.js +0 -3
  123. package/chunks/handlers-C63NVo7i.js +0 -15433
  124. package/chunks/line.compiler-DCv3h42f.js +0 -198
  125. package/chunks/standalone-06i1wmIX.js +0 -6
  126. package/chunks/standalone-B6zUvxNQ.js +0 -357
  127. package/chunks/standalone-Be5APcVv.js +0 -762
  128. package/chunks/standalone-BuXpKMnc.js +0 -2
  129. package/chunks/standalone-CUGt2FUF.js +0 -2
  130. package/chunks/standalone-CnF2OYLQ.js +0 -355
  131. package/chunks/standalone-CznEEiq3.js +0 -422
  132. package/chunks/standalone-DcuE8KBa.js +0 -287
  133. package/chunks/standalone-pCrzBiTy.js +0 -773
  134. package/chunks/standalone-qrZaimgC.js +0 -689
  135. package/chunks/standalone-yqDJ8h3K.js +0 -1012
@@ -0,0 +1,355 @@
1
+ import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
2
+ import { $c as n, Ec as r, Oo as i, Sa as a, Ua as o, di as s, hl as c, hs as l, kc as u, po as d } from "./visualization-filters-B9qik5_K.js";
3
+ import { Kt as f, Mt as p, P as m, Ur as h, fi as g, qt as _ } from "./utils-CUKgR7it.js";
4
+ import { x_ as v } from "./handlers-CyYFSfhM.js";
5
+ import { n as y } from "./label-format-type-C46pzgx7.js";
6
+ import "./logger-Cioob-QV.js";
7
+ import { A as b, At as x, En as S, It as C, Lt as ee, Mn as w, On as T, P as E, _ as D, en as te, i as ne, mn as re, un as O, v as k, wn as ie, zt as A } from "./escobar-CMvphKSK.js";
8
+ import { t as j } from "./coloring-Cd6p0GQJ.js";
9
+ import { t as M } from "./set-coloring-datafield-B3uIS1Pe.js";
10
+ var N = /* @__PURE__ */ e(g()), P = {
11
+ outerRadius: .95,
12
+ cornerRadius: 10,
13
+ additionalTextAnchorHeight: 50,
14
+ barMinWidth: 1,
15
+ barMaxWidth: 200,
16
+ minScaleValue: 0,
17
+ maxScaleValue: 100,
18
+ scalePadding: 1,
19
+ backgroundBarOpacity: .2,
20
+ barWidthRadiusPadding: .2,
21
+ maxBarWidthOfRadius: .15,
22
+ gaugeCollectionKey: "Gauge-Collection"
23
+ }, F = (e) => e.gaugeSettings?.barMode ?? !1, I = (e) => e.gaugeSettings?.comparisonMode ?? !1, L = (e) => {
24
+ let { coloring: t } = e || {};
25
+ return t?.type === n.Categorical || t?.type === n.Single ? ee(e, []) ?? "" : A(e) ?? "";
26
+ }, R = (e, t, n) => {
27
+ let r = { ...C(M(e, L(e) ?? ""), t, {}) }, i = e.gaugeSettings?.barPadding ?? T.scale.padding;
28
+ r = b(e, r, i);
29
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
30
+ return !a.length && F(e) ? r.onlyMeasures = {
31
+ data: I(e) ? { extract: { field: o[0] ? c(o[0].dataItem) : "" } } : o.map((e) => c(e.dataItem)),
32
+ type: S.Band,
33
+ padding: i
34
+ } : I(e) || (r.onlyMeasures = {
35
+ data: { fields: o.map((e) => c(e.dataItem)) },
36
+ include: [0],
37
+ expand: .05
38
+ }), F(e) && (r.barScale = {
39
+ min: P.minScaleValue - P.scalePadding,
40
+ max: P.maxScaleValue + P.scalePadding,
41
+ invert: e.gaugeSettings?.orientation === l.Vertical
42
+ }), {
43
+ ...n,
44
+ scales: r
45
+ };
46
+ }, z = (e, t, n, r, i) => {
47
+ if (!i) return n;
48
+ let a = e.dimensions.filter(s), o = e.measures.filter(s), l = k((e.supportingMeasures ?? []).filter(s)), u = o.filter((e) => e.role === d.GAUGE_VALUE), f = a[0], p = u[0], { targetType: m } = e.gaugeSettings ?? {}, h = F(e), g = f?.dataItem ?? p?.dataItem;
49
+ if (!g) return n;
50
+ let _ = [], v = P.minScaleValue;
51
+ if (I(e) ? _.push(...V(e, g, i, l)) : f ? _.push(...B(e, g, i, l)) : _.push(...H(e, i, l)), h) {
52
+ let t = c(p.dataItem), n = {
53
+ field: c(g),
54
+ props: {
55
+ actual: { field: t },
56
+ color: t,
57
+ start: v,
58
+ end: P.maxScaleValue,
59
+ background: !0,
60
+ ...l
61
+ }
62
+ };
63
+ (m === y.Data || m === y.Manual) && (n.props ??= {}, n.props.target = G(e, i)), o.forEach((e) => {
64
+ n.props ??= {};
65
+ let t = `measure-${c(e.dataItem)}`;
66
+ n.props[t] = { field: c(e.dataItem) };
67
+ }), _.push(n);
68
+ }
69
+ let b = [{
70
+ key: P.gaugeCollectionKey,
71
+ data: { extract: _ }
72
+ }];
73
+ return {
74
+ ...n,
75
+ collections: b
76
+ };
77
+ }, B = (e, t, n, r) => {
78
+ let i = e.measures.filter(s), a = i.filter((e) => e.role === d.GAUGE_VALUE), o = i.filter((e) => e.role === d.GAUGE_TARGET), l = a[0], u = o[0], { targetType: f } = e.gaugeSettings, p = F(e), m = [], h = c(l.dataItem);
79
+ return p || m.push({
80
+ field: c(t),
81
+ props: {
82
+ actual: { field: h },
83
+ [h]: { field: h },
84
+ color: h,
85
+ ...r
86
+ }
87
+ }), m.push({
88
+ field: c(t),
89
+ props: {
90
+ actual: { field: h },
91
+ start: p ? P.minScaleValue : void 0,
92
+ end: p ? { getValue: U(e, n) } : void 0,
93
+ [h]: { field: h },
94
+ color: h,
95
+ ...r
96
+ }
97
+ }), (f === y.Data || f === y.Manual) && m.forEach((t) => {
98
+ t.props ??= {}, t.props.target = G(e, n), u && f === y.Data && (t.props[c(u.dataItem)] = { field: c(u.dataItem) });
99
+ }), m;
100
+ }, V = (e, t, n, r) => {
101
+ let i = F(e), a = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), o = a.reduce((e, t) => {
102
+ let n = c(t.dataItem);
103
+ return e[n] = { field: n }, e;
104
+ }, {});
105
+ return a.map((a, s) => {
106
+ let l = c(a.dataItem);
107
+ return {
108
+ field: c(t),
109
+ props: {
110
+ measure: { field: l },
111
+ color: l,
112
+ start: i ? P.minScaleValue : void 0,
113
+ end: i ? { getValue: U(e, n, s) } : void 0,
114
+ ...o,
115
+ ...r
116
+ }
117
+ };
118
+ });
119
+ }, H = (e, t, n) => {
120
+ let r = F(e), i = [];
121
+ return e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE).forEach((a) => {
122
+ let o = c(a.dataItem), s = t[0].items[0][o], l = G(e, t, a), u = [];
123
+ u.push({
124
+ field: o,
125
+ props: {
126
+ measureValue: o,
127
+ measure: { field: o },
128
+ actual: { field: o },
129
+ color: o,
130
+ start: r ? P.minScaleValue : void 0,
131
+ end: r && typeof s == "number" && typeof l == "number" ? W(s, l) : void 0,
132
+ [o]: { field: o },
133
+ ...n
134
+ }
135
+ }), u.push({
136
+ field: o,
137
+ props: {
138
+ measureValue: o,
139
+ measure: { field: o },
140
+ actual: { field: o },
141
+ color: o,
142
+ start: r ? P.minScaleValue : void 0,
143
+ end: r ? P.maxScaleValue : void 0,
144
+ background: !0,
145
+ [o]: { field: o },
146
+ ...n
147
+ }
148
+ }), (e.gaugeSettings?.targetType ?? y.Auto) !== y.Auto && u.forEach((e) => {
149
+ e.props ??= {}, e.props.target = l;
150
+ }), i.push(...u);
151
+ }), i;
152
+ }, U = (e, t, n) => {
153
+ let r = e.measures.filter(s), i = r.filter((e) => e.role === d.GAUGE_VALUE), a = r.filter((e) => e.role === d.GAUGE_TARGET), o = i[0], l = a[0];
154
+ return (r, a, s) => {
155
+ if (!s) return P.minScaleValue;
156
+ let u = i.find((e, t) => t === n), d = u && s[c(u.dataItem)];
157
+ if (typeof d == "number" && d < 0) return P.minScaleValue;
158
+ let f = s[c(o.dataItem)], p;
159
+ if (p = e.gaugeSettings?.targetType === y.Data ? s[c(l?.dataItem)] : G(e, t), typeof f != "number" || typeof p != "number") return P.minScaleValue;
160
+ if (!I(e) || n === void 0) return W(f, p);
161
+ let m = 0, h = 0;
162
+ return i.forEach((e, t) => {
163
+ let r = Math.max(0, s[c(e.dataItem)]);
164
+ m += r, t <= n && (h += r);
165
+ }), h / m * P.maxScaleValue;
166
+ };
167
+ }, W = (e, t) => {
168
+ let n = t ? Math.max(0, e) / t : 1;
169
+ return Math.min(n, 1) * P.maxScaleValue;
170
+ }, G = (e, t, n) => {
171
+ let { targetType: r, targetValue: i } = e.gaugeSettings, a = e.measures.filter(s), o = a.filter((e) => e.role === d.GAUGE_TARGET)[0];
172
+ return r === y.Auto ? t[0].items.map((e) => a.map((t) => e[c(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + T.scale.padding) : o && r === y.Data ? { field: c(o.dataItem) } : n && r === y.PerMeasure ? n.targetValue ?? 0 : r === y.Manual ? i ?? 0 : 0;
173
+ }, K = {
174
+ Foreground: "foreground",
175
+ Background: "background"
176
+ }, q = (e, t, n = 0) => `${e}-${t}-${n}`, J = (e) => Math.min(P.maxBarWidthOfRadius, P.outerRadius / e), ae = (e, t, n) => {
177
+ let r = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
178
+ return (e) => n !== void 0 && e.measure?.source?.field !== c(r[n]?.dataItem) ? !1 : e.background?.value ? t === K.Background : t === K.Foreground;
179
+ }, Y = (e, t) => !t || e.coloring?.type === n.Single ? !1 : !I(e) || e.coloring?.type === n.Categorical, X = (e, t, n, r, i, a, o, l) => {
180
+ let u = n.dimensions.filter(s)[0], f = new j(n, r, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(Y(n, u) ? { ref: f.MAIN_FIELD } : {}), m = (e, t = 0) => !I(n) && t === 1 || a && I(n) ? "transparent" : typeof p == "function" ? p(e) : p, h = J(o), g = Number(n.gaugeSettings?.size), _ = Number(n.gaugeSettings?.startAngle), v = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + v, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
181
+ return {
182
+ key: q(w.Pie, a ? K.Background : K.Foreground, i),
183
+ type: w.Pie,
184
+ animations: {
185
+ enabled: !0,
186
+ presetId: "pie-chart"
187
+ },
188
+ data: {
189
+ collection: P.gaugeCollectionKey,
190
+ filter: (t) => {
191
+ if (!u) {
192
+ let e = n.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
193
+ return I(n) || e[i] && t.measure?.source?.field === c(e[i].dataItem);
194
+ }
195
+ return `${t.value}` == `${e[c(u.dataItem)]}`;
196
+ }
197
+ },
198
+ settings: {
199
+ startAngle: S,
200
+ endAngle: C,
201
+ slice: {
202
+ cornerRadius: n.gaugeSettings?.cornerRadius ?? 10,
203
+ outerRadius: P.outerRadius - i * h,
204
+ innerRadius: P.outerRadius - (i + (1 - P.barWidthRadiusPadding)) * h,
205
+ fill: m,
206
+ strokeWidth: .1,
207
+ opacity: a ? P.backgroundBarOpacity : 1,
208
+ arc: (e, t = 0) => {
209
+ if (a) return +(t === 0);
210
+ if (I(n)) return e.datum.measure.value;
211
+ if ((n.gaugeSettings.targetType ?? y.Auto) !== y.Auto) return t === 0 ? e.datum.actual.value : Number(e.datum.target.value) - Number(e.datum.actual.value);
212
+ {
213
+ let n = e.resources.scale("onlyMeasures"), r = Number(n(e.datum.actual.value)) || 0;
214
+ return t === 0 ? r : 1 - r;
215
+ }
216
+ }
217
+ }
218
+ },
219
+ brush: O([""], l, { overwriteOpacity: a ? P.backgroundBarOpacity : void 0 })
220
+ };
221
+ }, Z = (e, t, n, r, i, a) => {
222
+ let u = e.dimensions.filter(s)[0], d = new j(e, t, n?.[0]?.itemsNotAffectedByFiltering), f;
223
+ f = r === K.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(Y(e, u) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && r === K.Background ? P.backgroundBarOpacity : void 0);
224
+ let p = u ? c(u.dataItem) : "onlyMeasures", m = !u && !I(e) ? "measureValue" : void 0, h = {
225
+ key: q(w.Box, r, i),
226
+ type: w.Box,
227
+ animations: { enabled: !0 },
228
+ data: {
229
+ collection: P.gaugeCollectionKey,
230
+ filter: ae(e, r, i)
231
+ },
232
+ settings: {
233
+ orientation: e.gaugeSettings.orientation ?? l.Horizontal,
234
+ major: {
235
+ scale: p,
236
+ ref: m
237
+ },
238
+ minor: { scale: "barScale" },
239
+ box: {
240
+ minWidthPx: 2,
241
+ fill: f,
242
+ rx: e.gaugeSettings?.barRadius ?? 0
243
+ }
244
+ },
245
+ brush: O([""], a, { disable: { triggers: r === K.Foreground } })
246
+ };
247
+ if (e.gaugeSettings?.strokeEnabled) {
248
+ let n = h.settings;
249
+ n && (n.box.stroke = e.gaugeSettings?.strokeColor || t.colors.brandColors[0], n.box.strokeWidth = e.gaugeSettings?.strokeWidth);
250
+ } else {
251
+ let e = h.settings;
252
+ e && (e.box.stroke = o.transparent);
253
+ }
254
+ return h;
255
+ }, oe = (e, t, n, r, i, a) => {
256
+ if (!i) return n;
257
+ let o = [];
258
+ return o = F(e) ? ce(e, t, r, i, a) : se(e, t, r, i, a), {
259
+ ...n,
260
+ components: [...n.components, ...o]
261
+ };
262
+ }, se = (e, t, n, r, i) => {
263
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
264
+ return !a[0] && !I(e) ? o.map((n, i) => [X(r[0].items[0], r, e, t, i, !0, o.length), X(r[0].items[0], r, e, t, i, !1, o.length)]).reduce((e, t) => e.concat(t), []) : r[0].items.map((n, a) => [X(n, r, e, t, a, !0, r[0].items.length, i), X(n, r, e, t, a, !1, r[0].items.length, i)]).reduce((e, t) => e.concat(t), []);
265
+ }, ce = (e, t, n, r, i) => {
266
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = a[0], l = [];
267
+ if (I(e)) for (let n = o.length - 1; n >= 0; n--) l.push(Z(e, t, r, K.Foreground, n, i));
268
+ else if (c) l = [Z(e, t, r, K.Background, void 0, i), Z(e, t, r, K.Foreground, void 0, i)];
269
+ else for (let n = o.length - 1; n >= 0; n--) l.push(Z(e, t, r, K.Background, n)), l.push(Z(e, t, r, K.Foreground, n));
270
+ return l;
271
+ }, le = (e, t, n) => {
272
+ let r = e.dimensions.filter(s), i = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
273
+ if (!e.gaugeSettings?.barMode || !r.length && e.gaugeSettings?.comparisonMode) return n;
274
+ let a = [];
275
+ return r.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && r[0] && a.push(Q(!1, t, r[0].formatter, "dimension", void 0, e.gaugeSettings)), !e.gaugeSettings?.comparisonMode && e.gaugeSettings?.showValueLabels !== !1 && i[0] && a.push(Q(!0, t, i[0].formatter, "value", void 0, e.gaugeSettings))) : e.gaugeSettings?.showValueLabels !== !1 && i.forEach((n, r) => {
276
+ a.push(Q(!0, t, n.formatter, String(r), r, e.gaugeSettings));
277
+ }), {
278
+ ...n,
279
+ components: [...n.components, ...a]
280
+ };
281
+ }, Q = (e, t, n, r, i, a) => {
282
+ let o = +!!e, s = {
283
+ type: "bar",
284
+ settings: {
285
+ direction: a?.orientation === l.Vertical ? "up" : "right",
286
+ fontSize: re(a?.labelFontSize),
287
+ fontFamily: t.fonts.general.fontFamily,
288
+ labels: [{
289
+ label: (t) => t.data ? e ? ue(t.data.actual.value, n, t) : `${_(n, t.data?.label)}` : "",
290
+ placements: e ? [{
291
+ position: v.Outside,
292
+ fill: "#000",
293
+ justify: 0
294
+ }, {
295
+ position: v.Inside,
296
+ fill: "#fff",
297
+ justify: o
298
+ }] : [{
299
+ position: v.Inside,
300
+ fill: "#fff",
301
+ justify: o
302
+ }]
303
+ }]
304
+ }
305
+ };
306
+ return {
307
+ type: w.Labels,
308
+ key: `gauge-bar-labels-${r}`,
309
+ layout: { displayOrder: te.Labels },
310
+ settings: { sources: [{
311
+ component: q(w.Box, K.Foreground, i),
312
+ selector: ie.Rect,
313
+ strategy: s
314
+ }] },
315
+ animations: {
316
+ enabled: !0,
317
+ presetId: "chart-labels"
318
+ }
319
+ };
320
+ }, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && i(t) ? f(t.format, t)(e, void 0, n.data) : `${_(t, e)}`, de = (e, t, n, r) => x(e, t, n, r), fe = (e, t, n, r, i) => {
321
+ if (!i) return n;
322
+ let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = a[0], l = F(e), u = I(e), f = l ? w.Box : w.Pie, p = l && !u ? K.Background : K.Foreground, m = ((l || !c ? o : i[0]?.items) || []).map((e, t) => q(f, p, t));
323
+ return E(e, t, n, {
324
+ filter: (e) => e.filter((e) => m.findIndex((t) => t === e.key) !== -1),
325
+ placement: {
326
+ type: l ? "bounds" : "slice",
327
+ area: "target"
328
+ }
329
+ });
330
+ }, pe = class extends D {
331
+ constructor() {
332
+ super([
333
+ z,
334
+ R,
335
+ oe,
336
+ le,
337
+ de,
338
+ fe
339
+ ]);
340
+ }
341
+ preCompile(e) {
342
+ if (!(e.measures ?? []).filter(s).filter((e) => e.role === d.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
343
+ }
344
+ }, me = h(), $ = p(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties: o }) => {
345
+ let s = m(), [c] = (0, N.useState)(() => new pe());
346
+ if (!e || !(u(e) || r(e)) || !i) return null;
347
+ let l = t || a, d = c.compile(e, l, n, i, o, e.type, s);
348
+ return d ? /* @__PURE__ */ (0, me.jsx)(ne, {
349
+ config: o,
350
+ definition: d,
351
+ size: i,
352
+ vSpec: e
353
+ }) : null;
354
+ }), he = /* @__PURE__ */ t({ GaugeChart: () => $ });
355
+ export { $ as n, he as t };
@@ -1,8 +1,8 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Nn as t, ac as n, qt as r } from "./visualization-filters-BwS0xUqs.js";
3
- import { Br as i, G as a, Qt as o, f as s, li as c } from "./utils-BdJrEeIQ.js";
4
- import "./defaults-B5_8S-J-.js";
5
- var l = /* @__PURE__ */ e(c()), u = a({
2
+ import { Mc as t, Vn as n, tn as r } from "./visualization-filters-B9qik5_K.js";
3
+ import { G as i, Ur as a, f as o, fi as s, tn as c } from "./utils-CUKgR7it.js";
4
+ import "./defaults-CMFqXvaJ.js";
5
+ var l = /* @__PURE__ */ e(s()), u = i({
6
6
  iframeWrapper: {
7
7
  width: "100%",
8
8
  height: "100%",
@@ -25,20 +25,20 @@ var l = /* @__PURE__ */ e(c()), u = a({
25
25
  width: "100%",
26
26
  height: "100%"
27
27
  }
28
- }), d = i(), f = t(), p = ({ vSpec: e }) => {
29
- let t = r((e && n(e) ? e : f).iframeSettings.url, null), i = s(), a = u(), c = o();
28
+ }), d = a(), f = n(), p = ({ vSpec: e }) => {
29
+ let n = r((e && t(e) ? e : f).iframeSettings.url, null), i = o(), a = u(), s = c();
30
30
  if ((0, l.useEffect)(() => {
31
31
  i();
32
- }, []), !t) return /* @__PURE__ */ (0, d.jsx)("div", {
32
+ }, []), !n) return /* @__PURE__ */ (0, d.jsx)("div", {
33
33
  className: a.emptyState,
34
34
  "data-testid": "iframe-empty-container"
35
35
  });
36
36
  let p = "\n allow-scripts\n allow-forms\n allow-same-origin\n allow-popups\n allow-popups-to-escape-sandbox\n allow-modals\n allow-downloads\n ", m = "\n autoplay\n clipboard-write\n clipboard-read\n ";
37
- return c.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, d.jsxs)("div", {
37
+ return s.daedalus.objectCapabilities.editable ? /* @__PURE__ */ (0, d.jsxs)("div", {
38
38
  className: a.iframeWrapper,
39
39
  "data-testid": "iframe-container",
40
40
  children: [/* @__PURE__ */ (0, d.jsx)("iframe", {
41
- src: t,
41
+ src: n,
42
42
  width: "100%",
43
43
  height: "100%",
44
44
  style: { border: "none" },
@@ -55,7 +55,7 @@ var l = /* @__PURE__ */ e(c()), u = a({
55
55
  className: a.iframeWrapper,
56
56
  "data-testid": "iframe-container",
57
57
  children: /* @__PURE__ */ (0, d.jsx)("iframe", {
58
- src: t,
58
+ src: n,
59
59
  width: "100%",
60
60
  height: "100%",
61
61
  style: { border: "none" },