@undp/data-viz 2.0.7 → 2.0.9
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/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.js +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.cjs.map +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +152 -140
- package/dist/GriddedGraphs.js.map +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.js +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.cjs.map +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +88 -83
- package/dist/MultiGraphDashboard.js.map +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +74 -70
- package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.cjs.map +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +122 -119
- package/dist/SingleGraphDashboard.js.map +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +126 -122
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +1 -1
- package/dist/Types.d.ts +1 -0
- package/dist/{getGraphList-gf02xgT2.cjs → getGraphList-CA17dvFB.cjs} +2 -2
- package/dist/getGraphList-CA17dvFB.cjs.map +1 -0
- package/dist/{getGraphList-BpEWn1Tk.js → getGraphList-Dxwo9TDb.js} +7 -1
- package/dist/{getGraphList-BpEWn1Tk.js.map → getGraphList-Dxwo9TDb.js.map} +1 -1
- package/dist/getSchema.cjs +1 -1
- package/dist/getSchema.js +1 -1
- package/dist/getUniqValue-DsqSii6M.js +11 -0
- package/dist/getUniqValue-DsqSii6M.js.map +1 -0
- package/dist/getUniqValue-NX8DgwND.cjs +2 -0
- package/dist/getUniqValue-NX8DgwND.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +2 -2
- package/dist/{transformDataForAggregation-CjwEAUOR.js → transformDataForAggregation-DEU__LUl.js} +2 -2
- package/dist/{transformDataForAggregation-CjwEAUOR.js.map → transformDataForAggregation-DEU__LUl.js.map} +1 -1
- package/dist/{transformDataForAggregation-DAGK2BZy.cjs → transformDataForAggregation-XNg0OGYE.cjs} +2 -2
- package/dist/{transformDataForAggregation-DAGK2BZy.cjs.map → transformDataForAggregation-XNg0OGYE.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-D5TMQYYd.js → transformDataForGraphFromFile-CSG24iF6.js} +2 -2
- package/dist/{transformDataForGraphFromFile-D5TMQYYd.js.map → transformDataForGraphFromFile-CSG24iF6.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-B1zJSPRP.cjs → transformDataForGraphFromFile-CzepNVGZ.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-B1zJSPRP.cjs.map → transformDataForGraphFromFile-CzepNVGZ.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +2 -2
- package/dist/validateSchema.cjs +1 -1
- package/dist/validateSchema.js +1 -1
- package/package.json +1 -1
- package/dist/getGraphList-gf02xgT2.cjs.map +0 -1
- package/dist/getUniqValue-BKHCm3zE.js +0 -11
- package/dist/getUniqValue-BKHCm3zE.js.map +0 -1
- package/dist/getUniqValue-RViz8tTw.cjs +0 -2
- package/dist/getUniqValue-RViz8tTw.cjs.map +0 -1
|
@@ -1,103 +1,104 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as b, useRef as
|
|
1
|
+
import { j as t } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
|
+
import { useState as b, useRef as B, useEffectEvent as R, useEffect as w } from "react";
|
|
3
3
|
import { i as sa } from "./index-BuwmuDFJ.js";
|
|
4
4
|
import { f as F } from "./index-EArKRVKg.js";
|
|
5
|
-
import { i as
|
|
6
|
-
import { j as
|
|
7
|
-
import { b as A, y as
|
|
5
|
+
import { i as ua } from "./index-Bwrro8-q.js";
|
|
6
|
+
import { j as V, D as M } from "./DropdownSelect-BbdPQa2k.js";
|
|
7
|
+
import { b as A, y as H, h as O, c as da, $ as K, P as Q } from "./checkIfMultiple-Y9iKaV_u.js";
|
|
8
8
|
import { w as ha } from "./Spinner-D7rnnwnA.js";
|
|
9
9
|
import { G as ca } from "./GraphContainer-CRqzdKu2.js";
|
|
10
10
|
import { G as fa } from "./GraphEl-CGq1EWRn.js";
|
|
11
11
|
import { f as ga, a as pa, b as ma, c as Ca, t as va } from "./fetchAndParseData-BpqkBPQL.js";
|
|
12
|
-
import { a as Ia, t as ba } from "./transformDataForAggregation-
|
|
13
|
-
import { g as X } from "./getUniqValue-
|
|
12
|
+
import { a as Ia, t as ba } from "./transformDataForAggregation-DEU__LUl.js";
|
|
13
|
+
import { g as X } from "./getUniqValue-DsqSii6M.js";
|
|
14
14
|
import { GraphHeader as xa } from "./GraphHeader.js";
|
|
15
15
|
import { f as Y } from "./filterData-DsAiFzKY.js";
|
|
16
|
-
import { g as wa } from "./getGraphList-
|
|
16
|
+
import { g as wa } from "./getGraphList-Dxwo9TDb.js";
|
|
17
17
|
import { t as Z } from "./transformDataForSelect-D8AuvYdf.js";
|
|
18
|
-
const
|
|
19
|
-
if (s.findIndex((
|
|
20
|
-
const
|
|
21
|
-
return s.findIndex((
|
|
18
|
+
const Va = (s) => {
|
|
19
|
+
if (s.findIndex((i) => i.chartConfigId === "yMin") !== -1 && s.findIndex((i) => i.chartConfigId === "yMax") !== -1) return s;
|
|
20
|
+
const n = [...s];
|
|
21
|
+
return s.findIndex((i) => i.chartConfigId === "yMin") === -1 && n.push({
|
|
22
22
|
chartConfigId: "yMin",
|
|
23
|
-
columnId: `${s[s.findIndex((
|
|
24
|
-
}), s.findIndex((
|
|
23
|
+
columnId: `${s[s.findIndex((i) => i.chartConfigId === "y")].columnId}Min`
|
|
24
|
+
}), s.findIndex((i) => i.chartConfigId === "yMax") === -1 && n.push({
|
|
25
25
|
chartConfigId: "yMax",
|
|
26
|
-
columnId: `${s[s.findIndex((
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
const
|
|
30
|
-
const C = s?.findIndex((o) => o.chartConfigId ===
|
|
26
|
+
columnId: `${s[s.findIndex((i) => i.chartConfigId === "y")].columnId}Max`
|
|
27
|
+
}), n;
|
|
28
|
+
}, P = (s, n) => {
|
|
29
|
+
const i = n?.map((D) => {
|
|
30
|
+
const C = s?.findIndex((o) => o.chartConfigId === D.chartConfigId);
|
|
31
31
|
if (C === -1) return {};
|
|
32
|
-
const x = s[C]?.allowedColumnIds?.findIndex((o) => o.value ===
|
|
32
|
+
const x = s[C]?.allowedColumnIds?.findIndex((o) => o.value === D.columnId);
|
|
33
33
|
return x === -1 ? {} : s[C].allowedColumnIds[x].graphSettings || {};
|
|
34
34
|
}) || [];
|
|
35
|
-
return Object.assign({}, ...
|
|
35
|
+
return Object.assign({}, ...i);
|
|
36
36
|
};
|
|
37
37
|
function Ea(s) {
|
|
38
38
|
const {
|
|
39
|
-
graphSettings:
|
|
40
|
-
dataSettings:
|
|
41
|
-
filters:
|
|
39
|
+
graphSettings: n,
|
|
40
|
+
dataSettings: i,
|
|
41
|
+
filters: D,
|
|
42
42
|
graphType: C,
|
|
43
43
|
dataTransform: x,
|
|
44
44
|
graphDataConfiguration: o,
|
|
45
|
-
dataFilters:
|
|
45
|
+
dataFilters: k,
|
|
46
46
|
debugMode: y,
|
|
47
47
|
dataSelectionOptions: v,
|
|
48
|
-
advancedDataSelectionOptions:
|
|
48
|
+
advancedDataSelectionOptions: L,
|
|
49
49
|
readableHeader: _,
|
|
50
|
-
noOfFiltersPerRow:
|
|
50
|
+
noOfFiltersPerRow: h = 4,
|
|
51
51
|
updateFilters: aa,
|
|
52
|
-
uiMode:
|
|
52
|
+
uiMode: c = "normal",
|
|
53
53
|
highlightDataPointSettings: p
|
|
54
|
-
} = s, [
|
|
54
|
+
} = s, [E, U] = b(void 0), [u, ea] = b(void 0), [m, I] = b(o), [g, S] = b({}), [j, la] = b(void 0), [ta, ia] = b([]), z = B(null), W = B(o), [$, q] = b([]), G = {
|
|
55
55
|
ignoreCase: !0,
|
|
56
56
|
ignoreAccents: !0,
|
|
57
57
|
trim: !0
|
|
58
|
-
},
|
|
59
|
-
const a = (
|
|
58
|
+
}, J = R(() => {
|
|
59
|
+
const a = (D || []).map((r) => ({
|
|
60
60
|
filter: r.column,
|
|
61
61
|
label: r.label || `Filter by ${r.column}`,
|
|
62
62
|
singleSelect: r.singleSelect,
|
|
63
63
|
clearable: r.clearable,
|
|
64
|
+
ui: r.ui,
|
|
64
65
|
defaultValue: Z(r.defaultValue),
|
|
65
66
|
value: Z(r.defaultValue),
|
|
66
|
-
availableValues: X(
|
|
67
|
+
availableValues: X(u, r.column).filter((e) => !r.excludeValues?.includes(`${e}`)).map((e) => ({
|
|
67
68
|
value: e,
|
|
68
69
|
label: e
|
|
69
70
|
})),
|
|
70
71
|
allowSelectAll: r.allowSelectAll,
|
|
71
72
|
width: r.width
|
|
72
73
|
}));
|
|
73
|
-
|
|
74
|
+
q(a);
|
|
74
75
|
});
|
|
75
76
|
w(() => {
|
|
76
77
|
(async () => {
|
|
77
78
|
try {
|
|
78
|
-
const r =
|
|
79
|
+
const r = i.dataURL ? typeof i.dataURL == "string" ? i.fileType === "json" ? await ga(i.dataURL, i.columnsToArray, i.dataTransformation, y) : i.fileType === "api" ? await pa(i.dataURL, i.apiHeaders, i.columnsToArray, i.dataTransformation, y) : await ma(i.dataURL, i.dataTransformation, i.columnsToArray, y, i.delimiter, !0) : await Ca(i.dataURL, i.idColumnTitle) : await va(i.data, i.columnsToArray);
|
|
79
80
|
ea(r);
|
|
80
81
|
} catch (r) {
|
|
81
82
|
console.error("Data fetching error:", r);
|
|
82
83
|
}
|
|
83
|
-
})(),
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
}, [
|
|
84
|
+
})(), J();
|
|
85
|
+
}, [i, y]), w(() => {
|
|
86
|
+
J();
|
|
87
|
+
}, [D, u]);
|
|
87
88
|
const na = R(() => {
|
|
88
|
-
if (!
|
|
89
|
+
if (!u || $.length === 0) U(u);
|
|
89
90
|
else {
|
|
90
|
-
const a =
|
|
91
|
-
|
|
91
|
+
const a = u.filter((r) => $.every((e) => e.value && F([e.value]).length > 0 ? sa(F([r[e.filter]]), F([e.value]).map((l) => l.value)).length > 0 : !0));
|
|
92
|
+
U(a);
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
95
|
w(() => {
|
|
95
96
|
na();
|
|
96
|
-
}, [
|
|
97
|
-
v && S(
|
|
97
|
+
}, [$, u]), w(() => {
|
|
98
|
+
v && S(P(v, o));
|
|
98
99
|
}, [v, o]);
|
|
99
100
|
const ra = R(() => {
|
|
100
|
-
p?.column &&
|
|
101
|
+
p?.column && E && ia(X(E, p.column).filter((a) => !p?.excludeValues?.includes(`${a}`)).map((a) => ({
|
|
101
102
|
value: a,
|
|
102
103
|
label: a
|
|
103
104
|
})));
|
|
@@ -105,32 +106,32 @@ function Ea(s) {
|
|
|
105
106
|
w(() => {
|
|
106
107
|
ra();
|
|
107
108
|
}, [p]), w(() => {
|
|
108
|
-
|
|
109
|
+
ua(W.current, o) || (I(o), W.current = o);
|
|
109
110
|
}, [o]);
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
...
|
|
111
|
+
const T = (a, r) => {
|
|
112
|
+
q((e) => e.map((l) => l.filter === a ? {
|
|
113
|
+
...l,
|
|
113
114
|
value: r
|
|
114
|
-
} :
|
|
115
|
-
}, oa =
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
g?.graphTitle || g?.graphDescription ||
|
|
118
|
-
title: g?.styles?.title ||
|
|
119
|
-
description: g?.styles?.description ||
|
|
115
|
+
} : l));
|
|
116
|
+
}, oa = u ? Ia(x ? ba(Y(u, k || []), x.keyColumn, x.aggregationColumnsSetting) : Y(u, k || []), C, C === "lineChartWithConfidenceInterval" && m ? Va(m) : m) : void 0;
|
|
117
|
+
return /* @__PURE__ */ t.jsx(ca, { className: n?.classNames?.graphContainer, style: n?.styles?.graphContainer, id: n?.graphID, ref: z, "aria-label": n?.ariaLabel, backgroundColor: n?.backgroundColor ?? !1, theme: n?.theme || "light", language: n?.language || "en", width: n?.width, height: n?.height, padding: n?.padding, minHeight: n?.minHeight, relativeHeight: n?.relativeHeight, children: u || wa.filter((a) => a.geoHubMapPresentation).map((a) => a.graphID).indexOf(C) !== -1 ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
118
|
+
g?.graphTitle || g?.graphDescription || n?.graphTitle || n?.graphDescription || n?.graphDownload || n?.dataDownload ? /* @__PURE__ */ t.jsx(xa, { styles: {
|
|
119
|
+
title: g?.styles?.title || n?.styles?.title,
|
|
120
|
+
description: g?.styles?.description || n?.styles?.description
|
|
120
121
|
}, classNames: {
|
|
121
|
-
title: g?.classNames?.title ||
|
|
122
|
-
description: g?.classNames?.description ||
|
|
123
|
-
}, graphTitle: g?.graphTitle ||
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
width: a.width || `calc(${100 /
|
|
122
|
+
title: g?.classNames?.title || n?.classNames?.title,
|
|
123
|
+
description: g?.classNames?.description || n?.classNames?.description
|
|
124
|
+
}, graphTitle: g?.graphTitle || n?.graphTitle, graphDescription: g?.graphDescription || n?.graphDescription, width: g?.width || n?.width, graphDownload: n?.graphDownload ? z : void 0, dataDownload: n?.dataDownload && u && u.length > 0 ? u : null }) : null,
|
|
125
|
+
$.length !== 0 || (v || []).length !== 0 || (L || []).length !== 0 || p ? /* @__PURE__ */ t.jsxs("div", { className: "flex flex-wrap items-start gap-x-4 gap-y-0 w-full", children: [
|
|
126
|
+
L?.map((a, r) => /* @__PURE__ */ t.jsxs("div", { style: {
|
|
127
|
+
width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
127
128
|
flexGrow: 1,
|
|
128
129
|
flexShrink: a.ui !== "radio" ? 0 : 1,
|
|
129
130
|
minWidth: "240px"
|
|
130
131
|
}, className: "pb-4", children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
a.ui !== "radio" ? /* @__PURE__ */
|
|
133
|
-
|
|
132
|
+
/* @__PURE__ */ t.jsx(A, { className: "mb-2", children: a.label || "Graph by" }),
|
|
133
|
+
a.ui !== "radio" ? /* @__PURE__ */ t.jsx(
|
|
134
|
+
V,
|
|
134
135
|
{
|
|
135
136
|
options: a.options.map((e) => ({
|
|
136
137
|
...e,
|
|
@@ -139,7 +140,7 @@ function Ea(s) {
|
|
|
139
140
|
size: "sm",
|
|
140
141
|
isClearable: !1,
|
|
141
142
|
isSearchable: !0,
|
|
142
|
-
variant:
|
|
143
|
+
variant: c,
|
|
143
144
|
controlShouldRenderValue: !0,
|
|
144
145
|
defaultValue: a.defaultValue ? {
|
|
145
146
|
...a.defaultValue,
|
|
@@ -152,104 +153,106 @@ function Ea(s) {
|
|
|
152
153
|
S(e?.graphSettings || {}), I(e?.dataConfiguration);
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
|
-
) : /* @__PURE__ */
|
|
156
|
-
const
|
|
157
|
-
S(
|
|
158
|
-
}, children: a.options.map((e,
|
|
156
|
+
) : /* @__PURE__ */ t.jsx(H, { defaultValue: a.defaultValue?.label || a.options[0].label, variant: c, onValueChange: (e) => {
|
|
157
|
+
const l = a.options[a.options.findIndex((f) => f.label === e)];
|
|
158
|
+
S(l.graphSettings || {}), I(l.dataConfiguration);
|
|
159
|
+
}, children: a.options.map((e, l) => /* @__PURE__ */ t.jsx(O, { label: e.label, value: e.label }, l)) })
|
|
159
160
|
] }, r)),
|
|
160
|
-
v?.map((a, r) => /* @__PURE__ */
|
|
161
|
-
width: a.width || `calc(${100 /
|
|
161
|
+
v?.map((a, r) => /* @__PURE__ */ t.jsxs("div", { style: {
|
|
162
|
+
width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
162
163
|
flexGrow: 1,
|
|
163
164
|
flexShrink: a.ui !== "radio" ? 0 : 1,
|
|
164
165
|
minWidth: "240px"
|
|
165
166
|
}, className: "pb-4", children: [
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
/* @__PURE__ */ t.jsx(A, { className: "mb-2", children: a.label || `Visualize ${a.chartConfigId} by` }),
|
|
168
|
+
da(a.chartConfigId, m || []) ? a.ui !== "radio" ? /* @__PURE__ */ t.jsx(
|
|
169
|
+
V,
|
|
169
170
|
{
|
|
170
171
|
options: a.allowedColumnIds,
|
|
171
172
|
size: "sm",
|
|
172
173
|
isMulti: !0,
|
|
173
174
|
isSearchable: !0,
|
|
174
|
-
variant:
|
|
175
|
+
variant: c,
|
|
175
176
|
controlShouldRenderValue: !0,
|
|
176
|
-
defaultValue: o ? o[o.findIndex((e) => e.chartConfigId === a.chartConfigId)].columnId.map((e) => a.allowedColumnIds[a.allowedColumnIds.findIndex((
|
|
177
|
+
defaultValue: o ? o[o.findIndex((e) => e.chartConfigId === a.chartConfigId)].columnId.map((e) => a.allowedColumnIds[a.allowedColumnIds.findIndex((l) => l.value === e)]) : void 0,
|
|
177
178
|
filterOption: M(G),
|
|
178
179
|
onChange: (e) => {
|
|
179
|
-
const
|
|
180
|
+
const l = {
|
|
180
181
|
columnId: (e || []).map(
|
|
181
182
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
182
183
|
(d) => d.value
|
|
183
184
|
),
|
|
184
185
|
chartConfigId: a.chartConfigId
|
|
185
|
-
},
|
|
186
|
-
I(
|
|
186
|
+
}, f = m?.map((d) => d.chartConfigId === l.chartConfigId ? l : d);
|
|
187
|
+
I(f);
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
) : /* @__PURE__ */
|
|
190
|
-
const
|
|
190
|
+
) : /* @__PURE__ */ t.jsx(K, { variant: c, defaultValue: o ? o[o.findIndex((e) => e.chartConfigId === a.chartConfigId)].columnId.map((e) => a.allowedColumnIds[a.allowedColumnIds.findIndex((l) => l.value === e)]).map((e) => e.value) : [], onValueChange: (e) => {
|
|
191
|
+
const l = {
|
|
191
192
|
columnId: e || [],
|
|
192
193
|
chartConfigId: a.chartConfigId
|
|
193
|
-
},
|
|
194
|
-
I(
|
|
195
|
-
}, children: a.allowedColumnIds.map((e,
|
|
196
|
-
|
|
194
|
+
}, f = m?.map((d) => d.chartConfigId === l.chartConfigId ? l : d);
|
|
195
|
+
I(f);
|
|
196
|
+
}, children: a.allowedColumnIds.map((e, l) => /* @__PURE__ */ t.jsx(Q, { label: e.label, value: e.label }, l)) }) : a.ui !== "radio" ? /* @__PURE__ */ t.jsx(
|
|
197
|
+
V,
|
|
197
198
|
{
|
|
198
199
|
options: a.allowedColumnIds,
|
|
199
200
|
size: "sm",
|
|
200
201
|
isClearable: !1,
|
|
201
202
|
isSearchable: !0,
|
|
202
|
-
variant:
|
|
203
|
+
variant: c,
|
|
203
204
|
controlShouldRenderValue: !0,
|
|
204
|
-
defaultValue: o ? a.allowedColumnIds[a.allowedColumnIds.findIndex((e) => e.value === o[o.findIndex((
|
|
205
|
+
defaultValue: o ? a.allowedColumnIds[a.allowedColumnIds.findIndex((e) => e.value === o[o.findIndex((l) => l.chartConfigId === a.chartConfigId)].columnId)] : void 0,
|
|
205
206
|
onChange: (e) => {
|
|
206
|
-
const
|
|
207
|
+
const l = {
|
|
207
208
|
columnId: e?.value,
|
|
208
209
|
chartConfigId: a.chartConfigId
|
|
209
|
-
},
|
|
210
|
-
S(
|
|
210
|
+
}, f = m?.map((d) => d.chartConfigId === l.chartConfigId ? l : d);
|
|
211
|
+
S(P(v, f)), I(f);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
|
-
) : /* @__PURE__ */
|
|
214
|
-
const
|
|
214
|
+
) : /* @__PURE__ */ t.jsx(H, { variant: c, defaultValue: o ? a.allowedColumnIds[a.allowedColumnIds.findIndex((e) => e.value === o[o.findIndex((l) => l.chartConfigId === a.chartConfigId)].columnId)].label : "", onValueChange: (e) => {
|
|
215
|
+
const f = {
|
|
215
216
|
columnId: a.allowedColumnIds[a.allowedColumnIds.findIndex((N) => N.label === e)].value,
|
|
216
217
|
chartConfigId: a.chartConfigId
|
|
217
|
-
}, d = m?.map((N) => N.chartConfigId ===
|
|
218
|
-
S(
|
|
219
|
-
}, children: a.allowedColumnIds.map((e,
|
|
218
|
+
}, d = m?.map((N) => N.chartConfigId === f.chartConfigId ? f : N);
|
|
219
|
+
S(P(v, d)), I(d);
|
|
220
|
+
}, children: a.allowedColumnIds.map((e, l) => /* @__PURE__ */ t.jsx(O, { label: e.label, value: e.label }, l)) })
|
|
220
221
|
] }, r)),
|
|
221
|
-
|
|
222
|
-
width: a.width || `calc(${100 /
|
|
222
|
+
$?.map((a, r) => /* @__PURE__ */ t.jsxs("div", { style: {
|
|
223
|
+
width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
223
224
|
flexGrow: 1,
|
|
224
225
|
flexShrink: 0,
|
|
225
226
|
minWidth: "240px"
|
|
226
227
|
}, className: "pb-4", children: [
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
a.singleSelect ? /* @__PURE__ */
|
|
229
|
-
|
|
230
|
-
}, value: a.value, defaultValue: a.defaultValue }) : /* @__PURE__ */
|
|
231
|
-
a.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
|
|
228
|
+
/* @__PURE__ */ t.jsx(A, { className: "mb-2", children: a.label }),
|
|
229
|
+
a.singleSelect ? a.ui !== "radio" ? /* @__PURE__ */ t.jsx(V, { options: a.availableValues, variant: c, isClearable: a.clearable === void 0 ? !0 : a.clearable, isSearchable: !0, controlShouldRenderValue: !0, filterOption: M(G), onChange: (e) => {
|
|
230
|
+
T(a.filter, e);
|
|
231
|
+
}, value: a.value, defaultValue: a.defaultValue }) : /* @__PURE__ */ t.jsx(H, { variant: c, defaultValue: a.defaultValue.value, onValueChange: (e) => {
|
|
232
|
+
T(a.filter, a.availableValues.filter((l) => l.value === e));
|
|
233
|
+
}, children: a.availableValues.map((e, l) => /* @__PURE__ */ t.jsx(O, { label: `${e.label}`, value: `${e.value}` }, l)) }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
234
|
+
a.ui !== "radio" ? /* @__PURE__ */ t.jsx(V, { options: a.availableValues, variant: c, size: "sm", isMulti: !0, isClearable: a.clearable === void 0 ? !0 : a.clearable, isSearchable: !0, controlShouldRenderValue: !0, filterOption: M(G), onChange: (e) => {
|
|
235
|
+
T(a.filter, e);
|
|
236
|
+
}, value: a.value, defaultValue: a.defaultValue }) : /* @__PURE__ */ t.jsx(K, { variant: c, defaultValue: a.defaultValue ? a.defaultValue.map((e) => `${e.value}`) : [], value: a.value ? a.value.map((e) => `${e.value}`) : void 0, onValueChange: (e) => {
|
|
237
|
+
T(a.filter, a.availableValues.filter((l) => e.indexOf(`${l.value}`) !== -1));
|
|
238
|
+
}, children: a.availableValues.map((e, l) => /* @__PURE__ */ t.jsx(Q, { label: `${e.label}`, value: `${e.value}` }, l)) }),
|
|
239
|
+
a.allowSelectAll ? /* @__PURE__ */ t.jsx("button", { type: "button", className: "bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400", onClick: () => {
|
|
240
|
+
T(a.filter, a.availableValues);
|
|
238
241
|
}, children: "Select all options" }) : null
|
|
239
242
|
] })
|
|
240
243
|
] }, r)),
|
|
241
|
-
p ? /* @__PURE__ */
|
|
242
|
-
width: p.width || `calc(${100 /
|
|
244
|
+
p ? /* @__PURE__ */ t.jsxs("div", { style: {
|
|
245
|
+
width: p.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
243
246
|
flexGrow: 1,
|
|
244
247
|
flexShrink: 0,
|
|
245
248
|
minWidth: "240px"
|
|
246
249
|
}, className: "pb-4", children: [
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
|
|
250
|
+
/* @__PURE__ */ t.jsx(A, { className: "mb-2", children: p.label || "Highlight data" }),
|
|
251
|
+
/* @__PURE__ */ t.jsx(
|
|
252
|
+
V,
|
|
250
253
|
{
|
|
251
|
-
options:
|
|
252
|
-
variant:
|
|
254
|
+
options: ta,
|
|
255
|
+
variant: c,
|
|
253
256
|
size: "sm",
|
|
254
257
|
isMulti: !0,
|
|
255
258
|
isClearable: !0,
|
|
@@ -257,7 +260,7 @@ function Ea(s) {
|
|
|
257
260
|
controlShouldRenderValue: !0,
|
|
258
261
|
filterOption: M(G),
|
|
259
262
|
onChange: (a) => {
|
|
260
|
-
|
|
263
|
+
la(a?.map((r) => r.value));
|
|
261
264
|
},
|
|
262
265
|
value: j?.map((a) => ({
|
|
263
266
|
label: a,
|
|
@@ -271,8 +274,8 @@ function Ea(s) {
|
|
|
271
274
|
)
|
|
272
275
|
] }) : null
|
|
273
276
|
] }) : null,
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
...
|
|
277
|
+
/* @__PURE__ */ t.jsx(fa, { graph: C, graphData: oa, graphDataConfiguration: m, debugMode: y, readableHeader: _ || [], updateFilters: aa, settings: {
|
|
278
|
+
...n || {},
|
|
276
279
|
...g,
|
|
277
280
|
graphTitle: void 0,
|
|
278
281
|
graphDescription: void 0,
|
|
@@ -284,14 +287,14 @@ function Ea(s) {
|
|
|
284
287
|
relativeHeight: void 0,
|
|
285
288
|
minHeight: void 0,
|
|
286
289
|
padding: "0",
|
|
287
|
-
theme:
|
|
290
|
+
theme: n?.theme,
|
|
288
291
|
...j ? {
|
|
289
292
|
highlightedDataPoints: j,
|
|
290
293
|
highlightedIds: j?.map((a) => `${a}`),
|
|
291
294
|
highlightedLines: j?.map((a) => a)
|
|
292
295
|
} : {}
|
|
293
296
|
} })
|
|
294
|
-
] }) : /* @__PURE__ */
|
|
297
|
+
] }) : /* @__PURE__ */ t.jsx("div", { className: "w-full flex justify-center p-4", children: /* @__PURE__ */ t.jsx(ha, {}) }) });
|
|
295
298
|
}
|
|
296
299
|
export {
|
|
297
300
|
Ea as SingleGraphDashboard
|