@astrato-io/visualizations 0.10.0 → 0.10.1

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 (114) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -3
  3. package/VISUALIZATION_DEFINITIONS.md +65 -12
  4. package/chunks/{Button-CCF851ea.js → Button-Dn3rJrYf.js} +2 -2
  5. package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-BFeu06Yb.js} +4 -4
  6. package/chunks/{FieldTypeIcon-D_MzsdfY.js → FieldTypeIcon-DrMoGpHJ.js} +2 -2
  7. package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-ClO6GUjN.js} +2 -2
  8. package/chunks/{MenuOption-CQpT79AP.js → MenuOption-Czc34u4q.js} +7 -7
  9. package/chunks/{Title-C-p4ZarD.js → Title-BgYnaVTR.js} +3 -3
  10. package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-BMu9uRax.js} +8 -8
  11. package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-CVir0wkl.js} +3 -3
  12. package/chunks/{bar-layout-DStC-GNV.js → bar-layout-C_UgRlVl.js} +2 -2
  13. package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-DYuFdi9J.js} +8 -8
  14. package/chunks/{builder-CScg1TOS.js → builder-C-TKA-My.js} +11 -11
  15. package/chunks/{coloring-9jU3s_-p.js → coloring-BtnPiQ_o.js} +16 -16
  16. package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter--zrZxRV9.js} +1 -1
  17. package/chunks/defaults-Dtk7fg3C.js +3 -0
  18. package/chunks/{definitions-C4grxhye.js → definitions-CT304NDn.js} +77 -51
  19. package/chunks/{escobar-CjirINHP.js → escobar-CvEV2ES1.js} +6126 -6059
  20. package/chunks/{extend-preset-D-l9u_we.js → extend-preset-D9-JP92b.js} +396 -396
  21. package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CXeZznks.js} +7 -7
  22. package/chunks/{filtering-C1zakrrX.js → filtering-8_bFv-jb.js} +84 -84
  23. package/chunks/{handlers-ZviIUC-j.js → handlers-C6CZ0XJA.js} +5620 -5608
  24. package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-BXiJ1SZS.js} +2 -2
  25. package/chunks/{isEqual-Ch9OEye3.js → isEqual-D8Ay63xR.js} +1 -1
  26. package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-Bu8gGZu5.js} +1 -1
  27. package/chunks/{line.compiler-De5fiKuR.js → line.compiler-DmHpmQCC.js} +4 -4
  28. package/chunks/{logger-CKRjhSHQ.js → logger-DdZpR7xZ.js} +65 -65
  29. package/chunks/{map.compiler-CKzorLgK.js → map.compiler-Q_Y1Pvat.js} +12 -14
  30. package/chunks/{metadata-Bb9pTXrq.js → metadata-BQm_TXI1.js} +1 -1
  31. package/chunks/{number.compiler-CaTmJkmi.js → number.compiler-DQdg6zTy.js} +4 -4
  32. package/chunks/{operations-DZoY50VX.js → operations-DKQWuLL7.js} +9469 -9451
  33. package/chunks/{range-D1BTmFMp.js → range-BdhzvYQ_.js} +2 -2
  34. package/chunks/{react-dom-Dgv2azN2.js → react-dom-BGP4tbXV.js} +1 -1
  35. package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-BZpyDnJy.js} +1 -1
  36. package/chunks/{requirements-NHNrR8Ie.js → requirements-e8Fe96ag.js} +29 -29
  37. package/chunks/{shared-UitWpq1J.js → shared-C_2F90xq.js} +478 -472
  38. package/chunks/{standalone-wgFAVnnm.js → standalone-4MsKiqs0.js} +130 -130
  39. package/chunks/standalone-B794g9pE.js +1012 -0
  40. package/chunks/{standalone-BBu90BhK.js → standalone-B8ZSqauS.js} +59 -59
  41. package/chunks/standalone-BA2YXyJS.js +422 -0
  42. package/chunks/{standalone-DtBk_iUz.js → standalone-BDrXVxlP.js} +4 -4
  43. package/chunks/{standalone-U0WJwFlG.js → standalone-BE_ONgiG.js} +64 -64
  44. package/chunks/{standalone-BOzHA_d4.js → standalone-BTY3w_JA.js} +24 -24
  45. package/chunks/{standalone-BEekPuA12.js → standalone-BgumbdaJ2.js} +101 -101
  46. package/chunks/{standalone-Bnnr87pc.js → standalone-BkbiH-o8.js} +174 -174
  47. package/chunks/{standalone-xGV0dqPV.js → standalone-Blh4qejk.js} +197 -197
  48. package/chunks/{standalone-DxBAyqAu.js → standalone-CXY4FpF7.js} +278 -277
  49. package/chunks/{standalone-CVknVdUC.js → standalone-CY_kjarf.js} +18 -18
  50. package/chunks/{standalone-BapqaniK.js → standalone-CaTxAydz.js} +54 -54
  51. package/chunks/{standalone-CRdDZYeM.js → standalone-Cc98Pdr6.js} +829 -829
  52. package/chunks/standalone-Cl0TSfqC.js +396 -0
  53. package/chunks/{standalone-B0U6c3su.js → standalone-CsoMmE9T.js} +80 -80
  54. package/chunks/standalone-DH0xTEes.js +2 -0
  55. package/chunks/{standalone-ByKKqT5L.js → standalone-DHRalbVO.js} +268 -268
  56. package/chunks/{standalone-CbPk8bKn.js → standalone-DNh9NcMa.js} +109 -109
  57. package/chunks/standalone-DcnHjNnC.js +2 -0
  58. package/chunks/{standalone-Ck63MZzj.js → standalone-DflyWtuR.js} +107 -107
  59. package/chunks/standalone-DrHdGkY7.js +762 -0
  60. package/chunks/standalone-c_rROMtx.js +287 -0
  61. package/chunks/{standalone-DibjA73M.js → standalone-drcFLeN6.js} +2 -2
  62. package/chunks/{standalone-swGs70tD.js → standalone-wOWRCpdn.js} +26 -26
  63. package/chunks/{standalone-DCFY1MAV.js → standalone-z0o52o5t.js} +4191 -4191
  64. package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-COaHE9VD.js} +18 -18
  65. package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-CdnCWzhd.js} +1 -1
  66. package/chunks/{utils-3Igg6xmO.js → utils-DganVptf.js} +491 -483
  67. package/chunks/{view-DdMLZySj.js → view-Bzlros43.js} +158 -158
  68. package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-D7i6oh1Z.js} +23 -12
  69. package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-CiIhFEa5.js} +2497 -2497
  70. package/definitions.js +2 -2
  71. package/docs/operations/astrato-app-filter-bar.md +1 -1
  72. package/docs/operations/bar.md +1 -1
  73. package/docs/operations/combo.md +1 -1
  74. package/docs/operations/date-picker.md +1 -1
  75. package/docs/operations/distribution-gauge.md +1 -1
  76. package/docs/operations/dot.md +1 -1
  77. package/docs/operations/filter.md +1 -1
  78. package/docs/operations/gauge.md +1 -1
  79. package/docs/operations/heatMap.md +1 -1
  80. package/docs/operations/histogram.md +1 -1
  81. package/docs/operations/iframe.md +1 -1
  82. package/docs/operations/image.md +1 -1
  83. package/docs/operations/index.md +2 -2
  84. package/docs/operations/line.md +19 -1
  85. package/docs/operations/number.md +1 -1
  86. package/docs/operations/pie.md +1 -1
  87. package/docs/operations/radar.md +1 -1
  88. package/docs/operations/sankey.md +1 -1
  89. package/docs/operations/scatter.md +1 -1
  90. package/docs/operations/shape.md +1 -1
  91. package/docs/operations/simpleTextObject.md +1 -1
  92. package/docs/operations/slider.md +1 -1
  93. package/docs/operations/table.md +1 -1
  94. package/docs/operations/tree.md +1 -1
  95. package/docs/operations/treemap.md +1 -1
  96. package/docs/operations/waterfall.md +1 -1
  97. package/docs/operations/word-cloud.md +1 -1
  98. package/getters.js +2 -2
  99. package/index.js +54 -54
  100. package/metadata.js +2 -2
  101. package/operations.js +5 -5
  102. package/package.json +67 -67
  103. package/src/definitions/index.d.ts +7 -1
  104. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +31 -5
  105. package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
  106. package/src/types.d.ts +28 -28
  107. package/chunks/defaults-cyNhn37t.js +0 -3
  108. package/chunks/standalone-BR2JuRIC.js +0 -422
  109. package/chunks/standalone-BwJqDj2Z.js +0 -396
  110. package/chunks/standalone-CRfDOO1x.js +0 -287
  111. package/chunks/standalone-DZDGX3aa.js +0 -518
  112. package/chunks/standalone-DhfgeJIk.js +0 -1012
  113. package/chunks/standalone-KMQPsNsq.js +0 -2
  114. package/chunks/standalone-MBLSvsrY.js +0 -2
@@ -1,8 +1,8 @@
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";
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
6
  var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
7
7
  let t = C[e];
8
8
  return t ? String.fromCodePoint(parseInt(t, 16)) : null;
@@ -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 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 = c(t.target, 0) ?? 0, { belowTargetColorAndIcon: r, targetColorAndIcon: i, aboveTargetColorAndIcon: a } = t;
49
+ let n = s(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) => (s(t.rangeTo, 0) ?? 0) - (s(e.rangeTo, 0) ?? 0)).reduce((t, n) => e < (s(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
69
  textAlign: l.Center,
70
70
  horizontalAlign: l.Center,
71
- verticalAlign: f.Middle,
71
+ verticalAlign: c.Middle,
72
72
  numberStyle: {
73
73
  fontSize: 12,
74
74
  fontFamily: "Roboto",
@@ -78,24 +78,24 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
78
78
  strikethrough: !1
79
79
  },
80
80
  comparisonStyle: {
81
- relativeFontSizePercentage: p.relativeFontSizePercentage,
81
+ relativeFontSizePercentage: f.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 || d, i = r.fonts.general.fontFamily ?? void 0, { numberValue: a, numberFormat: s, comparisonNumberValue: c, comparisonFormat: l } = 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) => o(e) && e.role === p.NUMBER_MEASURE), !0), z(e, n)),
95
95
  numberValue: a,
96
- numberFormat: c,
97
- comparisonNumberValue: l,
98
- comparisonFormat: u,
96
+ numberFormat: s,
97
+ comparisonNumberValue: c,
98
+ comparisonFormat: l,
99
99
  numberStyle: {
100
100
  fontSize: e.numberSettings?.numberStyle?.fontSize ?? I.numberStyle.fontSize,
101
101
  fontFamily: e.numberSettings?.numberStyle?.fontFamily ?? i,
@@ -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(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), {
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(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;
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];
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;
141
+ if (i && 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
- }, H = (e, t, n = !1) => {
168
- let r = a(t?.dataItem), i = (e?.[0])?.items?.[0], o = r === null ? void 0 : i?.[r];
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
169
  if (o == null || o === "") return null;
170
- let s = +`${o}`, c = n && (!t?.formatter || t?.formatter?.format === "string") ? `${o}` : 0;
170
+ let s = +`${o}`, c = r && (!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(o).filter((e) => e.role === p.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:
198
+ case c.Top:
199
199
  case l.Left: return "flex-start";
200
- case f.Bottom:
200
+ case c.Bottom:
201
201
  case l.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,26 +213,26 @@ 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;
235
+ let s = b(), c = (a.relativeFontSizePercentage ?? f.relativeFontSizePercentage) / 100, l = 1;
236
236
  for (let u = o; u >= 1; --u) {
237
237
  let o = {
238
238
  width: s.getTextSize({
@@ -275,14 +275,14 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
275
275
  }
276
276
  }
277
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({
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({
280
280
  number: T,
281
281
  comparisonNumber: O
282
- }, u, r);
282
+ }, u, 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 d == "number" ? (typeof b != "number" && (s(0), b = 0), e = q(d, b, s, !p)) : s(d), () => {
286
286
  e && e();
287
287
  };
288
288
  }, [d]), (0, E.useEffect)(() => {
@@ -318,7 +318,7 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
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`,
321
+ fontSize: `${(u.comparisonStyle.relativeFontSizePercentage ?? f.relativeFontSizePercentage) / 100}em`,
322
322
  fontFamily: u.comparisonStyle.fontFamily,
323
323
  fontStyle: u.comparisonStyle.italic ? "italic" : "normal",
324
324
  fontWeight: u.comparisonStyle.weight || (u.comparisonStyle.bold ? "bold" : "normal"),
@@ -337,7 +337,7 @@ var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
337
337
  textDecoration: Z(u.numberStyle.underlined ?? !1, u.numberStyle.strikethrough ?? !1),
338
338
  color: u.numberColor
339
339
  },
340
- children: f && typeof x == "number" ? m(f, x) : x
340
+ children: p && typeof x == "number" ? m(p, x) : x
341
341
  })]
342
342
  })
343
343
  });
@@ -1,10 +1,10 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { $o as t, cc as n, io as r, oa as i, ro as a } from "./visualization-filters-CzvFHE6M.js";
3
- import { U as o, W as s, ci as c, f as l, jt as u, zr as d } from "./utils-3Igg6xmO.js";
2
+ import { ao as t, es as n, io as r, lc as i, sa as a } from "./visualization-filters-D7i6oh1Z.js";
3
+ import { U as o, W as s, ci as c, f as l, jt as u, zr as d } from "./utils-DganVptf.js";
4
4
  import { t as f } from "./stroke-dash-UgMEcCS4.js";
5
- import { s as p } from "./coloring-9jU3s_-p.js";
6
- var m = /* @__PURE__ */ e(c()), h = (e) => e === r.Line || e === r.Elbow, g = {
7
- shape: r.Square,
5
+ import { s as p } from "./coloring-BtnPiQ_o.js";
6
+ var m = /* @__PURE__ */ e(c()), h = (e) => e === t.Line || e === t.Elbow, g = {
7
+ shape: t.Square,
8
8
  backgroundColor: { code: "#c4c4c4" },
9
9
  backgroundType: "color",
10
10
  lineThickness: 2,
@@ -13,18 +13,18 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === r.Line || e === r.Elbow, g = {
13
13
  borderRadiusY: 0,
14
14
  preserveAspectRatio: !0,
15
15
  strokeColor: { code: "#8d8d8d" },
16
- imageFit: a.Fill,
16
+ imageFit: r.Fill,
17
17
  strokeDash: void 0,
18
18
  imageURL: void 0,
19
19
  scale: 1,
20
20
  rotate: 0,
21
21
  heightBasedSize: !1
22
- }, _ = (e, n) => {
22
+ }, _ = (e, r) => {
23
23
  let i = { ...e?.shapeSettings }, a = 0, o = 0, s = i?.borderEnabled ?? g.borderEnabled;
24
- (i?.shape === r.Square || i?.shape === r.Rectangle) && i?.borderRadius && (a = i?.borderRadius, o = a, !i?.preserveAspectRatio && n && (n.width > n.height ? o = (n.width || 1) / (n.height || 1) * o : a = (n.height || 1) / (n.width || 1) * a)), h(i?.shape) && (i.backgroundColor = { code: "none" }, s = !0);
24
+ (i?.shape === t.Square || i?.shape === t.Rectangle) && i?.borderRadius && (a = i?.borderRadius, o = a, !i?.preserveAspectRatio && r && (r.width > r.height ? o = (r.width || 1) / (r.height || 1) * o : a = (r.height || 1) / (r.width || 1) * a)), h(i?.shape) && (i.backgroundColor = { code: "none" }, s = !0);
25
25
  let c = i?.rotate ?? g.rotate;
26
- i?.shape === r.Line && i?.heightBasedSize && (c += 90);
27
- let l = i?.borderStyle === t.Line ? void 0 : i?.strokeDash ?? g.strokeDash;
26
+ i?.shape === t.Line && i?.heightBasedSize && (c += 90);
27
+ let l = i?.borderStyle === n.Line ? void 0 : i?.strokeDash ?? g.strokeDash;
28
28
  return {
29
29
  backgroundType: i?.backgroundType ?? "color",
30
30
  shape: i?.shape ?? g.shape,
@@ -83,14 +83,14 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === r.Line || e === r.Elbow, g = {
83
83
  ...e
84
84
  }), E = (e) => {
85
85
  switch (e) {
86
- case r.Circle: return b;
87
- case r.Rectangle:
88
- case r.Square: return w;
89
- case r.Triangle: return T;
90
- case r.Hexagon: return S;
91
- case r.Line: return C;
92
- case r.Arrow: return y;
93
- case r.Elbow: return x;
86
+ case t.Circle: return b;
87
+ case t.Rectangle:
88
+ case t.Square: return w;
89
+ case t.Triangle: return T;
90
+ case t.Hexagon: return S;
91
+ case t.Line: return C;
92
+ case t.Arrow: return y;
93
+ case t.Elbow: return x;
94
94
  default: return w;
95
95
  }
96
96
  }, D = s({
@@ -111,25 +111,25 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === r.Line || e === r.Elbow, g = {
111
111
  height: "100%",
112
112
  transition: "ease-in-out 300ms"
113
113
  }
114
- }), O = ({ patternId: e, imgUrl: t, onLoadCallback: n, imageFit: r = a.Fill }) => /* @__PURE__ */ (0, v.jsx)("defs", { children: /* @__PURE__ */ (0, v.jsx)("pattern", {
114
+ }), O = ({ patternId: e, imgUrl: t, onLoadCallback: n, imageFit: i = r.Fill }) => /* @__PURE__ */ (0, v.jsx)("defs", { children: /* @__PURE__ */ (0, v.jsx)("pattern", {
115
115
  id: e,
116
116
  viewBox: "0 0 1 1",
117
117
  patternUnits: "objectBoundingBox",
118
118
  width: "100%",
119
119
  height: "100%",
120
- preserveAspectRatio: r,
120
+ preserveAspectRatio: i,
121
121
  children: /* @__PURE__ */ (0, v.jsx)("image", {
122
122
  xlinkHref: t,
123
123
  x: "0",
124
124
  y: "0",
125
125
  width: "1",
126
126
  height: "1",
127
- preserveAspectRatio: r,
127
+ preserveAspectRatio: i,
128
128
  onLoad: n,
129
129
  onError: n
130
130
  })
131
- }) }), k = u(({ vSpec: e, vTheme: t, elementSize: a }) => {
132
- let s = t || i, c = _(e && n(e) ? e : void 0, a), u = D(), d = l(), y = E(c.shape), b = `${o()}-background-image-fill`, x = `${o()}-insideStroke`, S = p(s, c.backgroundColor?.code), C = p(s, c.strokeColor?.code), w = f(c.strokeDash), T = c.lineThickness ?? g.lineThickness, k = c.shape === r.Line ? T / 2 : T;
131
+ }) }), k = u(({ vSpec: e, vTheme: n, elementSize: r }) => {
132
+ let s = n || a, c = _(e && i(e) ? e : void 0, r), u = D(), d = l(), y = E(c.shape), b = `${o()}-background-image-fill`, x = `${o()}-insideStroke`, S = p(s, c.backgroundColor?.code), C = p(s, c.strokeColor?.code), w = f(c.strokeDash), T = c.lineThickness ?? g.lineThickness, k = c.shape === t.Line ? T / 2 : T;
133
133
  return (0, m.useEffect)(() => {
134
134
  (!c.imageURL || c.backgroundType === "color") && d();
135
135
  }, []), /* @__PURE__ */ (0, v.jsx)("div", {
@@ -168,7 +168,7 @@ var m = /* @__PURE__ */ e(c()), h = (e) => e === r.Line || e === r.Elbow, g = {
168
168
  children: /* @__PURE__ */ (0, v.jsx)(y, {
169
169
  rx: `${c.borderRadiusX ?? 0}px`,
170
170
  ry: `${c.borderRadiusY ?? 0}px`,
171
- ...c.shape === r.Line ? { heightBasedSize: c.heightBasedSize } : {}
171
+ ...c.shape === t.Line ? { heightBasedSize: c.heightBasedSize } : {}
172
172
  })
173
173
  })
174
174
  })