@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,12 +1,11 @@
|
|
|
1
1
|
import { o as e, r as t } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as M } from "./coloring-C16AUZEi.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";
|
|
8
7
|
import { t as re } from "./set-coloring-datafield-B3uIS1Pe.js";
|
|
9
|
-
var ie = /* @__PURE__ */ e(
|
|
8
|
+
var ie = /* @__PURE__ */ e(m()), N = {
|
|
10
9
|
outerRadius: .95,
|
|
11
10
|
cornerRadius: 10,
|
|
12
11
|
additionalTextAnchorHeight: 50,
|
|
@@ -21,45 +20,45 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
21
20
|
gaugeCollectionKey: "Gauge-Collection"
|
|
22
21
|
}, P = (e) => e.gaugeSettings?.barMode ?? !1, F = (e) => e.gaugeSettings?.comparisonMode ?? !1, ae = (e) => {
|
|
23
22
|
let { coloring: t } = e || {};
|
|
24
|
-
return t?.type ===
|
|
23
|
+
return t?.type === l.Categorical || t?.type === l.Single ? y(e, []) : ee(e);
|
|
25
24
|
}, I = (e, t, r) => {
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
let c = e.dimensions.filter(
|
|
29
|
-
return !c.length && P(e) ?
|
|
30
|
-
data: F(e) ? { extract: { field:
|
|
31
|
-
type:
|
|
32
|
-
padding:
|
|
33
|
-
} : F(e) || (
|
|
34
|
-
data: { fields:
|
|
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)) },
|
|
35
34
|
include: [0],
|
|
36
35
|
expand: .05
|
|
37
|
-
}), P(e) && (
|
|
36
|
+
}), P(e) && (i.barScale = {
|
|
38
37
|
min: N.minScaleValue - N.scalePadding,
|
|
39
38
|
max: N.maxScaleValue + N.scalePadding,
|
|
40
|
-
invert: e.gaugeSettings?.orientation ===
|
|
39
|
+
invert: e.gaugeSettings?.orientation === a.Vertical
|
|
41
40
|
}), {
|
|
42
41
|
...r,
|
|
43
|
-
scales:
|
|
42
|
+
scales: i
|
|
44
43
|
};
|
|
45
44
|
}, L = (e, t, r, i, a) => {
|
|
46
45
|
if (!a) return r;
|
|
47
|
-
let
|
|
48
|
-
if (F(e) ? _.push(...z(e, g, a,
|
|
49
|
-
let t =
|
|
50
|
-
field:
|
|
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),
|
|
51
50
|
props: {
|
|
52
51
|
actual: { field: t },
|
|
53
52
|
color: t,
|
|
54
53
|
start: y,
|
|
55
54
|
end: N.maxScaleValue,
|
|
56
55
|
background: !0,
|
|
57
|
-
...
|
|
56
|
+
...l
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
59
|
(m === v.Data || m === v.Manual) && (n.props.target = U(e, a)), c.forEach((e) => {
|
|
61
|
-
let t = `measure-${
|
|
62
|
-
n.props[t] = { field:
|
|
60
|
+
let t = `measure-${u(e.dataItem)}`;
|
|
61
|
+
n.props[t] = { field: u(e.dataItem) };
|
|
63
62
|
}), _.push(n);
|
|
64
63
|
}
|
|
65
64
|
let b = [{
|
|
@@ -71,9 +70,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
71
70
|
collections: b
|
|
72
71
|
};
|
|
73
72
|
}, R = (e, t, r, i) => {
|
|
74
|
-
let a = e.measures.filter(
|
|
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);
|
|
75
74
|
return p || m.push({
|
|
76
|
-
field:
|
|
75
|
+
field: u(t),
|
|
77
76
|
props: {
|
|
78
77
|
actual: { field: h },
|
|
79
78
|
[h]: { field: h },
|
|
@@ -81,7 +80,7 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
81
80
|
...i
|
|
82
81
|
}
|
|
83
82
|
}), m.push({
|
|
84
|
-
field:
|
|
83
|
+
field: u(t),
|
|
85
84
|
props: {
|
|
86
85
|
actual: { field: h },
|
|
87
86
|
start: p ? N.minScaleValue : void 0,
|
|
@@ -91,17 +90,17 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
91
90
|
...i
|
|
92
91
|
}
|
|
93
92
|
}), (f === v.Data || f === v.Manual) && m.forEach((t) => {
|
|
94
|
-
t.props.target = U(e, r), d && f === v.Data && (t.props[
|
|
93
|
+
t.props.target = U(e, r), d && f === v.Data && (t.props[u(d.dataItem)] = { field: u(d.dataItem) });
|
|
95
94
|
}), m;
|
|
96
95
|
}, z = (e, t, r, i) => {
|
|
97
|
-
let a = P(e),
|
|
98
|
-
let n =
|
|
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);
|
|
99
98
|
return e[n] = { field: n }, e;
|
|
100
99
|
}, {});
|
|
101
|
-
return
|
|
102
|
-
let s =
|
|
100
|
+
return o.map((n, o) => {
|
|
101
|
+
let s = u(n.dataItem);
|
|
103
102
|
return {
|
|
104
|
-
field:
|
|
103
|
+
field: u(t),
|
|
105
104
|
props: {
|
|
106
105
|
measure: { field: s },
|
|
107
106
|
color: s,
|
|
@@ -114,9 +113,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
114
113
|
});
|
|
115
114
|
}, B = (e, t, r) => {
|
|
116
115
|
let i = P(e), a = [];
|
|
117
|
-
return e.measures.filter(
|
|
118
|
-
let o =
|
|
119
|
-
|
|
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({
|
|
120
119
|
field: o,
|
|
121
120
|
props: {
|
|
122
121
|
measureValue: o,
|
|
@@ -128,7 +127,7 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
128
127
|
[o]: { field: o },
|
|
129
128
|
...r
|
|
130
129
|
}
|
|
131
|
-
}),
|
|
130
|
+
}), l.push({
|
|
132
131
|
field: o,
|
|
133
132
|
props: {
|
|
134
133
|
measureValue: o,
|
|
@@ -141,21 +140,21 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
141
140
|
[o]: { field: o },
|
|
142
141
|
...r
|
|
143
142
|
}
|
|
144
|
-
}), (e.gaugeSettings?.targetType ?? v.Auto) !== v.Auto &&
|
|
143
|
+
}), (e.gaugeSettings?.targetType ?? v.Auto) !== v.Auto && l.forEach((e) => {
|
|
145
144
|
e.props.target = c;
|
|
146
|
-
}), a.push(...
|
|
145
|
+
}), a.push(...l);
|
|
147
146
|
}), a;
|
|
148
147
|
}, V = (e, t, r) => {
|
|
149
|
-
let i = e.measures.filter(
|
|
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];
|
|
150
149
|
return (n, i, o) => {
|
|
151
|
-
let s = a.find((e, t) => t === r), d = s && o[
|
|
150
|
+
let s = a.find((e, t) => t === r), d = s && o[u(s.dataItem)];
|
|
152
151
|
if (typeof d == "number" && d < 0) return N.minScaleValue;
|
|
153
|
-
let f = o[
|
|
154
|
-
if (p = e.gaugeSettings?.targetType === v.Data ? o[l
|
|
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;
|
|
155
154
|
if (!F(e) || r === void 0) return H(f, p);
|
|
156
155
|
let m = 0, h = 0;
|
|
157
156
|
return a.forEach((e, t) => {
|
|
158
|
-
let n = Math.max(0, o[
|
|
157
|
+
let n = Math.max(0, o[u(e.dataItem)]);
|
|
159
158
|
m += n, t <= r && (h += n);
|
|
160
159
|
}), h / m * N.maxScaleValue;
|
|
161
160
|
};
|
|
@@ -163,18 +162,18 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
163
162
|
let n = t ? Math.max(0, e) / t : 1;
|
|
164
163
|
return Math.min(n, 1) * N.maxScaleValue;
|
|
165
164
|
}, U = (e, t, r) => {
|
|
166
|
-
let { targetType: i, targetValue: a } = e.gaugeSettings,
|
|
167
|
-
return i === v.Auto ? t[0].items.map((e) =>
|
|
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;
|
|
168
167
|
}, W = /* @__PURE__ */ function(e) {
|
|
169
168
|
return e.Foreground = "foreground", e.Background = "background", e;
|
|
170
169
|
}({}), G = (e, t, n = 0) => `${e}-${t}-${n}`, K = (e) => Math.min(N.maxBarWidthOfRadius, N.outerRadius / e), q = (e, t, r) => {
|
|
171
|
-
let i = e.measures.filter(
|
|
172
|
-
return (e) => r !== void 0 && e.measure?.source?.field !==
|
|
173
|
-
}, J = (e, t) => !t || e.coloring?.type ===
|
|
174
|
-
let d = r.dimensions.filter(
|
|
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;
|
|
175
174
|
return {
|
|
176
|
-
key: G(
|
|
177
|
-
type:
|
|
175
|
+
key: G(D.Pie, o ? W.Background : W.Foreground, a),
|
|
176
|
+
type: D.Pie,
|
|
178
177
|
animations: {
|
|
179
178
|
enabled: !0,
|
|
180
179
|
presetId: "pie-chart"
|
|
@@ -183,10 +182,10 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
183
182
|
collection: N.gaugeCollectionKey,
|
|
184
183
|
filter: (t) => {
|
|
185
184
|
if (!d) {
|
|
186
|
-
let e = r.measures.filter(
|
|
187
|
-
return F(r) || e[a] && t.measure?.source?.field ===
|
|
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);
|
|
188
187
|
}
|
|
189
|
-
return `${t.value}` == `${e[
|
|
188
|
+
return `${t.value}` == `${e[u(d.dataItem)]}`;
|
|
190
189
|
}
|
|
191
190
|
},
|
|
192
191
|
settings: {
|
|
@@ -198,9 +197,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
198
197
|
innerRadius: N.outerRadius - (a + (1 - N.barWidthRadiusPadding)) * h,
|
|
199
198
|
fill: m,
|
|
200
199
|
strokeWidth: .1,
|
|
201
|
-
opacity:
|
|
200
|
+
opacity: o ? N.backgroundBarOpacity : 1,
|
|
202
201
|
arc: (e, t) => {
|
|
203
|
-
if (
|
|
202
|
+
if (o) return +(t === 0);
|
|
204
203
|
if (F(r)) return e.datum.measure.value;
|
|
205
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);
|
|
206
205
|
{
|
|
@@ -210,21 +209,21 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
211
|
},
|
|
213
|
-
brush:
|
|
212
|
+
brush: T([""], l, { overwriteOpacity: o ? N.backgroundBarOpacity : null })
|
|
214
213
|
};
|
|
215
|
-
}, X = (e, t, n,
|
|
216
|
-
let
|
|
217
|
-
f =
|
|
218
|
-
let p =
|
|
219
|
-
key: G(
|
|
220
|
-
type:
|
|
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,
|
|
221
220
|
animations: { enabled: !0 },
|
|
222
221
|
data: {
|
|
223
222
|
collection: N.gaugeCollectionKey,
|
|
224
|
-
filter: q(e,
|
|
223
|
+
filter: q(e, r, i)
|
|
225
224
|
},
|
|
226
225
|
settings: {
|
|
227
|
-
orientation: e.gaugeSettings.orientation ??
|
|
226
|
+
orientation: e.gaugeSettings.orientation ?? a.Horizontal,
|
|
228
227
|
major: {
|
|
229
228
|
scale: p,
|
|
230
229
|
ref: m
|
|
@@ -236,9 +235,9 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
236
235
|
rx: e.gaugeSettings?.barRadius ?? 0
|
|
237
236
|
}
|
|
238
237
|
},
|
|
239
|
-
brush:
|
|
238
|
+
brush: T([""], o, { disable: { triggers: r === W.Foreground } })
|
|
240
239
|
};
|
|
241
|
-
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 =
|
|
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;
|
|
242
241
|
}, oe = (e, t, n, r, i, a) => {
|
|
243
242
|
if (!i) return n;
|
|
244
243
|
let o = [];
|
|
@@ -247,29 +246,29 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
247
246
|
components: [...n.components, ...o]
|
|
248
247
|
};
|
|
249
248
|
}, se = (e, t, r, i, a) => {
|
|
250
|
-
let
|
|
251
|
-
return !
|
|
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), []);
|
|
252
251
|
}, ce = (e, t, r, i, a) => {
|
|
253
|
-
let
|
|
252
|
+
let o = e.dimensions.filter(s), c = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE), l = o[0], u = [];
|
|
254
253
|
if (F(e)) for (let n = c.length - 1; n >= 0; n--) u.push(X(e, t, i, W.Foreground, n, a));
|
|
255
254
|
else if (l) u = [X(e, t, i, W.Background, void 0, a), X(e, t, i, W.Foreground, void 0, a)];
|
|
256
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));
|
|
257
256
|
return u;
|
|
258
257
|
}, le = (e, t, r) => {
|
|
259
|
-
let i = e.dimensions.filter(
|
|
258
|
+
let i = e.dimensions.filter(s), a = e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE);
|
|
260
259
|
if (!e.gaugeSettings?.barMode || !i.length && e.gaugeSettings?.comparisonMode) return r;
|
|
261
|
-
let
|
|
262
|
-
return i.length ? (e.gaugeSettings?.showDimensionLabels !== !1 && i[0] &&
|
|
263
|
-
|
|
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));
|
|
264
263
|
}), {
|
|
265
264
|
...r,
|
|
266
|
-
components: [...r.components, ...
|
|
265
|
+
components: [...r.components, ...o]
|
|
267
266
|
};
|
|
268
|
-
}, Z = (e, t, n, r,
|
|
267
|
+
}, Z = (e, t, n, r, i, o) => {
|
|
269
268
|
let s = +!!e, c = {
|
|
270
269
|
type: "bar",
|
|
271
270
|
settings: {
|
|
272
|
-
direction: o?.orientation ===
|
|
271
|
+
direction: o?.orientation === a.Vertical ? "up" : "right",
|
|
273
272
|
fontSize: x(o?.labelFontSize),
|
|
274
273
|
fontFamily: t.fonts.general.fontFamily,
|
|
275
274
|
labels: [{
|
|
@@ -291,12 +290,12 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
291
290
|
}
|
|
292
291
|
};
|
|
293
292
|
return {
|
|
294
|
-
type:
|
|
293
|
+
type: D.Labels,
|
|
295
294
|
key: `gauge-bar-labels-${r}`,
|
|
296
295
|
layout: { displayOrder: b.Labels },
|
|
297
296
|
settings: { sources: [{
|
|
298
|
-
component: G(
|
|
299
|
-
selector:
|
|
297
|
+
component: G(D.Box, W.Foreground, i),
|
|
298
|
+
selector: A.Rect,
|
|
300
299
|
strategy: c
|
|
301
300
|
}] },
|
|
302
301
|
animations: {
|
|
@@ -304,17 +303,17 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
304
303
|
presetId: "chart-labels"
|
|
305
304
|
}
|
|
306
305
|
};
|
|
307
|
-
}, ue = (e, t, n) => e === null ? "-" : typeof t != "string" &&
|
|
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) => {
|
|
308
307
|
if (!a) return r;
|
|
309
|
-
let
|
|
310
|
-
return
|
|
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, {
|
|
311
310
|
filter: (e) => e.filter((e) => m.findIndex((t) => t === e.key) !== -1),
|
|
312
311
|
placement: {
|
|
313
312
|
type: u ? "bounds" : "slice",
|
|
314
313
|
area: "target"
|
|
315
314
|
}
|
|
316
315
|
});
|
|
317
|
-
}, fe = class extends
|
|
316
|
+
}, fe = class extends k {
|
|
318
317
|
constructor() {
|
|
319
318
|
super([
|
|
320
319
|
L,
|
|
@@ -326,13 +325,13 @@ var ie = /* @__PURE__ */ e(d()), N = {
|
|
|
326
325
|
]);
|
|
327
326
|
}
|
|
328
327
|
preCompile(e) {
|
|
329
|
-
if (!e.measures.filter(
|
|
328
|
+
if (!e.measures.filter(s).filter((e) => e.role === n.GAUGE_VALUE).length) throw Error("Charts w/o measures are not supported ATM.");
|
|
330
329
|
}
|
|
331
|
-
}, pe =
|
|
332
|
-
let
|
|
333
|
-
return
|
|
334
|
-
config:
|
|
335
|
-
definition:
|
|
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,
|
|
336
335
|
size: r,
|
|
337
336
|
vSpec: e
|
|
338
337
|
}) : null;
|