@astrato-io/visualizations 0.6.4 → 0.6.5
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 +0 -0
- package/THIRD_PARTY_NOTICES.md +94 -4
- package/chunks/ClickAwayListener-BbeNMAvj.js +52 -0
- package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-B1FeWaen.js} +54 -54
- package/chunks/app-filter-bar.compiler-BGJ7HAbr.js +64 -0
- package/chunks/bar.compiler-CT0ZbQKc.js +374 -0
- package/chunks/{src-Cum_2NLV.js → builder-B6dWSIdD.js} +5779 -5635
- package/chunks/{coloring-C16AUZEi.js → coloring-B1XAfg6b.js} +234 -233
- package/chunks/{src-BC7cGcJ-.js → definitions-D3OVqmXl.js} +438 -360
- package/chunks/{escobar-BGqT1EsE.js → escobar-eDjtGpkC.js} +4645 -4619
- package/chunks/filter.compiler-DBsyRBJt.js +70 -0
- package/chunks/{filtering-Yq4DEa0t.js → filtering-tqjAyJH5.js} +432 -313
- package/chunks/{grouping-type-BX_9Ix5q.js → grouping-type-On4s9Thj.js} +1 -1
- package/chunks/handlers-VTBfIZYZ.js +13072 -0
- package/chunks/isEqual-BDxAhUo8.js +7514 -0
- package/chunks/line.compiler-CzdM5Ld0.js +198 -0
- package/chunks/{metadata-CPXdYoln.js → metadata-BGElBy5Z.js} +1 -1
- package/chunks/number.compiler-G-R7y16P.js +53 -0
- package/chunks/{src-C0LgoUWY.js → operations-CTNUX6Sy.js} +9576 -9432
- package/chunks/{range-DrzdfBX4.js → range-CiwTbMig.js} +2 -2
- package/chunks/{registry-CExpGJ1N.js → registry-CsQQzukD.js} +153 -153
- package/chunks/{requirements-DNhuShLS.js → requirements-DYjZCFyf.js} +1 -1
- package/chunks/{shared-CKDL4hx9.js → shared-CBvcC5YV.js} +460 -413
- package/chunks/{standalone-D5vnf-9y.js → standalone-0M4HlmDW2.js} +823 -822
- package/chunks/standalone-0ashe9w1.js +411 -0
- package/chunks/{standalone-C85u7U6I.js → standalone-B7jax8wa.js} +93 -94
- package/chunks/standalone-BK0VYU-l.js +463 -0
- package/chunks/{standalone-BDCwI6Hn.js → standalone-BMIbT1b2.js} +815 -815
- package/chunks/standalone-BZV5vOwA.js +6 -0
- package/chunks/standalone-BhDrWj4p.js +1980 -0
- package/chunks/{standalone-CNyNHKVx.js → standalone-BtSHCp2U2.js} +97 -98
- package/chunks/{standalone-CDQnr6qT.js → standalone-BvaKdky9.js} +95 -96
- package/chunks/standalone-BwtM31-f.js +2 -0
- package/chunks/{standalone-CY57qwZ-.js → standalone-C3gg736V.js} +153 -153
- package/chunks/{standalone-DFPva_ku.js → standalone-CC1VUjO32.js} +60 -60
- package/chunks/{standalone-CCNtaJ7s.js → standalone-C_rYnZ0N.js} +41 -41
- package/chunks/{standalone-CZynjFG7.js → standalone-CoLrAxRV.js} +3701 -3482
- package/chunks/{standalone-jiz0L2Dg.js → standalone-DC-aUgXC.js} +104 -104
- package/chunks/standalone-DCtRoTWg.js +675 -0
- package/chunks/standalone-DUDFTBqL.js +833 -0
- package/chunks/standalone-DhZkX9Td.js +2 -0
- package/chunks/{standalone-Dx3MLlrO.js → standalone-DtLElfuM.js} +141 -141
- package/chunks/{standalone-BmfMt74U.js → standalone-G9Q4Uczu.js} +192 -192
- package/chunks/{standalone-BH5NqDwp.js → standalone-JuLF-OoH.js} +390 -391
- package/chunks/standalone-_DeX21JJ.js +383 -0
- package/chunks/{standalone-lBm9hQ-q.js → standalone-gFhKZh8m.js} +34 -34
- package/chunks/standalone-tDNy-SFH.js +281 -0
- package/chunks/{standalone-rJ45Zfl1.js → standalone-v1oxfU20.js} +10 -10
- package/chunks/{standalone-BYm1UjLr.js → standalone-vzBY6q0I2.js} +18 -18
- package/chunks/table.compiler-tb914oj3.js +222 -0
- package/chunks/{ui-D1HQNIBy.js → ui-DQWtv2iM.js} +13485 -3973
- package/chunks/{useFieldName-oqQ3bvnO.js → useFieldName-BvdcoJRl.js} +1 -1
- package/chunks/{utils-Ba9T0TqC.js → utils-Bg7K-t6K.js} +7306 -6024
- package/chunks/{src-DvX5LU9T.js → view-Bn83C8d9.js} +2555 -4831
- package/definitions.js +3 -3
- package/docs/operations/astrato-app-filter-bar.md +17 -17
- package/docs/operations/bar.md +989 -1071
- package/docs/operations/combo.md +717 -738
- package/docs/operations/date-picker.md +25 -25
- package/docs/operations/distribution-gauge.md +471 -607
- package/docs/operations/dot.md +787 -879
- package/docs/operations/filter.md +139 -163
- package/docs/operations/gauge.md +491 -627
- package/docs/operations/heatMap.md +834 -916
- package/docs/operations/histogram.md +166 -180
- package/docs/operations/iframe.md +5 -5
- package/docs/operations/image.md +16 -16
- package/docs/operations/index.md +12 -12
- package/docs/operations/line.md +811 -888
- package/docs/operations/number.md +470 -536
- package/docs/operations/pie.md +825 -958
- package/docs/operations/radar.md +599 -679
- package/docs/operations/sankey.md +462 -584
- package/docs/operations/scatter.md +823 -929
- package/docs/operations/shape.md +34 -34
- package/docs/operations/simpleTextObject.md +18 -25
- package/docs/operations/slider.md +33 -43
- package/docs/operations/table.md +1160 -1150
- package/docs/operations/tree.md +354 -361
- package/docs/operations/treemap.md +545 -637
- package/docs/operations/waterfall.md +369 -379
- package/docs/operations/word-cloud.md +512 -583
- package/getters.js +3 -3
- package/index.js +51 -51
- package/metadata.js +3 -3
- package/operations.js +7 -7
- package/package.json +80 -86
- package/src/definitions/index.d.ts +2 -2
- package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
- package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
- package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1341 -0
- package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
- package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
- package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
- package/src/definitions/model/definitions/index.d.ts +23 -0
- package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
- package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
- package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
- package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
- package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +6 -6
- package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
- package/src/definitions/model/definitions/types/index.d.ts +3 -0
- package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
- package/chunks/Radio-Ciu-F4CU.js +0 -957
- package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
- package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
- package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
- package/chunks/bar.compiler-oqaPzIut.js +0 -370
- package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
- package/chunks/event-bus-KiSiCJrC.js +0 -2683
- package/chunks/filter.compiler-CuLtc_02.js +0 -60
- package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
- package/chunks/interfaces-VUY4_yVO.js +0 -8742
- package/chunks/line-settings-DfYTUyPz.js +0 -4
- package/chunks/line.compiler-BpA_6Tc7.js +0 -188
- package/chunks/number.compiler-DbkWcG4S.js +0 -44
- package/chunks/pie-uv42Eqal.js +0 -10
- package/chunks/src-Dun_jXtz.js +0 -10295
- package/chunks/standalone-87YV_m9n.js +0 -687
- package/chunks/standalone-BLVAWLNJ.js +0 -385
- package/chunks/standalone-BPomtAVs.js +0 -2
- package/chunks/standalone-BXyBcUOQ.js +0 -2
- package/chunks/standalone-BllF4rDp.js +0 -383
- package/chunks/standalone-BqWyrnZI.js +0 -281
- package/chunks/standalone-DQxxNwF8.js +0 -675
- package/chunks/standalone-DS9T0FZ-.js +0 -830
- package/chunks/standalone-DzixzZAL.js +0 -411
- package/chunks/standalone-QJ1kKMnO.js +0 -6
- package/chunks/table.compiler-BrXkm4Fz.js +0 -213
- package/chunks/toInteger-DVZr-D1j.js +0 -11
- package/chunks/treemap-x_zmJoG7.js +0 -23
- package/chunks/types-dVVCsDWD.js +0 -4
- package/chunks/view-CLqWMV7Z.js +0 -156
- package/src/definitions/shared/index.d.ts +0 -5
- package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
- package/src/definitions/shared/lib/registry/index.d.ts +0 -3
- package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
- package/src/definitions/shared/lib/types/index.d.ts +0 -3
- package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
- package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
- /package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +0 -0
- /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
var S = /* @__PURE__ */ e(
|
|
2
|
+
import { An as t, Fa as n, Ma as r, Mo as i, Na as a, Sa as o, Si as s, Ti as c, as as l, fc as u, ja as d, os as f } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as p, Ei as m, G as h, Kn as g, Yi as _, d as v, hn as y } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
import { u as b } from "./ui-DQWtv2iM.js";
|
|
5
|
+
import { _ as x } from "./coloring-B1XAfg6b.js";
|
|
6
|
+
var S = /* @__PURE__ */ e(_()), C = (e, t) => {
|
|
7
7
|
switch (e.thresholdType) {
|
|
8
|
-
case
|
|
9
|
-
case
|
|
10
|
-
case
|
|
8
|
+
case a.Range: return T(t, e.rangeThresholds ?? []);
|
|
9
|
+
case a.Target: return w(t, e.targetThreshold);
|
|
10
|
+
case a.None: return {};
|
|
11
11
|
}
|
|
12
|
-
}, w = (e,
|
|
13
|
-
let
|
|
14
|
-
return e <
|
|
15
|
-
}, T = (e,
|
|
12
|
+
}, w = (e, n) => {
|
|
13
|
+
let r = t(n?.target, 0), { belowTargetColorAndIcon: i, targetColorAndIcon: a, aboveTargetColorAndIcon: o } = n || {};
|
|
14
|
+
return e < r * (1 - n.targetTolerance) ? i : e > r * (1 + n.targetTolerance) ? o : a;
|
|
15
|
+
}, T = (e, n) => [...n].sort((e, n) => t(n.rangeTo, 0) - t(e.rangeTo, 0)).reduce((n, r) => e < t(r.rangeTo, 0) ? r.colorAndIcon : n, {}), E = (e) => {
|
|
16
16
|
let t = ["numberColor"], n = ["comparisonColor"];
|
|
17
17
|
switch (e) {
|
|
18
18
|
case "main": return t;
|
|
@@ -30,8 +30,8 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
30
30
|
comparisonPosition: i.Bottom
|
|
31
31
|
}, k = {
|
|
32
32
|
numberValue: 0,
|
|
33
|
-
textAlign:
|
|
34
|
-
horizontalAlign:
|
|
33
|
+
textAlign: l.Center,
|
|
34
|
+
horizontalAlign: l.Center,
|
|
35
35
|
verticalAlign: f.Middle,
|
|
36
36
|
numberStyle: {
|
|
37
37
|
fontSize: 12,
|
|
@@ -42,21 +42,21 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
42
42
|
strikethrough: !1
|
|
43
43
|
},
|
|
44
44
|
comparisonStyle: {
|
|
45
|
-
relativeFontSizePercentage:
|
|
45
|
+
relativeFontSizePercentage: c.relativeFontSizePercentage,
|
|
46
46
|
fontFamily: "Roboto",
|
|
47
47
|
bold: !1,
|
|
48
48
|
italic: !1,
|
|
49
49
|
underlined: !1,
|
|
50
50
|
strikethrough: !1
|
|
51
51
|
},
|
|
52
|
-
comparisonGap:
|
|
52
|
+
comparisonGap: d.SmallGap,
|
|
53
53
|
...O
|
|
54
54
|
}, A = (e, t, r) => {
|
|
55
55
|
if (!r?.length || !e) return k;
|
|
56
|
-
let i = t ||
|
|
56
|
+
let i = t || o, a = i.fonts.general.fontFamily, c = F(r, e.measures.find((e) => s(e) && e.role === n.NUMBER_MEASURE), !0), { numberValue: l, numberFormat: u, comparisonNumberValue: d, comparisonFormat: f } = j(e, r);
|
|
57
57
|
return {
|
|
58
|
-
...N(e, i,
|
|
59
|
-
numberValue:
|
|
58
|
+
...N(e, i, c, d),
|
|
59
|
+
numberValue: l,
|
|
60
60
|
numberFormat: u,
|
|
61
61
|
comparisonNumberValue: d,
|
|
62
62
|
comparisonFormat: f,
|
|
@@ -84,7 +84,7 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
84
84
|
comparisonGap: e.numberSettings?.position?.comparisonGap ?? k.comparisonGap
|
|
85
85
|
};
|
|
86
86
|
}, j = (e, t) => {
|
|
87
|
-
let r, i, a, o,
|
|
87
|
+
let r, i, a, o, c = e.measures.filter(s), l = c.filter((e) => e.role === n.NUMBER_MEASURE), u = c.filter((e) => e.role === n.NUMBER_COMPARISON), d = l[0], f = u[0];
|
|
88
88
|
return r = F(t, d, !0), a = M(e, t), d?.formatter && typeof d?.formatter?.format != "string" && (i = d.formatter), f?.formatter && typeof f?.formatter?.format != "string" && (o = f.formatter), f && e.numberSettings?.data?.showOnlyComparison && (r = a, i = o, a = void 0, o = void 0), {
|
|
89
89
|
numberValue: r,
|
|
90
90
|
numberFormat: i,
|
|
@@ -92,15 +92,15 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
92
92
|
comparisonFormat: o
|
|
93
93
|
};
|
|
94
94
|
}, M = (e, t) => {
|
|
95
|
-
let
|
|
96
|
-
if (!
|
|
97
|
-
let u = +F(t,
|
|
98
|
-
return f ===
|
|
99
|
-
}, N = (e, r, i
|
|
100
|
-
let o = e.measures.filter(
|
|
101
|
-
return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !==
|
|
95
|
+
let i = e.measures.filter(s), a = i.filter((e) => e.role === n.NUMBER_MEASURE), o = i.filter((e) => e.role === n.NUMBER_COMPARISON), c = a[0], l = o[0];
|
|
96
|
+
if (!l) return;
|
|
97
|
+
let u = +F(t, c), d = +F(t, l), f = e.numberSettings?.data?.comparisonType, p = Math.abs(d);
|
|
98
|
+
return f === r.PercentageToComparison ? u === 0 && d === 0 ? 1 : u / p : f === r.PercentageAboveBelow ? u === 0 && d === 0 ? 0 : (u - d) / p : f === r.Difference ? u - d : d;
|
|
99
|
+
}, N = (e, t, r, i) => {
|
|
100
|
+
let o = e.measures.filter(s), c = o.filter((e) => e.role === n.NUMBER_MEASURE), l = o.filter((e) => e.role === n.NUMBER_COMPARISON), u = c[0], d = l[0];
|
|
101
|
+
return (e.numberSettings?.thresholds ?? []).filter((e) => e.thresholdType !== a.None).reduce((e, t) => {
|
|
102
102
|
if (t.measureRule === "main" ? u : d) {
|
|
103
|
-
let n = C(t, t.measureRule === "main" ?
|
|
103
|
+
let n = C(t, t.measureRule === "main" ? r : i);
|
|
104
104
|
return {
|
|
105
105
|
...e,
|
|
106
106
|
...D(n, "icon", ["icon"]),
|
|
@@ -110,7 +110,7 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
return e;
|
|
113
|
-
}, P(e,
|
|
113
|
+
}, P(e, t));
|
|
114
114
|
}, P = (e, t) => {
|
|
115
115
|
let { icon: n, iconColor: r } = e.numberSettings?.colorAndIcon || {};
|
|
116
116
|
return {
|
|
@@ -121,15 +121,15 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
121
121
|
...I(e, t, e.numberSettings?.comparisonStyle?.fontColor)
|
|
122
122
|
};
|
|
123
123
|
}, F = (e, t, n = !1) => {
|
|
124
|
-
let r =
|
|
124
|
+
let r = u(t?.dataItem), i = (e?.[0])?.items?.[0]?.[r], a = +`${i}`, o = n && (!t?.formatter || t?.formatter?.format === "string") ? `${i}` : 0;
|
|
125
125
|
return isNaN(a) ? o : a;
|
|
126
|
-
}, I = (e, t, r) => !e.measures.filter(
|
|
126
|
+
}, I = (e, t, r) => !e.measures.filter(s).filter((e) => e.role === n.NUMBER_COMPARISON)[0] || e.numberSettings.data?.showOnlyComparison ? {
|
|
127
127
|
comparisonPosition: void 0,
|
|
128
128
|
comparisonColor: void 0
|
|
129
129
|
} : {
|
|
130
130
|
comparisonColor: x(t, r ?? t.fonts.general.color),
|
|
131
131
|
comparisonPosition: e.numberSettings?.position?.comparisonPosition ?? i.Left
|
|
132
|
-
}, L =
|
|
132
|
+
}, L = h({
|
|
133
133
|
mainContainer: {
|
|
134
134
|
width: "100%",
|
|
135
135
|
height: "100%",
|
|
@@ -150,9 +150,9 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
150
150
|
}), R = (e) => {
|
|
151
151
|
switch (e) {
|
|
152
152
|
case f.Top:
|
|
153
|
-
case
|
|
153
|
+
case l.Left: return "flex-start";
|
|
154
154
|
case f.Bottom:
|
|
155
|
-
case
|
|
155
|
+
case l.Right: return "flex-end";
|
|
156
156
|
default: return "center";
|
|
157
157
|
}
|
|
158
158
|
}, z = (e) => {
|
|
@@ -167,7 +167,7 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
167
167
|
r && (d = Number(d.toFixed(o))), n(d), l < 500 ? i = requestAnimationFrame(s) : (n(e), cancelAnimationFrame(i));
|
|
168
168
|
};
|
|
169
169
|
return e !== t && (i = requestAnimationFrame(s)), () => cancelAnimationFrame(i);
|
|
170
|
-
}, V = .5, H = `${V}em`, U = (e, t) => !(t === i.Left || t === i.Right) || !e || e ===
|
|
170
|
+
}, V = .5, H = `${V}em`, U = (e, t) => !(t === i.Left || t === i.Right) || !e || e === d.None ? {} : e === d.SmallGap ? { gap: H } : {
|
|
171
171
|
width: "100%",
|
|
172
172
|
justifyContent: e
|
|
173
173
|
}, W = (e, t) => e ? t === i.Top || t === i.Bottom ? "0.33em" : "0.5em" : t === i.Top || t === i.Bottom ? "0.5em" : "1.0em", G = (e) => {
|
|
@@ -177,34 +177,34 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
177
177
|
case i.Right: return "row-reverse";
|
|
178
178
|
default: return "row";
|
|
179
179
|
}
|
|
180
|
-
}, K = (e, t) => !e && !t ? "inherit" : `${e ? "underline" : ""} ${t ? "line-through" : ""}`, q = ({ numberSize: e, comparisonNumberSize: t, numberProps: n, elementSize:
|
|
181
|
-
let
|
|
182
|
-
return
|
|
180
|
+
}, K = (e, t) => !e && !t ? "inherit" : `${e ? "underline" : ""} ${t ? "line-through" : ""}`, q = ({ numberSize: e, comparisonNumberSize: t, numberProps: n, elementSize: r, fontSize: a }) => {
|
|
181
|
+
let o = n.comparisonNumberValue != null && !!t && (n.comparisonPosition === i.Left || n.comparisonPosition === i.Right), s = !!n.icon && (n.iconPosition === i.Left || n.iconPosition === i.Right), c = o ? e.width + t.width : Math.max(e.width, t?.width ?? 0);
|
|
182
|
+
return o && n.comparisonGap === d.SmallGap && (c += V * a), s && (c += e.height), c <= r.width;
|
|
183
183
|
}, J = ({ numberSize: e, comparisonNumberSize: t, numberProps: n, elementSize: r }) => {
|
|
184
184
|
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);
|
|
185
185
|
return o && (s += e.height), s <= r.height;
|
|
186
186
|
}, Y = 1.2, X = ({ number: e, comparisonNumber: t }, n, r) => {
|
|
187
|
-
let { numberStyle: i, comparisonStyle:
|
|
187
|
+
let { numberStyle: i, comparisonStyle: a } = n;
|
|
188
188
|
if (r.width === 0) return i.fontSize;
|
|
189
|
-
let
|
|
190
|
-
for (let
|
|
189
|
+
let o = g(), s = (a.relativeFontSizePercentage ?? c.relativeFontSizePercentage) / 100, l = 1;
|
|
190
|
+
for (let c = i.fontSize; c >= 1; --c) {
|
|
191
191
|
let u, d;
|
|
192
192
|
if (e && (u = {
|
|
193
|
-
width:
|
|
194
|
-
size:
|
|
193
|
+
width: o.getTextSize({
|
|
194
|
+
size: c,
|
|
195
195
|
label: e,
|
|
196
196
|
fontFamily: i.fontFamily,
|
|
197
197
|
letterSpacing: "0.05em",
|
|
198
198
|
fontWeight: 400
|
|
199
199
|
}).width,
|
|
200
|
-
height:
|
|
200
|
+
height: c * Y
|
|
201
201
|
}), t) {
|
|
202
|
-
let e =
|
|
202
|
+
let e = c * s;
|
|
203
203
|
d = {
|
|
204
|
-
width:
|
|
204
|
+
width: o.getTextSize({
|
|
205
205
|
size: e,
|
|
206
206
|
label: t,
|
|
207
|
-
fontFamily:
|
|
207
|
+
fontFamily: a.fontFamily,
|
|
208
208
|
letterSpacing: "0.05em",
|
|
209
209
|
fontWeight: 400
|
|
210
210
|
}).width,
|
|
@@ -216,33 +216,33 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
216
216
|
comparisonNumberSize: d,
|
|
217
217
|
numberProps: n,
|
|
218
218
|
elementSize: r,
|
|
219
|
-
fontSize:
|
|
219
|
+
fontSize: c
|
|
220
220
|
}) && J({
|
|
221
221
|
numberSize: u,
|
|
222
222
|
comparisonNumberSize: d,
|
|
223
223
|
numberProps: n,
|
|
224
224
|
elementSize: r,
|
|
225
|
-
fontSize:
|
|
225
|
+
fontSize: c
|
|
226
226
|
})) {
|
|
227
|
-
l =
|
|
227
|
+
l = c;
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
return
|
|
232
|
-
}, Z =
|
|
233
|
-
let [
|
|
231
|
+
return o.cleanDOM(), l;
|
|
232
|
+
}, Z = m(), Q = p((0, S.memo)(({ vSpec: e, vTheme: t, elementSize: n, data: r, vizProperties: i }) => {
|
|
233
|
+
let [a, o] = (0, S.useState)(0), s = L(), l = v(), u = A(e, t, r), { numberValue: d, numberFormat: f, comparisonNumberValue: p, comparisonFormat: m, backgroundColor: h } = u, g = a, _ = f ? y(f, a) : a, x = m ? y(m, p) : p, C = _ === "" || _ == null, w = C ? void 0 : `${_}`, T = x === "" || x == null ? void 0 : `${x}`, E = C ? u.numberStyle.fontSize || 14 : X({
|
|
234
234
|
number: w,
|
|
235
235
|
comparisonNumber: T
|
|
236
236
|
}, u, n);
|
|
237
237
|
return (0, S.useEffect)(() => {
|
|
238
238
|
let e;
|
|
239
|
-
return !i?.disable?.animations && typeof d == "number" ? (typeof g != "number" && (
|
|
239
|
+
return !i?.disable?.animations && typeof d == "number" ? (typeof g != "number" && (o(0), g = 0), e = B(d, g, o, !f)) : o(d), () => {
|
|
240
240
|
e && e();
|
|
241
241
|
};
|
|
242
242
|
}, [d]), (0, S.useEffect)(() => {
|
|
243
243
|
e && l();
|
|
244
244
|
}, [e]), /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
245
|
-
className:
|
|
245
|
+
className: s.mainContainer,
|
|
246
246
|
style: {
|
|
247
247
|
fontSize: `${E}px`,
|
|
248
248
|
alignItems: R(u.verticalAlign),
|
|
@@ -250,14 +250,14 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
250
250
|
backgroundColor: h
|
|
251
251
|
},
|
|
252
252
|
children: /* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
253
|
-
className:
|
|
253
|
+
className: s.numbersContainer,
|
|
254
254
|
style: {
|
|
255
255
|
alignItems: z(u),
|
|
256
256
|
flexDirection: G(u.comparisonPosition ?? u.iconPosition),
|
|
257
257
|
...U(u.comparisonGap, u.comparisonPosition)
|
|
258
258
|
},
|
|
259
259
|
children: [/* @__PURE__ */ (0, Z.jsxs)("div", {
|
|
260
|
-
className:
|
|
260
|
+
className: s.comparisonIconContainer,
|
|
261
261
|
style: {
|
|
262
262
|
alignItems: R(u.textAlign),
|
|
263
263
|
flexDirection: G(u.iconPosition)
|
|
@@ -272,7 +272,7 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
272
272
|
}), /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
273
273
|
"data-testid": "number-comparison",
|
|
274
274
|
style: {
|
|
275
|
-
fontSize: `${(u.comparisonStyle.relativeFontSizePercentage ??
|
|
275
|
+
fontSize: `${(u.comparisonStyle.relativeFontSizePercentage ?? c.relativeFontSizePercentage) / 100}em`,
|
|
276
276
|
fontFamily: u.comparisonStyle.fontFamily,
|
|
277
277
|
fontStyle: u.comparisonStyle.italic ? "italic" : "normal",
|
|
278
278
|
fontWeight: u.comparisonStyle.weight || (u.comparisonStyle.bold ? "bold" : "normal"),
|
|
@@ -282,7 +282,7 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
282
282
|
children: T
|
|
283
283
|
})]
|
|
284
284
|
}), /* @__PURE__ */ (0, Z.jsx)("div", {
|
|
285
|
-
className:
|
|
285
|
+
className: s.number,
|
|
286
286
|
"data-testid": "number-base",
|
|
287
287
|
style: {
|
|
288
288
|
fontFamily: u.numberStyle.fontFamily,
|
|
@@ -291,7 +291,7 @@ var S = /* @__PURE__ */ e(m()), C = (e, n) => {
|
|
|
291
291
|
textDecoration: K(u.numberStyle.underlined, u.numberStyle.strikethrough),
|
|
292
292
|
color: u.numberColor
|
|
293
293
|
},
|
|
294
|
-
children: f && typeof
|
|
294
|
+
children: f && typeof a == "number" ? y(f, a) : a
|
|
295
295
|
})]
|
|
296
296
|
})
|
|
297
297
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as e, o as t, t as n } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { M as b, Q as x, St as S, Wt as C, X as w, Z as T,
|
|
5
|
-
import { t as j } from "./coloring-
|
|
2
|
+
import { Gn as r, Ja as i, Ks as a, Sa as o, Si as s, Xa as c, Ya as l, Ys as u, Za as d, fc as f } from "./isEqual-BDxAhUo8.js";
|
|
3
|
+
import { $t as p, Ei as m, On as h, P as g, Yi as _, d as v, o as y } from "./utils-Bg7K-t6K.js";
|
|
4
|
+
import { M as b, Q as x, St as S, Wt as C, X as w, Z as T, dn as E, i as D, j as O, rn as k, rt as A } from "./escobar-eDjtGpkC.js";
|
|
5
|
+
import { t as j } from "./coloring-B1XAfg6b.js";
|
|
6
6
|
import { n as M, t as N } from "./src-BOS6SqkZ.js";
|
|
7
7
|
var P = /* @__PURE__ */ n(((e, t) => {
|
|
8
8
|
(function(e, t, n) {
|
|
@@ -284,20 +284,20 @@ var P = /* @__PURE__ */ n(((e, t) => {
|
|
|
284
284
|
})), z = /* @__PURE__ */ n(((e, t) => {
|
|
285
285
|
var n = P(), r = ee(), i = te(), a = F(), o = I(), s = ne(), c = R();
|
|
286
286
|
c.alea = n, c.xor128 = r, c.xorwow = i, c.xorshift7 = a, c.xor4096 = o, c.tychei = s, t.exports = c;
|
|
287
|
-
})), re = /* @__PURE__ */ t(
|
|
287
|
+
})), re = /* @__PURE__ */ t(_()), B = .7, V = 12 * B, H = /* @__PURE__ */ function(e) {
|
|
288
288
|
return e.RenderDone = "render-done", e;
|
|
289
289
|
}({}), U = /* @__PURE__ */ function(e) {
|
|
290
290
|
return e.Minimum = "Minimum", e;
|
|
291
291
|
}({}), W = /* @__PURE__ */ function(e) {
|
|
292
292
|
return e.collectionKey = "coll", e.measureValue = "size", e;
|
|
293
293
|
}({}), G = (e, t, n) => {
|
|
294
|
-
let r = e.dimensions.filter((e) =>
|
|
294
|
+
let r = e.dimensions.filter((e) => s(e)), i = e.measures.filter((e) => s(e)), a = b((e.supportingMeasures ?? []).filter((e) => s(e)));
|
|
295
295
|
if (!r[0] || !i[0]) return n;
|
|
296
|
-
let
|
|
296
|
+
let o = f(r[0].dataItem), c = f(i[0].dataItem), l = [{
|
|
297
297
|
key: "coll",
|
|
298
298
|
data: {
|
|
299
299
|
extract: [{
|
|
300
|
-
field:
|
|
300
|
+
field: o,
|
|
301
301
|
props: {
|
|
302
302
|
size: { field: c },
|
|
303
303
|
[c]: { field: c },
|
|
@@ -314,18 +314,18 @@ var P = /* @__PURE__ */ n(((e, t) => {
|
|
|
314
314
|
}, K = /* @__PURE__ */ function(e) {
|
|
315
315
|
return e.size = "size", e.gradient = "gradient", e;
|
|
316
316
|
}({}), q = (e, t, n) => {
|
|
317
|
-
let r = e.dimensions.filter((e) =>
|
|
317
|
+
let r = e.dimensions.filter((e) => s(e)), i = e.measures.filter((e) => s(e));
|
|
318
318
|
if (!r[0] || !i[0]) return n;
|
|
319
|
-
let a = { size: { data: { field:
|
|
319
|
+
let a = { size: { data: { field: f(i[0].dataItem) } } };
|
|
320
320
|
return a = S(e, t, a), {
|
|
321
321
|
...n,
|
|
322
322
|
scales: a
|
|
323
323
|
};
|
|
324
|
-
}, J = (e, t, n,
|
|
325
|
-
let
|
|
324
|
+
}, J = (e, t, n, a, o, c, l, u) => e.filter(s).map((e, a) => {
|
|
325
|
+
let o = Object.keys(t.data).find((n) => t.data[n]?.source?.field === f(e.dataItem)), s = (t.data[String(o)] || t.data[`measure${a}`])?.value, c = r(e) || e.label || e.dataItem.name || "", l = u && !i(e.formatter) ? A(e.formatter) : e.formatter;
|
|
326
326
|
return {
|
|
327
|
-
label:
|
|
328
|
-
value:
|
|
327
|
+
label: c,
|
|
328
|
+
value: l ? n.formatter(l)(s, void 0, t.data) : s
|
|
329
329
|
};
|
|
330
330
|
}), Y = (e, t, n, r, i) => {
|
|
331
331
|
let a = {
|
|
@@ -337,14 +337,14 @@ var P = /* @__PURE__ */ n(((e, t) => {
|
|
|
337
337
|
};
|
|
338
338
|
return a.extract = T(e, t, J, x), w(e, t, n, a, "tooltip", i);
|
|
339
339
|
}, ie = (e, t, n, r, i, a) => {
|
|
340
|
-
let
|
|
341
|
-
|
|
340
|
+
let o = e.measures.filter((e) => s(e)), c = new j(e, t, i?.[0]?.itemsNotAffectedByFiltering), l = f(o[0].dataItem), d = C([""], a);
|
|
341
|
+
d?.trigger.forEach((e) => e.propagation = "stop");
|
|
342
342
|
let p = {
|
|
343
343
|
key: "word-cloud",
|
|
344
|
-
type:
|
|
344
|
+
type: E.WordCloud,
|
|
345
345
|
data: { collection: W.collectionKey },
|
|
346
346
|
on: { [H.RenderDone]() {
|
|
347
|
-
a
|
|
347
|
+
a?.onRenderDone?.();
|
|
348
348
|
} },
|
|
349
349
|
layout: { minimumLayoutMode: U.Minimum },
|
|
350
350
|
settings: {
|
|
@@ -359,20 +359,20 @@ var P = /* @__PURE__ */ n(((e, t) => {
|
|
|
359
359
|
scale: K.size,
|
|
360
360
|
ref: W.measureValue
|
|
361
361
|
},
|
|
362
|
-
fill:
|
|
363
|
-
ref: e.coloring?.type ===
|
|
364
|
-
dataItemId: e.coloring?.type ===
|
|
365
|
-
overwriteSources: [
|
|
362
|
+
fill: c.getColorDefinition({
|
|
363
|
+
ref: e.coloring?.type === u.Gradient ? W.measureValue : c.MAIN_FIELD,
|
|
364
|
+
dataItemId: e.coloring?.type === u.Single ? l : void 0,
|
|
365
|
+
overwriteSources: [c.MAIN_FIELD]
|
|
366
366
|
})
|
|
367
367
|
}
|
|
368
368
|
},
|
|
369
|
-
brush:
|
|
369
|
+
brush: d || void 0
|
|
370
370
|
};
|
|
371
371
|
return {
|
|
372
372
|
...n,
|
|
373
373
|
components: [...n.components, p]
|
|
374
374
|
};
|
|
375
|
-
}, ae = class extends
|
|
375
|
+
}, ae = class extends O {
|
|
376
376
|
onRenderDone;
|
|
377
377
|
onChartUpdated;
|
|
378
378
|
constructor(e) {
|
|
@@ -387,7 +387,7 @@ var P = /* @__PURE__ */ n(((e, t) => {
|
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
389
|
preCompile(e) {
|
|
390
|
-
let t = e.dimensions.filter((e) =>
|
|
390
|
+
let t = e.dimensions.filter((e) => s(e)), n = e.measures.filter((e) => s(e)), r = t[0], i = n[0];
|
|
391
391
|
if (!r || !i) throw Error("Word cloud w/o a dimension or measure is not supported.");
|
|
392
392
|
}
|
|
393
393
|
postCompile(e) {
|
|
@@ -638,7 +638,7 @@ function pe(e, t, n) {
|
|
|
638
638
|
}
|
|
639
639
|
function me(e) {
|
|
640
640
|
return e.map((e) => ({
|
|
641
|
-
type:
|
|
641
|
+
type: k.Text,
|
|
642
642
|
text: e.text,
|
|
643
643
|
x: e.x,
|
|
644
644
|
y: e.y,
|
|
@@ -659,9 +659,9 @@ function me(e) {
|
|
|
659
659
|
}
|
|
660
660
|
var Q = {
|
|
661
661
|
fontFamily: "Arial",
|
|
662
|
-
fontScaling:
|
|
663
|
-
fontStyle:
|
|
664
|
-
fontWeight:
|
|
662
|
+
fontScaling: l.linear,
|
|
663
|
+
fontStyle: c.normal,
|
|
664
|
+
fontWeight: d.normal,
|
|
665
665
|
seed: 1,
|
|
666
666
|
maxNumChars: 32,
|
|
667
667
|
word: {
|
|
@@ -717,21 +717,21 @@ var Q = {
|
|
|
717
717
|
}
|
|
718
718
|
};
|
|
719
719
|
function ge(e) {
|
|
720
|
-
e.component(
|
|
720
|
+
e.component(E.WordCloud, he);
|
|
721
721
|
}
|
|
722
|
-
var $ =
|
|
723
|
-
let
|
|
722
|
+
var $ = m(), _e = () => {}, ve = p(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
|
|
723
|
+
let s = g(), c = v(), [l] = (0, re.useState)(() => new ae(c)), { activeKey: u } = y(), d = {
|
|
724
724
|
...i,
|
|
725
|
-
valuePickerMode: !!
|
|
726
|
-
},
|
|
727
|
-
...
|
|
728
|
-
onRenderDone:
|
|
729
|
-
},
|
|
730
|
-
return
|
|
725
|
+
valuePickerMode: !!u
|
|
726
|
+
}, f = t || o, p = l.compile(e, f, n, r, {
|
|
727
|
+
...d,
|
|
728
|
+
onRenderDone: c
|
|
729
|
+
}, a.WordCloud, s);
|
|
730
|
+
return p ? /* @__PURE__ */ (0, $.jsx)(h.Provider, {
|
|
731
731
|
value: _e,
|
|
732
|
-
children: /* @__PURE__ */ (0, $.jsx)(
|
|
733
|
-
config:
|
|
734
|
-
definition:
|
|
732
|
+
children: /* @__PURE__ */ (0, $.jsx)(D, {
|
|
733
|
+
config: d,
|
|
734
|
+
definition: p,
|
|
735
735
|
size: r,
|
|
736
736
|
vSpec: e,
|
|
737
737
|
escobarPlugins: [ge]
|