@devgateway/dvz-ui-react 1.8.8 → 1.9.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/dist/cjs/common.css +1 -1
- package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -0
- package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -1
- package/dist/cjs/embeddable/big-number-trend/useBigNumberTrendData.js +1 -0
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Messages.js +2 -2
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/chart/index.js +1 -1
- package/dist/cjs/embeddable/d3Map/index.js +1 -1
- package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
- package/dist/cjs/embeddable/data/DataConsumer.js +1 -1
- package/dist/cjs/embeddable/data/DataProvider.js +1 -1
- package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/FlexWrapDetector.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/common.css +1 -1
- package/dist/esm/embeddable/big-number-trend/Alternative.js +62 -211
- package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +125 -0
- package/dist/esm/embeddable/big-number-trend/Classic.js +51 -181
- package/dist/esm/embeddable/big-number-trend/index.js +8 -8
- package/dist/esm/embeddable/big-number-trend/useBigNumberTrendData.js +49 -0
- package/dist/esm/embeddable/chart/Bar.js +464 -471
- package/dist/esm/embeddable/chart/Messages.js +18 -15
- package/dist/esm/embeddable/chart/data/Line.js +1 -4
- package/dist/esm/embeddable/chart/data/Utils.js +0 -1
- package/dist/esm/embeddable/chart/index.js +363 -359
- package/dist/esm/embeddable/d3Map/index.js +129 -125
- package/dist/esm/embeddable/data/CategoriesProvider.js +31 -38
- package/dist/esm/embeddable/data/DataConsumer.js +12 -8
- package/dist/esm/embeddable/data/DataProvider.js +62 -124
- package/dist/esm/embeddable/featuredtabs/index.js +64 -61
- package/dist/esm/embeddable/map/index.js +42 -42
- package/dist/esm/embeddable/reducers/data.js +46 -44
- package/dist/esm/index.js +74 -73
- package/dist/esm/layout/FlexWrapDetector.js +10 -10
- package/dist/esm/styles.css +1 -1
- package/dist/types/embeddable/big-number-trend/Alternative.d.ts +2 -4
- package/dist/types/embeddable/big-number-trend/BigNumberTrendContainer.d.ts +5 -0
- package/dist/types/embeddable/big-number-trend/Classic.d.ts +2 -4
- package/dist/types/embeddable/big-number-trend/useBigNumberTrendData.d.ts +21 -0
- package/dist/types/embeddable/chart/Bar.d.ts +1 -2
- package/dist/types/embeddable/data/DataConsumer.d.ts +5 -2
- package/dist/types/embeddable/data/DataProvider.d.ts +18 -3
- package/dist/types/layout/FlexWrapDetector.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,99 +1,96 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { ResponsiveBar as
|
|
5
|
-
import { injectIntl as
|
|
6
|
-
import { useTheme as
|
|
7
|
-
import { line as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
editing:
|
|
14
|
-
legends:
|
|
15
|
-
marginLeft:
|
|
16
|
-
marginTop:
|
|
17
|
-
marginRight:
|
|
18
|
-
marginBottom:
|
|
19
|
-
options:
|
|
1
|
+
import { jsx as c, jsxs as x, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
+
import { useState as B, useEffect as Ne, Fragment as Pe } from "react";
|
|
3
|
+
import Ct from "./Tooltip.js";
|
|
4
|
+
import { ResponsiveBar as Yt } from "@nivo/bar";
|
|
5
|
+
import { injectIntl as Kt } from "react-intl";
|
|
6
|
+
import { useTheme as Pt } from "@nivo/theming";
|
|
7
|
+
import { line as Xe } from "d3-shape";
|
|
8
|
+
import qe from "./LineLayer.js";
|
|
9
|
+
import Ie from "papaparse";
|
|
10
|
+
import Xt from "../../layout/FlexWrapDetector.js";
|
|
11
|
+
import ke from "../../utils/deviceType.js";
|
|
12
|
+
const qt = "middle", Zt = "top", W = "#66676d", Ze = "#dddddd", Jt = "none", ee = "_Color", Ut = ({
|
|
13
|
+
editing: y,
|
|
14
|
+
legends: q,
|
|
15
|
+
marginLeft: Je,
|
|
16
|
+
marginTop: j,
|
|
17
|
+
marginRight: Ue,
|
|
18
|
+
marginBottom: R,
|
|
19
|
+
options: m,
|
|
20
20
|
intl: b,
|
|
21
|
-
format:
|
|
22
|
-
colors:
|
|
23
|
-
groupMode:
|
|
24
|
-
height:
|
|
21
|
+
format: g,
|
|
22
|
+
colors: T,
|
|
23
|
+
groupMode: E,
|
|
24
|
+
height: Qe,
|
|
25
|
+
chartHeight: Le,
|
|
25
26
|
showLegends: te,
|
|
26
27
|
legendPosition: v,
|
|
27
28
|
tickRotation: z,
|
|
28
29
|
offsetText: ae,
|
|
29
30
|
tickColor: ne,
|
|
30
31
|
layout: u,
|
|
31
|
-
reverse:
|
|
32
|
-
offsetY:
|
|
33
|
-
csvLineLayerData:
|
|
32
|
+
reverse: A,
|
|
33
|
+
offsetY: Ge,
|
|
34
|
+
csvLineLayerData: De,
|
|
34
35
|
tooltip: le,
|
|
35
36
|
lineLayerEnabled: re,
|
|
36
|
-
overlays:
|
|
37
|
+
overlays: H,
|
|
37
38
|
maxValue: ie,
|
|
38
|
-
valueScale:
|
|
39
|
+
valueScale: et,
|
|
39
40
|
colorGenerator: N,
|
|
40
|
-
legendLabel:
|
|
41
|
-
overrideTickColor:
|
|
41
|
+
legendLabel: we,
|
|
42
|
+
overrideTickColor: tt,
|
|
42
43
|
fixedMinValue: se,
|
|
43
44
|
fixedMaxValue: ce,
|
|
44
|
-
barPadding:
|
|
45
|
-
barLabelPosition:
|
|
46
|
-
barInnerPadding:
|
|
47
|
-
tooltipEnabled:
|
|
48
|
-
xLabelColor:
|
|
49
|
-
barLabelColor:
|
|
50
|
-
legendCheckBack:
|
|
51
|
-
legendLabelBack:
|
|
52
|
-
legendLabelColor:
|
|
53
|
-
highlightXAxisLine:
|
|
54
|
-
showTickLine:
|
|
55
|
-
showRightAxis:
|
|
56
|
-
offsetRight:
|
|
57
|
-
offsetBottom:
|
|
58
|
-
confidenceIntervals:
|
|
59
|
-
showGroupTotal:
|
|
60
|
-
groupTotalLabel:
|
|
61
|
-
groupTotalFormat:
|
|
62
|
-
groupTotalMeasure:
|
|
63
|
-
groupTotalOffset:
|
|
64
|
-
groupTotalFixedPosition:
|
|
65
|
-
tooltipEnableMarkdown:
|
|
66
|
-
xAxisTickValues:
|
|
67
|
-
yAxisTickValues:
|
|
68
|
-
mobileCustomization:
|
|
69
|
-
minMaxClamp:
|
|
70
|
-
reverseLegend:
|
|
71
|
-
enableGridY:
|
|
72
|
-
enableGridX:
|
|
73
|
-
customAxisFormat:
|
|
74
|
-
previewMode:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
lineXAxisTickCount: ft = 10,
|
|
79
|
-
lineXAxisTickEvery: ut = 1
|
|
45
|
+
barPadding: at,
|
|
46
|
+
barLabelPosition: Fe,
|
|
47
|
+
barInnerPadding: nt,
|
|
48
|
+
tooltipEnabled: lt,
|
|
49
|
+
xLabelColor: M,
|
|
50
|
+
barLabelColor: Z,
|
|
51
|
+
legendCheckBack: k,
|
|
52
|
+
legendLabelBack: he,
|
|
53
|
+
legendLabelColor: de,
|
|
54
|
+
highlightXAxisLine: rt,
|
|
55
|
+
showTickLine: C,
|
|
56
|
+
showRightAxis: it,
|
|
57
|
+
offsetRight: st,
|
|
58
|
+
offsetBottom: Me,
|
|
59
|
+
confidenceIntervals: me,
|
|
60
|
+
showGroupTotal: ct,
|
|
61
|
+
groupTotalLabel: Oe,
|
|
62
|
+
groupTotalFormat: Ee,
|
|
63
|
+
groupTotalMeasure: ze,
|
|
64
|
+
groupTotalOffset: V,
|
|
65
|
+
groupTotalFixedPosition: J,
|
|
66
|
+
tooltipEnableMarkdown: ht,
|
|
67
|
+
xAxisTickValues: dt,
|
|
68
|
+
yAxisTickValues: mt,
|
|
69
|
+
mobileCustomization: ft,
|
|
70
|
+
minMaxClamp: Qt,
|
|
71
|
+
reverseLegend: ut,
|
|
72
|
+
enableGridY: ot,
|
|
73
|
+
enableGridX: yt,
|
|
74
|
+
customAxisFormat: O,
|
|
75
|
+
previewMode: L,
|
|
76
|
+
lineXAxisTickMode: Ve = "none",
|
|
77
|
+
lineXAxisTickCount: xt = 10,
|
|
78
|
+
lineXAxisTickEvery: pt = 1
|
|
80
79
|
}) => {
|
|
81
|
-
var
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
j.forEach((e, t) => {
|
|
88
|
-
$e[t] = !0;
|
|
80
|
+
var Ke;
|
|
81
|
+
const fe = y ? L === "Mobile" || L === "Tablet" : ["mobile", "tablet", "midTablet"].includes(ke()), U = ["tablet", "midTablet"].includes(ke()), Q = ke() === "mobile", ue = 30, oe = 15, f = JSON.parse(
|
|
82
|
+
decodeURIComponent(ft)
|
|
83
|
+
), $e = fe && ((f == null ? void 0 : f.showCustomization) ?? !1), S = $e && L !== "Desktop", _ = !y && $e, ye = () => Z === "null" || Z === null || !Z ? "#000000" : Z, [D, gt] = B([]), { colorBy: Y } = T, Be = {};
|
|
84
|
+
H.forEach((e, t) => {
|
|
85
|
+
Be[t] = !0;
|
|
89
86
|
});
|
|
90
|
-
const [
|
|
91
|
-
|
|
87
|
+
const [I, bt] = B(Be), [We, vt] = B(50), [Gt, Te] = B(j), [ea, Ae] = B(0), [He, Se] = B(R), [_e, Nt] = B(!1);
|
|
88
|
+
Ne(() => {
|
|
92
89
|
let e, t;
|
|
93
90
|
return e = requestAnimationFrame(() => {
|
|
94
91
|
e = requestAnimationFrame(() => {
|
|
95
92
|
t = setTimeout(() => {
|
|
96
|
-
|
|
93
|
+
Nt(!0);
|
|
97
94
|
}, 50);
|
|
98
95
|
});
|
|
99
96
|
}), () => {
|
|
@@ -103,48 +100,48 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
103
100
|
const K = ((e, t, r, i, a) => {
|
|
104
101
|
let s = [];
|
|
105
102
|
return e.data && (s = t.colorBy === "index" ? e.data.map((l) => {
|
|
106
|
-
let n,
|
|
107
|
-
return r.indexOf(l[e.indexBy]) > -1 ? (
|
|
108
|
-
enabled:
|
|
103
|
+
let n, h = !0;
|
|
104
|
+
return r.indexOf(l[e.indexBy]) > -1 ? (h = !1, n = i) : n = l[ee] ? l[ee] : a.getColor(l.id, l), {
|
|
105
|
+
enabled: h,
|
|
109
106
|
color: n,
|
|
110
107
|
id: l[e.indexBy],
|
|
111
108
|
label: l[e.indexBy]
|
|
112
109
|
};
|
|
113
110
|
}) : e.keys.map((l) => {
|
|
114
|
-
let n,
|
|
115
|
-
return r.indexOf(l) > -1 ? (
|
|
116
|
-
enabled:
|
|
111
|
+
let n, h = !0;
|
|
112
|
+
return r.indexOf(l) > -1 ? (h = !1, n = i) : n = a.getColorByKey(l), {
|
|
113
|
+
enabled: h,
|
|
117
114
|
color: n,
|
|
118
115
|
id: l,
|
|
119
116
|
label: l
|
|
120
117
|
};
|
|
121
118
|
})), s;
|
|
122
119
|
})(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
m,
|
|
121
|
+
T,
|
|
122
|
+
D,
|
|
123
|
+
Jt,
|
|
127
124
|
N
|
|
128
|
-
),
|
|
129
|
-
te && K.map((e) => /* @__PURE__ */
|
|
125
|
+
), je = () => (ut && K.reverse(), /* @__PURE__ */ x(ve, { children: [
|
|
126
|
+
te && K.map((e) => /* @__PURE__ */ x(
|
|
130
127
|
"div",
|
|
131
128
|
{
|
|
132
129
|
className: `legend item ${e.enabled ? "" : "ignore"}`,
|
|
133
|
-
onClick: () =>
|
|
130
|
+
onClick: () => zt(e.id),
|
|
134
131
|
children: [
|
|
135
|
-
|
|
132
|
+
k && /* @__PURE__ */ c(
|
|
136
133
|
"input",
|
|
137
134
|
{
|
|
138
135
|
className: e.enabled ? "" : "ignore",
|
|
139
136
|
type: "checkbox",
|
|
140
137
|
checked: e.enabled,
|
|
141
138
|
style: {
|
|
142
|
-
backgroundColor:
|
|
139
|
+
backgroundColor: k ? Y === "values" ? ne : e.color : "none",
|
|
143
140
|
color: "#000"
|
|
144
141
|
}
|
|
145
142
|
}
|
|
146
143
|
),
|
|
147
|
-
!
|
|
144
|
+
!k && /* @__PURE__ */ c(
|
|
148
145
|
"input",
|
|
149
146
|
{
|
|
150
147
|
type: "checkbox",
|
|
@@ -154,31 +151,31 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
154
151
|
}
|
|
155
152
|
}
|
|
156
153
|
),
|
|
157
|
-
|
|
154
|
+
k && /* @__PURE__ */ c(
|
|
158
155
|
"span",
|
|
159
156
|
{
|
|
160
157
|
className: "checkmark-with-bg",
|
|
161
158
|
style: { backgroundColor: e.color }
|
|
162
159
|
}
|
|
163
160
|
),
|
|
164
|
-
!
|
|
165
|
-
|
|
161
|
+
!k && /* @__PURE__ */ c("span", { className: "checkmark" }),
|
|
162
|
+
he && /* @__PURE__ */ c(
|
|
166
163
|
"label",
|
|
167
164
|
{
|
|
168
165
|
className: e.enabled ? "" : "ignore",
|
|
169
166
|
style: {
|
|
170
|
-
backgroundColor:
|
|
171
|
-
color:
|
|
167
|
+
backgroundColor: Y === "values" ? ne : e.color,
|
|
168
|
+
color: de
|
|
172
169
|
},
|
|
173
170
|
children: e.label
|
|
174
171
|
}
|
|
175
172
|
),
|
|
176
|
-
!
|
|
173
|
+
!he && /* @__PURE__ */ c(
|
|
177
174
|
"label",
|
|
178
175
|
{
|
|
179
176
|
className: e.enabled ? "" : "ignore",
|
|
180
177
|
style: {
|
|
181
|
-
color:
|
|
178
|
+
color: de
|
|
182
179
|
},
|
|
183
180
|
children: e.label
|
|
184
181
|
}
|
|
@@ -186,7 +183,7 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
186
183
|
]
|
|
187
184
|
}
|
|
188
185
|
)),
|
|
189
|
-
|
|
186
|
+
Y === "values" && /* @__PURE__ */ x("div", { className: "legend item", children: [
|
|
190
187
|
/* @__PURE__ */ c(
|
|
191
188
|
"label",
|
|
192
189
|
{
|
|
@@ -200,14 +197,14 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
200
197
|
}
|
|
201
198
|
),
|
|
202
199
|
/* @__PURE__ */ c("label", { children: b.formatNumber(
|
|
203
|
-
|
|
200
|
+
g.style === "percent" ? N.minValue / 100 : N.minValue,
|
|
204
201
|
{
|
|
205
|
-
...
|
|
202
|
+
...g,
|
|
206
203
|
minimumFractionDigits: 0
|
|
207
204
|
}
|
|
208
205
|
) })
|
|
209
206
|
] }),
|
|
210
|
-
|
|
207
|
+
Y === "values" && /* @__PURE__ */ x("div", { className: "legend item", children: [
|
|
211
208
|
/* @__PURE__ */ c(
|
|
212
209
|
"label",
|
|
213
210
|
{
|
|
@@ -222,22 +219,22 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
222
219
|
}
|
|
223
220
|
),
|
|
224
221
|
/* @__PURE__ */ c("label", { children: b.formatNumber(
|
|
225
|
-
|
|
222
|
+
g.style === "percent" ? N.maxValue / 100 : N.maxValue,
|
|
226
223
|
{
|
|
227
|
-
...
|
|
224
|
+
...g,
|
|
228
225
|
minimumFractionDigits: 0
|
|
229
226
|
}
|
|
230
227
|
) })
|
|
231
228
|
] }),
|
|
232
|
-
te && re &&
|
|
229
|
+
te && re && H.map((e, t) => /* @__PURE__ */ x("div", { className: "legend item", onClick: () => Vt(t), children: [
|
|
233
230
|
/* @__PURE__ */ c(
|
|
234
231
|
"input",
|
|
235
232
|
{
|
|
236
|
-
className:
|
|
233
|
+
className: k && I[t] ? "" : "ignore",
|
|
237
234
|
type: "checkbox",
|
|
238
|
-
checked:
|
|
235
|
+
checked: I[t],
|
|
239
236
|
style: {
|
|
240
|
-
backgroundColor:
|
|
237
|
+
backgroundColor: I[t] && k === !0 ? e.lineColor : "none",
|
|
241
238
|
color: "#000"
|
|
242
239
|
}
|
|
243
240
|
}
|
|
@@ -245,65 +242,65 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
245
242
|
/* @__PURE__ */ c(
|
|
246
243
|
"span",
|
|
247
244
|
{
|
|
248
|
-
className:
|
|
245
|
+
className: k ? "checkmark-with-bg" : "checkmark",
|
|
249
246
|
style: {
|
|
250
|
-
backgroundColor:
|
|
247
|
+
backgroundColor: I[t] && k === !0 ? e.lineColor : "none"
|
|
251
248
|
}
|
|
252
249
|
}
|
|
253
250
|
),
|
|
254
251
|
/* @__PURE__ */ c(
|
|
255
252
|
"label",
|
|
256
253
|
{
|
|
257
|
-
className:
|
|
254
|
+
className: I[t] ? "" : "ignore",
|
|
258
255
|
style: {
|
|
259
|
-
backgroundColor:
|
|
260
|
-
color:
|
|
256
|
+
backgroundColor: I[t] && he === !0 ? e.lineColor : "none",
|
|
257
|
+
color: de
|
|
261
258
|
},
|
|
262
259
|
children: e.title
|
|
263
260
|
}
|
|
264
261
|
)
|
|
265
262
|
] }))
|
|
266
263
|
] }));
|
|
267
|
-
|
|
264
|
+
Ne(() => {
|
|
268
265
|
(() => {
|
|
269
266
|
const r = 5 * Math.max(K.length - 5, 0);
|
|
270
|
-
|
|
267
|
+
vt(r);
|
|
271
268
|
})();
|
|
272
|
-
}, [K]),
|
|
273
|
-
|
|
274
|
-
}, [v,
|
|
275
|
-
const
|
|
276
|
-
bottom: `-${
|
|
269
|
+
}, [K]), Ne(() => {
|
|
270
|
+
Te(j), Se(R);
|
|
271
|
+
}, [v, j, R]);
|
|
272
|
+
const It = {
|
|
273
|
+
bottom: `-${We}px`,
|
|
277
274
|
justifyContent: "flex-start"
|
|
278
|
-
},
|
|
279
|
-
bottom: `-${
|
|
275
|
+
}, kt = {
|
|
276
|
+
bottom: `-${We}px`,
|
|
280
277
|
gap: "0px",
|
|
281
278
|
justifyContent: "flex-start"
|
|
282
279
|
// top: "0px",
|
|
283
|
-
},
|
|
280
|
+
}, Lt = (e) => xe(e, "1 0", Ze, "Y"), Dt = (e) => xe(e, "4 4", W, "X"), wt = (e) => xe(e, "1 0", Ze, "X"), Ft = (e) => {
|
|
284
281
|
const t = K.find((r) => r.id === e.value);
|
|
285
282
|
return t ? t.color : "#FFFFFF";
|
|
286
|
-
},
|
|
283
|
+
}, Mt = (e) => {
|
|
287
284
|
const { yScale: t, xScale: r, bars: i } = e;
|
|
288
285
|
return /* @__PURE__ */ c(Pe, { children: i.filter((a) => a.data.value != null).map((a) => {
|
|
289
286
|
let s = a.data.indexValue;
|
|
290
|
-
|
|
291
|
-
const l =
|
|
287
|
+
m.dimensionsMetadata && m.dimensionsMetadata.size > 1 && (s = a.data.id);
|
|
288
|
+
const l = me.filter(
|
|
292
289
|
(n) => n.serieLabel == s
|
|
293
290
|
)[0];
|
|
294
291
|
if (l && l.low && l.high)
|
|
295
292
|
if (u === "horizontal") {
|
|
296
|
-
const n = r(parseFloat(l.low)),
|
|
297
|
-
return /* @__PURE__ */
|
|
293
|
+
const n = r(parseFloat(l.low)), h = r(parseFloat(l.high));
|
|
294
|
+
return /* @__PURE__ */ x("g", { children: [
|
|
298
295
|
/* @__PURE__ */ c(
|
|
299
296
|
"line",
|
|
300
297
|
{
|
|
301
298
|
x1: n,
|
|
302
|
-
x2:
|
|
299
|
+
x2: h,
|
|
303
300
|
y1: a.y + a.height / 2,
|
|
304
301
|
y2: a.y + a.height / 2,
|
|
305
302
|
strokeWidth: 1,
|
|
306
|
-
stroke:
|
|
303
|
+
stroke: W
|
|
307
304
|
}
|
|
308
305
|
),
|
|
309
306
|
/* @__PURE__ */ c(
|
|
@@ -314,33 +311,33 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
314
311
|
y1: a.y + a.height / 2 - 3,
|
|
315
312
|
y2: a.y + a.height / 2 + 3,
|
|
316
313
|
strokeWidth: 1,
|
|
317
|
-
stroke:
|
|
314
|
+
stroke: W
|
|
318
315
|
}
|
|
319
316
|
),
|
|
320
317
|
/* @__PURE__ */ c(
|
|
321
318
|
"line",
|
|
322
319
|
{
|
|
323
|
-
x1:
|
|
324
|
-
x2:
|
|
320
|
+
x1: h,
|
|
321
|
+
x2: h,
|
|
325
322
|
y1: a.y + a.height / 2 - 3,
|
|
326
323
|
y2: a.y + a.height / 2 + 3,
|
|
327
324
|
strokeWidth: 1,
|
|
328
|
-
stroke:
|
|
325
|
+
stroke: W
|
|
329
326
|
}
|
|
330
327
|
)
|
|
331
328
|
] });
|
|
332
329
|
} else {
|
|
333
|
-
const n = t(parseFloat(l.low)),
|
|
334
|
-
return /* @__PURE__ */
|
|
330
|
+
const n = t(parseFloat(l.low)), h = t(parseFloat(l.high));
|
|
331
|
+
return /* @__PURE__ */ x("g", { children: [
|
|
335
332
|
/* @__PURE__ */ c(
|
|
336
333
|
"line",
|
|
337
334
|
{
|
|
338
335
|
y1: n,
|
|
339
|
-
y2:
|
|
336
|
+
y2: h,
|
|
340
337
|
x1: a.x + a.width / 2,
|
|
341
338
|
x2: a.x + a.width / 2,
|
|
342
339
|
strokeWidth: 1,
|
|
343
|
-
stroke:
|
|
340
|
+
stroke: W
|
|
344
341
|
}
|
|
345
342
|
),
|
|
346
343
|
/* @__PURE__ */ c(
|
|
@@ -351,54 +348,54 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
351
348
|
x1: a.x + a.width / 2 - 3,
|
|
352
349
|
x2: a.x + a.width / 2 + 3,
|
|
353
350
|
strokeWidth: 1,
|
|
354
|
-
stroke:
|
|
351
|
+
stroke: W
|
|
355
352
|
}
|
|
356
353
|
),
|
|
357
354
|
/* @__PURE__ */ c(
|
|
358
355
|
"line",
|
|
359
356
|
{
|
|
360
|
-
y1:
|
|
361
|
-
y2:
|
|
357
|
+
y1: h,
|
|
358
|
+
y2: h,
|
|
362
359
|
x1: a.x + a.width / 2 - 3,
|
|
363
360
|
x2: a.x + a.width / 2 + 3,
|
|
364
361
|
strokeWidth: 1,
|
|
365
|
-
stroke:
|
|
362
|
+
stroke: W
|
|
366
363
|
}
|
|
367
364
|
)
|
|
368
365
|
] });
|
|
369
366
|
}
|
|
370
367
|
}) });
|
|
371
|
-
},
|
|
368
|
+
}, xe = (e, t, r, i) => {
|
|
372
369
|
const { yScale: a, innerWidth: s, innerHeight: l } = e;
|
|
373
|
-
let n,
|
|
374
|
-
return i == "X" ? (n = [0, s],
|
|
370
|
+
let n, h;
|
|
371
|
+
return i == "X" ? (n = [0, s], h = Xe().x((o, $) => $ === 0 ? -10 : o).y(() => a(0))) : (n = [0, l], h = Xe().x(() => 0).y((o) => o)), /* @__PURE__ */ c(Pe, { children: /* @__PURE__ */ c(
|
|
375
372
|
"path",
|
|
376
373
|
{
|
|
377
|
-
d:
|
|
374
|
+
d: h(n),
|
|
378
375
|
fill: "none",
|
|
379
376
|
stroke: r,
|
|
380
377
|
style: { pointerEvents: "none", strokeDasharray: t }
|
|
381
378
|
}
|
|
382
379
|
) });
|
|
383
|
-
},
|
|
384
|
-
const t =
|
|
380
|
+
}, w = (e, t) => D ? (T.colorBy === "index" || T.colorBy === "id" || T.colorBy === "values") && !t ? e.filter((r) => D.indexOf(r[m.indexBy]) === -1) : e ? e.filter((r) => D.indexOf(r) === -1) : [] : e, Ot = (e) => {
|
|
381
|
+
const t = Pt();
|
|
385
382
|
if (!e.value) return "";
|
|
386
383
|
const r = Object.assign({}, e);
|
|
387
|
-
(
|
|
384
|
+
(_ || S) && be.includes(String(r.value)) && (r.value = "");
|
|
388
385
|
let i;
|
|
389
|
-
|
|
386
|
+
tt ? i = ne : i = Ft(e);
|
|
390
387
|
let a = [], s = "";
|
|
391
|
-
if (
|
|
388
|
+
if (S || _) {
|
|
392
389
|
const n = String(r.value).split(" ");
|
|
393
|
-
let
|
|
394
|
-
|
|
395
|
-
s.length + String(o).length <=
|
|
390
|
+
let h = 25;
|
|
391
|
+
y && L === "Mobile" || Q && !y ? h = (f == null ? void 0 : f.mobileMaxTickLength) ?? 25 : y && L === "Tablet" || U && !y ? h = (f == null ? void 0 : f.tabletMaxTickLength) ?? 25 : window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches && !y && (h = 15), n.forEach((o) => {
|
|
392
|
+
s.length + String(o).length <= h ? s += (s ? " " : "") + o : (a.push(s), s = o);
|
|
396
393
|
}), s && a.push(s);
|
|
397
394
|
} else
|
|
398
395
|
a = [r.value];
|
|
399
396
|
let l = 12;
|
|
400
|
-
return
|
|
401
|
-
|
|
397
|
+
return Q ? l = (f == null ? void 0 : f.mobileYAxisLineHeight) ?? 12 : U && (l = (f == null ? void 0 : f.tabletYAxisLineHeight) ?? 12), z > 0 && z < 180 ? /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
|
|
398
|
+
C && /* @__PURE__ */ c(
|
|
402
399
|
"line",
|
|
403
400
|
{
|
|
404
401
|
stroke: i,
|
|
@@ -407,16 +404,16 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
407
404
|
y2: -12
|
|
408
405
|
}
|
|
409
406
|
),
|
|
410
|
-
/* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n,
|
|
407
|
+
/* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, h) => /* @__PURE__ */ c(
|
|
411
408
|
"text",
|
|
412
409
|
{
|
|
413
410
|
transform: `rotate(${z})`,
|
|
414
411
|
textAnchor: "start",
|
|
415
|
-
y: typeof e.value == "number" ? 0 :
|
|
412
|
+
y: typeof e.value == "number" ? 0 : h * l,
|
|
416
413
|
dominantBaseline: "middle",
|
|
417
414
|
style: {
|
|
418
415
|
...t.axis.ticks.text,
|
|
419
|
-
fill:
|
|
416
|
+
fill: M === "null" ? "black" : M,
|
|
420
417
|
fontSize: "12px",
|
|
421
418
|
fontFamily: "sans-serif"
|
|
422
419
|
},
|
|
@@ -424,8 +421,8 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
424
421
|
},
|
|
425
422
|
n
|
|
426
423
|
)) })
|
|
427
|
-
] }) : z > 180 && z < 360 ? /* @__PURE__ */
|
|
428
|
-
|
|
424
|
+
] }) : z > 180 && z < 360 ? /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
|
|
425
|
+
C && /* @__PURE__ */ c(
|
|
429
426
|
"line",
|
|
430
427
|
{
|
|
431
428
|
stroke: i,
|
|
@@ -434,25 +431,25 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
434
431
|
y2: -12
|
|
435
432
|
}
|
|
436
433
|
),
|
|
437
|
-
/* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n,
|
|
434
|
+
/* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, h) => /* @__PURE__ */ c(
|
|
438
435
|
"text",
|
|
439
436
|
{
|
|
440
437
|
transform: `rotate(${z})`,
|
|
441
438
|
textAnchor: "end",
|
|
442
|
-
y: typeof e.value == "number" ? 0 :
|
|
439
|
+
y: typeof e.value == "number" ? 0 : h * l,
|
|
443
440
|
dominantBaseline: "middle",
|
|
444
441
|
style: {
|
|
445
442
|
...t.axis.ticks.text,
|
|
446
|
-
fill:
|
|
443
|
+
fill: M === "null" ? "black" : M,
|
|
447
444
|
fontSize: "12px",
|
|
448
445
|
fontFamily: "sans-serif"
|
|
449
446
|
},
|
|
450
447
|
children: n
|
|
451
448
|
},
|
|
452
|
-
|
|
449
|
+
h
|
|
453
450
|
)) })
|
|
454
|
-
] }) : /* @__PURE__ */
|
|
455
|
-
|
|
451
|
+
] }) : /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
|
|
452
|
+
C && /* @__PURE__ */ c(
|
|
456
453
|
"line",
|
|
457
454
|
{
|
|
458
455
|
stroke: i,
|
|
@@ -461,30 +458,30 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
461
458
|
y2: -12
|
|
462
459
|
}
|
|
463
460
|
),
|
|
464
|
-
/* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n,
|
|
461
|
+
/* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, h) => /* @__PURE__ */ c(
|
|
465
462
|
"text",
|
|
466
463
|
{
|
|
467
464
|
transform: `rotate(${z})`,
|
|
468
465
|
textAnchor: "middle",
|
|
469
|
-
y: typeof e.value == "number" ? 0 :
|
|
466
|
+
y: typeof e.value == "number" ? 0 : h * l,
|
|
470
467
|
dominantBaseline: "middle",
|
|
471
468
|
style: {
|
|
472
469
|
...t.axis.ticks.text,
|
|
473
|
-
fill:
|
|
470
|
+
fill: M === "null" ? "black" : M,
|
|
474
471
|
fontSize: "12px",
|
|
475
472
|
fontFamily: "sans-serif"
|
|
476
473
|
},
|
|
477
474
|
children: n
|
|
478
475
|
},
|
|
479
|
-
|
|
476
|
+
h
|
|
480
477
|
)) })
|
|
481
478
|
] });
|
|
482
|
-
},
|
|
483
|
-
if (!e.value || (
|
|
479
|
+
}, Et = (e) => {
|
|
480
|
+
if (!e.value || (S || _) && be.includes(String(e.value)))
|
|
484
481
|
return "";
|
|
485
482
|
let t = e.value;
|
|
486
483
|
if (u === "vertical") {
|
|
487
|
-
const n =
|
|
484
|
+
const n = O || g;
|
|
488
485
|
t = b.formatNumber(
|
|
489
486
|
n.style === "percent" ? t / 100 : t,
|
|
490
487
|
{
|
|
@@ -493,24 +490,24 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
493
490
|
);
|
|
494
491
|
}
|
|
495
492
|
let r = 25;
|
|
496
|
-
|
|
493
|
+
y && L === "Mobile" || Q && !y ? r = (f == null ? void 0 : f.mobileMaxTickLength) ?? 25 : y && L === "Tablet" || U && !y ? r = (f == null ? void 0 : f.tabletMaxTickLength) ?? 25 : window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches && !y && (r = 15);
|
|
497
494
|
const i = typeof t == "string" ? t.split(" ") : [t], a = [];
|
|
498
495
|
let s = "";
|
|
499
496
|
i.forEach((n) => {
|
|
500
497
|
s.length + String(n).length <= r ? s += (s ? " " : "") + n : (a.push(s), s = n);
|
|
501
498
|
}), s && a.push(s);
|
|
502
499
|
let l = 12;
|
|
503
|
-
return
|
|
500
|
+
return y && L === "Mobile" || Q && !y ? l = (f == null ? void 0 : f.mobileYAxisLineHeight) ?? 12 : (y && L === "Tablet" || U && !y) && (l = (f == null ? void 0 : f.tabletYAxisLineHeight) ?? 12), /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y})`, children: [
|
|
504
501
|
/* @__PURE__ */ c("line", { x1: -5, x2: 0, y1: 0, y2: 0, stroke: "#000", strokeWidth: 1 }),
|
|
505
|
-
a.map((n,
|
|
502
|
+
a.map((n, h) => /* @__PURE__ */ c(
|
|
506
503
|
"text",
|
|
507
504
|
{
|
|
508
505
|
x: -10,
|
|
509
|
-
y: typeof t == "number" ? 0 :
|
|
506
|
+
y: typeof t == "number" ? 0 : h * l,
|
|
510
507
|
textAnchor: "end",
|
|
511
508
|
dominantBaseline: "middle",
|
|
512
509
|
style: {
|
|
513
|
-
fill:
|
|
510
|
+
fill: M === "null" ? "black" : M,
|
|
514
511
|
fontSize: "12px",
|
|
515
512
|
fontFamily: "sans-serif"
|
|
516
513
|
},
|
|
@@ -519,135 +516,135 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
519
516
|
n
|
|
520
517
|
))
|
|
521
518
|
] });
|
|
522
|
-
},
|
|
523
|
-
const t =
|
|
519
|
+
}, zt = (e) => {
|
|
520
|
+
const t = D.slice();
|
|
524
521
|
if (t.indexOf(e) > -1) {
|
|
525
522
|
const r = t.indexOf(e);
|
|
526
523
|
t.splice(r, 1);
|
|
527
524
|
} else
|
|
528
525
|
t.push(e);
|
|
529
|
-
|
|
530
|
-
},
|
|
531
|
-
const t = Object.assign({},
|
|
532
|
-
t[e] = !t[e],
|
|
533
|
-
},
|
|
526
|
+
gt(t);
|
|
527
|
+
}, Vt = (e) => {
|
|
528
|
+
const t = Object.assign({}, I);
|
|
529
|
+
t[e] = !t[e], bt(t);
|
|
530
|
+
}, $t = ({ bars: e }) => /* @__PURE__ */ c("g", { children: e.map((t) => {
|
|
534
531
|
const { width: r, height: i, y: a, x: s, data: l } = t;
|
|
535
532
|
if (u === "horizontal" && i <= oe || u === "vertical" && r <= ue)
|
|
536
533
|
return;
|
|
537
534
|
const n = l.value ? b.formatNumber(
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
) : "",
|
|
541
|
-
let o,
|
|
535
|
+
g.style === "percent" ? l.value / 100 : l.value,
|
|
536
|
+
g
|
|
537
|
+
) : "", h = n.length;
|
|
538
|
+
let o, $;
|
|
542
539
|
if (u === "vertical" && r >= ue || u === "horizontal" && i >= oe)
|
|
543
|
-
return u === "vertical" ? (o = a - 6,
|
|
540
|
+
return u === "vertical" ? (o = a - 6, $ = s + r / 2 - h * 3.5) : (o = a + i / 2 + 4, $ = s + r + 5), /* @__PURE__ */ c(
|
|
544
541
|
"text",
|
|
545
542
|
{
|
|
546
543
|
y: o,
|
|
547
|
-
x:
|
|
548
|
-
style: { fill:
|
|
544
|
+
x: $,
|
|
545
|
+
style: { fill: ye() },
|
|
549
546
|
children: `${n}`
|
|
550
547
|
}
|
|
551
548
|
);
|
|
552
|
-
}) }),
|
|
553
|
-
const t =
|
|
549
|
+
}) }), Bt = (e) => {
|
|
550
|
+
const t = m.data.filter((i) => D.indexOf(i[m.indexBy]) == -1).map((i) => i[m.indexBy]), { bars: r } = e;
|
|
554
551
|
return /* @__PURE__ */ c("g", { children: t.filter(
|
|
555
552
|
(i) => r.filter((a) => a.data.indexValue == i).length > 0
|
|
556
553
|
).map((i) => {
|
|
557
554
|
var G;
|
|
558
|
-
const a = r.filter((
|
|
555
|
+
const a = r.filter((d) => d.data.indexValue == i);
|
|
559
556
|
let s = "right", l = 0, n = 0;
|
|
560
557
|
if (u == "horizontal")
|
|
561
|
-
|
|
562
|
-
else if (s = "middle",
|
|
563
|
-
l = e.xScale(i) + a[0].width / 2,
|
|
564
|
-
else if (l = e.xScale(i) + a.map((
|
|
565
|
-
n = n - parseInt(
|
|
558
|
+
E === "stacked" ? (J ? l = e.innerWidth - 20 : (l = a.map((d) => d.width).reduce((d, p) => d + p), A && (l = e.innerWidth - l)), n = e.yScale(i) + a[0].height / 2) : (J ? l = e.innerWidth : (l = a.map((d) => d.width).reduce((d, p) => d > p ? d : p), A && (l = e.innerWidth - l)), n = e.yScale(i) + a.map((d) => d.height).reduce((d, p) => d + p) / 2), l = l + parseInt(V) + 5;
|
|
559
|
+
else if (s = "middle", E === "stacked")
|
|
560
|
+
l = e.xScale(i) + a[0].width / 2, J ? n = n - parseInt(V) : A ? n = parseInt(V) + a.map((d) => d.height).reduce((d, p) => d + p) + 14 : n = e.innerHeight - parseInt(V) - a.map((d) => d.height).reduce((d, p) => d + p) - 5;
|
|
561
|
+
else if (l = e.xScale(i) + a.map((d) => d.width).reduce((d, p) => d + p) / 2, A && (n = e.innerHeight), J)
|
|
562
|
+
n = n - parseInt(V);
|
|
566
563
|
else {
|
|
567
564
|
if (a.length % 2 == 1) {
|
|
568
|
-
const
|
|
569
|
-
n = a[
|
|
565
|
+
const d = Math.floor(a.length / 2);
|
|
566
|
+
n = a[d].height;
|
|
570
567
|
} else {
|
|
571
|
-
const
|
|
568
|
+
const d = a.length / 2;
|
|
572
569
|
n = Math.max(
|
|
573
|
-
a[
|
|
574
|
-
a[
|
|
570
|
+
a[d].height,
|
|
571
|
+
a[d - 1].height
|
|
575
572
|
);
|
|
576
573
|
}
|
|
577
|
-
|
|
574
|
+
A ? n = n + 14 + parseInt(V) : n = e.innerHeight - n - parseInt(V) - 5;
|
|
578
575
|
}
|
|
579
|
-
const
|
|
580
|
-
(
|
|
576
|
+
const h = m.data.filter(
|
|
577
|
+
(d) => d[m.indexBy] === i
|
|
581
578
|
)[0];
|
|
582
|
-
let o =
|
|
583
|
-
const
|
|
584
|
-
return o -=
|
|
585
|
-
|
|
579
|
+
let o = h.parent_variables ? h.parent_variables[ze] : h[ze];
|
|
580
|
+
const $ = Y !== "index" ? (G = D == null ? void 0 : D.map((d) => h[d])) == null ? void 0 : G.reduce((d, p) => d + p, 0) : 0;
|
|
581
|
+
return o -= $, /* @__PURE__ */ c("text", { y: n, x: l, style: { fill: ye() }, children: /* @__PURE__ */ x("tspan", { textAnchor: s, children: [
|
|
582
|
+
Oe ? Oe + " " : "",
|
|
586
583
|
b.formatNumber(
|
|
587
|
-
|
|
588
|
-
|
|
584
|
+
Ee.style === "percent" ? o / 100 : o,
|
|
585
|
+
Ee
|
|
589
586
|
)
|
|
590
587
|
] }) });
|
|
591
588
|
}) });
|
|
592
|
-
},
|
|
593
|
-
top:
|
|
594
|
-
right:
|
|
595
|
-
bottom:
|
|
596
|
-
left:
|
|
589
|
+
}, Wt = {
|
|
590
|
+
top: j,
|
|
591
|
+
right: Ue,
|
|
592
|
+
bottom: R,
|
|
593
|
+
left: Je
|
|
597
594
|
};
|
|
598
595
|
let pe;
|
|
599
|
-
|
|
596
|
+
De && (pe = Ie.parse(De, {
|
|
600
597
|
header: !1,
|
|
601
598
|
dynamicTyping: !0
|
|
602
599
|
}), Math.max(...pe.data.map((e) => e[1])), Math.min(...pe.data.map((e) => e[1])));
|
|
603
|
-
const
|
|
600
|
+
const Re = () => {
|
|
604
601
|
const e = [];
|
|
605
|
-
if (
|
|
602
|
+
if (me && me.forEach((t) => {
|
|
606
603
|
t.low && e.push(parseFloat(t.low)), t.high && e.push(parseFloat(t.high));
|
|
607
|
-
}),
|
|
608
|
-
const t =
|
|
604
|
+
}), m.data) {
|
|
605
|
+
const t = w(m.data, !1), r = w(m.keys, !0);
|
|
609
606
|
t.forEach((i) => {
|
|
610
607
|
r.forEach((a) => {
|
|
611
608
|
i[a] && e.push(i[a]);
|
|
612
609
|
});
|
|
613
610
|
});
|
|
614
611
|
}
|
|
615
|
-
return re &&
|
|
616
|
-
if (
|
|
612
|
+
return re && H && H.forEach((t, r) => {
|
|
613
|
+
if (I[r] !== !1)
|
|
617
614
|
if (t.app === "csv" && t.csvLineLayerData) {
|
|
618
|
-
const i =
|
|
615
|
+
const i = Ie.parse(t.csvLineLayerData, {
|
|
619
616
|
header: !1,
|
|
620
617
|
dynamicTyping: !0
|
|
621
618
|
});
|
|
622
619
|
i.data && i.data.filter((a) => a[1] !== null && typeof a[1] == "number").forEach((a) => e.push(a[1]));
|
|
623
|
-
} else t.measure[0] &&
|
|
620
|
+
} else t.measure[0] && m.data && m.data.forEach((i) => {
|
|
624
621
|
var s;
|
|
625
622
|
const a = (s = i.variables) == null ? void 0 : s[t.measure[0]];
|
|
626
623
|
a !== null && typeof a == "number" && e.push(a);
|
|
627
624
|
});
|
|
628
625
|
}), e;
|
|
629
|
-
},
|
|
630
|
-
const e =
|
|
626
|
+
}, Tt = () => {
|
|
627
|
+
const e = Re(), t = e.length > 0 ? Math.max(...e) : 0;
|
|
631
628
|
if (ie === "fixed" && ce !== null && ce !== "")
|
|
632
629
|
return Number(ce);
|
|
633
|
-
if (
|
|
634
|
-
const r =
|
|
635
|
-
let a = i.length > 0 ? i :
|
|
630
|
+
if (E === "stacked" && ie !== "fixed") {
|
|
631
|
+
const r = w(m.data, !1), i = w(m.keys, !0);
|
|
632
|
+
let a = i.length > 0 ? i : m.keys;
|
|
636
633
|
const s = Math.max(
|
|
637
|
-
...r.map((l) => a.map((n) => l[n] ? l[n] : 0)).map((l) => l.length > 0 ? l.reduce((n,
|
|
634
|
+
...r.map((l) => a.map((n) => l[n] ? l[n] : 0)).map((l) => l.length > 0 ? l.reduce((n, h) => n + h, 0) : 0)
|
|
638
635
|
);
|
|
639
636
|
return Math.max(s, t) * 1.1;
|
|
640
637
|
}
|
|
641
638
|
return t * 1.05;
|
|
642
|
-
},
|
|
643
|
-
const e =
|
|
639
|
+
}, At = () => {
|
|
640
|
+
const e = Re(), t = e.length > 0 ? Math.min(...e) : 0;
|
|
644
641
|
return ie === "fixed" && se !== null && String(se) !== "" ? Number(se) : t > 0 ? t * 0.9 : t * 1.1;
|
|
645
|
-
},
|
|
646
|
-
|
|
647
|
-
if (
|
|
642
|
+
}, Ht = Number(Tt()), St = Number(At()), _t = Math.min(0, St), jt = Math.max(0, Ht), F = ["grid", "axes", "bars"];
|
|
643
|
+
ct && F.push(Bt), F.push(Lt), F.push(wt), re && H && H.forEach((e, t) => {
|
|
644
|
+
if (I[t] == !0 || I[t] == null) {
|
|
648
645
|
const { csvLineLayerData: r, lineColor: i, tooltip: a } = e;
|
|
649
646
|
if (e.app == "csv") {
|
|
650
|
-
const s =
|
|
647
|
+
const s = Ie.parse(r, {
|
|
651
648
|
header: !1,
|
|
652
649
|
dynamicTyping: !0
|
|
653
650
|
});
|
|
@@ -655,281 +652,277 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
|
|
|
655
652
|
s.data = s.data.filter(
|
|
656
653
|
(n) => n[1] !== null
|
|
657
654
|
);
|
|
658
|
-
const l =
|
|
655
|
+
const l = qe(
|
|
659
656
|
s,
|
|
660
657
|
i,
|
|
661
658
|
u,
|
|
662
|
-
|
|
663
|
-
|
|
659
|
+
E,
|
|
660
|
+
w(m.keys, !0),
|
|
664
661
|
a,
|
|
665
662
|
e.title,
|
|
666
663
|
""
|
|
667
664
|
);
|
|
668
|
-
|
|
665
|
+
F.push(l);
|
|
669
666
|
}
|
|
670
667
|
} else if (e.measure[0]) {
|
|
671
|
-
const s = {}, l =
|
|
672
|
-
o[
|
|
668
|
+
const s = {}, l = m.data.map((o) => [
|
|
669
|
+
o[m.indexBy],
|
|
673
670
|
o.variables[e.measure[0]]
|
|
674
|
-
]), n =
|
|
671
|
+
]), n = m.metadata.measures ? m.metadata.measures.filter((o) => o.value == e.measure[0]) : [];
|
|
675
672
|
s.data = l;
|
|
676
|
-
const
|
|
673
|
+
const h = qe(
|
|
677
674
|
s,
|
|
678
675
|
i,
|
|
679
676
|
u,
|
|
680
|
-
|
|
681
|
-
|
|
677
|
+
E,
|
|
678
|
+
w(m.keys, !0),
|
|
682
679
|
a,
|
|
683
680
|
e.title,
|
|
684
681
|
n.length > 0 ? n[0].label : ""
|
|
685
682
|
);
|
|
686
|
-
|
|
683
|
+
F.push(h);
|
|
687
684
|
}
|
|
688
685
|
}
|
|
689
|
-
}),
|
|
690
|
-
let
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
|
|
686
|
+
}), Fe === Zt && F.push($t), rt && F.push(Dt), F.push(Mt);
|
|
687
|
+
let ge = parseInt(mt);
|
|
688
|
+
const Ce = () => /* @__PURE__ */ c(ve, { children: te && we && /* @__PURE__ */ c("div", { className: "legend item", children: /* @__PURE__ */ c("label", { className: "legend-title", children: we }) }) }), be = [];
|
|
689
|
+
if (_ || S) {
|
|
690
|
+
ge = Number.parseInt(f.yAxisTickValues);
|
|
694
691
|
const e = new Map(
|
|
695
|
-
Object.entries(((
|
|
692
|
+
Object.entries(((Ke = f == null ? void 0 : f.labels) == null ? void 0 : Ke.xAxis) ?? {})
|
|
696
693
|
);
|
|
697
694
|
for (const [t, r] of e)
|
|
698
|
-
r ||
|
|
695
|
+
r || be.push(t);
|
|
699
696
|
}
|
|
700
|
-
let
|
|
701
|
-
if (u === "vertical" && (
|
|
702
|
-
const e =
|
|
697
|
+
let P;
|
|
698
|
+
if (u === "vertical" && (m != null && m.data) && m.data.length > 0) {
|
|
699
|
+
const e = w(m.data, !1), t = [];
|
|
703
700
|
if (e.forEach((r) => {
|
|
704
|
-
const i = r == null ? void 0 : r[
|
|
701
|
+
const i = r == null ? void 0 : r[m.indexBy];
|
|
705
702
|
i !== void 0 && t.indexOf(i) === -1 && t.push(i);
|
|
706
|
-
}),
|
|
707
|
-
const r = Math.max(1, parseInt(String(
|
|
703
|
+
}), Ve === "count") {
|
|
704
|
+
const r = Math.max(1, parseInt(String(xt)));
|
|
708
705
|
if (t.length > 0 && r > 0)
|
|
709
706
|
if (t.length <= r)
|
|
710
|
-
|
|
707
|
+
P = t.slice();
|
|
711
708
|
else {
|
|
712
709
|
const i = (t.length - 1) / (r - 1), a = new Array(r);
|
|
713
710
|
for (let s = 0; s < r; s++)
|
|
714
711
|
a[s] = Math.floor(s * i);
|
|
715
|
-
a[r - 1] = t.length - 1,
|
|
712
|
+
a[r - 1] = t.length - 1, P = a.map((s) => t[s]);
|
|
716
713
|
}
|
|
717
|
-
} else if (
|
|
718
|
-
const r = Math.max(1, parseInt(String(
|
|
714
|
+
} else if (Ve === "every") {
|
|
715
|
+
const r = Math.max(1, parseInt(String(pt)));
|
|
719
716
|
if (t.length > 0) {
|
|
720
717
|
const i = [];
|
|
721
718
|
for (let a = 0; a < t.length; a++)
|
|
722
719
|
a % r === 0 && i.push(t[a]);
|
|
723
|
-
i[i.length - 1] !== t[t.length - 1] && i.push(t[t.length - 1]),
|
|
720
|
+
i[i.length - 1] !== t[t.length - 1] && i.push(t[t.length - 1]), P = i;
|
|
724
721
|
}
|
|
725
722
|
}
|
|
726
723
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
{
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
724
|
+
let Ye = parseInt(Qe + "") - He;
|
|
725
|
+
const X = Number(Le) > 0, Rt = X ? Number(Le) : Ye;
|
|
726
|
+
return /* @__PURE__ */ c(
|
|
727
|
+
"div",
|
|
728
|
+
{
|
|
729
|
+
style: X ? { display: "flex", flexDirection: "column" } : { height: Ye },
|
|
730
|
+
children: (m == null ? void 0 : m.data) && m.data.length > 0 && /* @__PURE__ */ x(ve, { children: [
|
|
731
|
+
/* @__PURE__ */ c(
|
|
732
|
+
"div",
|
|
733
|
+
{
|
|
734
|
+
style: X ? { height: Rt, flexShrink: 0 } : { height: "100%" },
|
|
735
|
+
children: /* @__PURE__ */ c(
|
|
736
|
+
Yt,
|
|
737
|
+
{
|
|
738
|
+
colorBy: T.colorBy,
|
|
739
|
+
animate: !0,
|
|
740
|
+
enableLabel: Fe == qt,
|
|
741
|
+
...m,
|
|
742
|
+
maxValue: jt,
|
|
743
|
+
minValue: _t,
|
|
744
|
+
keys: w(m.keys, !0),
|
|
745
|
+
data: w(m.data, !1),
|
|
746
|
+
groupMode: E || "grouped",
|
|
747
|
+
margin: Wt,
|
|
748
|
+
innerPadding: nt,
|
|
749
|
+
valueScale: { type: et, clamp: !0 },
|
|
750
|
+
colors: (e) => e && e.data[ee] ? e.data[ee] : N.getColor(e.id, e.data),
|
|
751
|
+
borderColor: "#000",
|
|
752
|
+
reverse: A,
|
|
753
|
+
axisTop: null,
|
|
754
|
+
axisRight: it ? {
|
|
755
|
+
tickSize: u == "horizontal" && C || u === "vertical" ? 5 : 0,
|
|
756
|
+
tickPadding: 5,
|
|
757
|
+
tickRotation: 0,
|
|
758
|
+
tickValues: ge,
|
|
759
|
+
legend: q.right,
|
|
760
|
+
legendPosition: "middle",
|
|
761
|
+
legendOffset: parseInt(st),
|
|
762
|
+
format: (e) => {
|
|
763
|
+
if (!e) return "";
|
|
764
|
+
if (u == "vertical") {
|
|
765
|
+
const t = O || g;
|
|
766
|
+
return b.formatNumber(
|
|
767
|
+
t.style === "percent" ? e / 100 : e,
|
|
768
|
+
{
|
|
769
|
+
...t
|
|
770
|
+
}
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
return e;
|
|
774
|
+
}
|
|
775
|
+
} : null,
|
|
776
|
+
axisBottom: (S || _) && (f == null ? void 0 : f.xAxisDisabled) === !0 ? null : u === "horizontal" ? {
|
|
777
|
+
legend: q.bottom,
|
|
778
|
+
legendPosition: "middle",
|
|
779
|
+
legendOffset: parseInt(Me),
|
|
780
|
+
tickPadding: 5,
|
|
781
|
+
tickRotation: 0,
|
|
782
|
+
tickValues: parseInt(dt),
|
|
783
|
+
format: (e) => {
|
|
784
|
+
if (!e) return "";
|
|
785
|
+
if (u == "horizontal") {
|
|
786
|
+
const t = O || g;
|
|
787
|
+
return b.formatNumber(
|
|
788
|
+
t.style === "percent" ? e / 100 : e,
|
|
789
|
+
{
|
|
790
|
+
...t
|
|
791
|
+
}
|
|
792
|
+
);
|
|
793
|
+
}
|
|
794
|
+
return e;
|
|
795
|
+
}
|
|
796
|
+
} : {
|
|
797
|
+
legend: q.bottom,
|
|
798
|
+
legendPosition: "middle",
|
|
799
|
+
legendOffset: parseInt(Me),
|
|
800
|
+
...P ? { tickValues: P } : {},
|
|
801
|
+
renderTick: Ot
|
|
802
|
+
},
|
|
803
|
+
axisLeft: {
|
|
804
|
+
tickSize: u === "horizontal" && C || u === "vertical" ? 5 : 0,
|
|
805
|
+
tickPadding: 5,
|
|
806
|
+
tickRotation: 0,
|
|
807
|
+
tickValues: ge,
|
|
808
|
+
legend: q.left,
|
|
809
|
+
legendPosition: "middle",
|
|
810
|
+
legendOffset: Number.parseInt(Ge),
|
|
811
|
+
...S || _ ? { renderTick: Et } : {
|
|
812
|
+
format: (e) => {
|
|
813
|
+
if (!e) return "";
|
|
814
|
+
if (u === "vertical") {
|
|
815
|
+
const t = O || g;
|
|
816
|
+
return b.formatNumber(
|
|
817
|
+
t.style === "percent" ? e / 100 : e,
|
|
818
|
+
{
|
|
819
|
+
...t
|
|
820
|
+
}
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
return e;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
enableGridY: ot,
|
|
828
|
+
enableGridX: yt,
|
|
829
|
+
layout: u,
|
|
830
|
+
labelSkipWidth: ue,
|
|
831
|
+
labelSkipHeight: oe,
|
|
832
|
+
padding: at,
|
|
833
|
+
labelTextColor: ye(),
|
|
834
|
+
label: (e) => b.formatNumber(
|
|
835
|
+
g.style === "percent" && e.value ? e.value / 100 : e.value,
|
|
836
|
+
g
|
|
837
|
+
),
|
|
838
|
+
layers: F,
|
|
839
|
+
onMouseEnter: (e) => {
|
|
840
|
+
},
|
|
841
|
+
onMouseLeave: (e) => {
|
|
842
|
+
},
|
|
843
|
+
motionStiffness: 130,
|
|
844
|
+
motionDamping: 15,
|
|
845
|
+
tooltip: (e) => lt && le && le.trim().length > 0 ? /* @__PURE__ */ c(
|
|
846
|
+
Ct,
|
|
835
847
|
{
|
|
836
|
-
|
|
848
|
+
intl: b,
|
|
849
|
+
format: g,
|
|
850
|
+
d: e,
|
|
851
|
+
tooltip: le,
|
|
852
|
+
tooltipEnableMarkdown: ht
|
|
853
|
+
}
|
|
854
|
+
) : null,
|
|
855
|
+
theme: {
|
|
856
|
+
tooltip: {
|
|
857
|
+
basic: {
|
|
858
|
+
whiteSpace: "pre",
|
|
859
|
+
display: "flex",
|
|
860
|
+
alignItems: "center"
|
|
861
|
+
},
|
|
862
|
+
container: {
|
|
863
|
+
background: "transparent",
|
|
864
|
+
boxShadow: ""
|
|
865
|
+
},
|
|
866
|
+
table: {},
|
|
867
|
+
tableCell: { padding: "3px 5px" }
|
|
837
868
|
}
|
|
838
|
-
|
|
869
|
+
}
|
|
839
870
|
}
|
|
840
|
-
|
|
841
|
-
}
|
|
871
|
+
)
|
|
842
872
|
}
|
|
843
|
-
},
|
|
844
|
-
enableGridY: ht,
|
|
845
|
-
enableGridX: mt,
|
|
846
|
-
layout: u,
|
|
847
|
-
labelSkipWidth: ue,
|
|
848
|
-
labelSkipHeight: oe,
|
|
849
|
-
padding: Ge,
|
|
850
|
-
labelTextColor: xe(),
|
|
851
|
-
label: (e) => b.formatNumber(
|
|
852
|
-
p.style === "percent" && e.value ? e.value / 100 : e.value,
|
|
853
|
-
p
|
|
854
873
|
),
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
},
|
|
858
|
-
onMouseLeave: (e) => {
|
|
859
|
-
},
|
|
860
|
-
motionStiffness: 130,
|
|
861
|
-
motionDamping: 15,
|
|
862
|
-
tooltip: (e) => tt && le && le.trim().length > 0 ? /* @__PURE__ */ c(
|
|
863
|
-
_t,
|
|
874
|
+
(v === "top" || v === "bottom") && _e && /* @__PURE__ */ c(
|
|
875
|
+
"div",
|
|
864
876
|
{
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
},
|
|
879
|
-
container: {
|
|
880
|
-
background: "transparent",
|
|
881
|
-
boxShadow: ""
|
|
877
|
+
className: `legends container has-standard-12-font-size ${v}`,
|
|
878
|
+
style: v === "bottom" ? {
|
|
879
|
+
// In chart-height mode the legend flows below the chart;
|
|
880
|
+
// the dynamic margin-reservation is only needed in legacy.
|
|
881
|
+
marginBottom: X ? void 0 : `${He}px`,
|
|
882
|
+
marginTop: "25px",
|
|
883
|
+
textAlign: "left",
|
|
884
|
+
justifyContent: "flex-start"
|
|
885
|
+
} : {
|
|
886
|
+
justifyContent: "flex-start",
|
|
887
|
+
// Top legend: in chart-height mode it flows ABOVE the chart
|
|
888
|
+
// (override the legacy `position: absolute`) via flex order.
|
|
889
|
+
...X ? { position: "static", order: -1 } : {}
|
|
882
890
|
},
|
|
883
|
-
|
|
884
|
-
|
|
891
|
+
children: /* @__PURE__ */ x("div", { className: "legend-sections", children: [
|
|
892
|
+
/* @__PURE__ */ c("div", { className: "title-section", children: Ce() }),
|
|
893
|
+
/* @__PURE__ */ c(
|
|
894
|
+
Xt,
|
|
895
|
+
{
|
|
896
|
+
isMobileOrTablet: fe,
|
|
897
|
+
onWrapChange: (e) => {
|
|
898
|
+
if (v === "top" && fe) {
|
|
899
|
+
const t = j + e / 2 * 40;
|
|
900
|
+
Te(t), Ae(e);
|
|
901
|
+
} else
|
|
902
|
+
Se(R + e / 2 * 25), Ae(e);
|
|
903
|
+
},
|
|
904
|
+
className: "legends container has-standard-12-font-size items-section",
|
|
905
|
+
children: je()
|
|
906
|
+
}
|
|
907
|
+
)
|
|
908
|
+
] })
|
|
885
909
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
/* @__PURE__ */ c("div", { className: "title-section", children: je() }),
|
|
903
|
-
/* @__PURE__ */ c(
|
|
904
|
-
Pt,
|
|
905
|
-
{
|
|
906
|
-
onWrapChange: (e) => {
|
|
907
|
-
if (v === "top" && Ee) {
|
|
908
|
-
const t = R + e / 2 * 40;
|
|
909
|
-
We(t), Te(e);
|
|
910
|
-
} else
|
|
911
|
-
Ae(P + e / 2 * 25), Te(e);
|
|
912
|
-
},
|
|
913
|
-
className: "legends container has-standard-12-font-size items-section",
|
|
914
|
-
children: _e()
|
|
915
|
-
}
|
|
916
|
-
)
|
|
917
|
-
] })
|
|
918
|
-
}
|
|
919
|
-
),
|
|
920
|
-
(v === "right" || v === "left") && He && /* @__PURE__ */ y(
|
|
921
|
-
"div",
|
|
922
|
-
{
|
|
923
|
-
className: `legends container has-standard-12-font-size ${v}`,
|
|
924
|
-
style: v === "right" ? bt : vt,
|
|
925
|
-
children: [
|
|
926
|
-
je(),
|
|
927
|
-
_e()
|
|
928
|
-
]
|
|
929
|
-
}
|
|
930
|
-
)
|
|
931
|
-
] }) });
|
|
932
|
-
}, ma = jt(Xt);
|
|
910
|
+
),
|
|
911
|
+
(v === "right" || v === "left") && _e && /* @__PURE__ */ x(
|
|
912
|
+
"div",
|
|
913
|
+
{
|
|
914
|
+
className: `legends container has-standard-12-font-size ${v}`,
|
|
915
|
+
style: v === "right" ? It : kt,
|
|
916
|
+
children: [
|
|
917
|
+
Ce(),
|
|
918
|
+
je()
|
|
919
|
+
]
|
|
920
|
+
}
|
|
921
|
+
)
|
|
922
|
+
] })
|
|
923
|
+
}
|
|
924
|
+
);
|
|
925
|
+
}, ua = Kt(Ut);
|
|
933
926
|
export {
|
|
934
|
-
|
|
927
|
+
ua as default
|
|
935
928
|
};
|