@astrato-io/visualizations 0.6.5 → 0.8.0
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/README.md +8 -2
- package/THIRD_PARTY_NOTICES.md +2 -229
- package/VISUALIZATION_DEFINITIONS.md +68 -114
- package/chunks/Button-BrGKp9Nm.js +110 -0
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
- package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
- package/chunks/{LinearProgress-B1FeWaen.js → LinearProgress-VtfFx2vJ.js} +55 -55
- package/chunks/MenuOption-ByRqhRdX.js +3934 -0
- package/chunks/Title-CO5dP1ma.js +1691 -0
- package/chunks/ToggleButton-KOBAimC1.js +112 -0
- package/chunks/{app-filter-bar.compiler-BGJ7HAbr.js → app-filter-bar.compiler-TwVTeoj5.js} +10 -10
- package/chunks/{bar.compiler-CT0ZbQKc.js → bar.compiler-DuQg8EUb.js} +84 -84
- package/chunks/builder-DEDvNq1k.js +201 -0
- package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
- package/chunks/color-settings-3VRlf_Vw.js +6 -0
- package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
- package/chunks/coloring-CncX_JRX.js +278 -0
- package/chunks/{definitions-D3OVqmXl.js → definitions-BPJQTx16.js} +490 -382
- package/chunks/{escobar-eDjtGpkC.js → escobar-DRhRMYRE.js} +6067 -4742
- package/chunks/event-bus-CrLB-Y8z.js +3 -0
- package/chunks/extend-preset-CUFNpmPe.js +4398 -0
- package/chunks/{filter.compiler-DBsyRBJt.js → filter.compiler-w27dlv0C.js} +12 -12
- package/chunks/{filtering-tqjAyJH5.js → filtering-cc7WqWpg.js} +391 -310
- package/chunks/{handlers-VTBfIZYZ.js → handlers-TOT-7INo.js} +3241 -3442
- package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
- package/chunks/isEqual-B8loyPsC.js +12 -0
- package/chunks/label-format-type-weq1XfcX.js +8 -0
- package/chunks/{line.compiler-CzdM5Ld0.js → line.compiler-Ct1WhN2p.js} +27 -27
- package/chunks/logger-DpQtYQnX.js +1163 -0
- package/chunks/lookup-BWllin0q.js +36 -0
- package/chunks/{metadata-BGElBy5Z.js → metadata-WABZrt7Y.js} +1 -1
- package/chunks/{number.compiler-G-R7y16P.js → number.compiler-D8TPly-4.js} +13 -13
- package/chunks/{operations-CTNUX6Sy.js → operations-Dh4v1Ovt.js} +9314 -9283
- package/chunks/{range-CiwTbMig.js → range-Bi-7zT0k.js} +2 -2
- package/chunks/render-wrappers-OEmtaM8g.js +2 -0
- package/chunks/{registry-CsQQzukD.js → requirements-Dvd8jqYF.js} +218 -222
- package/chunks/responsive.styles-DSiOGD7u.js +82 -0
- package/chunks/{shared-CBvcC5YV.js → shared-Bn4N5QcZ.js} +424 -424
- package/chunks/src-77e3mC7i.js +391 -0
- package/chunks/standalone-B55oyW6c.js +689 -0
- package/chunks/{standalone-C3gg736V.js → standalone-BDhPQtzQ.js} +375 -341
- package/chunks/{standalone-BMIbT1b2.js → standalone-BGkmozIb.js} +992 -837
- package/chunks/standalone-BMTCb10X.js +179 -0
- package/chunks/standalone-BXKRE_Se.js +468 -0
- package/chunks/standalone-Bes8srx1.js +354 -0
- package/chunks/standalone-BjZp0QMe.js +2 -0
- package/chunks/{standalone-JuLF-OoH.js → standalone-BlMIwpEe.js} +634 -519
- package/chunks/{standalone-C_rYnZ0N.js → standalone-C8ZAEutO.js} +43 -42
- package/chunks/standalone-C8qAelL4.js +2 -0
- package/chunks/standalone-CJvIXsQE.js +743 -0
- package/chunks/standalone-CLmGb7nn2.js +355 -0
- package/chunks/standalone-CM5XcAN5.js +52327 -0
- package/chunks/standalone-CXNP6-xD.js +420 -0
- package/chunks/{standalone-vzBY6q0I2.js → standalone-D5Q5ngsD.js} +57 -55
- package/chunks/standalone-DLlyRIE6.js +287 -0
- package/chunks/standalone-DMcI1afI.js +396 -0
- package/chunks/{standalone-DC-aUgXC.js → standalone-DN4S1MjT.js} +1111 -1092
- package/chunks/standalone-DT0wKji7.js +6 -0
- package/chunks/standalone-DW6NT205.js +518 -0
- package/chunks/standalone-DYQIQH4c.js +2095 -0
- package/chunks/standalone-D__XCp-h.js +1003 -0
- package/chunks/standalone-XTgSsTAa.js +354 -0
- package/chunks/{standalone-v1oxfU20.js → standalone-XuGksArp.js} +20 -20
- package/chunks/{standalone-0M4HlmDW2.js → standalone-vBnBS2YC.js} +1047 -964
- package/chunks/{standalone-BtSHCp2U2.js → standalone-we5D5MIn.js} +173 -168
- package/chunks/{table.compiler-tb914oj3.js → table.compiler-DMeeHxb6.js} +29 -29
- package/chunks/useFieldName-Cjn9KCVp.js +7 -0
- package/chunks/useSlotProps-DLbQp4lc.js +166 -0
- package/chunks/{utils-Bg7K-t6K.js → utils-vdmi_2PK.js} +6271 -7804
- package/chunks/{view-Bn83C8d9.js → view-BuwQugKb.js} +2717 -3504
- package/chunks/{isEqual-BDxAhUo8.js → visualization-filters-Cc4KU-l-.js} +1887 -1946
- package/chunks/with-html-element-D0uY2zjI.js +7328 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +31 -14
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +3 -3
- package/docs/operations/distribution-gauge.md +13 -13
- package/docs/operations/dot.md +13 -13
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +13 -13
- package/docs/operations/heatMap.md +13 -13
- 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 +3 -3
- package/docs/operations/line.md +7 -7
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +13 -13
- package/docs/operations/radar.md +7 -7
- package/docs/operations/sankey.md +13 -13
- package/docs/operations/scatter.md +13 -13
- 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 +18 -1
- package/docs/operations/tree.md +51 -37
- package/docs/operations/treemap.md +63 -49
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +13 -13
- package/getters.js +7 -7
- package/index.js +419 -417
- package/metadata.js +17 -18
- package/operations.js +13 -13
- package/package.json +70 -55
- package/src/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +53 -30
- package/src/definitions/model/definitions/index.d.ts +1 -1
- package/src/definitions/model/definitions/schema-registry.d.ts +2 -2
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +2 -2
- package/src/definitions/model/definitions/types/compilation.types.d.ts +10 -0
- package/src/definitions/model/definitions/types/index.d.ts +1 -1
- package/src/getters/index.d.ts +1 -1
- package/src/operations/index.d.ts +1 -1
- package/src/types.d.ts +1 -0
- package/chunks/ClickAwayListener-BbeNMAvj.js +0 -52
- package/chunks/builder-B6dWSIdD.js +0 -12289
- package/chunks/coloring-B1XAfg6b.js +0 -664
- package/chunks/events-WZut5Ow6.js +0 -4
- package/chunks/grouping-type-On4s9Thj.js +0 -3
- package/chunks/requirements-DYjZCFyf.js +0 -6
- package/chunks/standalone-0ashe9w1.js +0 -411
- package/chunks/standalone-B7jax8wa.js +0 -339
- package/chunks/standalone-BK0VYU-l.js +0 -463
- package/chunks/standalone-BZV5vOwA.js +0 -6
- package/chunks/standalone-BhDrWj4p.js +0 -1980
- package/chunks/standalone-BvaKdky9.js +0 -344
- package/chunks/standalone-BwtM31-f.js +0 -2
- package/chunks/standalone-CC1VUjO32.js +0 -299
- package/chunks/standalone-CoLrAxRV.js +0 -13198
- package/chunks/standalone-DCtRoTWg.js +0 -675
- package/chunks/standalone-DUDFTBqL.js +0 -833
- package/chunks/standalone-DhZkX9Td.js +0 -2
- package/chunks/standalone-DtLElfuM.js +0 -512
- package/chunks/standalone-G9Q4Uczu.js +0 -726
- package/chunks/standalone-_DeX21JJ.js +0 -383
- package/chunks/standalone-gFhKZh8m.js +0 -179
- package/chunks/standalone-tDNy-SFH.js +0 -281
- package/chunks/ui-DQWtv2iM.js +0 -63551
- package/chunks/useFieldName-BvdcoJRl.js +0 -7
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import { Fa as n, Ja as r, Ks as i, No as a, Sa as o, Si as s, Ta as c, Ys as l, fc as u } from "./isEqual-BDxAhUo8.js";
|
|
3
|
-
import { $t as d, Ei as f, P as p, Yi as m, hn as h, mn as g } from "./utils-Bg7K-t6K.js";
|
|
4
|
-
import { Pm as _, zm as v } from "./handlers-VTBfIZYZ.js";
|
|
5
|
-
import { Ct as y, Ft as b, Jt as x, K as S, M as C, St as w, Tt as ee, Wt as T, X as E, an as te, dn as D, gt as ne, i as O, j as k, rn as A, sn as j } from "./escobar-eDjtGpkC.js";
|
|
6
|
-
import { t as M } from "./coloring-B1XAfg6b.js";
|
|
7
|
-
import { t as re } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
8
|
-
var ie = /* @__PURE__ */ e(m()), N = {
|
|
9
|
-
outerRadius: .95,
|
|
10
|
-
cornerRadius: 10,
|
|
11
|
-
additionalTextAnchorHeight: 50,
|
|
12
|
-
barMinWidth: 1,
|
|
13
|
-
barMaxWidth: 200,
|
|
14
|
-
minScaleValue: 0,
|
|
15
|
-
maxScaleValue: 100,
|
|
16
|
-
scalePadding: 1,
|
|
17
|
-
backgroundBarOpacity: .2,
|
|
18
|
-
barWidthRadiusPadding: .2,
|
|
19
|
-
maxBarWidthOfRadius: .15,
|
|
20
|
-
gaugeCollectionKey: "Gauge-Collection"
|
|
21
|
-
}, P = (e) => e.gaugeSettings?.barMode ?? !1, F = (e) => e.gaugeSettings?.comparisonMode ?? !1, ae = (e) => {
|
|
22
|
-
let { coloring: t } = e || {};
|
|
23
|
-
return t?.type === l.Categorical || t?.type === l.Single ? y(e, []) : ee(e);
|
|
24
|
-
}, I = (e, t, r) => {
|
|
25
|
-
let i = { ...w(re(e, ae(e)), t, {}) }, o = e.gaugeSettings?.barPadding ?? j.scale.padding;
|
|
26
|
-
i = S(e, i, o);
|
|
27
|
-
let c = e.dimensions.filter(s), l = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
|
|
28
|
-
return !c.length && P(e) ? i.onlyMeasures = {
|
|
29
|
-
data: F(e) ? { extract: { field: l.length > 0 ? u(l[0].dataItem) : void 0 } } : l.map((e) => u(e.dataItem)),
|
|
30
|
-
type: te.Band,
|
|
31
|
-
padding: o
|
|
32
|
-
} : F(e) || (i.onlyMeasures = {
|
|
33
|
-
data: { fields: l.map((e) => u(e.dataItem)) },
|
|
34
|
-
include: [0],
|
|
35
|
-
expand: .05
|
|
36
|
-
}), P(e) && (i.barScale = {
|
|
37
|
-
min: N.minScaleValue - N.scalePadding,
|
|
38
|
-
max: N.maxScaleValue + N.scalePadding,
|
|
39
|
-
invert: e.gaugeSettings?.orientation === a.Vertical
|
|
40
|
-
}), {
|
|
41
|
-
...r,
|
|
42
|
-
scales: i
|
|
43
|
-
};
|
|
44
|
-
}, L = (e, t, r, i, a) => {
|
|
45
|
-
if (!a) return r;
|
|
46
|
-
let o = e.dimensions.filter(s), c = e.measures.filter(s), l = C((e.supportingMeasures ?? []).filter(s)), d = c.filter((e) => e.role === n.GAUGE_VALUE), f = o[0], p = d[0], { targetType: m } = e.gaugeSettings, h = P(e), g = f?.dataItem ?? p.dataItem, _ = [], y = N.minScaleValue;
|
|
47
|
-
if (F(e) ? _.push(...z(e, g, a, l)) : f ? _.push(...R(e, g, a, l)) : _.push(...B(e, a, l)), h) {
|
|
48
|
-
let t = u(p.dataItem), n = {
|
|
49
|
-
field: u(g),
|
|
50
|
-
props: {
|
|
51
|
-
actual: { field: t },
|
|
52
|
-
color: t,
|
|
53
|
-
start: y,
|
|
54
|
-
end: N.maxScaleValue,
|
|
55
|
-
background: !0,
|
|
56
|
-
...l
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
(m === v.Data || m === v.Manual) && (n.props.target = U(e, a)), c.forEach((e) => {
|
|
60
|
-
let t = `measure-${u(e.dataItem)}`;
|
|
61
|
-
n.props[t] = { field: u(e.dataItem) };
|
|
62
|
-
}), _.push(n);
|
|
63
|
-
}
|
|
64
|
-
let b = [{
|
|
65
|
-
key: N.gaugeCollectionKey,
|
|
66
|
-
data: { extract: _ }
|
|
67
|
-
}];
|
|
68
|
-
return {
|
|
69
|
-
...r,
|
|
70
|
-
collections: b
|
|
71
|
-
};
|
|
72
|
-
}, R = (e, t, r, i) => {
|
|
73
|
-
let a = e.measures.filter(s), o = a.filter((e) => e.role === n.GAUGE_VALUE), c = a.filter((e) => e.role === n.GAUGE_TARGET), l = o[0], d = c[0], { targetType: f } = e.gaugeSettings, p = P(e), m = [], h = u(l.dataItem);
|
|
74
|
-
return p || m.push({
|
|
75
|
-
field: u(t),
|
|
76
|
-
props: {
|
|
77
|
-
actual: { field: h },
|
|
78
|
-
[h]: { field: h },
|
|
79
|
-
color: h,
|
|
80
|
-
...i
|
|
81
|
-
}
|
|
82
|
-
}), m.push({
|
|
83
|
-
field: u(t),
|
|
84
|
-
props: {
|
|
85
|
-
actual: { field: h },
|
|
86
|
-
start: p ? N.minScaleValue : void 0,
|
|
87
|
-
end: p ? { getValue: V(e, r) } : void 0,
|
|
88
|
-
[h]: { field: h },
|
|
89
|
-
color: h,
|
|
90
|
-
...i
|
|
91
|
-
}
|
|
92
|
-
}), (f === v.Data || f === v.Manual) && m.forEach((t) => {
|
|
93
|
-
t.props.target = U(e, r), d && f === v.Data && (t.props[u(d.dataItem)] = { field: u(d.dataItem) });
|
|
94
|
-
}), m;
|
|
95
|
-
}, z = (e, t, r, i) => {
|
|
96
|
-
let a = P(e), o = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), c = o.reduce((e, t) => {
|
|
97
|
-
let n = u(t.dataItem);
|
|
98
|
-
return e[n] = { field: n }, e;
|
|
99
|
-
}, {});
|
|
100
|
-
return o.map((n, o) => {
|
|
101
|
-
let s = u(n.dataItem);
|
|
102
|
-
return {
|
|
103
|
-
field: u(t),
|
|
104
|
-
props: {
|
|
105
|
-
measure: { field: s },
|
|
106
|
-
color: s,
|
|
107
|
-
start: a ? N.minScaleValue : void 0,
|
|
108
|
-
end: a ? { getValue: V(e, r, o) } : void 0,
|
|
109
|
-
...c,
|
|
110
|
-
...i
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
}, B = (e, t, r) => {
|
|
115
|
-
let i = P(e), a = [];
|
|
116
|
-
return e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE).forEach((n) => {
|
|
117
|
-
let o = u(n.dataItem), s = t[0].items[0][o], c = U(e, t, n), l = [];
|
|
118
|
-
l.push({
|
|
119
|
-
field: o,
|
|
120
|
-
props: {
|
|
121
|
-
measureValue: o,
|
|
122
|
-
measure: { field: o },
|
|
123
|
-
actual: { field: o },
|
|
124
|
-
color: o,
|
|
125
|
-
start: i ? N.minScaleValue : void 0,
|
|
126
|
-
end: i && typeof s == "number" && typeof c == "number" ? H(s, c) : void 0,
|
|
127
|
-
[o]: { field: o },
|
|
128
|
-
...r
|
|
129
|
-
}
|
|
130
|
-
}), l.push({
|
|
131
|
-
field: o,
|
|
132
|
-
props: {
|
|
133
|
-
measureValue: o,
|
|
134
|
-
measure: { field: o },
|
|
135
|
-
actual: { field: o },
|
|
136
|
-
color: o,
|
|
137
|
-
start: i ? N.minScaleValue : void 0,
|
|
138
|
-
end: i ? N.maxScaleValue : void 0,
|
|
139
|
-
background: !0,
|
|
140
|
-
[o]: { field: o },
|
|
141
|
-
...r
|
|
142
|
-
}
|
|
143
|
-
}), (e.gaugeSettings?.targetType ?? v.Auto) !== v.Auto && l.forEach((e) => {
|
|
144
|
-
e.props.target = c;
|
|
145
|
-
}), a.push(...l);
|
|
146
|
-
}), a;
|
|
147
|
-
}, V = (e, t, r) => {
|
|
148
|
-
let i = e.measures.filter(s), a = i.filter((e) => e.role === n.GAUGE_VALUE), o = i.filter((e) => e.role === n.GAUGE_TARGET), c = a[0], l = o[0];
|
|
149
|
-
return (n, i, o) => {
|
|
150
|
-
let s = a.find((e, t) => t === r), d = s && o[u(s.dataItem)];
|
|
151
|
-
if (typeof d == "number" && d < 0) return N.minScaleValue;
|
|
152
|
-
let f = o[u(c.dataItem)], p;
|
|
153
|
-
if (p = e.gaugeSettings?.targetType === v.Data ? o[u(l?.dataItem)] : U(e, t), !o || typeof f != "number" || typeof p != "number") return N.minScaleValue;
|
|
154
|
-
if (!F(e) || r === void 0) return H(f, p);
|
|
155
|
-
let m = 0, h = 0;
|
|
156
|
-
return a.forEach((e, t) => {
|
|
157
|
-
let n = Math.max(0, o[u(e.dataItem)]);
|
|
158
|
-
m += n, t <= r && (h += n);
|
|
159
|
-
}), h / m * N.maxScaleValue;
|
|
160
|
-
};
|
|
161
|
-
}, H = (e, t) => {
|
|
162
|
-
let n = t ? Math.max(0, e) / t : 1;
|
|
163
|
-
return Math.min(n, 1) * N.maxScaleValue;
|
|
164
|
-
}, U = (e, t, r) => {
|
|
165
|
-
let { targetType: i, targetValue: a } = e.gaugeSettings, o = e.measures.filter(s), c = o.filter((e) => e.role === n.GAUGE_TARGET)[0];
|
|
166
|
-
return i === v.Auto ? t[0].items.map((e) => o.map((t) => e[u(t.dataItem)])).reduce((e, t) => Math.max(...t, e), 0) * (1 + j.scale.padding) : c && i === v.Data ? { field: u(c.dataItem) } : r && i === v.PerMeasure ? r.targetValue ?? 0 : i === v.Manual ? a ?? 0 : 0;
|
|
167
|
-
}, W = /* @__PURE__ */ function(e) {
|
|
168
|
-
return e.Foreground = "foreground", e.Background = "background", e;
|
|
169
|
-
}({}), G = (e, t, n = 0) => `${e}-${t}-${n}`, K = (e) => Math.min(N.maxBarWidthOfRadius, N.outerRadius / e), q = (e, t, r) => {
|
|
170
|
-
let i = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
|
|
171
|
-
return (e) => r !== void 0 && e.measure?.source?.field !== u(i[r]?.dataItem) ? !1 : e.background?.value ? t === W.Background : t === W.Foreground;
|
|
172
|
-
}, J = (e, t) => !t || e.coloring?.type === l.Single ? !1 : !F(e) || e.coloring?.type === l.Categorical, Y = (e, t, r, i, a, o, c, l) => {
|
|
173
|
-
let d = r.dimensions.filter(s)[0], f = new M(r, i, t?.[0]?.itemsNotAffectedByFiltering), p = f.getColorDefinition(J(r, d) ? { ref: f.MAIN_FIELD } : {}), m = (e, t) => !F(r) && t === 1 || o && F(r) ? "transparent" : typeof p == "function" ? p(e) : p, h = K(c), g = Number(r.gaugeSettings?.size), _ = Number(r.gaugeSettings?.startAngle), y = isNaN(g) ? 360 : g ?? 360, b = isNaN(_) ? 0 : _ ?? 0, x = b + y, S = b / 180 * Math.PI, C = x / 180 * Math.PI;
|
|
174
|
-
return {
|
|
175
|
-
key: G(D.Pie, o ? W.Background : W.Foreground, a),
|
|
176
|
-
type: D.Pie,
|
|
177
|
-
animations: {
|
|
178
|
-
enabled: !0,
|
|
179
|
-
presetId: "pie-chart"
|
|
180
|
-
},
|
|
181
|
-
data: {
|
|
182
|
-
collection: N.gaugeCollectionKey,
|
|
183
|
-
filter: (t) => {
|
|
184
|
-
if (!d) {
|
|
185
|
-
let e = r.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
|
|
186
|
-
return F(r) || e[a] && t.measure?.source?.field === u(e[a].dataItem);
|
|
187
|
-
}
|
|
188
|
-
return `${t.value}` == `${e[u(d.dataItem)]}`;
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
settings: {
|
|
192
|
-
startAngle: S,
|
|
193
|
-
endAngle: C,
|
|
194
|
-
slice: {
|
|
195
|
-
cornerRadius: r.gaugeSettings?.cornerRadius ?? 10,
|
|
196
|
-
outerRadius: N.outerRadius - a * h,
|
|
197
|
-
innerRadius: N.outerRadius - (a + (1 - N.barWidthRadiusPadding)) * h,
|
|
198
|
-
fill: m,
|
|
199
|
-
strokeWidth: .1,
|
|
200
|
-
opacity: o ? N.backgroundBarOpacity : 1,
|
|
201
|
-
arc: (e, t) => {
|
|
202
|
-
if (o) return +(t === 0);
|
|
203
|
-
if (F(r)) return e.datum.measure.value;
|
|
204
|
-
if ((r.gaugeSettings.targetType ?? v.Auto) !== v.Auto) return t === 0 ? e.datum.actual.value : Number(e.datum.target.value) - Number(e.datum.actual.value);
|
|
205
|
-
{
|
|
206
|
-
let n = e.resources.scale("onlyMeasures"), r = Number(n(e.datum.actual.value)) || 0;
|
|
207
|
-
return t === 0 ? r : 1 - r;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
brush: T([""], l, { overwriteOpacity: o ? N.backgroundBarOpacity : null })
|
|
213
|
-
};
|
|
214
|
-
}, X = (e, t, n, r, i, o) => {
|
|
215
|
-
let l = e.dimensions.filter(s)[0], d = new M(e, t, n?.[0]?.itemsNotAffectedByFiltering), f;
|
|
216
|
-
f = r === W.Background && e.gaugeSettings?.backgroundBarColor ? e.gaugeSettings?.backgroundBarColor : d.getColorDefinition(J(e, l) ? { ref: d.MAIN_FIELD } : {}, !e.gaugeSettings?.backgroundBarColor && r === W.Background ? N.backgroundBarOpacity : null);
|
|
217
|
-
let p = l ? u(l.dataItem) : "onlyMeasures", m = !l && !F(e) ? "measureValue" : void 0, h = {
|
|
218
|
-
key: G(D.Box, r, i),
|
|
219
|
-
type: D.Box,
|
|
220
|
-
animations: { enabled: !0 },
|
|
221
|
-
data: {
|
|
222
|
-
collection: N.gaugeCollectionKey,
|
|
223
|
-
filter: q(e, r, i)
|
|
224
|
-
},
|
|
225
|
-
settings: {
|
|
226
|
-
orientation: e.gaugeSettings.orientation ?? a.Horizontal,
|
|
227
|
-
major: {
|
|
228
|
-
scale: p,
|
|
229
|
-
ref: m
|
|
230
|
-
},
|
|
231
|
-
minor: { scale: "barScale" },
|
|
232
|
-
box: {
|
|
233
|
-
minWidthPx: 2,
|
|
234
|
-
fill: f,
|
|
235
|
-
rx: e.gaugeSettings?.barRadius ?? 0
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
brush: T([""], o, { disable: { triggers: r === W.Foreground } })
|
|
239
|
-
};
|
|
240
|
-
return e.gaugeSettings?.strokeEnabled ? (h.settings.box.stroke = e.gaugeSettings?.strokeColor || t.colors.brandColors[0], h.settings.box.strokeWidth = e.gaugeSettings?.strokeWidth) : h.settings.box.stroke = c.transparent, h;
|
|
241
|
-
}, oe = (e, t, n, r, i, a) => {
|
|
242
|
-
if (!i) return n;
|
|
243
|
-
let o = [];
|
|
244
|
-
return o = P(e) ? ce(e, t, r, i, a) : se(e, t, r, i, a), {
|
|
245
|
-
...n,
|
|
246
|
-
components: [...n.components, ...o]
|
|
247
|
-
};
|
|
248
|
-
}, se = (e, t, r, i, a) => {
|
|
249
|
-
let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
|
|
250
|
-
return !o[0] && !F(e) ? c.map((n, r) => [Y(i[0].items[0], i, e, t, r, !0, c.length), Y(i[0].items[0], i, e, t, r, !1, c.length)]).reduce((e, t) => e.concat(t), []) : i[0].items.map((n, r) => [Y(n, i, e, t, r, !0, i[0].items.length, a), Y(n, i, e, t, r, !1, i[0].items.length, a)]).reduce((e, t) => e.concat(t), []);
|
|
251
|
-
}, ce = (e, t, r, i, a) => {
|
|
252
|
-
let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), l = o[0], u = [];
|
|
253
|
-
if (F(e)) for (let n = c.length - 1; n >= 0; n--) u.push(X(e, t, i, W.Foreground, n, a));
|
|
254
|
-
else if (l) u = [X(e, t, i, W.Background, void 0, a), X(e, t, i, W.Foreground, void 0, a)];
|
|
255
|
-
else for (let n = c.length - 1; n >= 0; n--) u.push(X(e, t, i, W.Background, n)), u.push(X(e, t, i, W.Foreground, n));
|
|
256
|
-
return u;
|
|
257
|
-
}, le = (e, t, r) => {
|
|
258
|
-
let i = e.dimensions.filter(s), a = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
|
|
259
|
-
if (!e.gaugeSettings?.barMode || !i.length && e.gaugeSettings?.comparisonMode) return r;
|
|
260
|
-
let o = [];
|
|
261
|
-
return i.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && i[0] && o.push(Z(!1, t, i[0].formatter, "dimension", void 0, e.gaugeSettings)), !e.gaugeSettings?.comparisonMode && e.gaugeSettings?.showValueLabels !== !1 && a[0] && o.push(Z(!0, t, a[0].formatter, "value", void 0, e.gaugeSettings))) : e.gaugeSettings?.showValueLabels !== !1 && a.forEach((n, r) => {
|
|
262
|
-
o.push(Z(!0, t, n.formatter, String(r), r, e.gaugeSettings));
|
|
263
|
-
}), {
|
|
264
|
-
...r,
|
|
265
|
-
components: [...r.components, ...o]
|
|
266
|
-
};
|
|
267
|
-
}, Z = (e, t, n, r, i, o) => {
|
|
268
|
-
let s = +!!e, c = {
|
|
269
|
-
type: "bar",
|
|
270
|
-
settings: {
|
|
271
|
-
direction: o?.orientation === a.Vertical ? "up" : "right",
|
|
272
|
-
fontSize: x(o?.labelFontSize),
|
|
273
|
-
fontFamily: t.fonts.general.fontFamily,
|
|
274
|
-
labels: [{
|
|
275
|
-
label: (t) => t.data ? e ? ue(t.data.actual.value, n, t) : `${h(n, t.data?.label)}` : "",
|
|
276
|
-
placements: e ? [{
|
|
277
|
-
position: _.Outside,
|
|
278
|
-
fill: "#000",
|
|
279
|
-
justify: 0
|
|
280
|
-
}, {
|
|
281
|
-
position: _.Inside,
|
|
282
|
-
fill: "#fff",
|
|
283
|
-
justify: s
|
|
284
|
-
}] : [{
|
|
285
|
-
position: _.Inside,
|
|
286
|
-
fill: "#fff",
|
|
287
|
-
justify: s
|
|
288
|
-
}]
|
|
289
|
-
}]
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
return {
|
|
293
|
-
type: D.Labels,
|
|
294
|
-
key: `gauge-bar-labels-${r}`,
|
|
295
|
-
layout: { displayOrder: b.Labels },
|
|
296
|
-
settings: { sources: [{
|
|
297
|
-
component: G(D.Box, W.Foreground, i),
|
|
298
|
-
selector: A.Rect,
|
|
299
|
-
strategy: c
|
|
300
|
-
}] },
|
|
301
|
-
animations: {
|
|
302
|
-
enabled: !0,
|
|
303
|
-
presetId: "chart-labels"
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
}, ue = (e, t, n) => e === null ? "-" : typeof t != "string" && r(t) ? g(t.format, t)(e, void 0, n.data) : `${h(t, e)}`, Q = (e, t, n, r) => ne(e, t, n, r), de = (e, t, r, i, a) => {
|
|
307
|
-
if (!a) return r;
|
|
308
|
-
let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), l = o[0], u = P(e), d = F(e), f = u ? D.Box : D.Pie, p = u && !d ? W.Background : W.Foreground, m = ((u || !l ? c : a[0]?.items) || []).map((e, t) => G(f, p, t));
|
|
309
|
-
return E(e, t, r, {
|
|
310
|
-
filter: (e) => e.filter((e) => m.findIndex((t) => t === e.key) !== -1),
|
|
311
|
-
placement: {
|
|
312
|
-
type: u ? "bounds" : "slice",
|
|
313
|
-
area: "target"
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
}, fe = class extends k {
|
|
317
|
-
constructor() {
|
|
318
|
-
super([
|
|
319
|
-
L,
|
|
320
|
-
I,
|
|
321
|
-
oe,
|
|
322
|
-
le,
|
|
323
|
-
Q,
|
|
324
|
-
de
|
|
325
|
-
]);
|
|
326
|
-
}
|
|
327
|
-
preCompile(e) {
|
|
328
|
-
if (!e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
|
|
329
|
-
}
|
|
330
|
-
}, pe = f(), $ = d(({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: a }) => {
|
|
331
|
-
let s = p(), [c] = (0, ie.useState)(() => new fe()), l = t || o, u = c.compile(e, l, n, r, a, i.Gauge, s);
|
|
332
|
-
return u ? /* @__PURE__ */ (0, pe.jsx)(O, {
|
|
333
|
-
config: a,
|
|
334
|
-
definition: u,
|
|
335
|
-
size: r,
|
|
336
|
-
vSpec: e
|
|
337
|
-
}) : null;
|
|
338
|
-
}), me = /* @__PURE__ */ t({ GaugeChart: () => $ });
|
|
339
|
-
export { $ as n, me as t };
|