@astrato-io/visualizations 0.10.1 → 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 (143) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +148 -5
  3. package/THIRD_PARTY_NOTICES.md +494 -0
  4. package/VISUALIZATION_DEFINITIONS.md +9 -146
  5. package/chunks/{Button-Dn3rJrYf.js → Button-CQdoKSXX.js} +3 -3
  6. package/chunks/{CircularProgress-BFeu06Yb.js → CircularProgress-DpT1lwWw.js} +20 -20
  7. package/chunks/FieldTypeIcon-Cg4F9Q5D.js +22 -0
  8. package/chunks/{LinearProgress-ClO6GUjN.js → LinearProgress-B7S0Q26A.js} +14 -14
  9. package/chunks/{MenuOption-Czc34u4q.js → MenuOption-DpKFJxmo.js} +167 -167
  10. package/chunks/{Title-BgYnaVTR.js → Title-m5damhc0.js} +37 -37
  11. package/chunks/{_createAggregator-BMu9uRax.js → _createAggregator-BA8_iU9q.js} +17 -17
  12. package/chunks/{app-filter-bar.compiler-CVir0wkl.js → app-filter-bar.compiler--T4Qz3Wu.js} +8 -8
  13. package/chunks/{bar-layout-C_UgRlVl.js → bar-layout-OFhxn2Go.js} +2 -2
  14. package/chunks/{bar.compiler-DYuFdi9J.js → bar.compiler-hWZBYYvV.js} +71 -69
  15. package/chunks/{builder-C-TKA-My.js → builder-7w_bgV_h.js} +106 -55
  16. package/chunks/{coloring-BtnPiQ_o.js → coloring-Cd6p0GQJ.js} +93 -88
  17. package/chunks/{createSimplePaletteValueFilter--zrZxRV9.js → createSimplePaletteValueFilter-CiJT8s1s.js} +169 -169
  18. package/chunks/defaults-CMFqXvaJ.js +3 -0
  19. package/chunks/{definitions-CT304NDn.js → definitions-DTauTjIX.js} +399 -398
  20. package/chunks/{escobar-CvEV2ES1.js → escobar-CMvphKSK.js} +4949 -4879
  21. package/chunks/{extend-preset-D9-JP92b.js → extend-preset-BpXttHFk.js} +449 -450
  22. package/chunks/{filter.compiler-CXeZznks.js → filter.compiler-DOGFweJz.js} +10 -10
  23. package/chunks/{filtering-8_bFv-jb.js → filtering-NOnDcGbo.js} +241 -241
  24. package/chunks/handlers-CyYFSfhM.js +15393 -0
  25. package/chunks/{icon-picker-styles-BXiJ1SZS.js → icon-picker-styles-DuSERhBU.js} +8 -8
  26. package/chunks/{isEqual-D8Ay63xR.js → isEqual-4f8yUUtC.js} +1 -1
  27. package/chunks/{isFocusVisible-Bu8gGZu5.js → isFocusVisible-Czm70MGc.js} +9 -9
  28. package/chunks/line.compiler-B-4H55_T.js +203 -0
  29. package/chunks/linear-Bq_r9l5S.js +264 -0
  30. package/chunks/{logger-DdZpR7xZ.js → logger-Cioob-QV.js} +74 -73
  31. package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
  32. package/chunks/{map.compiler-Q_Y1Pvat.js → map.compiler-Cv5V6EhF.js} +40 -40
  33. package/chunks/measure-axis-label-format-COy8U_dd.js +27 -0
  34. package/chunks/measure-format-default-B_kuGSzi.js +26 -0
  35. package/chunks/{metadata-BQm_TXI1.js → metadata-dGSe5UWy.js} +5 -5
  36. package/chunks/number.compiler-D7nMcEMv.js +57 -0
  37. package/chunks/{operations-DKQWuLL7.js → operations-CgfehCad.js} +11397 -11114
  38. package/chunks/{range-BdhzvYQ_.js → range-Dmwp9kVB.js} +2 -2
  39. package/chunks/{react-dom-BGP4tbXV.js → react-dom-CfuL-m78.js} +82 -82
  40. package/chunks/{render-wrappers-BZpyDnJy.js → render-wrappers--g-zPFBW.js} +1 -1
  41. package/chunks/{requirements-e8Fe96ag.js → requirements-DHayNJ2C.js} +245 -221
  42. package/chunks/{shared-C_2F90xq.js → shared-DoEN9nNM.js} +505 -494
  43. package/chunks/standalone-B3hRGgYi.js +773 -0
  44. package/chunks/{standalone-BkbiH-o8.js → standalone-BPNXgFft.js} +498 -759
  45. package/chunks/standalone-BPTT8XEu.js +424 -0
  46. package/chunks/standalone-BgAeHROc.js +2 -0
  47. package/chunks/{standalone-BE_ONgiG.js → standalone-BkQxag7M.js} +102 -102
  48. package/chunks/{standalone-Cc98Pdr6.js → standalone-Bxa3x6dg.js} +872 -872
  49. package/chunks/standalone-C0If-V6O.js +773 -0
  50. package/chunks/standalone-C1TOyflX.js +287 -0
  51. package/chunks/{standalone-CY_kjarf.js → standalone-CE5PwJN0.js} +18 -18
  52. package/chunks/{standalone-B8ZSqauS.js → standalone-CG7IFN6n.js} +120 -120
  53. package/chunks/{standalone-wOWRCpdn.js → standalone-CKlgGu80.js} +49 -49
  54. package/chunks/standalone-CNf-oA2U.js +355 -0
  55. package/chunks/{standalone-BDrXVxlP.js → standalone-CXPdWFlw.js} +14 -14
  56. package/chunks/{standalone-z0o52o5t.js → standalone-Cf0_5tbu.js} +5567 -5568
  57. package/chunks/{standalone-Cl0TSfqC.js → standalone-DMi4-Vp3.js} +122 -122
  58. package/chunks/{standalone-DNh9NcMa.js → standalone-DTEX67C8.js} +154 -154
  59. package/chunks/{standalone-DHRalbVO.js → standalone-DU46-kYv.js} +279 -279
  60. package/chunks/standalone-Dbn3jSH6.js +690 -0
  61. package/chunks/{standalone-CsoMmE9T.js → standalone-DdcAL_k_.js} +839 -843
  62. package/chunks/standalone-DwCIA0UG.js +1057 -0
  63. package/chunks/standalone-Dz13tl3P.js +357 -0
  64. package/chunks/standalone-H9GFzFk_.js +8377 -0
  65. package/chunks/{standalone-CaTxAydz.js → standalone-MduR0qre.js} +2227 -1000
  66. package/chunks/standalone-ejTz66P3.js +2 -0
  67. package/chunks/{standalone-DflyWtuR.js → standalone-keB-0wK3.js} +216 -216
  68. package/chunks/{standalone-BTY3w_JA.js → standalone-nnkuQd0K.js} +28 -28
  69. package/chunks/standalone-vGGR6Vcn.js +6 -0
  70. package/chunks/{table.compiler-COaHE9VD.js → table.compiler-mS4UvhLT.js} +31 -31
  71. package/chunks/theme-MYp6Rj1J.js +232 -0
  72. package/chunks/{useFieldName-CdnCWzhd.js → useFieldName-AdSak4Ch.js} +1 -1
  73. package/chunks/{utils-DganVptf.js → utils-CUKgR7it.js} +4216 -4070
  74. package/chunks/{view-Bzlros43.js → view-BeYwpcVD.js} +1561 -1561
  75. package/chunks/{visualization-filters-D7i6oh1Z.js → visualization-filters-B9qik5_K.js} +2683 -2342
  76. package/chunks/{with-html-element-CiIhFEa5.js → with-html-element-1GSeLT59.js} +3712 -3682
  77. package/definitions.js +2 -2
  78. package/docs/operations/astrato-app-filter-bar.md +1 -1
  79. package/docs/operations/bar.md +144 -32
  80. package/docs/operations/combo.md +79 -17
  81. package/docs/operations/date-picker.md +4 -4
  82. package/docs/operations/distribution-gauge.md +18 -16
  83. package/docs/operations/dot.md +107 -24
  84. package/docs/operations/filter.md +10 -8
  85. package/docs/operations/gauge.md +20 -18
  86. package/docs/operations/heatMap.md +73 -21
  87. package/docs/operations/histogram.md +45 -12
  88. package/docs/operations/iframe.md +1 -1
  89. package/docs/operations/image.md +1 -1
  90. package/docs/operations/index.md +12 -11
  91. package/docs/operations/line.md +86 -24
  92. package/docs/operations/map.md +5274 -0
  93. package/docs/operations/number.md +10 -9
  94. package/docs/operations/pie.md +23 -21
  95. package/docs/operations/radar.md +13 -11
  96. package/docs/operations/sankey.md +19 -17
  97. package/docs/operations/scatter.md +111 -28
  98. package/docs/operations/shape.md +5 -5
  99. package/docs/operations/simpleTextObject.md +4 -4
  100. package/docs/operations/slider.md +1 -1
  101. package/docs/operations/table.md +27 -25
  102. package/docs/operations/tree.md +5 -3
  103. package/docs/operations/treemap.md +70 -18
  104. package/docs/operations/waterfall.md +40 -7
  105. package/docs/operations/word-cloud.md +69 -17
  106. package/getters.js +3 -3
  107. package/index.js +585 -612
  108. package/metadata.js +2 -2
  109. package/operations.js +25 -18
  110. package/package.json +74 -70
  111. package/src/definitions/index.d.ts +1 -7
  112. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +3 -48
  113. package/src/definitions/model/definitions/schema-registry.d.ts +15 -14
  114. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +3 -3
  115. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
  116. package/src/definitions/model/definitions/schemas/common.schema.d.ts +19 -6
  117. package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
  118. package/src/definitions/model/definitions/schemas/line.schema.d.ts +4 -3
  119. package/src/definitions/model/definitions/schemas/number.schema.d.ts +1 -1
  120. package/src/definitions/model/definitions/schemas/table.schema.d.ts +14 -14
  121. package/src/index.d.ts +1 -1
  122. package/src/operations/index.d.ts +11 -1
  123. package/src/types.d.ts +166 -1
  124. package/src/visualization-catalog.d.ts +3 -0
  125. package/styles.css +1 -1
  126. package/chunks/FieldTypeIcon-DrMoGpHJ.js +0 -22
  127. package/chunks/color-rules-DYJL4fIW.js +0 -15
  128. package/chunks/color-settings-DJFoFTip.js +0 -5
  129. package/chunks/defaults-Dtk7fg3C.js +0 -3
  130. package/chunks/handlers-C6CZ0XJA.js +0 -15399
  131. package/chunks/line.compiler-DmHpmQCC.js +0 -198
  132. package/chunks/number.compiler-DQdg6zTy.js +0 -53
  133. package/chunks/standalone-4MsKiqs0.js +0 -355
  134. package/chunks/standalone-B794g9pE.js +0 -1012
  135. package/chunks/standalone-BA2YXyJS.js +0 -422
  136. package/chunks/standalone-BgumbdaJ2.js +0 -357
  137. package/chunks/standalone-Blh4qejk.js +0 -689
  138. package/chunks/standalone-CXY4FpF7.js +0 -773
  139. package/chunks/standalone-DH0xTEes.js +0 -2
  140. package/chunks/standalone-DcnHjNnC.js +0 -2
  141. package/chunks/standalone-DrHdGkY7.js +0 -762
  142. package/chunks/standalone-c_rROMtx.js +0 -287
  143. package/chunks/standalone-drcFLeN6.js +0 -6
@@ -1,16 +1,16 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Fa as t, Fc as n, Ia as r, Io as i, La as a, Qr as o, Ut as s, ms as c, ps as l, rc as u, sa as d, ti as f, za as p } from "./visualization-filters-D7i6oh1Z.js";
3
- import { Ut as m, W as h, ci as g, f as _, jt as v, sn as y, xn as b, zr as x } from "./utils-DganVptf.js";
4
- import { s as S } from "./coloring-BtnPiQ_o.js";
5
- import { n as C, r as w, t as T } from "./icon-picker-styles-BXiJ1SZS.js";
6
- var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
2
+ import { Js as t, Lc as n, Sa as r, di as i, do as a, hl as o, lo as s, mi as c, ms as l, po as u, qs as d, tn as f, uo as p } from "./visualization-filters-B9qik5_K.js";
3
+ import { G as m, Mt as h, Tn as g, Ur as _, dn as v, f as y, fi as b, qt as x } from "./utils-CUKgR7it.js";
4
+ import { c as S } from "./coloring-Cd6p0GQJ.js";
5
+ import { n as C, r as w, t as T } from "./icon-picker-styles-DuSERhBU.js";
6
+ var E = /* @__PURE__ */ e(b()), D = _(), O = (e) => {
7
7
  let t = C[e];
8
8
  return t ? String.fromCodePoint(parseInt(t, 16)) : null;
9
9
  }, k = ({ className: e, name: t, onClick: n, style: r, testId: i, displayNullIcon: a, displayNullTooltip: o, role: s }) => {
10
10
  let c = T(), l = O(t);
11
11
  return !l && a ? /* @__PURE__ */ (0, D.jsxs)("div", {
12
12
  role: s,
13
- className: y({
13
+ className: v({
14
14
  [c.nullIconWrapper]: !0,
15
15
  [e ?? ""]: !!e
16
16
  }),
@@ -29,7 +29,7 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
29
29
  })]
30
30
  }) : l ? /* @__PURE__ */ (0, D.jsx)("span", {
31
31
  role: s,
32
- className: y({
32
+ className: v({
33
33
  "material-icons": !0,
34
34
  [e ?? ""]: !!e
35
35
  }),
@@ -46,9 +46,9 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
46
46
  }
47
47
  }, j = (e, t) => {
48
48
  if (!t) return {};
49
- let n = s(t.target, 0) ?? 0, { belowTargetColorAndIcon: r, targetColorAndIcon: i, aboveTargetColorAndIcon: a } = t;
49
+ let n = f(t.target, 0) ?? 0, { belowTargetColorAndIcon: r, targetColorAndIcon: i, aboveTargetColorAndIcon: a } = t;
50
50
  return e < n * (1 - t.targetTolerance) ? r : e > n * (1 + t.targetTolerance) ? a : i;
51
- }, M = (e, t) => [...t].sort((e, t) => (s(t.rangeTo, 0) ?? 0) - (s(e.rangeTo, 0) ?? 0)).reduce((t, n) => e < (s(n.rangeTo, 0) ?? 0) ? n.colorAndIcon : t, {}), N = (e) => {
51
+ }, M = (e, t) => [...t].sort((e, t) => (f(t.rangeTo, 0) ?? 0) - (f(e.rangeTo, 0) ?? 0)).reduce((t, n) => e < (f(n.rangeTo, 0) ?? 0) ? n.colorAndIcon : t, {}), N = (e) => {
52
52
  let t = ["numberColor"], n = ["comparisonColor"];
53
53
  switch (e) {
54
54
  case "main": return t;
@@ -61,14 +61,14 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
61
61
  } : n, {}), F = {
62
62
  numberColor: "#1f1c3b",
63
63
  iconColor: "#1f1c3b",
64
- iconPosition: i.Left,
64
+ iconPosition: l.Left,
65
65
  comparisonColor: "#1f1c3b",
66
- comparisonPosition: i.Bottom
66
+ comparisonPosition: l.Bottom
67
67
  }, I = {
68
68
  numberValue: 0,
69
- textAlign: l.Center,
70
- horizontalAlign: l.Center,
71
- verticalAlign: c.Middle,
69
+ textAlign: d.Center,
70
+ horizontalAlign: d.Center,
71
+ verticalAlign: t.Middle,
72
72
  numberStyle: {
73
73
  fontSize: 12,
74
74
  fontFamily: "Roboto",
@@ -78,27 +78,27 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
78
78
  strikethrough: !1
79
79
  },
80
80
  comparisonStyle: {
81
- relativeFontSizePercentage: f.relativeFontSizePercentage,
81
+ relativeFontSizePercentage: c.relativeFontSizePercentage,
82
82
  fontFamily: "Roboto",
83
83
  bold: !1,
84
84
  italic: !1,
85
85
  underlined: !1,
86
86
  strikethrough: !1
87
87
  },
88
- comparisonGap: t.SmallGap,
88
+ comparisonGap: s.SmallGap,
89
89
  ...F
90
90
  }, L = (e, t, n) => {
91
91
  if (!n?.length || !e) return I;
92
- let r = t || d, i = r.fonts.general.fontFamily ?? void 0, { numberValue: a, numberFormat: s, comparisonNumberValue: c, comparisonFormat: l } = R(e, n);
92
+ let a = t || r, o = a.fonts.general.fontFamily ?? void 0, { numberValue: s, numberFormat: c, comparisonNumberValue: l, comparisonFormat: d } = R(e, n);
93
93
  return {
94
- ...B(e, r, H(n, e.measures.find((e) => o(e) && e.role === p.NUMBER_MEASURE), !0), z(e, n)),
95
- numberValue: a,
96
- numberFormat: s,
97
- comparisonNumberValue: c,
98
- comparisonFormat: l,
94
+ ...B(e, a, H(n, e.measures.find((e) => i(e) && e.role === u.NUMBER_MEASURE), !0), z(e, n)),
95
+ numberValue: s,
96
+ numberFormat: c,
97
+ comparisonNumberValue: l,
98
+ comparisonFormat: d,
99
99
  numberStyle: {
100
100
  fontSize: e.numberSettings?.numberStyle?.fontSize ?? I.numberStyle.fontSize,
101
- fontFamily: e.numberSettings?.numberStyle?.fontFamily ?? i,
101
+ fontFamily: e.numberSettings?.numberStyle?.fontFamily ?? o,
102
102
  bold: e.numberSettings?.numberStyle?.bold ?? I.numberStyle.bold,
103
103
  weight: e.numberSettings?.numberStyle?.weight ?? void 0,
104
104
  italic: e.numberSettings?.numberStyle?.italic ?? I.numberStyle.italic,
@@ -107,7 +107,7 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
107
107
  },
108
108
  comparisonStyle: {
109
109
  relativeFontSizePercentage: e.numberSettings?.comparisonStyle?.relativeFontSizePercentage ?? I.comparisonStyle.relativeFontSizePercentage,
110
- fontFamily: e.numberSettings?.comparisonStyle?.fontFamily ?? i,
110
+ fontFamily: e.numberSettings?.comparisonStyle?.fontFamily ?? o,
111
111
  bold: e.numberSettings?.comparisonStyle?.bold ?? I.comparisonStyle.bold,
112
112
  weight: e.numberSettings?.comparisonStyle?.weight ?? void 0,
113
113
  italic: e.numberSettings?.comparisonStyle?.italic ?? I.comparisonStyle.italic,
@@ -120,24 +120,24 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
120
120
  comparisonGap: e.numberSettings?.position?.comparisonGap ?? I.comparisonGap
121
121
  };
122
122
  }, R = (e, t) => {
123
- let n, r, i, a, s = e.measures.filter(o), c = s.filter((e) => e.role === p.NUMBER_MEASURE), l = s.filter((e) => e.role === p.NUMBER_COMPARISON), u = c[0], d = l[0];
124
- return n = H(t, u, !0), i = z(e, t), u?.formatter && typeof u?.formatter?.format != "string" && (r = u.formatter), d?.formatter && typeof d?.formatter?.format != "string" && (a = d.formatter), d && i !== void 0 && e.numberSettings?.data?.showOnlyComparison && (n = i, r = a, i = void 0, a = void 0), {
123
+ let n, r, a, o, s = e.measures.filter(i), c = s.filter((e) => e.role === u.NUMBER_MEASURE), l = s.filter((e) => e.role === u.NUMBER_COMPARISON), d = c[0], f = l[0];
124
+ return n = H(t, d, !0), a = z(e, t), d?.formatter && typeof d?.formatter?.format != "string" && (r = d.formatter), f?.formatter && typeof f?.formatter?.format != "string" && (o = f.formatter), f && a !== void 0 && e.numberSettings?.data?.showOnlyComparison && (n = a, r = o, a = void 0, o = void 0), {
125
125
  numberValue: n,
126
126
  numberFormat: r,
127
- comparisonNumberValue: i,
128
- comparisonFormat: a
127
+ comparisonNumberValue: a,
128
+ comparisonFormat: o
129
129
  };
130
130
  }, z = (e, t) => {
131
- let n = e.measures.filter(o), i = n.filter((e) => e.role === p.NUMBER_MEASURE), a = n.filter((e) => e.role === p.NUMBER_COMPARISON), s = i[0], c = a[0];
132
- if (!c) return;
133
- let l = H(t, s), u = H(t, c), d = e.numberSettings?.data?.comparisonType, f = d === r.PercentageToComparison || d === r.PercentageAboveBelow || d === r.Difference;
134
- if (u === null || f && l === null) return null;
135
- let m = Number(l), h = +u, g = Math.abs(h);
136
- return d === r.PercentageToComparison ? m === 0 && h === 0 ? 1 : m / g : d === r.PercentageAboveBelow ? m === 0 && h === 0 ? 0 : (m - h) / g : d === r.Difference ? m - h : h;
131
+ let n = e.measures.filter(i), r = n.filter((e) => e.role === u.NUMBER_MEASURE), a = n.filter((e) => e.role === u.NUMBER_COMPARISON), o = r[0], s = a[0];
132
+ if (!s) return;
133
+ let c = H(t, o), l = H(t, s), d = e.numberSettings?.data?.comparisonType, f = d === p.PercentageToComparison || d === p.PercentageAboveBelow || d === p.Difference;
134
+ if (l === null || f && c === null) return null;
135
+ let m = Number(c), h = +l, g = Math.abs(h);
136
+ return d === p.PercentageToComparison ? m === 0 && h === 0 ? 1 : m / g : d === p.PercentageAboveBelow ? m === 0 && h === 0 ? 0 : (m - h) / g : d === p.Difference ? m - h : h;
137
137
  }, B = (e, t, n, r) => {
138
- let i = e.measures.filter(o), s = i.filter((e) => e.role === p.NUMBER_MEASURE), c = i.filter((e) => e.role === p.NUMBER_COMPARISON), l = s[0], u = c[0];
138
+ let o = e.measures.filter(i), s = o.filter((e) => e.role === u.NUMBER_MEASURE), c = o.filter((e) => e.role === u.NUMBER_COMPARISON), l = s[0], d = c[0];
139
139
  return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !== a.None).reduce((e, t) => {
140
- let i = t.measureRule === "main" ? l : u, a = n === null ? null : Number(n), o = t.measureRule === "main" ? a : r;
140
+ let i = t.measureRule === "main" ? l : d, a = n === null ? null : Number(n), o = t.measureRule === "main" ? a : r;
141
141
  if (i && o != null) {
142
142
  let n = A(t, o), r = {
143
143
  ...e,
@@ -160,22 +160,22 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
160
160
  return {
161
161
  icon: n,
162
162
  iconColor: S(t, r ?? "black"),
163
- iconPosition: e?.numberSettings?.position?.iconPosition ?? i.Left,
163
+ iconPosition: e?.numberSettings?.position?.iconPosition ?? l.Left,
164
164
  numberColor: S(t, e?.numberSettings?.numberStyle?.fontColor ?? t.fonts.general.color),
165
165
  ...U(e, t, e.numberSettings?.comparisonStyle?.fontColor)
166
166
  };
167
- }, H = (e, t, r = !1) => {
168
- let i = n(t?.dataItem), a = (e?.[0])?.items?.[0], o = i === null ? void 0 : a?.[i];
169
- if (o == null || o === "") return null;
170
- let s = +`${o}`, c = r && (!t?.formatter || t?.formatter?.format === "string") ? `${o}` : 0;
167
+ }, H = (e, t, n = !1) => {
168
+ let r = o(t?.dataItem), i = (e?.[0])?.items?.[0], a = r === null ? void 0 : i?.[r];
169
+ if (a == null || a === "") return null;
170
+ let s = +`${a}`, c = n && (!t?.formatter || t?.formatter?.format === "string") ? `${a}` : 0;
171
171
  return isNaN(s) ? c : s;
172
- }, U = (e, t, n) => !e.measures.filter(o).filter((e) => e.role === p.NUMBER_COMPARISON)[0] || e.numberSettings?.data?.showOnlyComparison ? {
172
+ }, U = (e, t, n) => !e.measures.filter(i).filter((e) => e.role === u.NUMBER_COMPARISON)[0] || e.numberSettings?.data?.showOnlyComparison ? {
173
173
  comparisonPosition: void 0,
174
174
  comparisonColor: void 0
175
175
  } : {
176
176
  comparisonColor: S(t, n ?? t.fonts.general.color),
177
- comparisonPosition: e.numberSettings?.position?.comparisonPosition ?? i.Left
178
- }, W = h({
177
+ comparisonPosition: e.numberSettings?.position?.comparisonPosition ?? l.Left
178
+ }, W = m({
179
179
  mainContainer: {
180
180
  width: "100%",
181
181
  height: "100%",
@@ -195,15 +195,15 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
195
195
  }
196
196
  }), G = (e) => {
197
197
  switch (e) {
198
- case c.Top:
199
- case l.Left: return "flex-start";
200
- case c.Bottom:
201
- case l.Right: return "flex-end";
198
+ case t.Top:
199
+ case d.Left: return "flex-start";
200
+ case t.Bottom:
201
+ case d.Right: return "flex-end";
202
202
  default: return "center";
203
203
  }
204
204
  }, K = (e) => {
205
205
  let t = e.comparisonPosition ?? e.iconPosition;
206
- return t === i.Top || t === i.Bottom ? G(e.textAlign) : "center";
206
+ return t === l.Top || t === l.Bottom ? G(e.textAlign) : "center";
207
207
  }, q = (e, t, n, r = !1) => {
208
208
  let i, a, o = 0;
209
209
  r && Math.floor(e) !== e && (o = e.toString().split(".")[1].length || 0);
@@ -213,39 +213,39 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
213
213
  r && (d = Number(d.toFixed(o))), n(d), l < 500 ? i = requestAnimationFrame(s) : (n(e), cancelAnimationFrame(i));
214
214
  };
215
215
  return e !== t && (i = requestAnimationFrame(s)), () => cancelAnimationFrame(i);
216
- }, J = .5, Y = `${J}em`, ee = (e, n) => !(n === i.Left || n === i.Right) || !e || e === t.None ? {} : e === t.SmallGap ? { gap: Y } : {
216
+ }, J = .5, Y = `${J}em`, ee = (e, t) => !(t === l.Left || t === l.Right) || !e || e === s.None ? {} : e === s.SmallGap ? { gap: Y } : {
217
217
  width: "100%",
218
218
  justifyContent: e
219
- }, te = (e, t) => e ? t === i.Top || t === i.Bottom ? "0.33em" : "0.5em" : t === i.Top || t === i.Bottom ? "0.5em" : "1.0em", X = (e) => {
219
+ }, te = (e, t) => e ? t === l.Top || t === l.Bottom ? "0.33em" : "0.5em" : t === l.Top || t === l.Bottom ? "0.5em" : "1.0em", X = (e) => {
220
220
  switch (e) {
221
- case i.Top: return "column";
222
- case i.Bottom: return "column-reverse";
223
- case i.Right: return "row-reverse";
221
+ case l.Top: return "column";
222
+ case l.Bottom: return "column-reverse";
223
+ case l.Right: return "row-reverse";
224
224
  default: return "row";
225
225
  }
226
- }, Z = (e, t) => !e && !t ? "inherit" : `${e ? "underline" : ""} ${t ? "line-through" : ""}`, ne = ({ numberSize: e, comparisonNumberSize: n, numberProps: r, elementSize: a, fontSize: o }) => {
227
- let s = r.comparisonNumberValue != null && !!n && (r.comparisonPosition === i.Left || r.comparisonPosition === i.Right), c = !!r.icon && (r.iconPosition === i.Left || r.iconPosition === i.Right), l = s ? e.width + n.width : Math.max(e.width, n?.width ?? 0);
228
- return s && r.comparisonGap === t.SmallGap && (l += J * o), c && (l += e.height), l <= a.width;
226
+ }, Z = (e, t) => !e && !t ? "inherit" : `${e ? "underline" : ""} ${t ? "line-through" : ""}`, ne = ({ numberSize: e, comparisonNumberSize: t, numberProps: n, elementSize: r, fontSize: i }) => {
227
+ let a = n.comparisonNumberValue != null && !!t && (n.comparisonPosition === l.Left || n.comparisonPosition === l.Right), o = !!n.icon && (n.iconPosition === l.Left || n.iconPosition === l.Right), c = a ? e.width + t.width : Math.max(e.width, t?.width ?? 0);
228
+ return a && n.comparisonGap === s.SmallGap && (c += J * i), o && (c += e.height), c <= r.width;
229
229
  }, re = ({ numberSize: e, comparisonNumberSize: t, numberProps: n, elementSize: r }) => {
230
- let a = n.comparisonNumberValue != null && !!t && (n.comparisonPosition === i.Top || n.comparisonPosition === i.Bottom), o = !!n.icon && (n.iconPosition === i.Top || n.iconPosition === i.Bottom), s = a ? e.height + t.height : Math.max(e.height, t?.height ?? 0);
231
- return o && (s += e.height), s <= r.height;
230
+ let i = n.comparisonNumberValue != null && !!t && (n.comparisonPosition === l.Top || n.comparisonPosition === l.Bottom), a = !!n.icon && (n.iconPosition === l.Top || n.iconPosition === l.Bottom), o = i ? e.height + t.height : Math.max(e.height, t?.height ?? 0);
231
+ return a && (o += e.height), o <= r.height;
232
232
  }, Q = 1.2, ie = ({ number: e, comparisonNumber: t }, n, r) => {
233
233
  let { numberStyle: i, comparisonStyle: a } = n, o = i.fontSize ?? 14;
234
234
  if (!e || r.width === 0) return o;
235
- let s = b(), c = (a.relativeFontSizePercentage ?? f.relativeFontSizePercentage) / 100, l = 1;
236
- for (let u = o; u >= 1; --u) {
235
+ let s = g(), l = (a.relativeFontSizePercentage ?? c.relativeFontSizePercentage) / 100, u = 1;
236
+ for (let c = o; c >= 1; --c) {
237
237
  let o = {
238
238
  width: s.getTextSize({
239
- size: u,
239
+ size: c,
240
240
  label: e,
241
241
  fontFamily: i.fontFamily ?? "inherit",
242
242
  letterSpacing: "0.05em",
243
243
  fontWeight: 400
244
244
  }).width,
245
- height: u * Q
245
+ height: c * Q
246
246
  }, d;
247
247
  if (t) {
248
- let e = u * c;
248
+ let e = c * l;
249
249
  d = {
250
250
  width: s.getTextSize({
251
251
  size: e,
@@ -262,82 +262,82 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
262
262
  comparisonNumberSize: d,
263
263
  numberProps: n,
264
264
  elementSize: r,
265
- fontSize: u
265
+ fontSize: c
266
266
  }) && re({
267
267
  numberSize: o,
268
268
  comparisonNumberSize: d,
269
269
  numberProps: n,
270
270
  elementSize: r,
271
- fontSize: u
271
+ fontSize: c
272
272
  })) {
273
- l = u;
273
+ u = c;
274
274
  break;
275
275
  }
276
276
  }
277
- return s.cleanDOM(), l;
278
- }, $ = v((0, E.memo)(({ vSpec: e, vTheme: t, elementSize: n, data: r, vizProperties: a }) => {
279
- let [o, s] = (0, E.useState)(0), c = W(), l = _(), u = L(e, t, r ?? void 0), { numberValue: d, numberFormat: p, comparisonNumberValue: h, comparisonFormat: g, backgroundColor: v } = u, y = u.iconPosition ?? i.Left, b = o, x = d === null ? null : o, S = p && x !== null ? m(p, x) : x, C = g && h !== null ? m(g, h) : h, w = S === "" || S == null, T = w ? void 0 : `${S}`, O = C === "" || C == null ? void 0 : `${C}`, A = w || !n ? u.numberStyle.fontSize || 14 : ie({
277
+ return s.cleanDOM(), u;
278
+ }, $ = h((0, E.memo)(({ vSpec: e, vTheme: t, elementSize: n, data: r, vizProperties: i }) => {
279
+ let [a, o] = (0, E.useState)(0), s = W(), u = y(), d = L(e, t, r ?? void 0), { numberValue: f, numberFormat: p, comparisonNumberValue: m, comparisonFormat: h, backgroundColor: g } = d, _ = d.iconPosition ?? l.Left, v = a, b = f === null ? null : a, S = p && b !== null ? x(p, b) : b, C = h && m !== null ? x(h, m) : m, w = S === "" || S == null, T = w ? void 0 : `${S}`, O = C === "" || C == null ? void 0 : `${C}`, A = w || !n ? d.numberStyle.fontSize || 14 : ie({
280
280
  number: T,
281
281
  comparisonNumber: O
282
- }, u, n);
282
+ }, d, n);
283
283
  return (0, E.useEffect)(() => {
284
284
  let e;
285
- return !a?.disable?.animations && typeof d == "number" ? (typeof b != "number" && (s(0), b = 0), e = q(d, b, s, !p)) : s(d), () => {
285
+ return !i?.disable?.animations && typeof f == "number" ? (typeof v != "number" && (o(0), v = 0), e = q(f, v, o, !p)) : o(f), () => {
286
286
  e && e();
287
287
  };
288
- }, [d]), (0, E.useEffect)(() => {
289
- e && l();
288
+ }, [f]), (0, E.useEffect)(() => {
289
+ e && u();
290
290
  }, [e]), /* @__PURE__ */ (0, D.jsx)("div", {
291
- className: c.mainContainer,
291
+ className: s.mainContainer,
292
292
  style: {
293
293
  fontSize: `${A}px`,
294
- alignItems: G(u.verticalAlign),
295
- justifyContent: G(u.horizontalAlign),
296
- backgroundColor: v
294
+ alignItems: G(d.verticalAlign),
295
+ justifyContent: G(d.horizontalAlign),
296
+ backgroundColor: g
297
297
  },
298
298
  children: /* @__PURE__ */ (0, D.jsxs)("div", {
299
- className: c.numbersContainer,
299
+ className: s.numbersContainer,
300
300
  style: {
301
- alignItems: K(u),
302
- flexDirection: X(u.comparisonPosition ?? y),
303
- ...ee(u.comparisonGap, u.comparisonPosition)
301
+ alignItems: K(d),
302
+ flexDirection: X(d.comparisonPosition ?? _),
303
+ ...ee(d.comparisonGap, d.comparisonPosition)
304
304
  },
305
305
  children: [/* @__PURE__ */ (0, D.jsxs)("div", {
306
- className: c.comparisonIconContainer,
306
+ className: s.comparisonIconContainer,
307
307
  style: {
308
- alignItems: G(u.textAlign),
309
- flexDirection: X(y)
308
+ alignItems: G(d.textAlign),
309
+ flexDirection: X(_)
310
310
  },
311
311
  children: [/* @__PURE__ */ (0, D.jsx)(k, {
312
- name: u.icon ?? "",
312
+ name: d.icon ?? "",
313
313
  testId: "indicator-icon",
314
314
  style: {
315
- fontSize: te(u.comparisonPosition, y),
316
- color: u.iconColor ?? "inherit"
315
+ fontSize: te(d.comparisonPosition, _),
316
+ color: d.iconColor ?? "inherit"
317
317
  }
318
318
  }), /* @__PURE__ */ (0, D.jsx)("div", {
319
319
  "data-testid": "number-comparison",
320
320
  style: {
321
- fontSize: `${(u.comparisonStyle.relativeFontSizePercentage ?? f.relativeFontSizePercentage) / 100}em`,
322
- fontFamily: u.comparisonStyle.fontFamily,
323
- fontStyle: u.comparisonStyle.italic ? "italic" : "normal",
324
- fontWeight: u.comparisonStyle.weight || (u.comparisonStyle.bold ? "bold" : "normal"),
325
- textDecoration: Z(u.comparisonStyle.underlined ?? !1, u.comparisonStyle.strikethrough ?? !1),
326
- color: u.comparisonColor ?? "inherit"
321
+ fontSize: `${(d.comparisonStyle.relativeFontSizePercentage ?? c.relativeFontSizePercentage) / 100}em`,
322
+ fontFamily: d.comparisonStyle.fontFamily,
323
+ fontStyle: d.comparisonStyle.italic ? "italic" : "normal",
324
+ fontWeight: d.comparisonStyle.weight || (d.comparisonStyle.bold ? "bold" : "normal"),
325
+ textDecoration: Z(d.comparisonStyle.underlined ?? !1, d.comparisonStyle.strikethrough ?? !1),
326
+ color: d.comparisonColor ?? "inherit"
327
327
  },
328
328
  children: O
329
329
  })]
330
330
  }), /* @__PURE__ */ (0, D.jsx)("div", {
331
- className: c.number,
331
+ className: s.number,
332
332
  "data-testid": "number-base",
333
333
  style: {
334
- fontFamily: u.numberStyle.fontFamily,
335
- fontStyle: u.numberStyle.italic ? "italic" : "normal",
336
- fontWeight: u.numberStyle.weight || (u.numberStyle.bold ? "bold" : "normal"),
337
- textDecoration: Z(u.numberStyle.underlined ?? !1, u.numberStyle.strikethrough ?? !1),
338
- color: u.numberColor
334
+ fontFamily: d.numberStyle.fontFamily,
335
+ fontStyle: d.numberStyle.italic ? "italic" : "normal",
336
+ fontWeight: d.numberStyle.weight || (d.numberStyle.bold ? "bold" : "normal"),
337
+ textDecoration: Z(d.numberStyle.underlined ?? !1, d.numberStyle.strikethrough ?? !1),
338
+ color: d.numberColor
339
339
  },
340
- children: p && typeof x == "number" ? m(p, x) : x
340
+ children: p && typeof b == "number" ? x(p, b) : b
341
341
  })]
342
342
  })
343
343
  });
@@ -346,7 +346,7 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
346
346
  return t === null ? (0, E.createElement)($, {
347
347
  ...e,
348
348
  vSpec: null
349
- }) : u(t) ? (0, E.createElement)($, {
349
+ }) : n(t) ? (0, E.createElement)($, {
350
350
  ...e,
351
351
  vSpec: t
352
352
  }) : null;