@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,11 +1,11 @@
|
|
|
1
1
|
import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Ht as f, N as p, Ut as m, ci as h, jt as g, zr as _ } from "./utils-
|
|
4
|
-
import {
|
|
2
|
+
import { Fc as n, Ks as r, Lo as i, Oa as a, Qa as o, Qr as s, Ys as c, sa as l, yc as u, za as d } from "./visualization-filters-D7i6oh1Z.js";
|
|
3
|
+
import { Ht as f, N as p, Ut as m, ci as h, jt as g, zr as _ } from "./utils-DganVptf.js";
|
|
4
|
+
import { g_ as v } from "./handlers-C6CZ0XJA.js";
|
|
5
5
|
import { n as y } from "./label-format-type-C46pzgx7.js";
|
|
6
|
-
import "./logger-
|
|
7
|
-
import { At as b,
|
|
8
|
-
import { t as j } from "./coloring-
|
|
6
|
+
import "./logger-DdZpR7xZ.js";
|
|
7
|
+
import { At as b, Ct as x, L as S, Mt as C, N as ee, Qt as w, Ut as T, _ as E, bn as D, fn as te, gn as O, i as ne, kt as re, mn as k, on as ie, v as A } from "./escobar-CvEV2ES1.js";
|
|
8
|
+
import { t as j } from "./coloring-BtnPiQ_o.js";
|
|
9
9
|
import { t as M } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
10
10
|
var N = /* @__PURE__ */ e(h()), P = {
|
|
11
11
|
outerRadius: .95,
|
|
@@ -22,104 +22,104 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
22
22
|
gaugeCollectionKey: "Gauge-Collection"
|
|
23
23
|
}, F = (e) => e.gaugeSettings?.barMode ?? !1, I = (e) => e.gaugeSettings?.comparisonMode ?? !1, ae = (e) => {
|
|
24
24
|
let { coloring: t } = e || {};
|
|
25
|
-
return t?.type ===
|
|
26
|
-
}, L = (e, t,
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
let
|
|
30
|
-
return !
|
|
31
|
-
data: I(e) ? { extract: { field:
|
|
32
|
-
type:
|
|
33
|
-
padding:
|
|
34
|
-
} : I(e) || (
|
|
35
|
-
data: { fields:
|
|
25
|
+
return t?.type === u.Categorical || t?.type === u.Single ? b(e, []) ?? "" : C(e) ?? "";
|
|
26
|
+
}, L = (e, t, r) => {
|
|
27
|
+
let a = { ...re(M(e, ae(e) ?? ""), t, {}) }, o = e.gaugeSettings?.barPadding ?? O.scale.padding;
|
|
28
|
+
a = ee(e, a, o);
|
|
29
|
+
let c = e.dimensions.filter(s), l = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
|
|
30
|
+
return !c.length && F(e) ? a.onlyMeasures = {
|
|
31
|
+
data: I(e) ? { extract: { field: l[0] ? n(l[0].dataItem) : "" } } : l.map((e) => n(e.dataItem)),
|
|
32
|
+
type: k.Band,
|
|
33
|
+
padding: o
|
|
34
|
+
} : I(e) || (a.onlyMeasures = {
|
|
35
|
+
data: { fields: l.map((e) => n(e.dataItem)) },
|
|
36
36
|
include: [0],
|
|
37
37
|
expand: .05
|
|
38
|
-
}), F(e) && (
|
|
38
|
+
}), F(e) && (a.barScale = {
|
|
39
39
|
min: P.minScaleValue - P.scalePadding,
|
|
40
40
|
max: P.maxScaleValue + P.scalePadding,
|
|
41
41
|
invert: e.gaugeSettings?.orientation === i.Vertical
|
|
42
42
|
}), {
|
|
43
|
-
...
|
|
44
|
-
scales:
|
|
43
|
+
...r,
|
|
44
|
+
scales: a
|
|
45
45
|
};
|
|
46
|
-
}, R = (e, t,
|
|
47
|
-
if (!
|
|
48
|
-
let
|
|
49
|
-
if (!g) return
|
|
46
|
+
}, R = (e, t, r, i, a) => {
|
|
47
|
+
if (!a) return r;
|
|
48
|
+
let o = e.dimensions.filter(s), c = e.measures.filter(s), l = A((e.supportingMeasures ?? []).filter(s)), u = c.filter((e) => e.role === d.GAUGE_VALUE), f = o[0], p = u[0], { targetType: m } = e.gaugeSettings ?? {}, h = F(e), g = f?.dataItem ?? p?.dataItem;
|
|
49
|
+
if (!g) return r;
|
|
50
50
|
let _ = [], v = P.minScaleValue;
|
|
51
|
-
if (I(e) ? _.push(...B(e, g,
|
|
52
|
-
let t =
|
|
53
|
-
field:
|
|
51
|
+
if (I(e) ? _.push(...B(e, g, a, l)) : f ? _.push(...z(e, g, a, l)) : _.push(...V(e, a, l)), h) {
|
|
52
|
+
let t = n(p.dataItem), r = {
|
|
53
|
+
field: n(g),
|
|
54
54
|
props: {
|
|
55
55
|
actual: { field: t },
|
|
56
56
|
color: t,
|
|
57
57
|
start: v,
|
|
58
58
|
end: P.maxScaleValue,
|
|
59
59
|
background: !0,
|
|
60
|
-
...
|
|
60
|
+
...l
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
(m === y.Data || m === y.Manual) && (
|
|
64
|
-
|
|
65
|
-
let t = `measure-${
|
|
66
|
-
|
|
67
|
-
}), _.push(
|
|
63
|
+
(m === y.Data || m === y.Manual) && (r.props ??= {}, r.props.target = W(e, a)), c.forEach((e) => {
|
|
64
|
+
r.props ??= {};
|
|
65
|
+
let t = `measure-${n(e.dataItem)}`;
|
|
66
|
+
r.props[t] = { field: n(e.dataItem) };
|
|
67
|
+
}), _.push(r);
|
|
68
68
|
}
|
|
69
69
|
let b = [{
|
|
70
70
|
key: P.gaugeCollectionKey,
|
|
71
71
|
data: { extract: _ }
|
|
72
72
|
}];
|
|
73
73
|
return {
|
|
74
|
-
...
|
|
74
|
+
...r,
|
|
75
75
|
collections: b
|
|
76
76
|
};
|
|
77
|
-
}, z = (e, t,
|
|
78
|
-
let
|
|
77
|
+
}, z = (e, t, r, i) => {
|
|
78
|
+
let a = e.measures.filter(s), o = a.filter((e) => e.role === d.GAUGE_VALUE), c = a.filter((e) => e.role === d.GAUGE_TARGET), l = o[0], u = c[0], { targetType: f } = e.gaugeSettings, p = F(e), m = [], h = n(l.dataItem);
|
|
79
79
|
return p || m.push({
|
|
80
|
-
field:
|
|
80
|
+
field: n(t),
|
|
81
81
|
props: {
|
|
82
82
|
actual: { field: h },
|
|
83
83
|
[h]: { field: h },
|
|
84
84
|
color: h,
|
|
85
|
-
...
|
|
85
|
+
...i
|
|
86
86
|
}
|
|
87
87
|
}), m.push({
|
|
88
|
-
field:
|
|
88
|
+
field: n(t),
|
|
89
89
|
props: {
|
|
90
90
|
actual: { field: h },
|
|
91
91
|
start: p ? P.minScaleValue : void 0,
|
|
92
|
-
end: p ? { getValue: H(e,
|
|
92
|
+
end: p ? { getValue: H(e, r) } : void 0,
|
|
93
93
|
[h]: { field: h },
|
|
94
94
|
color: h,
|
|
95
|
-
...
|
|
95
|
+
...i
|
|
96
96
|
}
|
|
97
97
|
}), (f === y.Data || f === y.Manual) && m.forEach((t) => {
|
|
98
|
-
t.props ??= {}, t.props.target = W(e,
|
|
98
|
+
t.props ??= {}, t.props.target = W(e, r), u && f === y.Data && (t.props[n(u.dataItem)] = { field: n(u.dataItem) });
|
|
99
99
|
}), m;
|
|
100
|
-
}, B = (e, t,
|
|
101
|
-
let
|
|
102
|
-
let
|
|
103
|
-
return e[
|
|
100
|
+
}, B = (e, t, r, i) => {
|
|
101
|
+
let a = F(e), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = o.reduce((e, t) => {
|
|
102
|
+
let r = n(t.dataItem);
|
|
103
|
+
return e[r] = { field: r }, e;
|
|
104
104
|
}, {});
|
|
105
|
-
return
|
|
106
|
-
let
|
|
105
|
+
return o.map((o, s) => {
|
|
106
|
+
let l = n(o.dataItem);
|
|
107
107
|
return {
|
|
108
|
-
field:
|
|
108
|
+
field: n(t),
|
|
109
109
|
props: {
|
|
110
|
-
measure: { field:
|
|
111
|
-
color:
|
|
112
|
-
start:
|
|
113
|
-
end:
|
|
114
|
-
...
|
|
115
|
-
...
|
|
110
|
+
measure: { field: l },
|
|
111
|
+
color: l,
|
|
112
|
+
start: a ? P.minScaleValue : void 0,
|
|
113
|
+
end: a ? { getValue: H(e, r, s) } : void 0,
|
|
114
|
+
...c,
|
|
115
|
+
...i
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
|
-
}, V = (e, t,
|
|
120
|
-
let
|
|
121
|
-
return e.measures.filter(s).filter((e) => e.role ===
|
|
122
|
-
let s = o
|
|
119
|
+
}, V = (e, t, r) => {
|
|
120
|
+
let i = F(e), a = [];
|
|
121
|
+
return e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE).forEach((o) => {
|
|
122
|
+
let s = n(o.dataItem), c = t[0].items[0][s], l = W(e, t, o), u = [];
|
|
123
123
|
u.push({
|
|
124
124
|
field: s,
|
|
125
125
|
props: {
|
|
@@ -127,10 +127,10 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
127
127
|
measure: { field: s },
|
|
128
128
|
actual: { field: s },
|
|
129
129
|
color: s,
|
|
130
|
-
start:
|
|
131
|
-
end:
|
|
130
|
+
start: i ? P.minScaleValue : void 0,
|
|
131
|
+
end: i && typeof c == "number" && typeof l == "number" ? U(c, l) : void 0,
|
|
132
132
|
[s]: { field: s },
|
|
133
|
-
...
|
|
133
|
+
...r
|
|
134
134
|
}
|
|
135
135
|
}), u.push({
|
|
136
136
|
field: s,
|
|
@@ -139,48 +139,48 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
139
139
|
measure: { field: s },
|
|
140
140
|
actual: { field: s },
|
|
141
141
|
color: s,
|
|
142
|
-
start:
|
|
143
|
-
end:
|
|
142
|
+
start: i ? P.minScaleValue : void 0,
|
|
143
|
+
end: i ? P.maxScaleValue : void 0,
|
|
144
144
|
background: !0,
|
|
145
145
|
[s]: { field: s },
|
|
146
|
-
...
|
|
146
|
+
...r
|
|
147
147
|
}
|
|
148
148
|
}), (e.gaugeSettings?.targetType ?? y.Auto) !== y.Auto && u.forEach((e) => {
|
|
149
149
|
e.props ??= {}, e.props.target = l;
|
|
150
|
-
}),
|
|
151
|
-
}),
|
|
152
|
-
}, H = (e, t,
|
|
153
|
-
let
|
|
154
|
-
return (
|
|
150
|
+
}), a.push(...u);
|
|
151
|
+
}), a;
|
|
152
|
+
}, H = (e, t, r) => {
|
|
153
|
+
let i = e.measures.filter(s), a = i.filter((e) => e.role === d.GAUGE_VALUE), o = i.filter((e) => e.role === d.GAUGE_TARGET), c = a[0], l = o[0];
|
|
154
|
+
return (i, o, s) => {
|
|
155
155
|
if (!s) return P.minScaleValue;
|
|
156
|
-
let
|
|
156
|
+
let u = a.find((e, t) => t === r), d = u && s[n(u.dataItem)];
|
|
157
157
|
if (typeof d == "number" && d < 0) return P.minScaleValue;
|
|
158
|
-
let f = s[
|
|
159
|
-
if (p = e.gaugeSettings?.targetType === y.Data ? s[
|
|
160
|
-
if (!I(e) ||
|
|
158
|
+
let f = s[n(c.dataItem)], p;
|
|
159
|
+
if (p = e.gaugeSettings?.targetType === y.Data ? s[n(l?.dataItem)] : W(e, t), typeof f != "number" || typeof p != "number") return P.minScaleValue;
|
|
160
|
+
if (!I(e) || r === void 0) return U(f, p);
|
|
161
161
|
let m = 0, h = 0;
|
|
162
|
-
return
|
|
163
|
-
let
|
|
164
|
-
m +=
|
|
162
|
+
return a.forEach((e, t) => {
|
|
163
|
+
let i = Math.max(0, s[n(e.dataItem)]);
|
|
164
|
+
m += i, t <= r && (h += i);
|
|
165
165
|
}), h / m * P.maxScaleValue;
|
|
166
166
|
};
|
|
167
167
|
}, U = (e, t) => {
|
|
168
168
|
let n = t ? Math.max(0, e) / t : 1;
|
|
169
169
|
return Math.min(n, 1) * P.maxScaleValue;
|
|
170
|
-
}, W = (e, t,
|
|
171
|
-
let { targetType:
|
|
172
|
-
return
|
|
170
|
+
}, W = (e, t, r) => {
|
|
171
|
+
let { targetType: i, targetValue: a } = e.gaugeSettings, o = e.measures.filter(s), c = o.filter((e) => e.role === d.GAUGE_TARGET)[0];
|
|
172
|
+
return i === y.Auto ? t[0].items.map((e) => o.map((t) => e[n(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + O.scale.padding) : c && i === y.Data ? { field: n(c.dataItem) } : r && i === y.PerMeasure ? r.targetValue ?? 0 : i === y.Manual ? a ?? 0 : 0;
|
|
173
173
|
}, G = {
|
|
174
174
|
Foreground: "foreground",
|
|
175
175
|
Background: "background"
|
|
176
|
-
}, K = (e, t, n = 0) => `${e}-${t}-${n}`, q = (e) => Math.min(P.maxBarWidthOfRadius, P.outerRadius / e), oe = (e, t,
|
|
177
|
-
let
|
|
178
|
-
return (e) =>
|
|
179
|
-
}, J = (e, t) => !t || e.coloring?.type ===
|
|
180
|
-
let
|
|
176
|
+
}, K = (e, t, n = 0) => `${e}-${t}-${n}`, q = (e) => Math.min(P.maxBarWidthOfRadius, P.outerRadius / e), oe = (e, t, r) => {
|
|
177
|
+
let i = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
|
|
178
|
+
return (e) => r !== void 0 && e.measure?.source?.field !== n(i[r]?.dataItem) ? !1 : e.background?.value ? t === G.Background : t === G.Foreground;
|
|
179
|
+
}, J = (e, t) => !t || e.coloring?.type === u.Single ? !1 : !I(e) || e.coloring?.type === u.Categorical, Y = (e, t, r, i, a, o, c, l) => {
|
|
180
|
+
let u = r.dimensions.filter(s)[0], f = new j(r, i, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(J(r, u) ? { ref: f.MAIN_FIELD } : {}), m = (e, t = 0) => !I(r) && t === 1 || o && I(r) ? "transparent" : typeof p == "function" ? p(e) : p, h = q(c), g = Number(r.gaugeSettings?.size), _ = Number(r.gaugeSettings?.startAngle), v = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + v, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
|
|
181
181
|
return {
|
|
182
|
-
key: K(
|
|
183
|
-
type:
|
|
182
|
+
key: K(D.Pie, o ? G.Background : G.Foreground, a),
|
|
183
|
+
type: D.Pie,
|
|
184
184
|
animations: {
|
|
185
185
|
enabled: !0,
|
|
186
186
|
presetId: "pie-chart"
|
|
@@ -188,27 +188,27 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
188
188
|
data: {
|
|
189
189
|
collection: P.gaugeCollectionKey,
|
|
190
190
|
filter: (t) => {
|
|
191
|
-
if (!
|
|
192
|
-
let e =
|
|
193
|
-
return I(
|
|
191
|
+
if (!u) {
|
|
192
|
+
let e = r.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
|
|
193
|
+
return I(r) || e[a] && t.measure?.source?.field === n(e[a].dataItem);
|
|
194
194
|
}
|
|
195
|
-
return `${t.value}` == `${e[
|
|
195
|
+
return `${t.value}` == `${e[n(u.dataItem)]}`;
|
|
196
196
|
}
|
|
197
197
|
},
|
|
198
198
|
settings: {
|
|
199
199
|
startAngle: S,
|
|
200
200
|
endAngle: C,
|
|
201
201
|
slice: {
|
|
202
|
-
cornerRadius:
|
|
203
|
-
outerRadius: P.outerRadius -
|
|
204
|
-
innerRadius: P.outerRadius - (
|
|
202
|
+
cornerRadius: r.gaugeSettings?.cornerRadius ?? 10,
|
|
203
|
+
outerRadius: P.outerRadius - a * h,
|
|
204
|
+
innerRadius: P.outerRadius - (a + (1 - P.barWidthRadiusPadding)) * h,
|
|
205
205
|
fill: m,
|
|
206
206
|
strokeWidth: .1,
|
|
207
|
-
opacity:
|
|
207
|
+
opacity: o ? P.backgroundBarOpacity : 1,
|
|
208
208
|
arc: (e, t = 0) => {
|
|
209
|
-
if (
|
|
210
|
-
if (I(
|
|
211
|
-
if ((
|
|
209
|
+
if (o) return +(t === 0);
|
|
210
|
+
if (I(r)) return e.datum.measure.value;
|
|
211
|
+
if ((r.gaugeSettings.targetType ?? y.Auto) !== y.Auto) return t === 0 ? e.datum.actual.value : Number(e.datum.target.value) - Number(e.datum.actual.value);
|
|
212
212
|
{
|
|
213
213
|
let n = e.resources.scale("onlyMeasures"), r = Number(n(e.datum.actual.value)) || 0;
|
|
214
214
|
return t === 0 ? r : 1 - r;
|
|
@@ -216,18 +216,18 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
brush: w([""],
|
|
219
|
+
brush: w([""], l, { overwriteOpacity: o ? P.backgroundBarOpacity : void 0 })
|
|
220
220
|
};
|
|
221
|
-
}, X = (e, t, r,
|
|
221
|
+
}, X = (e, t, r, o, c, l) => {
|
|
222
222
|
let u = e.dimensions.filter(s)[0], d = new j(e, t, r?.[0]?.itemsNotAffectedByFiltering), f;
|
|
223
|
-
f =
|
|
224
|
-
let p = u ?
|
|
225
|
-
key: K(
|
|
226
|
-
type:
|
|
223
|
+
f = o === G.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(J(e, u) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && o === G.Background ? P.backgroundBarOpacity : void 0);
|
|
224
|
+
let p = u ? n(u.dataItem) : "onlyMeasures", m = !u && !I(e) ? "measureValue" : void 0, h = {
|
|
225
|
+
key: K(D.Box, o, c),
|
|
226
|
+
type: D.Box,
|
|
227
227
|
animations: { enabled: !0 },
|
|
228
228
|
data: {
|
|
229
229
|
collection: P.gaugeCollectionKey,
|
|
230
|
-
filter: oe(e,
|
|
230
|
+
filter: oe(e, o, c)
|
|
231
231
|
},
|
|
232
232
|
settings: {
|
|
233
233
|
orientation: e.gaugeSettings.orientation ?? i.Horizontal,
|
|
@@ -242,14 +242,14 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
242
242
|
rx: e.gaugeSettings?.barRadius ?? 0
|
|
243
243
|
}
|
|
244
244
|
},
|
|
245
|
-
brush: w([""], l, { disable: { triggers:
|
|
245
|
+
brush: w([""], l, { disable: { triggers: o === G.Foreground } })
|
|
246
246
|
};
|
|
247
247
|
if (e.gaugeSettings?.strokeEnabled) {
|
|
248
248
|
let n = h.settings;
|
|
249
249
|
n && (n.box.stroke = e.gaugeSettings?.strokeColor || t.colors.brandColors[0], n.box.strokeWidth = e.gaugeSettings?.strokeWidth);
|
|
250
250
|
} else {
|
|
251
251
|
let e = h.settings;
|
|
252
|
-
e && (e.box.stroke =
|
|
252
|
+
e && (e.box.stroke = a.transparent);
|
|
253
253
|
}
|
|
254
254
|
return h;
|
|
255
255
|
}, se = (e, t, n, r, i, a) => {
|
|
@@ -260,16 +260,16 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
260
260
|
components: [...n.components, ...o]
|
|
261
261
|
};
|
|
262
262
|
}, ce = (e, t, n, r, i) => {
|
|
263
|
-
let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role ===
|
|
263
|
+
let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
|
|
264
264
|
return !a[0] && !I(e) ? o.map((n, i) => [Y(r[0].items[0], r, e, t, i, !0, o.length), Y(r[0].items[0], r, e, t, i, !1, o.length)]).reduce((e, t) => e.concat(t), []) : r[0].items.map((n, a) => [Y(n, r, e, t, a, !0, r[0].items.length, i), Y(n, r, e, t, a, !1, r[0].items.length, i)]).reduce((e, t) => e.concat(t), []);
|
|
265
265
|
}, Z = (e, t, n, r, i) => {
|
|
266
|
-
let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role ===
|
|
267
|
-
if (I(e)) for (let n = o.length - 1; n >= 0; n--)
|
|
268
|
-
else if (
|
|
269
|
-
else for (let n = o.length - 1; n >= 0; n--)
|
|
270
|
-
return
|
|
266
|
+
let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = a[0], l = [];
|
|
267
|
+
if (I(e)) for (let n = o.length - 1; n >= 0; n--) l.push(X(e, t, r, G.Foreground, n, i));
|
|
268
|
+
else if (c) l = [X(e, t, r, G.Background, void 0, i), X(e, t, r, G.Foreground, void 0, i)];
|
|
269
|
+
else for (let n = o.length - 1; n >= 0; n--) l.push(X(e, t, r, G.Background, n)), l.push(X(e, t, r, G.Foreground, n));
|
|
270
|
+
return l;
|
|
271
271
|
}, le = (e, t, n) => {
|
|
272
|
-
let r = e.dimensions.filter(s), i = e.measures.filter(s).filter((e) => e.role ===
|
|
272
|
+
let r = e.dimensions.filter(s), i = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE);
|
|
273
273
|
if (!e.gaugeSettings?.barMode || !r.length && e.gaugeSettings?.comparisonMode) return n;
|
|
274
274
|
let a = [];
|
|
275
275
|
return r.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && r[0] && a.push(Q(!1, t, r[0].formatter, "dimension", void 0, e.gaugeSettings)), !e.gaugeSettings?.comparisonMode && e.gaugeSettings?.showValueLabels !== !1 && i[0] && a.push(Q(!0, t, i[0].formatter, "value", void 0, e.gaugeSettings))) : e.gaugeSettings?.showValueLabels !== !1 && i.forEach((n, r) => {
|
|
@@ -283,7 +283,7 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
283
283
|
type: "bar",
|
|
284
284
|
settings: {
|
|
285
285
|
direction: o?.orientation === i.Vertical ? "up" : "right",
|
|
286
|
-
fontSize:
|
|
286
|
+
fontSize: ie(o?.labelFontSize),
|
|
287
287
|
fontFamily: t.fonts.general.fontFamily,
|
|
288
288
|
labels: [{
|
|
289
289
|
label: (t) => t.data ? e ? ue(t.data.actual.value, n, t) : `${m(n, t.data?.label)}` : "",
|
|
@@ -304,12 +304,12 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
return {
|
|
307
|
-
type:
|
|
307
|
+
type: D.Labels,
|
|
308
308
|
key: `gauge-bar-labels-${r}`,
|
|
309
|
-
layout: { displayOrder:
|
|
309
|
+
layout: { displayOrder: T.Labels },
|
|
310
310
|
settings: { sources: [{
|
|
311
|
-
component: K(
|
|
312
|
-
selector:
|
|
311
|
+
component: K(D.Box, G.Foreground, a),
|
|
312
|
+
selector: te.Rect,
|
|
313
313
|
strategy: c
|
|
314
314
|
}] },
|
|
315
315
|
animations: {
|
|
@@ -317,17 +317,17 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
317
317
|
presetId: "chart-labels"
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
|
-
}, ue = (e, t, n) => e === null ? "-" : typeof t != "string" &&
|
|
320
|
+
}, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && o(t) ? f(t.format, t)(e, void 0, n.data) : `${m(t, e)}`, de = (e, t, n, r) => x(e, t, n, r), fe = (e, t, n, r, i) => {
|
|
321
321
|
if (!i) return n;
|
|
322
|
-
let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role ===
|
|
323
|
-
return
|
|
322
|
+
let a = e.dimensions.filter(s), o = e.measures.filter(s).filter((e) => e.role === d.GAUGE_VALUE), c = a[0], l = F(e), u = I(e), f = l ? D.Box : D.Pie, p = l && !u ? G.Background : G.Foreground, m = ((l || !c ? o : i[0]?.items) || []).map((e, t) => K(f, p, t));
|
|
323
|
+
return S(e, t, n, {
|
|
324
324
|
filter: (e) => e.filter((e) => m.findIndex((t) => t === e.key) !== -1),
|
|
325
325
|
placement: {
|
|
326
|
-
type:
|
|
326
|
+
type: l ? "bounds" : "slice",
|
|
327
327
|
area: "target"
|
|
328
328
|
}
|
|
329
329
|
});
|
|
330
|
-
}, pe = class extends
|
|
330
|
+
}, pe = class extends E {
|
|
331
331
|
constructor() {
|
|
332
332
|
super([
|
|
333
333
|
R,
|
|
@@ -339,14 +339,14 @@ var N = /* @__PURE__ */ e(h()), P = {
|
|
|
339
339
|
]);
|
|
340
340
|
}
|
|
341
341
|
preCompile(e) {
|
|
342
|
-
if (!(e.measures ?? []).filter(s).filter((e) => e.role ===
|
|
342
|
+
if (!(e.measures ?? []).filter(s).filter((e) => e.role === d.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
|
|
343
343
|
}
|
|
344
|
-
}, me = _(), $ = g(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties:
|
|
345
|
-
let
|
|
346
|
-
if (!e || !(
|
|
347
|
-
let
|
|
344
|
+
}, me = _(), $ = g(({ vSpec: e, vTheme: t, data: n, elementSize: i, vizProperties: a }) => {
|
|
345
|
+
let o = p(), [s] = (0, N.useState)(() => new pe());
|
|
346
|
+
if (!e || !(c(e) || r(e)) || !i) return null;
|
|
347
|
+
let u = t || l, d = s.compile(e, u, n, i, a, e.type, o);
|
|
348
348
|
return d ? /* @__PURE__ */ (0, me.jsx)(ne, {
|
|
349
|
-
config:
|
|
349
|
+
config: a,
|
|
350
350
|
definition: d,
|
|
351
351
|
size: i,
|
|
352
352
|
vSpec: e
|