@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
@@ -1,16 +1,16 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Ba as t, Ha as n, Hc as r, Uo as i, Va as a, Wa as o, bs as s, fa as c, oi as l, qt as u, ri as d, uc as f, xs as p } from "./visualization-filters-BwS0xUqs.js";
3
- import { Br as m, G as h, Mt as g, Sn as _, Wt as v, cn as y, f as b, li as x } from "./utils-BdJrEeIQ.js";
4
- import { c as S } from "./coloring-BOiP0rmn.js";
5
- import { n as C, r as w, t as T } from "./icon-picker-styles-CBlxEu3s.js";
6
- var E = /* @__PURE__ */ e(x()), D = m(), 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(x()), D = m(), 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
  }),
@@ -40,15 +40,15 @@ var E = /* @__PURE__ */ e(x()), D = m(), O = (e) => {
40
40
  }) : null;
41
41
  }, A = (e, t) => {
42
42
  switch (e.thresholdType) {
43
- case n.Range: return M(t, e.rangeThresholds ?? []);
44
- case n.Target: return j(t, e.targetThreshold);
45
- case n.None: return {};
43
+ case a.Range: return M(t, e.rangeThresholds ?? []);
44
+ case a.Target: return j(t, e.targetThreshold);
45
+ case a.None: return {};
46
46
  }
47
47
  }, j = (e, t) => {
48
48
  if (!t) return {};
49
- let n = u(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) => (u(t.rangeTo, 0) ?? 0) - (u(e.rangeTo, 0) ?? 0)).reduce((t, n) => e < (u(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(x()), D = m(), 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: s.Center,
70
- horizontalAlign: s.Center,
71
- verticalAlign: p.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(x()), D = m(), O = (e) => {
78
78
  strikethrough: !1
79
79
  },
80
80
  comparisonStyle: {
81
- relativeFontSizePercentage: l.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 || c, i = r.fonts.general.fontFamily ?? void 0, { numberValue: a, numberFormat: s, comparisonNumberValue: l, comparisonFormat: u } = 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) => d(e) && e.role === o.NUMBER_MEASURE), !0), z(e, n)),
95
- numberValue: a,
96
- numberFormat: s,
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
97
  comparisonNumberValue: l,
98
- comparisonFormat: u,
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(x()), D = m(), 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,25 +120,25 @@ var E = /* @__PURE__ */ e(x()), D = m(), 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(d), c = s.filter((e) => e.role === o.NUMBER_MEASURE), l = s.filter((e) => e.role === o.NUMBER_COMPARISON), u = c[0], f = l[0];
124
- return n = H(t, u, !0), i = z(e, t), u?.formatter && typeof u?.formatter?.format != "string" && (r = u.formatter), f?.formatter && typeof f?.formatter?.format != "string" && (a = f.formatter), f && 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(d), r = n.filter((e) => e.role === o.NUMBER_MEASURE), i = n.filter((e) => e.role === o.NUMBER_COMPARISON), s = r[0], c = i[0];
132
- if (!c) return;
133
- let l = H(t, s), u = H(t, c), f = e.numberSettings?.data?.comparisonType, p = f === a.PercentageToComparison || f === a.PercentageAboveBelow || f === a.Difference;
134
- if (u === null || p && l === null) return null;
135
- let m = Number(l), h = +u, g = Math.abs(h);
136
- return f === a.PercentageToComparison ? m === 0 && h === 0 ? 1 : m / g : f === a.PercentageAboveBelow ? m === 0 && h === 0 ? 0 : (m - h) / g : f === a.Difference ? m - h : h;
137
- }, B = (e, t, r, i) => {
138
- let a = e.measures.filter(d), s = a.filter((e) => e.role === o.NUMBER_MEASURE), c = a.filter((e) => e.role === o.NUMBER_COMPARISON), l = s[0], u = c[0];
139
- return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !== n.None).reduce((e, t) => {
140
- let n = t.measureRule === "main" ? l : u, a = r === null ? null : Number(r), o = t.measureRule === "main" ? a : i;
141
- if (n && o != null) {
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
+ }, B = (e, t, n, r) => {
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
+ return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !== a.None).reduce((e, t) => {
140
+ let i = t.measureRule === "main" ? l : d, a = n === null ? null : Number(n), o = t.measureRule === "main" ? a : r;
141
+ if (i && o != null) {
142
142
  let n = A(t, o), r = {
143
143
  ...e,
144
144
  ...P(n, "icon", ["icon"]),
@@ -160,22 +160,22 @@ var E = /* @__PURE__ */ e(x()), D = m(), 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
167
  }, H = (e, t, n = !1) => {
168
- let i = r(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 = n && (!t?.formatter || t?.formatter?.format === "string") ? `${o}` : 0;
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(d).filter((e) => e.role === o.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(x()), D = m(), O = (e) => {
195
195
  }
196
196
  }), G = (e) => {
197
197
  switch (e) {
198
- case p.Top:
199
- case s.Left: return "flex-start";
200
- case p.Bottom:
201
- case s.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(x()), D = m(), 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 = _(), c = (a.relativeFontSizePercentage ?? l.relativeFontSizePercentage) / 100, u = 1;
236
- for (let l = o; l >= 1; --l) {
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: l,
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: l * Q
245
+ height: c * Q
246
246
  }, d;
247
247
  if (t) {
248
- let e = l * c;
248
+ let e = c * l;
249
249
  d = {
250
250
  width: s.getTextSize({
251
251
  size: e,
@@ -262,33 +262,33 @@ var E = /* @__PURE__ */ e(x()), D = m(), O = (e) => {
262
262
  comparisonNumberSize: d,
263
263
  numberProps: n,
264
264
  elementSize: r,
265
- fontSize: l
265
+ fontSize: c
266
266
  }) && re({
267
267
  numberSize: o,
268
268
  comparisonNumberSize: d,
269
269
  numberProps: n,
270
270
  elementSize: r,
271
- fontSize: l
271
+ fontSize: c
272
272
  })) {
273
- u = l;
273
+ u = c;
274
274
  break;
275
275
  }
276
276
  }
277
277
  return s.cleanDOM(), u;
278
- }, $ = g((0, E.memo)(({ vSpec: e, vTheme: t, elementSize: n, data: r, vizProperties: a }) => {
279
- let [o, s] = (0, E.useState)(0), c = W(), u = b(), d = L(e, t, r ?? void 0), { numberValue: f, numberFormat: p, comparisonNumberValue: m, comparisonFormat: h, backgroundColor: g } = d, _ = d.iconPosition ?? i.Left, y = o, x = f === null ? null : o, S = p && x !== null ? v(p, x) : x, C = h && m !== null ? v(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({
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
282
  }, d, n);
283
283
  return (0, E.useEffect)(() => {
284
284
  let e;
285
- return !a?.disable?.animations && typeof f == "number" ? (typeof y != "number" && (s(0), y = 0), e = q(f, y, s, !p)) : s(f), () => {
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
288
  }, [f]), (0, E.useEffect)(() => {
289
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
294
  alignItems: G(d.verticalAlign),
@@ -296,14 +296,14 @@ var E = /* @__PURE__ */ e(x()), D = m(), O = (e) => {
296
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
301
  alignItems: K(d),
302
302
  flexDirection: X(d.comparisonPosition ?? _),
303
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
308
  alignItems: G(d.textAlign),
309
309
  flexDirection: X(_)
@@ -318,7 +318,7 @@ var E = /* @__PURE__ */ e(x()), D = m(), O = (e) => {
318
318
  }), /* @__PURE__ */ (0, D.jsx)("div", {
319
319
  "data-testid": "number-comparison",
320
320
  style: {
321
- fontSize: `${(d.comparisonStyle.relativeFontSizePercentage ?? l.relativeFontSizePercentage) / 100}em`,
321
+ fontSize: `${(d.comparisonStyle.relativeFontSizePercentage ?? c.relativeFontSizePercentage) / 100}em`,
322
322
  fontFamily: d.comparisonStyle.fontFamily,
323
323
  fontStyle: d.comparisonStyle.italic ? "italic" : "normal",
324
324
  fontWeight: d.comparisonStyle.weight || (d.comparisonStyle.bold ? "bold" : "normal"),
@@ -328,7 +328,7 @@ var E = /* @__PURE__ */ e(x()), D = m(), O = (e) => {
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
334
  fontFamily: d.numberStyle.fontFamily,
@@ -337,7 +337,7 @@ var E = /* @__PURE__ */ e(x()), D = m(), O = (e) => {
337
337
  textDecoration: Z(d.numberStyle.underlined ?? !1, d.numberStyle.strikethrough ?? !1),
338
338
  color: d.numberColor
339
339
  },
340
- children: p && typeof x == "number" ? v(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(x()), D = m(), O = (e) => {
346
346
  return t === null ? (0, E.createElement)($, {
347
347
  ...e,
348
348
  vSpec: null
349
- }) : f(t) ? (0, E.createElement)($, {
349
+ }) : n(t) ? (0, E.createElement)($, {
350
350
  ...e,
351
351
  vSpec: t
352
352
  }) : null;