@astrato-io/visualizations 0.9.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 +7 -3
- package/THIRD_PARTY_NOTICES.md +163 -14
- package/VISUALIZATION_DEFINITIONS.md +376 -36
- package/chunks/{Button-5CxPEACP.js → Button-Dn3rJrYf.js} +4 -4
- package/chunks/{CircularProgress-DFS-LQb7.js → CircularProgress-BFeu06Yb.js} +39 -39
- package/chunks/FieldTypeIcon-DrMoGpHJ.js +22 -0
- package/chunks/{LinearProgress-CjIQfkNA.js → LinearProgress-ClO6GUjN.js} +9 -9
- package/chunks/{MenuOption-Cb7B7x6z.js → MenuOption-Czc34u4q.js} +143 -142
- package/chunks/{Title-CtFw1bVg.js → Title-BgYnaVTR.js} +22 -22
- package/chunks/_createAggregator-BMu9uRax.js +50 -0
- package/chunks/{app-filter-bar.compiler-B9775gLJ.js → app-filter-bar.compiler-CVir0wkl.js} +10 -10
- package/chunks/bar-layout-C_UgRlVl.js +9 -0
- package/chunks/{bar.compiler-B7wlH_Ro.js → bar.compiler-DYuFdi9J.js} +100 -82
- package/chunks/{builder-Dxo7D7c6.js → builder-C-TKA-My.js} +70 -37
- package/chunks/color-rules-DYJL4fIW.js +15 -0
- package/chunks/color-settings-DJFoFTip.js +5 -0
- package/chunks/{coloring-B-Wa8D5P.js → coloring-BtnPiQ_o.js} +37 -37
- package/chunks/createSimplePaletteValueFilter--zrZxRV9.js +2005 -0
- package/chunks/defaults-Dtk7fg3C.js +3 -0
- package/chunks/{definitions-DNpzD9tY.js → definitions-CT304NDn.js} +655 -417
- package/chunks/{escobar-C4Nm3eJ7.js → escobar-CvEV2ES1.js} +7441 -7127
- package/chunks/{extend-preset-BVKFtoe-.js → extend-preset-D9-JP92b.js} +998 -933
- package/chunks/{filter.compiler-BlS3zoy_.js → filter.compiler-CXeZznks.js} +7 -7
- package/chunks/{filtering-CGuLpg7u.js → filtering-8_bFv-jb.js} +333 -377
- package/chunks/handlers-C6CZ0XJA.js +15399 -0
- package/chunks/{icon-picker-styles-DYQgVEKG.js → icon-picker-styles-BXiJ1SZS.js} +11 -11
- package/chunks/isEqual-D8Ay63xR.js +16 -0
- package/chunks/{isFocusVisible-B1_z03UT.js → isFocusVisible-Bu8gGZu5.js} +1 -1
- package/chunks/label-format-type-C46pzgx7.js +17 -0
- package/chunks/{line.compiler-Bo9i9qag.js → line.compiler-DmHpmQCC.js} +9 -9
- package/chunks/{logger-3lng-wOw.js → logger-DdZpR7xZ.js} +79 -72
- package/chunks/map.compiler-Q_Y1Pvat.js +343 -0
- package/chunks/{metadata-Fmx1swpK.js → metadata-BQm_TXI1.js} +1 -1
- package/chunks/{number.compiler-CdLd5aGW.js → number.compiler-DQdg6zTy.js} +7 -7
- package/chunks/operations-DKQWuLL7.js +31315 -0
- package/chunks/{range-CzO4isKK.js → range-BdhzvYQ_.js} +2 -2
- package/chunks/{react-dom-BwZT0N3F.js → react-dom-BGP4tbXV.js} +70 -70
- package/chunks/{render-wrappers-CAuvgMxi.js → render-wrappers-BZpyDnJy.js} +1 -1
- package/chunks/{requirements-CYpVh65U.js → requirements-e8Fe96ag.js} +60 -58
- package/chunks/shared-C_2F90xq.js +1337 -0
- package/chunks/standalone-4MsKiqs0.js +355 -0
- package/chunks/standalone-B794g9pE.js +1012 -0
- package/chunks/{standalone-C6XDHYAM.js → standalone-B8ZSqauS.js} +110 -110
- package/chunks/{standalone-5DnapeHH.js → standalone-BA2YXyJS.js} +126 -124
- package/chunks/{standalone-CXniic5x.js → standalone-BDrXVxlP.js} +6 -5
- package/chunks/{standalone-B6s_xG2u.js → standalone-BE_ONgiG.js} +116 -116
- package/chunks/{standalone-CPUiiWNP.js → standalone-BTY3w_JA.js} +37 -37
- package/chunks/standalone-BgumbdaJ2.js +357 -0
- package/chunks/{standalone-DWPfdP0A.js → standalone-BkbiH-o8.js} +482 -482
- package/chunks/standalone-Blh4qejk.js +689 -0
- package/chunks/standalone-CXY4FpF7.js +773 -0
- package/chunks/{standalone-BvWdpUL3.js → standalone-CY_kjarf.js} +34 -31
- package/chunks/{standalone-DuwTOBXH.js → standalone-CaTxAydz.js} +587 -587
- package/chunks/{standalone-BDrQMxLi.js → standalone-Cc98Pdr6.js} +1799 -1015
- package/chunks/{standalone-DMCwtebn.js → standalone-Cl0TSfqC.js} +125 -125
- package/chunks/{standalone-CoQxJ6ov.js → standalone-CsoMmE9T.js} +778 -778
- package/chunks/standalone-DH0xTEes.js +2 -0
- package/chunks/{standalone-LFVgLhia.js → standalone-DHRalbVO.js} +311 -303
- package/chunks/standalone-DNh9NcMa.js +580 -0
- package/chunks/standalone-DcnHjNnC.js +2 -0
- package/chunks/{standalone-r4ObFvys.js → standalone-DflyWtuR.js} +217 -215
- package/chunks/standalone-DrHdGkY7.js +762 -0
- package/chunks/standalone-c_rROMtx.js +287 -0
- package/chunks/standalone-drcFLeN6.js +6 -0
- package/chunks/{standalone-CNkHsynO.js → standalone-wOWRCpdn.js} +54 -56
- package/chunks/{standalone-Cu73fzSr.js → standalone-z0o52o5t.js} +5128 -4908
- package/chunks/{table.compiler-C1qjqXaT.js → table.compiler-COaHE9VD.js} +18 -18
- package/chunks/{useFieldName-mWrD_uk_.js → useFieldName-CdnCWzhd.js} +1 -1
- package/chunks/{utils-DYYD4Zzf.js → utils-DganVptf.js} +4758 -4747
- package/chunks/{view-7fH6mGmY.js → view-Bzlros43.js} +2021 -1665
- package/chunks/{visualization-filters-mVnsnvLP.js → visualization-filters-D7i6oh1Z.js} +3177 -2425
- package/chunks/{with-html-element-B0Clt4jY.js → with-html-element-CiIhFEa5.js} +3740 -3547
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +303 -2
- package/docs/operations/combo.md +262 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +148 -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 +262 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +7 -7
- package/docs/operations/line.md +280 -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 +148 -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 +374 -157
- 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 +482 -434
- package/metadata.js +2 -2
- package/operations.js +5 -5
- package/package.json +72 -67
- package/src/definitions/index.d.ts +7 -1
- package/src/definitions/model/definitions/available-fields.d.ts +2 -2
- package/src/definitions/model/definitions/compilers/compile.d.ts +1 -0
- package/src/definitions/model/definitions/data-item-resolution.d.ts +3 -3
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +219 -7
- package/src/definitions/model/definitions/index.d.ts +2 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +305 -0
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +2 -0
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +4 -3
- package/src/definitions/model/definitions/schemas/index.d.ts +1 -0
- package/src/definitions/model/definitions/schemas/map.schema.d.ts +590 -0
- package/src/definitions/model/definitions/types/compilation.types.d.ts +9 -1
- package/src/definitions/model/definitions/types/definition.types.d.ts +2 -2
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/index.d.ts +1 -1
- package/src/operations/index.d.ts +1 -1
- package/src/types.d.ts +17 -13
- package/chunks/FieldTypeIcon-pSVQFemC.js +0 -22
- package/chunks/ToggleButton-Br9HCPCv.js +0 -150
- package/chunks/color-rules-CN7TcGrC.js +0 -6
- package/chunks/color-settings-3VRlf_Vw.js +0 -6
- package/chunks/handlers-CMbyj5y1.js +0 -12930
- package/chunks/isEqual-DBg_b35N.js +0 -12
- package/chunks/label-format-type-weq1XfcX.js +0 -8
- package/chunks/operations-HSqnCRvv.js +0 -26324
- package/chunks/shared-DFoJxjVN.js +0 -1218
- package/chunks/standalone-530a5lvf.js +0 -1003
- package/chunks/standalone-B4jrf4KE.js +0 -354
- package/chunks/standalone-BMoJXGYe.js +0 -2
- package/chunks/standalone-BfvGggeM2.js +0 -355
- package/chunks/standalone-CMJJIi9v.js +0 -2
- package/chunks/standalone-C_Jd4gkj.js +0 -6
- package/chunks/standalone-CiaaibTa.js +0 -518
- package/chunks/standalone-DBeXQrwH.js +0 -468
- package/chunks/standalone-DpSRmAWx.js +0 -287
- package/chunks/standalone-kzAhwH19.js +0 -689
- package/chunks/standalone-mb7LwEiq.js +0 -3874
- /package/chunks/{src-BOS6SqkZ2.js → src-BOS6SqkZ.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { s as S } from "./coloring-
|
|
5
|
-
import { n as C, r as w, t as T } from "./icon-picker-styles-
|
|
6
|
-
var E = /* @__PURE__ */ e(
|
|
2
|
+
import { Fa as t, Fc as n, Ia as r, Io as i, La as a, Qr as o, Ut as s, ms as c, ps as l, rc as u, sa as d, ti as f, za as p } from "./visualization-filters-D7i6oh1Z.js";
|
|
3
|
+
import { Ut as m, W as h, ci as g, f as _, jt as v, sn as y, xn as b, zr as x } from "./utils-DganVptf.js";
|
|
4
|
+
import { s as S } from "./coloring-BtnPiQ_o.js";
|
|
5
|
+
import { n as C, r as w, t as T } from "./icon-picker-styles-BXiJ1SZS.js";
|
|
6
|
+
var E = /* @__PURE__ */ e(g()), D = x(), O = (e) => {
|
|
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(_()), D = b(), 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(_()), D = b(), 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
|
-
textAlign:
|
|
70
|
-
horizontalAlign:
|
|
71
|
-
verticalAlign:
|
|
69
|
+
textAlign: l.Center,
|
|
70
|
+
horizontalAlign: l.Center,
|
|
71
|
+
verticalAlign: c.Middle,
|
|
72
72
|
numberStyle: {
|
|
73
73
|
fontSize: 12,
|
|
74
74
|
fontFamily: "Roboto",
|
|
@@ -78,27 +78,27 @@ var E = /* @__PURE__ */ e(_()), D = b(), 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
|
-
}, L = (e,
|
|
91
|
-
if (!
|
|
92
|
-
let
|
|
90
|
+
}, L = (e, t, n) => {
|
|
91
|
+
if (!n?.length || !e) return I;
|
|
92
|
+
let r = t || d, i = r.fonts.general.fontFamily ?? void 0, { numberValue: a, numberFormat: s, comparisonNumberValue: c, comparisonFormat: l } = R(e, n);
|
|
93
93
|
return {
|
|
94
|
-
...B(e,
|
|
95
|
-
numberValue:
|
|
94
|
+
...B(e, r, H(n, e.measures.find((e) => o(e) && e.role === p.NUMBER_MEASURE), !0), z(e, n)),
|
|
95
|
+
numberValue: a,
|
|
96
96
|
numberFormat: s,
|
|
97
97
|
comparisonNumberValue: c,
|
|
98
98
|
comparisonFormat: l,
|
|
99
99
|
numberStyle: {
|
|
100
100
|
fontSize: e.numberSettings?.numberStyle?.fontSize ?? I.numberStyle.fontSize,
|
|
101
|
-
fontFamily: e.numberSettings?.numberStyle?.fontFamily ??
|
|
101
|
+
fontFamily: e.numberSettings?.numberStyle?.fontFamily ?? i,
|
|
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(_()), D = b(), O = (e) => {
|
|
|
107
107
|
},
|
|
108
108
|
comparisonStyle: {
|
|
109
109
|
relativeFontSizePercentage: e.numberSettings?.comparisonStyle?.relativeFontSizePercentage ?? I.comparisonStyle.relativeFontSizePercentage,
|
|
110
|
-
fontFamily: e.numberSettings?.comparisonStyle?.fontFamily ??
|
|
110
|
+
fontFamily: e.numberSettings?.comparisonStyle?.fontFamily ?? i,
|
|
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,
|
|
@@ -119,26 +119,26 @@ var E = /* @__PURE__ */ e(_()), D = b(), O = (e) => {
|
|
|
119
119
|
verticalAlign: e.numberSettings?.position?.numberVerticalAlign ?? I.verticalAlign,
|
|
120
120
|
comparisonGap: e.numberSettings?.position?.comparisonGap ?? I.comparisonGap
|
|
121
121
|
};
|
|
122
|
-
}, R = (e,
|
|
123
|
-
let r, i, a,
|
|
124
|
-
return
|
|
125
|
-
numberValue:
|
|
126
|
-
numberFormat:
|
|
127
|
-
comparisonNumberValue:
|
|
128
|
-
comparisonFormat:
|
|
122
|
+
}, R = (e, t) => {
|
|
123
|
+
let n, r, i, a, s = e.measures.filter(o), c = s.filter((e) => e.role === p.NUMBER_MEASURE), l = s.filter((e) => e.role === p.NUMBER_COMPARISON), u = c[0], d = l[0];
|
|
124
|
+
return n = H(t, u, !0), i = z(e, t), u?.formatter && typeof u?.formatter?.format != "string" && (r = u.formatter), d?.formatter && typeof d?.formatter?.format != "string" && (a = d.formatter), d && i !== void 0 && e.numberSettings?.data?.showOnlyComparison && (n = i, r = a, i = void 0, a = void 0), {
|
|
125
|
+
numberValue: n,
|
|
126
|
+
numberFormat: r,
|
|
127
|
+
comparisonNumberValue: i,
|
|
128
|
+
comparisonFormat: a
|
|
129
129
|
};
|
|
130
|
-
}, z = (e,
|
|
131
|
-
let
|
|
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
132
|
if (!c) return;
|
|
133
|
-
let l = H(
|
|
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
134
|
if (u === null || f && l === null) return null;
|
|
135
135
|
let m = Number(l), h = +u, g = Math.abs(h);
|
|
136
|
-
return d ===
|
|
137
|
-
}, B = (e, n, r
|
|
138
|
-
let
|
|
139
|
-
return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !==
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
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"]),
|
|
@@ -154,28 +154,28 @@ var E = /* @__PURE__ */ e(_()), D = b(), O = (e) => {
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
return e;
|
|
157
|
-
}, V(e,
|
|
157
|
+
}, V(e, t));
|
|
158
158
|
}, V = (e, t) => {
|
|
159
159
|
let { icon: n, iconColor: r } = e.numberSettings?.colorAndIcon || {};
|
|
160
160
|
return {
|
|
161
161
|
icon: n,
|
|
162
162
|
iconColor: S(t, r ?? "black"),
|
|
163
|
-
iconPosition: e?.numberSettings?.position?.iconPosition ??
|
|
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,
|
|
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(
|
|
177
|
-
comparisonPosition: e.numberSettings?.position?.comparisonPosition ??
|
|
178
|
-
}, W =
|
|
176
|
+
comparisonColor: S(t, n ?? t.fonts.general.color),
|
|
177
|
+
comparisonPosition: e.numberSettings?.position?.comparisonPosition ?? i.Left
|
|
178
|
+
}, W = h({
|
|
179
179
|
mainContainer: {
|
|
180
180
|
width: "100%",
|
|
181
181
|
height: "100%",
|
|
@@ -195,15 +195,15 @@ var E = /* @__PURE__ */ e(_()), D = b(), O = (e) => {
|
|
|
195
195
|
}
|
|
196
196
|
}), G = (e) => {
|
|
197
197
|
switch (e) {
|
|
198
|
-
case
|
|
199
|
-
case
|
|
200
|
-
case
|
|
201
|
-
case
|
|
198
|
+
case c.Top:
|
|
199
|
+
case l.Left: return "flex-start";
|
|
200
|
+
case c.Bottom:
|
|
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,44 +213,44 @@ var E = /* @__PURE__ */ e(_()), D = b(), 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
|
|
228
|
-
return
|
|
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
229
|
}, re = ({ numberSize: e, comparisonNumberSize: t, numberProps: n, elementSize: r }) => {
|
|
230
|
-
let
|
|
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
231
|
return o && (s += e.height), s <= r.height;
|
|
232
|
-
}, Q = 1.2, ie = ({ number: e, comparisonNumber: t }, n,
|
|
233
|
-
let { numberStyle:
|
|
234
|
-
if (!e ||
|
|
235
|
-
let
|
|
236
|
-
for (let
|
|
237
|
-
let
|
|
238
|
-
width:
|
|
239
|
-
size:
|
|
232
|
+
}, Q = 1.2, ie = ({ number: e, comparisonNumber: t }, n, r) => {
|
|
233
|
+
let { numberStyle: i, comparisonStyle: a } = n, o = i.fontSize ?? 14;
|
|
234
|
+
if (!e || r.width === 0) return o;
|
|
235
|
+
let s = b(), c = (a.relativeFontSizePercentage ?? f.relativeFontSizePercentage) / 100, l = 1;
|
|
236
|
+
for (let u = o; u >= 1; --u) {
|
|
237
|
+
let o = {
|
|
238
|
+
width: s.getTextSize({
|
|
239
|
+
size: u,
|
|
240
240
|
label: e,
|
|
241
|
-
fontFamily:
|
|
241
|
+
fontFamily: i.fontFamily ?? "inherit",
|
|
242
242
|
letterSpacing: "0.05em",
|
|
243
243
|
fontWeight: 400
|
|
244
244
|
}).width,
|
|
245
|
-
height:
|
|
245
|
+
height: u * Q
|
|
246
246
|
}, d;
|
|
247
247
|
if (t) {
|
|
248
|
-
let e =
|
|
248
|
+
let e = u * c;
|
|
249
249
|
d = {
|
|
250
|
-
width:
|
|
250
|
+
width: s.getTextSize({
|
|
251
251
|
size: e,
|
|
252
252
|
label: t,
|
|
253
|
-
fontFamily:
|
|
253
|
+
fontFamily: a.fontFamily ?? "inherit",
|
|
254
254
|
letterSpacing: "0.05em",
|
|
255
255
|
fontWeight: 400
|
|
256
256
|
}).width,
|
|
@@ -258,84 +258,84 @@ var E = /* @__PURE__ */ e(_()), D = b(), O = (e) => {
|
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
260
|
if (ne({
|
|
261
|
-
numberSize:
|
|
261
|
+
numberSize: o,
|
|
262
262
|
comparisonNumberSize: d,
|
|
263
263
|
numberProps: n,
|
|
264
|
-
elementSize:
|
|
265
|
-
fontSize:
|
|
264
|
+
elementSize: r,
|
|
265
|
+
fontSize: u
|
|
266
266
|
}) && re({
|
|
267
|
-
numberSize:
|
|
267
|
+
numberSize: o,
|
|
268
268
|
comparisonNumberSize: d,
|
|
269
269
|
numberProps: n,
|
|
270
|
-
elementSize:
|
|
271
|
-
fontSize:
|
|
270
|
+
elementSize: r,
|
|
271
|
+
fontSize: u
|
|
272
272
|
})) {
|
|
273
|
-
|
|
273
|
+
l = u;
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
return
|
|
278
|
-
}, $ =
|
|
279
|
-
let [
|
|
277
|
+
return s.cleanDOM(), l;
|
|
278
|
+
}, $ = v((0, E.memo)(({ vSpec: e, vTheme: t, elementSize: n, data: r, vizProperties: a }) => {
|
|
279
|
+
let [o, s] = (0, E.useState)(0), c = W(), l = _(), u = L(e, t, r ?? void 0), { numberValue: d, numberFormat: p, comparisonNumberValue: h, comparisonFormat: g, backgroundColor: v } = u, y = u.iconPosition ?? i.Left, b = o, x = d === null ? null : o, S = p && x !== null ? m(p, x) : x, C = g && h !== null ? m(g, h) : h, w = S === "" || S == null, T = w ? void 0 : `${S}`, O = C === "" || C == null ? void 0 : `${C}`, A = w || !n ? u.numberStyle.fontSize || 14 : ie({
|
|
280
280
|
number: T,
|
|
281
281
|
comparisonNumber: O
|
|
282
|
-
},
|
|
282
|
+
}, u, n);
|
|
283
283
|
return (0, E.useEffect)(() => {
|
|
284
284
|
let e;
|
|
285
|
-
return !
|
|
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
|
-
}, [
|
|
289
|
-
e &&
|
|
288
|
+
}, [d]), (0, E.useEffect)(() => {
|
|
289
|
+
e && l();
|
|
290
290
|
}, [e]), /* @__PURE__ */ (0, D.jsx)("div", {
|
|
291
|
-
className:
|
|
291
|
+
className: c.mainContainer,
|
|
292
292
|
style: {
|
|
293
293
|
fontSize: `${A}px`,
|
|
294
|
-
alignItems: G(
|
|
295
|
-
justifyContent: G(
|
|
296
|
-
backgroundColor:
|
|
294
|
+
alignItems: G(u.verticalAlign),
|
|
295
|
+
justifyContent: G(u.horizontalAlign),
|
|
296
|
+
backgroundColor: v
|
|
297
297
|
},
|
|
298
298
|
children: /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
299
|
-
className:
|
|
299
|
+
className: c.numbersContainer,
|
|
300
300
|
style: {
|
|
301
|
-
alignItems: K(
|
|
302
|
-
flexDirection: X(
|
|
303
|
-
...ee(
|
|
301
|
+
alignItems: K(u),
|
|
302
|
+
flexDirection: X(u.comparisonPosition ?? y),
|
|
303
|
+
...ee(u.comparisonGap, u.comparisonPosition)
|
|
304
304
|
},
|
|
305
305
|
children: [/* @__PURE__ */ (0, D.jsxs)("div", {
|
|
306
|
-
className:
|
|
306
|
+
className: c.comparisonIconContainer,
|
|
307
307
|
style: {
|
|
308
|
-
alignItems: G(
|
|
308
|
+
alignItems: G(u.textAlign),
|
|
309
309
|
flexDirection: X(y)
|
|
310
310
|
},
|
|
311
311
|
children: [/* @__PURE__ */ (0, D.jsx)(k, {
|
|
312
|
-
name:
|
|
312
|
+
name: u.icon ?? "",
|
|
313
313
|
testId: "indicator-icon",
|
|
314
314
|
style: {
|
|
315
|
-
fontSize: te(
|
|
316
|
-
color:
|
|
315
|
+
fontSize: te(u.comparisonPosition, y),
|
|
316
|
+
color: u.iconColor ?? "inherit"
|
|
317
317
|
}
|
|
318
318
|
}), /* @__PURE__ */ (0, D.jsx)("div", {
|
|
319
319
|
"data-testid": "number-comparison",
|
|
320
320
|
style: {
|
|
321
|
-
fontSize: `${(
|
|
322
|
-
fontFamily:
|
|
323
|
-
fontStyle:
|
|
324
|
-
fontWeight:
|
|
325
|
-
textDecoration: Z(
|
|
326
|
-
color:
|
|
321
|
+
fontSize: `${(u.comparisonStyle.relativeFontSizePercentage ?? f.relativeFontSizePercentage) / 100}em`,
|
|
322
|
+
fontFamily: u.comparisonStyle.fontFamily,
|
|
323
|
+
fontStyle: u.comparisonStyle.italic ? "italic" : "normal",
|
|
324
|
+
fontWeight: u.comparisonStyle.weight || (u.comparisonStyle.bold ? "bold" : "normal"),
|
|
325
|
+
textDecoration: Z(u.comparisonStyle.underlined ?? !1, u.comparisonStyle.strikethrough ?? !1),
|
|
326
|
+
color: u.comparisonColor ?? "inherit"
|
|
327
327
|
},
|
|
328
328
|
children: O
|
|
329
329
|
})]
|
|
330
330
|
}), /* @__PURE__ */ (0, D.jsx)("div", {
|
|
331
|
-
className:
|
|
331
|
+
className: c.number,
|
|
332
332
|
"data-testid": "number-base",
|
|
333
333
|
style: {
|
|
334
|
-
fontFamily:
|
|
335
|
-
fontStyle:
|
|
336
|
-
fontWeight:
|
|
337
|
-
textDecoration: Z(
|
|
338
|
-
color:
|
|
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
|
|
339
339
|
},
|
|
340
340
|
children: p && typeof x == "number" ? m(p, x) : x
|
|
341
341
|
})]
|
|
@@ -346,7 +346,7 @@ var E = /* @__PURE__ */ e(_()), D = b(), O = (e) => {
|
|
|
346
346
|
return t === null ? (0, E.createElement)($, {
|
|
347
347
|
...e,
|
|
348
348
|
vSpec: null
|
|
349
|
-
}) :
|
|
349
|
+
}) : u(t) ? (0, E.createElement)($, {
|
|
350
350
|
...e,
|
|
351
351
|
vSpec: t
|
|
352
352
|
}) : null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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(
|
|
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,
|
|
@@ -19,26 +19,26 @@ var m = /* @__PURE__ */ e(l()), h = (e) => e === i.Line || e === i.Elbow, g = {
|
|
|
19
19
|
scale: 1,
|
|
20
20
|
rotate: 0,
|
|
21
21
|
heightBasedSize: !1
|
|
22
|
-
}, _ = (e,
|
|
23
|
-
let
|
|
24
|
-
(
|
|
25
|
-
let c =
|
|
26
|
-
|
|
27
|
-
let l =
|
|
22
|
+
}, _ = (e, r) => {
|
|
23
|
+
let i = { ...e?.shapeSettings }, a = 0, o = 0, s = i?.borderEnabled ?? g.borderEnabled;
|
|
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
|
+
let c = i?.rotate ?? g.rotate;
|
|
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
|
-
backgroundType:
|
|
30
|
-
shape:
|
|
31
|
-
backgroundColor:
|
|
32
|
-
imageURL:
|
|
33
|
-
imageFit:
|
|
29
|
+
backgroundType: i?.backgroundType ?? "color",
|
|
30
|
+
shape: i?.shape ?? g.shape,
|
|
31
|
+
backgroundColor: i?.backgroundColor?.code ? i?.backgroundColor : g.backgroundColor,
|
|
32
|
+
imageURL: i?.imageURL ?? g.imageURL,
|
|
33
|
+
imageFit: i?.imageFit ?? g.imageFit,
|
|
34
34
|
strokeDash: l,
|
|
35
|
-
lineThickness:
|
|
35
|
+
lineThickness: i?.lineThickness ?? g.lineThickness,
|
|
36
36
|
borderEnabled: s,
|
|
37
|
-
strokeColor:
|
|
38
|
-
preserveAspectRatio:
|
|
39
|
-
scale:
|
|
37
|
+
strokeColor: i?.strokeColor?.code ? i?.strokeColor : g.strokeColor,
|
|
38
|
+
preserveAspectRatio: i?.preserveAspectRatio ?? g.preserveAspectRatio,
|
|
39
|
+
scale: i?.scale ?? g.scale,
|
|
40
40
|
rotate: c,
|
|
41
|
-
heightBasedSize:
|
|
41
|
+
heightBasedSize: i?.heightBasedSize ?? g.heightBasedSize,
|
|
42
42
|
borderRadiusX: a,
|
|
43
43
|
borderRadiusY: o
|
|
44
44
|
};
|
|
@@ -83,17 +83,17 @@ var m = /* @__PURE__ */ e(l()), h = (e) => e === i.Line || e === i.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
|
-
}, D =
|
|
96
|
+
}, D = s({
|
|
97
97
|
mainContainer: {
|
|
98
98
|
width: "100%",
|
|
99
99
|
height: "100%",
|
|
@@ -128,16 +128,16 @@ var m = /* @__PURE__ */ e(l()), h = (e) => e === i.Line || e === i.Elbow, g = {
|
|
|
128
128
|
onLoad: n,
|
|
129
129
|
onError: n
|
|
130
130
|
})
|
|
131
|
-
}) }), k =
|
|
132
|
-
let
|
|
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", {
|
|
136
|
-
className:
|
|
136
|
+
className: u.mainContainer,
|
|
137
137
|
"data-testid": "shape-container",
|
|
138
138
|
children: /* @__PURE__ */ (0, v.jsxs)("svg", {
|
|
139
139
|
viewBox: "0 0 100 100",
|
|
140
|
-
className:
|
|
140
|
+
className: u.svg,
|
|
141
141
|
style: { transform: `rotate(${c.rotate ?? 0}deg) scale(${c.scale ?? 1})` },
|
|
142
142
|
preserveAspectRatio: c.preserveAspectRatio ? "" : "none",
|
|
143
143
|
children: [
|
|
@@ -149,7 +149,7 @@ var m = /* @__PURE__ */ e(l()), h = (e) => e === i.Line || e === i.Elbow, g = {
|
|
|
149
149
|
}) : null,
|
|
150
150
|
/* @__PURE__ */ (0, v.jsx)("defs", { children: /* @__PURE__ */ (0, v.jsx)("clipPath", {
|
|
151
151
|
id: x,
|
|
152
|
-
className:
|
|
152
|
+
className: u.shapeGroup,
|
|
153
153
|
style: { opacity: c.opacity === void 0 ? 1 : c.opacity },
|
|
154
154
|
children: /* @__PURE__ */ (0, v.jsx)(y, {
|
|
155
155
|
rx: `${c.borderRadiusX ?? 0}px`,
|
|
@@ -157,7 +157,7 @@ var m = /* @__PURE__ */ e(l()), h = (e) => e === i.Line || e === i.Elbow, g = {
|
|
|
157
157
|
})
|
|
158
158
|
}) }),
|
|
159
159
|
/* @__PURE__ */ (0, v.jsx)("g", {
|
|
160
|
-
className:
|
|
160
|
+
className: u.shapeGroup,
|
|
161
161
|
style: { opacity: c.opacity === void 0 ? 1 : c.opacity },
|
|
162
162
|
fill: c.imageURL && c.backgroundType === "image" ? `url(#${b})` : S,
|
|
163
163
|
stroke: C,
|
|
@@ -168,7 +168,7 @@ var m = /* @__PURE__ */ e(l()), h = (e) => e === i.Line || e === i.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
|
})
|