@devgateway/dvz-ui-react 1.9.1 → 1.9.3
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/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/data-paragraph/index.js +1 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/grouped-bars/GroupedBars.js +1 -1
- package/dist/cjs/embeddable/newsletter/index.js +1 -1
- package/dist/cjs/embeddable/sankeychart/index.js +1 -1
- package/dist/cjs/embeddable/showcase/index.js +1 -1
- package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
- package/dist/cjs/embeddable/utils/parseUtils.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/tracker/InternalTrafficToggle.js +1 -1
- package/dist/cjs/tracker/InternalTrafficWatermark.js +1 -1
- package/dist/cjs/tracker/index.js +1 -1
- package/dist/cjs/tracker/internalTrafficUtils.js +1 -1
- package/dist/cjs/tracker/useInternalTrafficBypass.js +1 -1
- package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +79 -79
- package/dist/esm/embeddable/chart/Line.js +209 -207
- package/dist/esm/embeddable/data-paragraph/index.js +119 -119
- package/dist/esm/embeddable/filter/index.js +113 -113
- package/dist/esm/embeddable/grouped-bars/GroupedBars.js +320 -316
- package/dist/esm/embeddable/newsletter/index.js +35 -38
- package/dist/esm/embeddable/sankeychart/index.js +145 -145
- package/dist/esm/embeddable/showcase/index.js +27 -27
- package/dist/esm/embeddable/tabbedposts/index.js +40 -39
- package/dist/esm/embeddable/utils/parseUtils.js +11 -3
- package/dist/esm/index.js +74 -73
- package/dist/esm/tracker/InternalTrafficToggle.js +30 -20
- package/dist/esm/tracker/InternalTrafficWatermark.js +42 -52
- package/dist/esm/tracker/index.js +9 -8
- package/dist/esm/tracker/internalTrafficUtils.js +18 -13
- package/dist/esm/tracker/useInternalTrafficBypass.js +13 -31
- package/dist/types/embeddable/chart/Line.d.ts +2 -0
- package/dist/types/tracker/InternalTrafficToggle.d.ts +1 -4
- package/dist/types/tracker/InternalTrafficWatermark.d.ts +0 -10
- package/dist/types/tracker/internalTrafficUtils.d.ts +1 -14
- package/dist/types/tracker/useInternalTrafficBypass.d.ts +4 -10
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
1
|
+
import { jsx as m, jsxs as B, Fragment as Ae } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as be, useState as ve } from "react";
|
|
3
|
-
import { Container as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { connect as
|
|
3
|
+
import { Container as Be } from "semantic-ui-react";
|
|
4
|
+
import Le from "../data/DataProvider.js";
|
|
5
|
+
import Te from "../data/DataConsumer.js";
|
|
6
|
+
import { connect as _e } from "react-redux";
|
|
7
7
|
import { alphaSort as xe } from "../utils/common.js";
|
|
8
|
-
import { formatContent as
|
|
9
|
-
const
|
|
8
|
+
import { formatContent as Ee } from "../common/ChartTooltip.js";
|
|
9
|
+
const Re = "No data matches your selection", He = "-", Ue = "#5a5d68", $e = "none", ke = 14, Ve = "#3182ce", Oe = "none", de = 24, $ = (r, n) => n ? r : decodeURIComponent(r), le = (r, n) => {
|
|
10
10
|
try {
|
|
11
|
-
return JSON.parse(
|
|
11
|
+
return JSON.parse($(r, n));
|
|
12
12
|
} catch (s) {
|
|
13
|
-
return console.error("Error parsing value:",
|
|
13
|
+
return console.error("Error parsing value:", r, s), null;
|
|
14
14
|
}
|
|
15
|
-
}, we = (
|
|
16
|
-
style:
|
|
17
|
-
notation:
|
|
18
|
-
currency:
|
|
19
|
-
minimumFractionDigits: parseInt(
|
|
20
|
-
maximumFractionDigits: parseInt(
|
|
21
|
-
prefix:
|
|
22
|
-
suffix:
|
|
15
|
+
}, we = (r) => r ? {
|
|
16
|
+
style: r.style === "compacted" ? "decimal" : r.style,
|
|
17
|
+
notation: r.style === "compacted" ? "compact" : "standard",
|
|
18
|
+
currency: r.currency,
|
|
19
|
+
minimumFractionDigits: parseInt(r.minimumFractionDigits, 10),
|
|
20
|
+
maximumFractionDigits: parseInt(r.maximumFractionDigits, 10),
|
|
21
|
+
prefix: r.prefix || "",
|
|
22
|
+
suffix: r.suffix || ""
|
|
23
23
|
} : {
|
|
24
24
|
notation: "standard",
|
|
25
25
|
currency: "USD",
|
|
@@ -27,120 +27,120 @@ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "non
|
|
|
27
27
|
maximumFractionDigits: 2,
|
|
28
28
|
prefix: "",
|
|
29
29
|
suffix: ""
|
|
30
|
-
},
|
|
30
|
+
}, Ge = (r, n, s, x = !0) => {
|
|
31
31
|
const i = [];
|
|
32
|
-
if (!
|
|
33
|
-
const f =
|
|
34
|
-
if (f && typeof f == "object" && Object.entries(f).forEach(([p,
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
i.push({ name: p, format:
|
|
32
|
+
if (!r) return i;
|
|
33
|
+
const f = r[s];
|
|
34
|
+
if (f && typeof f == "object" && Object.entries(f).forEach(([p, M]) => {
|
|
35
|
+
if (M && M.selected) {
|
|
36
|
+
const k = x ? we(M.format || n) : n, D = M && typeof M.customLabel == "string" && M.customLabel.trim().length > 0 ? M.customLabel.trim() : p;
|
|
37
|
+
i.push({ name: p, format: k, label: D });
|
|
38
38
|
}
|
|
39
39
|
}), i.length === 0) {
|
|
40
|
-
const p = (Array.isArray(
|
|
41
|
-
p && i.push({ name: p, format:
|
|
40
|
+
const p = (Array.isArray(r), r[0]);
|
|
41
|
+
p && i.push({ name: p, format: n, label: p });
|
|
42
42
|
}
|
|
43
43
|
return i;
|
|
44
|
-
},
|
|
45
|
-
const s = {},
|
|
46
|
-
return
|
|
44
|
+
}, We = (r, n) => {
|
|
45
|
+
const s = {}, x = r || [];
|
|
46
|
+
return x.forEach && x.forEach((i) => {
|
|
47
47
|
var f;
|
|
48
48
|
((f = i.value) == null ? void 0 : f.filter((p) => p != null && p.toString().trim() !== "").length) > 0 && (s[i.param] = i.value);
|
|
49
|
-
}),
|
|
50
|
-
}, Pe = (
|
|
51
|
-
const
|
|
52
|
-
return
|
|
49
|
+
}), n && (s.dvzProxyDatasetId = n), s;
|
|
50
|
+
}, Pe = (r) => {
|
|
51
|
+
const n = [];
|
|
52
|
+
return r && r !== "none" && n.push(r), n;
|
|
53
53
|
}, Ze = ({
|
|
54
|
-
lineColor:
|
|
55
|
-
textColor:
|
|
54
|
+
lineColor: r,
|
|
55
|
+
textColor: n = "#ffffff",
|
|
56
56
|
fontSizePx: s = "14px",
|
|
57
|
-
showLabel:
|
|
57
|
+
showLabel: x = !1,
|
|
58
58
|
label: i = "",
|
|
59
59
|
showValue: f = !1,
|
|
60
60
|
valueString: p = ""
|
|
61
|
-
}) => /* @__PURE__ */
|
|
61
|
+
}) => /* @__PURE__ */ B("div", { style: { display: "flex", alignItems: "center", height: "100%" }, children: [
|
|
62
62
|
/* @__PURE__ */ m(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
65
|
className: "grouped-bar-zero-line",
|
|
66
66
|
style: {
|
|
67
67
|
width: "2px",
|
|
68
|
-
backgroundColor:
|
|
68
|
+
backgroundColor: r,
|
|
69
69
|
height: "100%"
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
|
|
74
|
-
color:
|
|
73
|
+
x && /* @__PURE__ */ m("span", { style: {
|
|
74
|
+
color: n,
|
|
75
75
|
fontSize: s,
|
|
76
76
|
fontWeight: "500",
|
|
77
77
|
whiteSpace: "nowrap",
|
|
78
78
|
marginLeft: "8px"
|
|
79
79
|
}, children: i }),
|
|
80
80
|
f && /* @__PURE__ */ m("span", { style: {
|
|
81
|
-
color:
|
|
81
|
+
color: n,
|
|
82
82
|
fontSize: s,
|
|
83
83
|
fontWeight: "500",
|
|
84
84
|
whiteSpace: "nowrap",
|
|
85
|
-
marginLeft:
|
|
85
|
+
marginLeft: x ? "6px" : "8px"
|
|
86
86
|
}, children: p })
|
|
87
|
-
] }),
|
|
88
|
-
dimensionValue:
|
|
89
|
-
measureEntries:
|
|
87
|
+
] }), je = ({ textColor: r, message: n = "No data to display" }) => /* @__PURE__ */ m("div", { className: "grouped-bars-data-frame", children: /* @__PURE__ */ m("div", { className: "no-data-text", style: { color: r }, children: n }) }), Je = ({
|
|
88
|
+
dimensionValue: r,
|
|
89
|
+
measureEntries: n,
|
|
90
90
|
mainEntry: s,
|
|
91
|
-
barBackgroundColor:
|
|
91
|
+
barBackgroundColor: x,
|
|
92
92
|
textColor: i,
|
|
93
93
|
measureTextColor: f,
|
|
94
94
|
fontSize: p,
|
|
95
|
-
mainValueFontSize:
|
|
96
|
-
labelPosition:
|
|
97
|
-
labelWidth:
|
|
98
|
-
labelHeight:
|
|
99
|
-
labelFormat:
|
|
100
|
-
vars:
|
|
101
|
-
intl:
|
|
102
|
-
valuePosition:
|
|
103
|
-
format:
|
|
104
|
-
showMeasureLabels:
|
|
95
|
+
mainValueFontSize: M,
|
|
96
|
+
labelPosition: k,
|
|
97
|
+
labelWidth: D,
|
|
98
|
+
labelHeight: N,
|
|
99
|
+
labelFormat: V,
|
|
100
|
+
vars: O,
|
|
101
|
+
intl: L,
|
|
102
|
+
valuePosition: _,
|
|
103
|
+
format: z,
|
|
104
|
+
showMeasureLabels: G = !1
|
|
105
105
|
}) => {
|
|
106
|
-
var
|
|
107
|
-
const
|
|
106
|
+
var F, T;
|
|
107
|
+
const E = {
|
|
108
108
|
fontSize: p + "px",
|
|
109
109
|
color: i,
|
|
110
|
-
width: `${
|
|
111
|
-
flex: `0 0 ${
|
|
110
|
+
width: `${D}%`,
|
|
111
|
+
flex: `0 0 ${D}%`,
|
|
112
112
|
whiteSpace: "normal",
|
|
113
113
|
wordBreak: "break-word",
|
|
114
114
|
overflow: "hidden",
|
|
115
115
|
lineHeight: "1.2",
|
|
116
116
|
display: "flex",
|
|
117
117
|
alignItems: "center",
|
|
118
|
-
height:
|
|
119
|
-
},
|
|
118
|
+
height: N + "px"
|
|
119
|
+
}, J = decodeURIComponent(V || ""), R = Ee(J, O || { value: r }, L), W = Array.isArray(n) && n.length === 1 && !s, P = _ === "top" && W ? /* @__PURE__ */ B(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
122
122
|
className: "grouped-bar-measure",
|
|
123
123
|
style: {
|
|
124
|
-
fontSize: (
|
|
124
|
+
fontSize: (M || de) + "px",
|
|
125
125
|
color: i,
|
|
126
126
|
whiteSpace: "nowrap",
|
|
127
127
|
flex: "1",
|
|
128
128
|
textAlign: "right"
|
|
129
129
|
},
|
|
130
130
|
children: [
|
|
131
|
-
|
|
132
|
-
new Intl.NumberFormat(
|
|
133
|
-
|
|
131
|
+
z.prefix,
|
|
132
|
+
new Intl.NumberFormat(L.locale, z).format(n[0].value),
|
|
133
|
+
z.suffix
|
|
134
134
|
]
|
|
135
135
|
}
|
|
136
|
-
) : null,
|
|
137
|
-
var
|
|
136
|
+
) : null, Z = /* @__PURE__ */ m("div", { style: { flex: "1", display: "flex", flexDirection: "column", gap: "6px", minWidth: 0 }, children: n.map((c, Y) => {
|
|
137
|
+
var j, y, K, I;
|
|
138
138
|
return /* @__PURE__ */ m(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
className: "grouped-bar-bar-container",
|
|
142
142
|
style: {
|
|
143
|
-
backgroundColor:
|
|
143
|
+
backgroundColor: x,
|
|
144
144
|
height: "28px",
|
|
145
145
|
borderRadius: "8px",
|
|
146
146
|
overflow: "hidden",
|
|
@@ -161,12 +161,12 @@ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "non
|
|
|
161
161
|
paddingLeft: "8px",
|
|
162
162
|
paddingRight: "8px"
|
|
163
163
|
},
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
-
|
|
164
|
+
children: /* @__PURE__ */ B("span", { style: { color: f || "#ffffff", fontSize: p + "px", fontWeight: "500", whiteSpace: "nowrap" }, children: [
|
|
165
|
+
G ? /* @__PURE__ */ B(Ae, { children: [
|
|
166
166
|
c.label || c.name,
|
|
167
167
|
c.label && c.label !== c.name ? " " : ": "
|
|
168
168
|
] }) : null,
|
|
169
|
-
|
|
169
|
+
_ === "bar" ? `${((j = c.format) == null ? void 0 : j.prefix) || ""}${new Intl.NumberFormat(L.locale, c.format || z).format(c.value)}${((y = c.format) == null ? void 0 : y.suffix) || ""}` : `${(c.width || 0).toFixed(1)}%`
|
|
170
170
|
] })
|
|
171
171
|
}
|
|
172
172
|
) : /* @__PURE__ */ m(
|
|
@@ -175,22 +175,22 @@ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "non
|
|
|
175
175
|
lineColor: c.color,
|
|
176
176
|
textColor: f || "#ffffff",
|
|
177
177
|
fontSizePx: p + "px",
|
|
178
|
-
showLabel: !!
|
|
178
|
+
showLabel: !!G,
|
|
179
179
|
label: c.label || c.name,
|
|
180
180
|
showValue: !0,
|
|
181
|
-
valueString: `${((
|
|
181
|
+
valueString: `${((K = c.format) == null ? void 0 : K.prefix) || ""}${new Intl.NumberFormat(L.locale, c.format || z).format(c.value)}${((I = c.format) == null ? void 0 : I.suffix) || ""}`
|
|
182
182
|
}
|
|
183
183
|
)
|
|
184
184
|
},
|
|
185
|
-
`${
|
|
185
|
+
`${r}-${c.name}-${Y}`
|
|
186
186
|
);
|
|
187
|
-
}) }), H = s ? /* @__PURE__ */
|
|
187
|
+
}) }), H = s ? /* @__PURE__ */ B(
|
|
188
188
|
"div",
|
|
189
189
|
{
|
|
190
190
|
className: "grouped-bar-main",
|
|
191
191
|
style: {
|
|
192
192
|
flex: "0 0 140px",
|
|
193
|
-
backgroundColor: s.color ||
|
|
193
|
+
backgroundColor: s.color || x,
|
|
194
194
|
borderRadius: "8px",
|
|
195
195
|
padding: "10px",
|
|
196
196
|
display: "flex",
|
|
@@ -200,16 +200,16 @@ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "non
|
|
|
200
200
|
minWidth: 0
|
|
201
201
|
},
|
|
202
202
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ B("span", { style: {
|
|
204
204
|
color: f || i,
|
|
205
|
-
fontSize: (
|
|
205
|
+
fontSize: (M || de) + "px",
|
|
206
206
|
fontWeight: 600,
|
|
207
207
|
lineHeight: 1,
|
|
208
208
|
whiteSpace: "nowrap"
|
|
209
209
|
}, children: [
|
|
210
|
-
((
|
|
211
|
-
new Intl.NumberFormat(
|
|
212
|
-
((
|
|
210
|
+
((F = s.format) == null ? void 0 : F.prefix) || "",
|
|
211
|
+
new Intl.NumberFormat(L.locale, s.format || z).format(s.value),
|
|
212
|
+
((T = s.format) == null ? void 0 : T.suffix) || ""
|
|
213
213
|
] }),
|
|
214
214
|
/* @__PURE__ */ m("span", { style: {
|
|
215
215
|
color: f || i,
|
|
@@ -223,315 +223,319 @@ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "non
|
|
|
223
223
|
]
|
|
224
224
|
}
|
|
225
225
|
) : null;
|
|
226
|
-
return
|
|
227
|
-
/* @__PURE__ */ m("div", { className: "grouped-bar-label", style:
|
|
226
|
+
return k === "left" ? /* @__PURE__ */ m("div", { className: "grouped-bar-item", style: { marginBottom: "12px" }, children: /* @__PURE__ */ B("div", { style: { display: "flex", alignItems: "flex-start", gap: "12px" }, children: [
|
|
227
|
+
/* @__PURE__ */ m("div", { className: "grouped-bar-label", style: E, dangerouslySetInnerHTML: { __html: R } }),
|
|
228
228
|
H,
|
|
229
|
-
|
|
230
|
-
] }) }) : /* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */ m("div", { className: "grouped-bar-label", style:
|
|
233
|
-
|
|
229
|
+
Z
|
|
230
|
+
] }) }) : /* @__PURE__ */ B("div", { className: "grouped-bar-item", style: { marginBottom: "12px" }, children: [
|
|
231
|
+
/* @__PURE__ */ B("div", { style: { display: "flex", alignItems: "flex-start", gap: "12px", marginBottom: "6px" }, children: [
|
|
232
|
+
/* @__PURE__ */ m("div", { className: "grouped-bar-label", style: E, dangerouslySetInnerHTML: { __html: R } }),
|
|
233
|
+
P
|
|
234
234
|
] }),
|
|
235
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ B("div", { style: { display: "flex", alignItems: "stretch", gap: "12px" }, children: [
|
|
236
236
|
H,
|
|
237
|
-
|
|
237
|
+
Z
|
|
238
238
|
] })
|
|
239
239
|
] });
|
|
240
|
-
},
|
|
240
|
+
}, Ke = (r) => {
|
|
241
241
|
const {
|
|
242
|
-
app:
|
|
242
|
+
app: n,
|
|
243
243
|
measure: s,
|
|
244
|
-
dimension1:
|
|
244
|
+
dimension1: x,
|
|
245
245
|
data: i,
|
|
246
246
|
format: f,
|
|
247
247
|
textColor: p,
|
|
248
|
-
measureTextColor:
|
|
249
|
-
fontSize:
|
|
250
|
-
mainValueFontSize:
|
|
251
|
-
intl:
|
|
252
|
-
manualColors:
|
|
253
|
-
defaultBarColor:
|
|
254
|
-
barBackgroundColor:
|
|
255
|
-
labelPosition:
|
|
256
|
-
valuePosition:
|
|
257
|
-
labelWidth:
|
|
258
|
-
labelHeight:
|
|
259
|
-
labelFormat:
|
|
260
|
-
sorting:
|
|
261
|
-
sortDirection:
|
|
262
|
-
topN:
|
|
263
|
-
barSizeCriteria:
|
|
248
|
+
measureTextColor: M,
|
|
249
|
+
fontSize: k,
|
|
250
|
+
mainValueFontSize: D,
|
|
251
|
+
intl: N,
|
|
252
|
+
manualColors: V,
|
|
253
|
+
defaultBarColor: O,
|
|
254
|
+
barBackgroundColor: L,
|
|
255
|
+
labelPosition: _,
|
|
256
|
+
valuePosition: z,
|
|
257
|
+
labelWidth: G,
|
|
258
|
+
labelHeight: E,
|
|
259
|
+
labelFormat: J,
|
|
260
|
+
sorting: R,
|
|
261
|
+
sortDirection: W,
|
|
262
|
+
topN: P,
|
|
263
|
+
barSizeCriteria: Z,
|
|
264
264
|
selectedMeasures: H,
|
|
265
|
-
mainMeasureName:
|
|
266
|
-
sortMeasureName:
|
|
265
|
+
mainMeasureName: F,
|
|
266
|
+
sortMeasureName: T,
|
|
267
267
|
barSizeUseGroup: c = !1,
|
|
268
|
-
showMeasureLabels:
|
|
269
|
-
onHeightChange:
|
|
270
|
-
} =
|
|
268
|
+
showMeasureLabels: Y = !1,
|
|
269
|
+
onHeightChange: j
|
|
270
|
+
} = r, y = be({ last: null, timer: null }), K = () => {
|
|
271
271
|
if (!i) return { dataItems: [], measureField: null, dimensionField: null };
|
|
272
|
-
if (
|
|
273
|
-
const { data: e, meta: { fields: t } } = i,
|
|
274
|
-
return { dataItems: i.data.map((
|
|
275
|
-
value:
|
|
276
|
-
[a]:
|
|
277
|
-
[
|
|
278
|
-
})), measureField: a, dimensionField:
|
|
272
|
+
if (n === "csv") {
|
|
273
|
+
const { data: e, meta: { fields: t } } = i, o = t[0], a = t[1];
|
|
274
|
+
return { dataItems: i.data.map((C) => ({
|
|
275
|
+
value: C[o],
|
|
276
|
+
[a]: C[a],
|
|
277
|
+
[o]: C[o]
|
|
278
|
+
})), measureField: a, dimensionField: o };
|
|
279
279
|
} else {
|
|
280
|
-
const e = i.children || [], t = s,
|
|
280
|
+
const e = i.children || [], t = s, o = x;
|
|
281
281
|
return { dataItems: e.map((u) => ({
|
|
282
282
|
value: u.value,
|
|
283
283
|
[t]: u[t],
|
|
284
|
-
[
|
|
284
|
+
[o]: u.value,
|
|
285
285
|
vars: { ...u }
|
|
286
|
-
})), measureField: t, dimensionField:
|
|
286
|
+
})), measureField: t, dimensionField: o };
|
|
287
287
|
}
|
|
288
|
-
}, { dataItems:
|
|
289
|
-
let
|
|
290
|
-
if (
|
|
291
|
-
const e =
|
|
292
|
-
|
|
293
|
-
const a = e ? (t.vars && t.vars[e]) ?? t[e] ?? 0 : 0, u = e ? (
|
|
294
|
-
return
|
|
288
|
+
}, { dataItems: I, measureField: X, dimensionField: A } = K(), h = H && H.length > 0 ? H : X ? [{ name: X, format: f }] : s ? [{ name: s, format: f }] : [];
|
|
289
|
+
let v;
|
|
290
|
+
if (R === "measure") {
|
|
291
|
+
const e = F || T || X || (h[0] ? h[0].name : null);
|
|
292
|
+
v = I.sort((t, o) => {
|
|
293
|
+
const a = e ? (t.vars && t.vars[e]) ?? t[e] ?? 0 : 0, u = e ? (o.vars && o.vars[e]) ?? o[e] ?? 0 : 0;
|
|
294
|
+
return W === "asc" ? a - u : u - a;
|
|
295
295
|
});
|
|
296
|
-
} else
|
|
297
|
-
if (
|
|
298
|
-
const e = parseInt(
|
|
296
|
+
} else R === "dimension" ? v = I.sort((e, t) => W === "asc" ? xe(!1, N.locale, e.value, t.value) : xe(!0, N.locale, e.value, t.value)) : v = I;
|
|
297
|
+
if (P && !isNaN(parseInt(P))) {
|
|
298
|
+
const e = parseInt(P);
|
|
299
299
|
if (e > 0)
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
else if (
|
|
303
|
-
const t = [...
|
|
304
|
-
const
|
|
305
|
-
return (((u.vars && u.vars[
|
|
306
|
-
}),
|
|
307
|
-
t.slice(0, e).map((a) => a[
|
|
300
|
+
if (h.length <= 1)
|
|
301
|
+
v = v.slice(0, e);
|
|
302
|
+
else if (F) {
|
|
303
|
+
const t = [...I].sort((a, u) => {
|
|
304
|
+
const C = ((a.vars && a.vars[F]) ?? a[F] ?? 0) || 0;
|
|
305
|
+
return (((u.vars && u.vars[F]) ?? u[F] ?? 0) || 0) - C;
|
|
306
|
+
}), o = new Set(
|
|
307
|
+
t.slice(0, e).map((a) => a[A])
|
|
308
308
|
);
|
|
309
|
-
|
|
309
|
+
v = v.filter((a) => o.has(a[A]));
|
|
310
310
|
} else {
|
|
311
|
-
const t = [...
|
|
312
|
-
const
|
|
313
|
-
const d = ((a.vars && a.vars[
|
|
314
|
-
return
|
|
311
|
+
const t = [...I].sort((a, u) => {
|
|
312
|
+
const C = h.reduce((l, b) => {
|
|
313
|
+
const d = ((a.vars && a.vars[b.name]) ?? a[b.name] ?? 0) || 0;
|
|
314
|
+
return l + d;
|
|
315
315
|
}, 0);
|
|
316
|
-
return
|
|
317
|
-
const d = ((u.vars && u.vars[
|
|
318
|
-
return
|
|
319
|
-
}, 0) -
|
|
320
|
-
}),
|
|
321
|
-
t.slice(0, e).map((a) => a[
|
|
316
|
+
return h.reduce((l, b) => {
|
|
317
|
+
const d = ((u.vars && u.vars[b.name]) ?? u[b.name] ?? 0) || 0;
|
|
318
|
+
return l + d;
|
|
319
|
+
}, 0) - C;
|
|
320
|
+
}), o = new Set(
|
|
321
|
+
t.slice(0, e).map((a) => a[A])
|
|
322
322
|
);
|
|
323
|
-
|
|
323
|
+
v = v.filter((a) => o.has(a[A]));
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const a = (
|
|
326
|
+
const ee = {};
|
|
327
|
+
h.forEach((e) => {
|
|
328
|
+
ee[e.name] = v.reduce((t, o) => {
|
|
329
|
+
const a = (o.vars && o.vars[e.name]) ?? o[e.name] ?? 0;
|
|
330
330
|
return t + (a || 0);
|
|
331
331
|
}, 0);
|
|
332
332
|
});
|
|
333
|
-
const
|
|
333
|
+
const q = Math.max(
|
|
334
334
|
0,
|
|
335
|
-
...
|
|
336
|
-
), se = Object.values(
|
|
337
|
-
|
|
338
|
-
const t = e[
|
|
339
|
-
|
|
340
|
-
const a = (e.vars && e.vars[
|
|
341
|
-
|
|
335
|
+
...h.flatMap((e) => v.map((t) => (t.vars && t.vars[e.name]) ?? t[e.name] ?? 0))
|
|
336
|
+
), se = Object.values(ee).reduce((e, t) => e + t, 0), ae = {};
|
|
337
|
+
v.forEach((e) => {
|
|
338
|
+
const t = e[A];
|
|
339
|
+
ae[t] = 0, h.forEach((o) => {
|
|
340
|
+
const a = (e.vars && e.vars[o.name]) ?? e[o.name] ?? 0;
|
|
341
|
+
ae[t] += a || 0;
|
|
342
342
|
});
|
|
343
343
|
});
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
const t = e[
|
|
347
|
-
|
|
348
|
-
}),
|
|
349
|
-
return /* @__PURE__ */ m(
|
|
344
|
+
const re = {};
|
|
345
|
+
if (v.forEach((e) => {
|
|
346
|
+
const t = e[A], o = h.map((a) => ((e.vars && e.vars[a.name]) ?? e[a.name] ?? 0) || 0);
|
|
347
|
+
re[t] = o.length > 0 ? Math.max(...o) : 0;
|
|
348
|
+
}), v.length === 0 || !A || h.length === 0 && !X)
|
|
349
|
+
return /* @__PURE__ */ m(je, { textColor: p });
|
|
350
350
|
const ie = (e, t) => {
|
|
351
|
-
const
|
|
352
|
-
return
|
|
353
|
-
}, me = 28, fe = 6,
|
|
354
|
-
if (
|
|
351
|
+
const o = r.manualColorsMode || "dimension", a = (V == null ? void 0 : V[n]) || {};
|
|
352
|
+
return o === "measure" ? a.measures && a.measures[e] ? a.measures[e] : t && a[t] ? a[t] : O : t && a[t] ? a[t] : a.measures && a.measures[e] ? a.measures[e] : O;
|
|
353
|
+
}, me = 28, fe = 6, oe = 6 + (_ === "left" ? 0 : 6), ce = E && parseInt(E, 10) || 0, ne = (e) => {
|
|
354
|
+
if (r.showZeroNullMeasures) return h.length;
|
|
355
355
|
let t = 0;
|
|
356
|
-
return
|
|
357
|
-
const a = (e.vars && e.vars[
|
|
356
|
+
return h.forEach((o) => {
|
|
357
|
+
const a = (e.vars && e.vars[o.name]) ?? e[o.name] ?? null, u = typeof a == "number" ? a : a != null ? parseFloat(a) : null;
|
|
358
358
|
u != null && u !== 0 && t++;
|
|
359
359
|
}), t;
|
|
360
360
|
};
|
|
361
|
-
let
|
|
362
|
-
|
|
363
|
-
const t = Math.max(1,
|
|
364
|
-
|
|
361
|
+
let Q = 0;
|
|
362
|
+
v.forEach((e) => {
|
|
363
|
+
const t = Math.max(1, ne(e)), o = me * t + fe * Math.max(0, t - 1), a = _ === "left" ? Math.max(o, ce) + 12 : o + 12 + oe;
|
|
364
|
+
Q += a;
|
|
365
365
|
});
|
|
366
|
-
const ue =
|
|
367
|
-
if (typeof
|
|
366
|
+
const ue = Q + 40;
|
|
367
|
+
if (typeof j == "function") {
|
|
368
368
|
const e = Math.ceil(ue);
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
y.current.timer && (clearTimeout(y.current.timer), y.current.timer = null), y.current.last !== e && (y.current.timer = setTimeout(() => {
|
|
370
|
+
y.current.last !== e && (y.current.last = e, j(e));
|
|
371
371
|
}, 100));
|
|
372
372
|
}
|
|
373
|
-
return /* @__PURE__ */ m("div", { className: "grouped-bars-data-frame", children:
|
|
374
|
-
const
|
|
375
|
-
const
|
|
376
|
-
let
|
|
377
|
-
if (
|
|
378
|
-
if (
|
|
373
|
+
return /* @__PURE__ */ m("div", { className: "grouped-bars-data-frame", children: v.map((e, t) => {
|
|
374
|
+
const o = e[A], a = h.map((l) => {
|
|
375
|
+
const b = (e.vars && e.vars[l.name]) ?? e[l.name] ?? null, d = typeof b == "number" ? b : b != null ? parseFloat(b) : null;
|
|
376
|
+
let g = 0;
|
|
377
|
+
if (Z === "percentage")
|
|
378
|
+
if (h.length > 1)
|
|
379
379
|
if (c) {
|
|
380
|
-
const
|
|
381
|
-
|
|
380
|
+
const S = ae[o] || 0;
|
|
381
|
+
g = S > 0 && d != null ? d / S * 100 : 0;
|
|
382
382
|
} else {
|
|
383
|
-
const
|
|
384
|
-
|
|
383
|
+
const S = se || 0;
|
|
384
|
+
g = S > 0 && d != null ? d / S * 100 : 0;
|
|
385
385
|
}
|
|
386
386
|
else {
|
|
387
|
-
const
|
|
388
|
-
|
|
387
|
+
const S = ee[l.name] || 0;
|
|
388
|
+
g = S > 0 && d != null ? d / S * 100 : 0;
|
|
389
389
|
}
|
|
390
|
-
else if (
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
393
|
-
|
|
390
|
+
else if (Z === "relative_max")
|
|
391
|
+
if (h.length > 1 && c) {
|
|
392
|
+
const S = re[o] || 0;
|
|
393
|
+
g = S > 0 && d != null ? d / S * 100 : 0;
|
|
394
394
|
} else
|
|
395
|
-
|
|
395
|
+
g = q > 0 && d != null ? d / q * 100 : 0;
|
|
396
396
|
else
|
|
397
|
-
|
|
398
|
-
(d == null || d === 0) && (
|
|
399
|
-
const
|
|
400
|
-
return { name:
|
|
401
|
-
}), u =
|
|
402
|
-
let
|
|
403
|
-
if (
|
|
404
|
-
const
|
|
405
|
-
|
|
397
|
+
g = q > 0 && d != null ? d / q * 100 : 0;
|
|
398
|
+
(d == null || d === 0) && (g = 0), g = Math.max(0, Math.min(100, g));
|
|
399
|
+
const U = ie(l.name, o);
|
|
400
|
+
return { name: l.name, label: l.label || l.name, value: d, width: g, color: U, format: l.format || f };
|
|
401
|
+
}), u = r.showZeroNullMeasures ? a : a.filter((l) => l.value != null && l.value !== 0);
|
|
402
|
+
let C = null;
|
|
403
|
+
if (F) {
|
|
404
|
+
const l = u.find((b) => b.name === F);
|
|
405
|
+
r.showZeroNullMeasures ? C = l || null : C = l && l.value != null && l.value !== 0 ? l : null;
|
|
406
406
|
}
|
|
407
|
-
let
|
|
408
|
-
|
|
409
|
-
(
|
|
410
|
-
|
|
411
|
-
|
|
407
|
+
let w = C ? u.filter((l) => l.name !== F) : u;
|
|
408
|
+
if (R === "measure") {
|
|
409
|
+
const l = T ? w.find((g) => g.name === T) : null, d = [...l ? w.filter((g) => g.name !== T) : w].sort(
|
|
410
|
+
(g, U) => W === "asc" ? g.value - U.value : U.value - g.value
|
|
411
|
+
);
|
|
412
|
+
w = l ? [l, ...d] : d;
|
|
413
|
+
}
|
|
414
|
+
return /* @__PURE__ */ m(
|
|
415
|
+
Je,
|
|
412
416
|
{
|
|
413
|
-
dimensionValue:
|
|
414
|
-
measureEntries:
|
|
415
|
-
mainEntry:
|
|
416
|
-
barBackgroundColor:
|
|
417
|
+
dimensionValue: o,
|
|
418
|
+
measureEntries: w,
|
|
419
|
+
mainEntry: C,
|
|
420
|
+
barBackgroundColor: L,
|
|
417
421
|
textColor: p,
|
|
418
|
-
measureTextColor:
|
|
419
|
-
fontSize:
|
|
420
|
-
mainValueFontSize:
|
|
421
|
-
labelPosition:
|
|
422
|
-
valuePosition:
|
|
422
|
+
measureTextColor: M,
|
|
423
|
+
fontSize: k,
|
|
424
|
+
mainValueFontSize: D,
|
|
425
|
+
labelPosition: _,
|
|
426
|
+
valuePosition: z,
|
|
423
427
|
format: f,
|
|
424
|
-
labelWidth:
|
|
425
|
-
labelHeight:
|
|
426
|
-
labelFormat:
|
|
428
|
+
labelWidth: G,
|
|
429
|
+
labelHeight: E,
|
|
430
|
+
labelFormat: J,
|
|
427
431
|
vars: e.vars,
|
|
428
|
-
intl:
|
|
429
|
-
showMeasureLabels:
|
|
432
|
+
intl: N,
|
|
433
|
+
showMeasureLabels: Y
|
|
430
434
|
},
|
|
431
|
-
`${
|
|
435
|
+
`${o}-${t}`
|
|
432
436
|
);
|
|
433
437
|
}) });
|
|
434
|
-
},
|
|
438
|
+
}, Xe = (r) => {
|
|
435
439
|
var he;
|
|
436
440
|
const {
|
|
437
|
-
editing:
|
|
441
|
+
editing: n = !1,
|
|
438
442
|
unique: s,
|
|
439
|
-
intl:
|
|
443
|
+
intl: x,
|
|
440
444
|
"data-csv": i = "",
|
|
441
445
|
"data-dvz-proxy-dataset-id": f,
|
|
442
|
-
"data-no-data-message": p =
|
|
443
|
-
"data-view-mode":
|
|
444
|
-
"data-height":
|
|
445
|
-
"data-app":
|
|
446
|
-
"data-measures":
|
|
447
|
-
"data-format":
|
|
448
|
-
"data-group":
|
|
449
|
-
"data-filters":
|
|
450
|
-
"data-text-color":
|
|
451
|
-
"data-measure-text-color":
|
|
452
|
-
"data-back-ground-color":
|
|
453
|
-
"data-font-size":
|
|
454
|
-
"data-dimension1":
|
|
455
|
-
"data-wait-for-filters":
|
|
456
|
-
"data-no-data-text":
|
|
457
|
-
"data-manual-colors":
|
|
458
|
-
"data-default-bar-color":
|
|
459
|
-
"data-bar-background-color": H =
|
|
460
|
-
"data-label-position":
|
|
461
|
-
"data-value-position":
|
|
446
|
+
"data-no-data-message": p = Re,
|
|
447
|
+
"data-view-mode": M = "info",
|
|
448
|
+
"data-height": k,
|
|
449
|
+
"data-app": D,
|
|
450
|
+
"data-measures": N = "{}",
|
|
451
|
+
"data-format": V = "{}",
|
|
452
|
+
"data-group": O,
|
|
453
|
+
"data-filters": L = "[]",
|
|
454
|
+
"data-text-color": _ = Ue,
|
|
455
|
+
"data-measure-text-color": z = "#ffffff",
|
|
456
|
+
"data-back-ground-color": G = $e,
|
|
457
|
+
"data-font-size": E = ke,
|
|
458
|
+
"data-dimension1": J,
|
|
459
|
+
"data-wait-for-filters": R = "false",
|
|
460
|
+
"data-no-data-text": W = He,
|
|
461
|
+
"data-manual-colors": P = "{}",
|
|
462
|
+
"data-default-bar-color": Z = Ve,
|
|
463
|
+
"data-bar-background-color": H = Oe,
|
|
464
|
+
"data-label-position": F,
|
|
465
|
+
"data-value-position": T,
|
|
462
466
|
"data-label-width": c,
|
|
463
|
-
"data-label-height":
|
|
464
|
-
"data-label-format":
|
|
465
|
-
"data-sorting":
|
|
466
|
-
"data-sort-direction":
|
|
467
|
-
"data-sort-measure":
|
|
468
|
-
"data-top-n":
|
|
469
|
-
"data-bar-size-criteria":
|
|
470
|
-
"data-main-measure":
|
|
471
|
-
"data-show-measure-labels":
|
|
472
|
-
"data-bar-size-use-group":
|
|
473
|
-
"data-enable-manual-colors":
|
|
467
|
+
"data-label-height": Y,
|
|
468
|
+
"data-label-format": j,
|
|
469
|
+
"data-sorting": y,
|
|
470
|
+
"data-sort-direction": K,
|
|
471
|
+
"data-sort-measure": I,
|
|
472
|
+
"data-top-n": X,
|
|
473
|
+
"data-bar-size-criteria": A,
|
|
474
|
+
"data-main-measure": h,
|
|
475
|
+
"data-show-measure-labels": v,
|
|
476
|
+
"data-bar-size-use-group": ee,
|
|
477
|
+
"data-enable-manual-colors": q,
|
|
474
478
|
"data-manual-colors-mode": se,
|
|
475
|
-
"data-main-value-font-size":
|
|
476
|
-
"data-show-zero-null-measures":
|
|
477
|
-
} =
|
|
479
|
+
"data-main-value-font-size": ae,
|
|
480
|
+
"data-show-zero-null-measures": re
|
|
481
|
+
} = r, ie = be(null), [me, fe] = ve(M), [oe, ce] = ve(null), ne = parseInt(k || 0, 10) || 0, Q = Math.max(ne, oe || 0), ue = n ? Q - 80 : Q - 40, e = le(V, n), t = we(e), o = le(L, n), a = le(N, n), u = a !== null ? a : N && typeof N == "string" && !N.startsWith("{") && !N.startsWith("[") ? [N] : null, C = le(P, n), w = Ge(u, t, D, r["data-enable-custom-measure-formats"] === "true"), l = w.map((te) => te.name), b = typeof h == "string" && h.length > 0 ? $(h) : null, d = b && b.toLowerCase() === "none" ? null : b || null, g = w.length > 1 ? d === null ? null : l.includes(d) ? d : l[0] : null, U = typeof I == "string" && I.length > 0 ? $(I) : null, S = U && U.toLowerCase() === "none" ? null : U || null, Se = w.length > 1 ? S === null ? null : l.includes(S) ? S : l[0] : null, Me = We(o, f), pe = Pe(J), Fe = A, Ce = ee === "true", Ne = q === "true", ye = se || "dimension", Ie = parseInt(ae || de, 10), De = v === "true", ze = re === "true";
|
|
478
482
|
return /* @__PURE__ */ m("div", { ref: ie, children: /* @__PURE__ */ m(
|
|
479
|
-
|
|
483
|
+
Be,
|
|
480
484
|
{
|
|
481
|
-
className: `chart container grouped-bars-container ${
|
|
482
|
-
style: { height: (
|
|
485
|
+
className: `chart container grouped-bars-container ${n ? "editing" : ""}`,
|
|
486
|
+
style: { height: (Q || ne) + "px", backgroundColor: G },
|
|
483
487
|
fluid: !0,
|
|
484
488
|
children: /* @__PURE__ */ m(
|
|
485
|
-
|
|
489
|
+
Le,
|
|
486
490
|
{
|
|
487
491
|
style: { height: `${ue}px` },
|
|
488
|
-
params:
|
|
489
|
-
app:
|
|
490
|
-
group:
|
|
492
|
+
params: Me,
|
|
493
|
+
app: D,
|
|
494
|
+
group: O,
|
|
491
495
|
csv: i,
|
|
492
|
-
editing:
|
|
493
|
-
waitForFilters:
|
|
494
|
-
store: [
|
|
496
|
+
editing: n,
|
|
497
|
+
waitForFilters: R === "true",
|
|
498
|
+
store: [D, s, ...pe],
|
|
495
499
|
source: pe.join("/"),
|
|
496
|
-
children: /* @__PURE__ */ m(
|
|
497
|
-
|
|
500
|
+
children: /* @__PURE__ */ m(Te, { children: /* @__PURE__ */ m(
|
|
501
|
+
Ke,
|
|
498
502
|
{
|
|
499
|
-
editing:
|
|
500
|
-
locale:
|
|
501
|
-
intl:
|
|
502
|
-
app:
|
|
503
|
+
editing: n,
|
|
504
|
+
locale: x.locale,
|
|
505
|
+
intl: x,
|
|
506
|
+
app: D,
|
|
503
507
|
format: t,
|
|
504
|
-
dimension1:
|
|
505
|
-
manualColors:
|
|
506
|
-
manualColorsMode:
|
|
507
|
-
measure:
|
|
508
|
-
fontSize:
|
|
509
|
-
textColor:
|
|
510
|
-
measureTextColor:
|
|
511
|
-
backGroundColor:
|
|
512
|
-
noDataText:
|
|
513
|
-
defaultBarColor:
|
|
514
|
-
barBackgroundColor:
|
|
515
|
-
labelPosition:
|
|
516
|
-
valuePosition:
|
|
508
|
+
dimension1: J,
|
|
509
|
+
manualColors: Ne ? C : {},
|
|
510
|
+
manualColorsMode: ye,
|
|
511
|
+
measure: w.length === 1 ? (he = w[0]) == null ? void 0 : he.name : null,
|
|
512
|
+
fontSize: E,
|
|
513
|
+
textColor: $(_),
|
|
514
|
+
measureTextColor: $(z),
|
|
515
|
+
backGroundColor: $(G),
|
|
516
|
+
noDataText: W,
|
|
517
|
+
defaultBarColor: $(Z),
|
|
518
|
+
barBackgroundColor: $(H),
|
|
519
|
+
labelPosition: F,
|
|
520
|
+
valuePosition: w.length > 1 ? "bar" : T,
|
|
517
521
|
labelWidth: c,
|
|
518
|
-
labelHeight:
|
|
519
|
-
labelFormat:
|
|
520
|
-
sorting:
|
|
521
|
-
sortDirection:
|
|
522
|
-
topN:
|
|
523
|
-
barSizeCriteria:
|
|
524
|
-
barSizeUseGroup:
|
|
525
|
-
selectedMeasures:
|
|
526
|
-
mainMeasureName:
|
|
527
|
-
sortMeasureName:
|
|
522
|
+
labelHeight: Y,
|
|
523
|
+
labelFormat: j,
|
|
524
|
+
sorting: y,
|
|
525
|
+
sortDirection: K,
|
|
526
|
+
topN: X,
|
|
527
|
+
barSizeCriteria: Fe,
|
|
528
|
+
barSizeUseGroup: Ce,
|
|
529
|
+
selectedMeasures: w,
|
|
530
|
+
mainMeasureName: g,
|
|
531
|
+
sortMeasureName: Se,
|
|
528
532
|
mainValueFontSize: Ie,
|
|
529
|
-
showMeasureLabels:
|
|
530
|
-
showZeroNullMeasures:
|
|
533
|
+
showMeasureLabels: De,
|
|
534
|
+
showZeroNullMeasures: ze,
|
|
531
535
|
onHeightChange: (te) => {
|
|
532
536
|
if (typeof te == "number" && te > 0) {
|
|
533
537
|
const ge = Math.ceil(te);
|
|
534
|
-
ge !==
|
|
538
|
+
ge !== oe && ce(ge);
|
|
535
539
|
}
|
|
536
540
|
}
|
|
537
541
|
}
|
|
@@ -540,10 +544,10 @@ const He = "No data matches your selection", Re = "-", Ee = "#5a5d68", Ue = "non
|
|
|
540
544
|
)
|
|
541
545
|
}
|
|
542
546
|
) });
|
|
543
|
-
},
|
|
544
|
-
const { "data-app": s, "data-group":
|
|
547
|
+
}, qe = (r, n) => {
|
|
548
|
+
const { "data-app": s, "data-group": x } = n, i = r.getIn(["data", "measures", s, x]);
|
|
545
549
|
return i ? { injectedMeasures: i } : {};
|
|
546
|
-
},
|
|
550
|
+
}, Qe = {}, sa = _e(qe, Qe)(Xe);
|
|
547
551
|
export {
|
|
548
|
-
|
|
552
|
+
sa as default
|
|
549
553
|
};
|