@astrato-io/visualizations 0.10.0 → 0.11.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 (138) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +22 -4
  3. package/THIRD_PARTY_NOTICES.md +494 -0
  4. package/VISUALIZATION_DEFINITIONS.md +59 -145
  5. package/chunks/{Button-CCF851ea.js → Button-CPG4WX8X.js} +3 -3
  6. package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-PSLW8HmD.js} +12 -12
  7. package/chunks/FieldTypeIcon-5k2bkqd0.js +22 -0
  8. package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-KQ2EQlGL.js} +16 -16
  9. package/chunks/{MenuOption-CQpT79AP.js → MenuOption-B-6K7kks.js} +151 -151
  10. package/chunks/{Title-C-p4ZarD.js → Title-BmvwZYkh.js} +32 -32
  11. package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-CFmH6gUN.js} +11 -11
  12. package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-BY5-T16I.js} +8 -8
  13. package/chunks/{bar-layout-DStC-GNV.js → bar-layout-BNou0dZF.js} +2 -2
  14. package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-BkhO7sDd.js} +55 -53
  15. package/chunks/{builder-CScg1TOS.js → builder-CNjuqD2z.js} +107 -56
  16. package/chunks/category-axis-D1OVyMrr.js +20 -0
  17. package/chunks/{coloring-9jU3s_-p.js → coloring-BOiP0rmn.js} +54 -54
  18. package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter-BkgQ7MFE.js} +166 -166
  19. package/chunks/defaults-B5_8S-J-.js +3 -0
  20. package/chunks/{definitions-C4grxhye.js → definitions-AS9GcavE.js} +263 -242
  21. package/chunks/{escobar-CjirINHP.js → escobar-cQ1eQ64G.js} +8528 -8461
  22. package/chunks/{extend-preset-D-l9u_we.js → extend-preset-BlCbcXKR.js} +421 -421
  23. package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CI7dDNM1.js} +12 -12
  24. package/chunks/{filtering-C1zakrrX.js → filtering-Dwi7hDPZ.js} +263 -263
  25. package/chunks/handlers-C63NVo7i.js +15433 -0
  26. package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-CBlxEu3s.js} +8 -8
  27. package/chunks/{isEqual-Ch9OEye3.js → isEqual-BdHo6wqq.js} +1 -1
  28. package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-C1nlVUwL.js} +9 -9
  29. package/chunks/line.compiler-DCv3h42f.js +198 -0
  30. package/chunks/linear-Bq_r9l5S.js +264 -0
  31. package/chunks/{logger-CKRjhSHQ.js → logger-Bc-DqDM_.js} +72 -72
  32. package/chunks/{lookup-BWllin0q.js → lookup-B3tWH2hX.js} +1 -0
  33. package/chunks/{map.compiler-CKzorLgK.js → map.compiler-CRO6XpdI.js} +43 -45
  34. package/chunks/measure-format-default-B6ghxih7.js +22 -0
  35. package/chunks/{metadata-Bb9pTXrq.js → metadata-CtkvZEhS.js} +1 -1
  36. package/chunks/number.compiler-kV4lobCZ.js +57 -0
  37. package/chunks/{operations-DZoY50VX.js → operations-COl9wgqi.js} +9893 -9831
  38. package/chunks/{range-D1BTmFMp.js → range-CMJ5yc5Z.js} +2 -2
  39. package/chunks/{react-dom-Dgv2azN2.js → react-dom-BjsCbYHq.js} +76 -76
  40. package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-DFHi3Wkr.js} +1 -1
  41. package/chunks/{requirements-NHNrR8Ie.js → requirements-C5YLmHKe.js} +251 -227
  42. package/chunks/{shared-UitWpq1J.js → shared-DyqxOie0.js} +290 -278
  43. package/chunks/standalone-06i1wmIX.js +6 -0
  44. package/chunks/{standalone-DtBk_iUz.js → standalone-9jrQ3zJT.js} +10 -10
  45. package/chunks/standalone-B6zUvxNQ.js +357 -0
  46. package/chunks/{standalone-Bnnr87pc.js → standalone-BYK2U0Vd.js} +418 -679
  47. package/chunks/standalone-Be5APcVv.js +762 -0
  48. package/chunks/standalone-Bp4G3MDx.js +396 -0
  49. package/chunks/{standalone-CbPk8bKn.js → standalone-BrjtMIdd.js} +132 -132
  50. package/chunks/{standalone-BOzHA_d4.js → standalone-Bsfz5vnJ.js} +57 -57
  51. package/chunks/standalone-BuXpKMnc.js +2 -0
  52. package/chunks/standalone-CIjNYyya.js +8378 -0
  53. package/chunks/{standalone-B0U6c3su.js → standalone-CS5VGoja.js} +358 -358
  54. package/chunks/standalone-CUGt2FUF.js +2 -0
  55. package/chunks/{standalone-BapqaniK.js → standalone-ChfEHb28.js} +2299 -1072
  56. package/chunks/standalone-CnF2OYLQ.js +355 -0
  57. package/chunks/standalone-CznEEiq3.js +422 -0
  58. package/chunks/{standalone-Ck63MZzj.js → standalone-D9k5SCd8.js} +165 -165
  59. package/chunks/{standalone-CRdDZYeM.js → standalone-DYVYccmY.js} +855 -855
  60. package/chunks/{standalone-CVknVdUC.js → standalone-DaNxWIKn.js} +27 -27
  61. package/chunks/{standalone-swGs70tD.js → standalone-Db_HNuWx.js} +50 -50
  62. package/chunks/standalone-DcuE8KBa.js +287 -0
  63. package/chunks/{standalone-U0WJwFlG.js → standalone-I5kRIsp8.js} +97 -97
  64. package/chunks/{standalone-BBu90BhK.js → standalone-K2OvRAQM.js} +125 -125
  65. package/chunks/{standalone-DCFY1MAV.js → standalone-c4CPN6ug.js} +4634 -4633
  66. package/chunks/{standalone-ByKKqT5L.js → standalone-iOnJhCvA.js} +302 -302
  67. package/chunks/standalone-pCrzBiTy.js +773 -0
  68. package/chunks/standalone-qrZaimgC.js +689 -0
  69. package/chunks/standalone-yqDJ8h3K.js +1012 -0
  70. package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-CMH_dtYs.js} +29 -29
  71. package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-BfxBzhhH.js} +1 -1
  72. package/chunks/{utils-3Igg6xmO.js → utils-BdJrEeIQ.js} +4037 -4015
  73. package/chunks/{view-DdMLZySj.js → view-Q-_XIrWE.js} +1615 -1615
  74. package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-BwS0xUqs.js} +1723 -1693
  75. package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-D_ooGNWI.js} +4006 -3994
  76. package/definitions.js +2 -2
  77. package/docs/operations/astrato-app-filter-bar.md +1 -1
  78. package/docs/operations/bar.md +30 -1
  79. package/docs/operations/combo.md +30 -1
  80. package/docs/operations/date-picker.md +1 -1
  81. package/docs/operations/distribution-gauge.md +1 -1
  82. package/docs/operations/dot.md +1 -1
  83. package/docs/operations/filter.md +1 -1
  84. package/docs/operations/gauge.md +1 -1
  85. package/docs/operations/heatMap.md +1 -1
  86. package/docs/operations/histogram.md +1 -1
  87. package/docs/operations/iframe.md +1 -1
  88. package/docs/operations/image.md +1 -1
  89. package/docs/operations/index.md +5 -4
  90. package/docs/operations/line.md +48 -1
  91. package/docs/operations/map.md +5274 -0
  92. package/docs/operations/number.md +1 -1
  93. package/docs/operations/pie.md +1 -1
  94. package/docs/operations/radar.md +1 -1
  95. package/docs/operations/sankey.md +1 -1
  96. package/docs/operations/scatter.md +1 -1
  97. package/docs/operations/shape.md +1 -1
  98. package/docs/operations/simpleTextObject.md +1 -1
  99. package/docs/operations/slider.md +1 -1
  100. package/docs/operations/table.md +1 -1
  101. package/docs/operations/tree.md +1 -1
  102. package/docs/operations/treemap.md +1 -1
  103. package/docs/operations/waterfall.md +1 -1
  104. package/docs/operations/word-cloud.md +1 -1
  105. package/getters.js +3 -3
  106. package/index.js +528 -504
  107. package/metadata.js +2 -2
  108. package/operations.js +6 -6
  109. package/package.json +73 -68
  110. package/src/definitions/index.d.ts +1 -1
  111. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +34 -53
  112. package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
  113. package/src/definitions/model/definitions/schemas/bar.schema.d.ts +1 -1
  114. package/src/definitions/model/definitions/schemas/broad-chart.schema.d.ts +2 -2
  115. package/src/definitions/model/definitions/schemas/common.schema.d.ts +14 -2
  116. package/src/definitions/model/definitions/schemas/index.d.ts +1 -1
  117. package/src/definitions/model/definitions/schemas/line.schema.d.ts +1 -1
  118. package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
  119. package/src/types.d.ts +28 -28
  120. package/src/visualization-catalog.d.ts +3 -0
  121. package/styles.css +1 -1
  122. package/chunks/FieldTypeIcon-D_MzsdfY.js +0 -22
  123. package/chunks/defaults-cyNhn37t.js +0 -3
  124. package/chunks/handlers-ZviIUC-j.js +0 -15387
  125. package/chunks/line.compiler-De5fiKuR.js +0 -198
  126. package/chunks/number.compiler-CaTmJkmi.js +0 -53
  127. package/chunks/standalone-BEekPuA12.js +0 -357
  128. package/chunks/standalone-BR2JuRIC.js +0 -422
  129. package/chunks/standalone-BwJqDj2Z.js +0 -396
  130. package/chunks/standalone-CRfDOO1x.js +0 -287
  131. package/chunks/standalone-DZDGX3aa.js +0 -518
  132. package/chunks/standalone-DhfgeJIk.js +0 -1012
  133. package/chunks/standalone-DibjA73M.js +0 -6
  134. package/chunks/standalone-DxBAyqAu.js +0 -772
  135. package/chunks/standalone-KMQPsNsq.js +0 -2
  136. package/chunks/standalone-MBLSvsrY.js +0 -2
  137. package/chunks/standalone-wgFAVnnm.js +0 -355
  138. package/chunks/standalone-xGV0dqPV.js +0 -689
@@ -1,9 +1,9 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Fa as t, Fo as n, Ia as r, Pa as i, Pc as a, Qr as o, Ra as s, Ut as c, fs as l, nc as u, oa as d, ps as f, ti as p } from "./visualization-filters-CzvFHE6M.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-3Igg6xmO.js";
4
- import { s as S } from "./coloring-9jU3s_-p.js";
5
- import { n as C, r as w, t as T } from "./icon-picker-styles-Bj80ZUBK.js";
6
- var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
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) => {
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 }) => {
@@ -40,15 +40,15 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
40
40
  }) : null;
41
41
  }, A = (e, t) => {
42
42
  switch (e.thresholdType) {
43
- case r.Range: return M(t, e.rangeThresholds ?? []);
44
- case r.Target: return j(t, e.targetThreshold);
45
- case r.None: return {};
43
+ case n.Range: return M(t, e.rangeThresholds ?? []);
44
+ case n.Target: return j(t, e.targetThreshold);
45
+ case n.None: return {};
46
46
  }
47
47
  }, j = (e, t) => {
48
48
  if (!t) return {};
49
- let n = c(t.target, 0) ?? 0, { belowTargetColorAndIcon: r, targetColorAndIcon: i, aboveTargetColorAndIcon: a } = t;
49
+ let n = u(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) => (c(t.rangeTo, 0) ?? 0) - (c(e.rangeTo, 0) ?? 0)).reduce((t, n) => e < (c(n.rangeTo, 0) ?? 0) ? n.colorAndIcon : t, {}), N = (e) => {
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) => {
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: n.Left,
64
+ iconPosition: i.Left,
65
65
  comparisonColor: "#1f1c3b",
66
- comparisonPosition: n.Bottom
66
+ comparisonPosition: i.Bottom
67
67
  }, I = {
68
68
  numberValue: 0,
69
- textAlign: l.Center,
70
- horizontalAlign: l.Center,
71
- verticalAlign: f.Middle,
69
+ textAlign: s.Center,
70
+ horizontalAlign: s.Center,
71
+ verticalAlign: p.Middle,
72
72
  numberStyle: {
73
73
  fontSize: 12,
74
74
  fontFamily: "Roboto",
@@ -78,22 +78,22 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
78
78
  strikethrough: !1
79
79
  },
80
80
  comparisonStyle: {
81
- relativeFontSizePercentage: p.relativeFontSizePercentage,
81
+ relativeFontSizePercentage: l.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: i.SmallGap,
88
+ comparisonGap: t.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: c, comparisonNumberValue: l, comparisonFormat: u } = R(e, n);
92
+ let r = t || c, i = r.fonts.general.fontFamily ?? void 0, { numberValue: a, numberFormat: s, comparisonNumberValue: l, comparisonFormat: u } = R(e, n);
93
93
  return {
94
- ...B(e, r, H(n, e.measures.find((e) => o(e) && e.role === s.NUMBER_MEASURE), !0), z(e, n)),
94
+ ...B(e, r, H(n, e.measures.find((e) => d(e) && e.role === o.NUMBER_MEASURE), !0), z(e, n)),
95
95
  numberValue: a,
96
- numberFormat: c,
96
+ numberFormat: s,
97
97
  comparisonNumberValue: l,
98
98
  comparisonFormat: u,
99
99
  numberStyle: {
@@ -120,25 +120,25 @@ 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, c = e.measures.filter(o), l = c.filter((e) => e.role === s.NUMBER_MEASURE), u = c.filter((e) => e.role === s.NUMBER_COMPARISON), d = l[0], f = u[0];
124
- return n = H(t, d, !0), i = z(e, t), d?.formatter && typeof d?.formatter?.format != "string" && (r = d.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, 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), {
125
125
  numberValue: n,
126
126
  numberFormat: r,
127
127
  comparisonNumberValue: i,
128
128
  comparisonFormat: a
129
129
  };
130
- }, z = (e, n) => {
131
- let r = e.measures.filter(o), i = r.filter((e) => e.role === s.NUMBER_MEASURE), a = r.filter((e) => e.role === s.NUMBER_COMPARISON), c = i[0], l = a[0];
132
- if (!l) return;
133
- let u = H(n, c), d = H(n, l), f = e.numberSettings?.data?.comparisonType, p = f === t.PercentageToComparison || f === t.PercentageAboveBelow || f === t.Difference;
134
- if (d === null || p && u === null) return null;
135
- let m = Number(u), h = +d, g = Math.abs(h);
136
- return f === t.PercentageToComparison ? m === 0 && h === 0 ? 1 : m / g : f === t.PercentageAboveBelow ? m === 0 && h === 0 ? 0 : (m - h) / g : f === t.Difference ? m - h : h;
137
- }, B = (e, t, n, i) => {
138
- let a = e.measures.filter(o), c = a.filter((e) => e.role === s.NUMBER_MEASURE), l = a.filter((e) => e.role === s.NUMBER_COMPARISON), u = c[0], d = l[0];
139
- return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !== r.None).reduce((e, t) => {
140
- let r = t.measureRule === "main" ? u : d, a = n === null ? null : Number(n), o = t.measureRule === "main" ? a : i;
141
- if (r && o != null) {
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) {
142
142
  let n = A(t, o), r = {
143
143
  ...e,
144
144
  ...P(n, "icon", ["icon"]),
@@ -156,25 +156,25 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
156
156
  return e;
157
157
  }, V(e, t));
158
158
  }, V = (e, t) => {
159
- let { icon: r, iconColor: i } = e.numberSettings?.colorAndIcon || {};
159
+ let { icon: n, iconColor: r } = e.numberSettings?.colorAndIcon || {};
160
160
  return {
161
- icon: r,
162
- iconColor: S(t, i ?? "black"),
163
- iconPosition: e?.numberSettings?.position?.iconPosition ?? n.Left,
161
+ icon: n,
162
+ iconColor: S(t, r ?? "black"),
163
+ iconPosition: e?.numberSettings?.position?.iconPosition ?? i.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 r = a(t?.dataItem), i = (e?.[0])?.items?.[0], o = r === null ? void 0 : i?.[r];
168
+ let i = r(t?.dataItem), a = (e?.[0])?.items?.[0], o = i === null ? void 0 : a?.[i];
169
169
  if (o == null || o === "") return null;
170
170
  let s = +`${o}`, c = n && (!t?.formatter || t?.formatter?.format === "string") ? `${o}` : 0;
171
171
  return isNaN(s) ? c : s;
172
- }, U = (e, t, r) => !e.measures.filter(o).filter((e) => e.role === s.NUMBER_COMPARISON)[0] || e.numberSettings?.data?.showOnlyComparison ? {
172
+ }, U = (e, t, n) => !e.measures.filter(d).filter((e) => e.role === o.NUMBER_COMPARISON)[0] || e.numberSettings?.data?.showOnlyComparison ? {
173
173
  comparisonPosition: void 0,
174
174
  comparisonColor: void 0
175
175
  } : {
176
- comparisonColor: S(t, r ?? t.fonts.general.color),
177
- comparisonPosition: e.numberSettings?.position?.comparisonPosition ?? n.Left
176
+ comparisonColor: S(t, n ?? t.fonts.general.color),
177
+ comparisonPosition: e.numberSettings?.position?.comparisonPosition ?? i.Left
178
178
  }, W = h({
179
179
  mainContainer: {
180
180
  width: "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 f.Top:
199
- case l.Left: return "flex-start";
200
- case f.Bottom:
201
- case l.Right: return "flex-end";
198
+ case p.Top:
199
+ case s.Left: return "flex-start";
200
+ case p.Bottom:
201
+ case s.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 === n.Top || t === n.Bottom ? G(e.textAlign) : "center";
206
+ return t === i.Top || t === i.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, t) => !(t === n.Left || t === n.Right) || !e || e === i.None ? {} : e === i.SmallGap ? { gap: Y } : {
216
+ }, J = .5, Y = `${J}em`, ee = (e, n) => !(n === i.Left || n === i.Right) || !e || e === t.None ? {} : e === t.SmallGap ? { gap: Y } : {
217
217
  width: "100%",
218
218
  justifyContent: e
219
- }, te = (e, t) => e ? t === n.Top || t === n.Bottom ? "0.33em" : "0.5em" : t === n.Top || t === n.Bottom ? "0.5em" : "1.0em", X = (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) => {
220
220
  switch (e) {
221
- case n.Top: return "column";
222
- case n.Bottom: return "column-reverse";
223
- case n.Right: return "row-reverse";
221
+ case i.Top: return "column";
222
+ case i.Bottom: return "column-reverse";
223
+ case i.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: t, numberProps: r, elementSize: a, fontSize: o }) => {
227
- let s = r.comparisonNumberValue != null && !!t && (r.comparisonPosition === n.Left || r.comparisonPosition === n.Right), c = !!r.icon && (r.iconPosition === n.Left || r.iconPosition === n.Right), l = s ? e.width + t.width : Math.max(e.width, t?.width ?? 0);
228
- return s && r.comparisonGap === i.SmallGap && (l += J * o), c && (l += e.height), l <= a.width;
229
- }, re = ({ numberSize: e, comparisonNumberSize: t, numberProps: r, elementSize: i }) => {
230
- let a = r.comparisonNumberValue != null && !!t && (r.comparisonPosition === n.Top || r.comparisonPosition === n.Bottom), o = !!r.icon && (r.iconPosition === n.Top || r.iconPosition === n.Bottom), s = a ? e.height + t.height : Math.max(e.height, t?.height ?? 0);
231
- return o && (s += e.height), s <= i.height;
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;
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;
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 ?? p.relativeFontSizePercentage) / 100, l = 1;
236
- for (let u = o; u >= 1; --u) {
235
+ let s = _(), c = (a.relativeFontSizePercentage ?? l.relativeFontSizePercentage) / 100, u = 1;
236
+ for (let l = o; l >= 1; --l) {
237
237
  let o = {
238
238
  width: s.getTextSize({
239
- size: u,
239
+ size: l,
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: l * Q
246
246
  }, d;
247
247
  if (t) {
248
- let e = u * c;
248
+ let e = l * c;
249
249
  d = {
250
250
  width: s.getTextSize({
251
251
  size: e,
@@ -262,68 +262,68 @@ 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: l
266
266
  }) && re({
267
267
  numberSize: o,
268
268
  comparisonNumberSize: d,
269
269
  numberProps: n,
270
270
  elementSize: r,
271
- fontSize: u
271
+ fontSize: l
272
272
  })) {
273
- l = u;
273
+ u = l;
274
274
  break;
275
275
  }
276
276
  }
277
- return s.cleanDOM(), l;
278
- }, $ = v((0, E.memo)(({ vSpec: e, vTheme: t, elementSize: r, data: i, vizProperties: a }) => {
279
- let [o, s] = (0, E.useState)(0), c = W(), l = _(), u = L(e, t, i ?? void 0), { numberValue: d, numberFormat: f, comparisonNumberValue: h, comparisonFormat: g, backgroundColor: v } = u, y = u.iconPosition ?? n.Left, b = o, x = d === null ? null : o, S = f && x !== null ? m(f, 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 || !r ? u.numberStyle.fontSize || 14 : ie({
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({
280
280
  number: T,
281
281
  comparisonNumber: O
282
- }, u, r);
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, !f)) : s(d), () => {
285
+ return !a?.disable?.animations && typeof f == "number" ? (typeof y != "number" && (s(0), y = 0), e = q(f, y, s, !p)) : s(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
291
  className: c.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
299
  className: c.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
306
  className: c.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 ?? p.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 ?? l.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
  })]
@@ -331,13 +331,13 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
331
331
  className: c.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: f && typeof x == "number" ? m(f, x) : x
340
+ children: p && typeof x == "number" ? v(p, x) : x
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
+ }) : f(t) ? (0, E.createElement)($, {
350
350
  ...e,
351
351
  vSpec: t
352
352
  }) : null;