@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.
- package/CHANGELOG.md +10 -0
- package/README.md +3 -3
- package/VISUALIZATION_DEFINITIONS.md +65 -12
- package/chunks/{Button-CCF851ea.js → Button-Dn3rJrYf.js} +2 -2
- package/chunks/{CircularProgress-yupH6YWs.js → CircularProgress-BFeu06Yb.js} +4 -4
- package/chunks/{FieldTypeIcon-D_MzsdfY.js → FieldTypeIcon-DrMoGpHJ.js} +2 -2
- package/chunks/{LinearProgress-CyFjN4px.js → LinearProgress-ClO6GUjN.js} +2 -2
- package/chunks/{MenuOption-CQpT79AP.js → MenuOption-Czc34u4q.js} +7 -7
- package/chunks/{Title-C-p4ZarD.js → Title-BgYnaVTR.js} +3 -3
- package/chunks/{_createAggregator-BF4qG9XK.js → _createAggregator-BMu9uRax.js} +8 -8
- package/chunks/{app-filter-bar.compiler-8fxCo2q7.js → app-filter-bar.compiler-CVir0wkl.js} +3 -3
- package/chunks/{bar-layout-DStC-GNV.js → bar-layout-C_UgRlVl.js} +2 -2
- package/chunks/{bar.compiler-CQAu8KL8.js → bar.compiler-DYuFdi9J.js} +8 -8
- package/chunks/{builder-CScg1TOS.js → builder-C-TKA-My.js} +11 -11
- package/chunks/{coloring-9jU3s_-p.js → coloring-BtnPiQ_o.js} +16 -16
- package/chunks/{createSimplePaletteValueFilter-C4hZpCdn.js → createSimplePaletteValueFilter--zrZxRV9.js} +1 -1
- package/chunks/defaults-Dtk7fg3C.js +3 -0
- package/chunks/{definitions-C4grxhye.js → definitions-CT304NDn.js} +77 -51
- package/chunks/{escobar-CjirINHP.js → escobar-CvEV2ES1.js} +6126 -6059
- package/chunks/{extend-preset-D-l9u_we.js → extend-preset-D9-JP92b.js} +396 -396
- package/chunks/{filter.compiler-lji2Acgn.js → filter.compiler-CXeZznks.js} +7 -7
- package/chunks/{filtering-C1zakrrX.js → filtering-8_bFv-jb.js} +84 -84
- package/chunks/{handlers-ZviIUC-j.js → handlers-C6CZ0XJA.js} +5620 -5608
- package/chunks/{icon-picker-styles-Bj80ZUBK.js → icon-picker-styles-BXiJ1SZS.js} +2 -2
- package/chunks/{isEqual-Ch9OEye3.js → isEqual-D8Ay63xR.js} +1 -1
- package/chunks/{isFocusVisible-CgMP0qkR.js → isFocusVisible-Bu8gGZu5.js} +1 -1
- package/chunks/{line.compiler-De5fiKuR.js → line.compiler-DmHpmQCC.js} +4 -4
- package/chunks/{logger-CKRjhSHQ.js → logger-DdZpR7xZ.js} +65 -65
- package/chunks/{map.compiler-CKzorLgK.js → map.compiler-Q_Y1Pvat.js} +12 -14
- package/chunks/{metadata-Bb9pTXrq.js → metadata-BQm_TXI1.js} +1 -1
- package/chunks/{number.compiler-CaTmJkmi.js → number.compiler-DQdg6zTy.js} +4 -4
- package/chunks/{operations-DZoY50VX.js → operations-DKQWuLL7.js} +9469 -9451
- package/chunks/{range-D1BTmFMp.js → range-BdhzvYQ_.js} +2 -2
- package/chunks/{react-dom-Dgv2azN2.js → react-dom-BGP4tbXV.js} +1 -1
- package/chunks/{render-wrappers-_P3xwu5A.js → render-wrappers-BZpyDnJy.js} +1 -1
- package/chunks/{requirements-NHNrR8Ie.js → requirements-e8Fe96ag.js} +29 -29
- package/chunks/{shared-UitWpq1J.js → shared-C_2F90xq.js} +478 -472
- package/chunks/{standalone-wgFAVnnm.js → standalone-4MsKiqs0.js} +130 -130
- package/chunks/standalone-B794g9pE.js +1012 -0
- package/chunks/{standalone-BBu90BhK.js → standalone-B8ZSqauS.js} +59 -59
- package/chunks/standalone-BA2YXyJS.js +422 -0
- package/chunks/{standalone-DtBk_iUz.js → standalone-BDrXVxlP.js} +4 -4
- package/chunks/{standalone-U0WJwFlG.js → standalone-BE_ONgiG.js} +64 -64
- package/chunks/{standalone-BOzHA_d4.js → standalone-BTY3w_JA.js} +24 -24
- package/chunks/{standalone-BEekPuA12.js → standalone-BgumbdaJ2.js} +101 -101
- package/chunks/{standalone-Bnnr87pc.js → standalone-BkbiH-o8.js} +174 -174
- package/chunks/{standalone-xGV0dqPV.js → standalone-Blh4qejk.js} +197 -197
- package/chunks/{standalone-DxBAyqAu.js → standalone-CXY4FpF7.js} +278 -277
- package/chunks/{standalone-CVknVdUC.js → standalone-CY_kjarf.js} +18 -18
- package/chunks/{standalone-BapqaniK.js → standalone-CaTxAydz.js} +54 -54
- package/chunks/{standalone-CRdDZYeM.js → standalone-Cc98Pdr6.js} +829 -829
- package/chunks/standalone-Cl0TSfqC.js +396 -0
- package/chunks/{standalone-B0U6c3su.js → standalone-CsoMmE9T.js} +80 -80
- package/chunks/standalone-DH0xTEes.js +2 -0
- package/chunks/{standalone-ByKKqT5L.js → standalone-DHRalbVO.js} +268 -268
- package/chunks/{standalone-CbPk8bKn.js → standalone-DNh9NcMa.js} +109 -109
- package/chunks/standalone-DcnHjNnC.js +2 -0
- package/chunks/{standalone-Ck63MZzj.js → standalone-DflyWtuR.js} +107 -107
- package/chunks/standalone-DrHdGkY7.js +762 -0
- package/chunks/standalone-c_rROMtx.js +287 -0
- package/chunks/{standalone-DibjA73M.js → standalone-drcFLeN6.js} +2 -2
- package/chunks/{standalone-swGs70tD.js → standalone-wOWRCpdn.js} +26 -26
- package/chunks/{standalone-DCFY1MAV.js → standalone-z0o52o5t.js} +4191 -4191
- package/chunks/{table.compiler-OWSx5MOq.js → table.compiler-COaHE9VD.js} +18 -18
- package/chunks/{useFieldName-B8iCYyw1.js → useFieldName-CdnCWzhd.js} +1 -1
- package/chunks/{utils-3Igg6xmO.js → utils-DganVptf.js} +491 -483
- package/chunks/{view-DdMLZySj.js → view-Bzlros43.js} +158 -158
- package/chunks/{visualization-filters-CzvFHE6M.js → visualization-filters-D7i6oh1Z.js} +23 -12
- package/chunks/{with-html-element-DOfkR3C1.js → with-html-element-CiIhFEa5.js} +2497 -2497
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +1 -1
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +1 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +1 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +2 -2
- package/docs/operations/line.md +19 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +1 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +1 -1
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +54 -54
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +67 -67
- package/src/definitions/index.d.ts +7 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +31 -5
- package/src/definitions/model/definitions/types/compilation.types.d.ts +4 -1
- package/src/types.d.ts +28 -28
- package/chunks/defaults-cyNhn37t.js +0 -3
- package/chunks/standalone-BR2JuRIC.js +0 -422
- package/chunks/standalone-BwJqDj2Z.js +0 -396
- package/chunks/standalone-CRfDOO1x.js +0 -287
- package/chunks/standalone-DZDGX3aa.js +0 -518
- package/chunks/standalone-DhfgeJIk.js +0 -1012
- package/chunks/standalone-KMQPsNsq.js +0 -2
- 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,
|
|
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-
|
|
4
|
-
import { s as S } from "./coloring-
|
|
5
|
-
import { n as C, r as w, t as T } from "./icon-picker-styles-
|
|
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
|
|
44
|
-
case
|
|
45
|
-
case
|
|
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 =
|
|
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) => (
|
|
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:
|
|
64
|
+
iconPosition: i.Left,
|
|
65
65
|
comparisonColor: "#1f1c3b",
|
|
66
|
-
comparisonPosition:
|
|
66
|
+
comparisonPosition: i.Bottom
|
|
67
67
|
}, I = {
|
|
68
68
|
numberValue: 0,
|
|
69
69
|
textAlign: l.Center,
|
|
70
70
|
horizontalAlign: l.Center,
|
|
71
|
-
verticalAlign:
|
|
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:
|
|
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:
|
|
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:
|
|
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 ===
|
|
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:
|
|
97
|
-
comparisonNumberValue:
|
|
98
|
-
comparisonFormat:
|
|
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,
|
|
124
|
-
return n = H(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), {
|
|
125
125
|
numberValue: n,
|
|
126
126
|
numberFormat: r,
|
|
127
127
|
comparisonNumberValue: i,
|
|
128
128
|
comparisonFormat: a
|
|
129
129
|
};
|
|
130
|
-
}, z = (e,
|
|
131
|
-
let
|
|
132
|
-
if (!
|
|
133
|
-
let
|
|
134
|
-
if (
|
|
135
|
-
let m = Number(
|
|
136
|
-
return
|
|
137
|
-
}, B = (e, t, n,
|
|
138
|
-
let
|
|
139
|
-
return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !==
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
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:
|
|
159
|
+
let { icon: n, iconColor: r } = e.numberSettings?.colorAndIcon || {};
|
|
160
160
|
return {
|
|
161
|
-
icon:
|
|
162
|
-
iconColor: S(t,
|
|
163
|
-
iconPosition: e?.numberSettings?.position?.iconPosition ??
|
|
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,
|
|
168
|
-
let
|
|
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 =
|
|
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,
|
|
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,
|
|
177
|
-
comparisonPosition: e.numberSettings?.position?.comparisonPosition ??
|
|
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
|
|
198
|
+
case c.Top:
|
|
199
199
|
case l.Left: return "flex-start";
|
|
200
|
-
case
|
|
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 ===
|
|
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,
|
|
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 ===
|
|
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
|
|
222
|
-
case
|
|
223
|
-
case
|
|
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:
|
|
227
|
-
let s = r.comparisonNumberValue != null && !!
|
|
228
|
-
return s && r.comparisonGap ===
|
|
229
|
-
}, re = ({ numberSize: e, comparisonNumberSize: t, numberProps:
|
|
230
|
-
let a =
|
|
231
|
-
return o && (s += e.height), s <=
|
|
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 ??
|
|
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:
|
|
279
|
-
let [o, s] = (0, E.useState)(0), c = W(), l = _(), u = L(e, t,
|
|
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,
|
|
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, !
|
|
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 ??
|
|
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:
|
|
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 {
|
|
3
|
-
import { U as o, W as s, ci as c, f as l, jt as u, zr as d } from "./utils-
|
|
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-
|
|
6
|
-
var m = /* @__PURE__ */ e(c()), h = (e) => e ===
|
|
7
|
-
shape:
|
|
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:
|
|
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,
|
|
22
|
+
}, _ = (e, r) => {
|
|
23
23
|
let i = { ...e?.shapeSettings }, a = 0, o = 0, s = i?.borderEnabled ?? g.borderEnabled;
|
|
24
|
-
(i?.shape ===
|
|
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 ===
|
|
27
|
-
let l = i?.borderStyle ===
|
|
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
|
|
87
|
-
case
|
|
88
|
-
case
|
|
89
|
-
case
|
|
90
|
-
case
|
|
91
|
-
case
|
|
92
|
-
case
|
|
93
|
-
case
|
|
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:
|
|
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:
|
|
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:
|
|
127
|
+
preserveAspectRatio: i,
|
|
128
128
|
onLoad: n,
|
|
129
129
|
onError: n
|
|
130
130
|
})
|
|
131
|
-
}) }), k = u(({ vSpec: e, vTheme:
|
|
132
|
-
let s =
|
|
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 ===
|
|
171
|
+
...c.shape === t.Line ? { heightBasedSize: c.heightBasedSize } : {}
|
|
172
172
|
})
|
|
173
173
|
})
|
|
174
174
|
})
|