@undp/data-viz 2.0.8 → 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 +120 -117
- 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 +124 -120
- 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/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 +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -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,50 +1,50 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { useState as S, useRef as
|
|
3
|
-
import { i as
|
|
1
|
+
import { c as ue, j as o } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
|
+
import { useState as S, useRef as Q, useEffectEvent as E, useEffect as $ } from "react";
|
|
3
|
+
import { i as de } from "./index-BuwmuDFJ.js";
|
|
4
4
|
import { f as z } from "./index-EArKRVKg.js";
|
|
5
|
-
import { i as
|
|
6
|
-
import { j as
|
|
7
|
-
import { g as he, b as M, y as
|
|
5
|
+
import { i as ce } from "./index-Bwrro8-q.js";
|
|
6
|
+
import { j as k, D as L } from "./DropdownSelect-BbdPQa2k.js";
|
|
7
|
+
import { g as he, b as M, y as U, h as B, c as ge, $ as X, P as Y } from "./checkIfMultiple-Y9iKaV_u.js";
|
|
8
8
|
import { w as pe } from "./Spinner-D7rnnwnA.js";
|
|
9
|
-
import { j as
|
|
10
|
-
import { ThreeDGlobe as
|
|
11
|
-
import { f as
|
|
9
|
+
import { j as _ } from "./Typography-PxtFcnJb.js";
|
|
10
|
+
import { ThreeDGlobe as fe } from "./ThreeDGlobe.js";
|
|
11
|
+
import { f as me, a as Ce, b as be, c as ve, t as xe } from "./fetchAndParseData-BpqkBPQL.js";
|
|
12
12
|
import { a as Ie, t as we } from "./transformDataForAggregation-DEU__LUl.js";
|
|
13
|
-
import { g as
|
|
13
|
+
import { g as ee } from "./getUniqValue-DsqSii6M.js";
|
|
14
14
|
import { GraphHeader as De } from "./GraphHeader.js";
|
|
15
|
-
import { f as
|
|
15
|
+
import { f as ae } from "./filterData-DsAiFzKY.js";
|
|
16
16
|
import { g as ye } from "./getGraphList-Dxwo9TDb.js";
|
|
17
|
-
import { t as
|
|
17
|
+
import { t as te } from "./transformDataForSelect-D8AuvYdf.js";
|
|
18
18
|
import { G as Se } from "./GraphContainer-CRqzdKu2.js";
|
|
19
|
-
function
|
|
20
|
-
const a =
|
|
19
|
+
function Ve(D) {
|
|
20
|
+
const a = ue.c(24), {
|
|
21
21
|
settings: t,
|
|
22
22
|
graph: g,
|
|
23
|
-
graphData:
|
|
23
|
+
graphData: d,
|
|
24
24
|
debugMode: w,
|
|
25
25
|
graphDataConfiguration: r,
|
|
26
|
-
readableHeader:
|
|
26
|
+
readableHeader: V,
|
|
27
27
|
updateFilters: I
|
|
28
28
|
} = D;
|
|
29
|
-
if (w && (console.log(`Graph: ${g}`), console.log("Transformed data:",
|
|
30
|
-
const
|
|
29
|
+
if (w && (console.log(`Graph: ${g}`), console.log("Transformed data:", d), console.log("Settings:", t)), typeof d == "string") {
|
|
30
|
+
const m = `flex my-0 mx-auto grow flex-col justify-center ${t?.width ? "w-fit" : "w-full"}`;
|
|
31
31
|
let p;
|
|
32
32
|
a[0] === Symbol.for("react.memo_cache_sentinel") ? (p = {
|
|
33
33
|
height: "inherit"
|
|
34
34
|
}, a[0] = p) : p = a[0];
|
|
35
|
-
let
|
|
36
|
-
a[1] !==
|
|
35
|
+
let u;
|
|
36
|
+
a[1] !== d ? (u = /* @__PURE__ */ o.jsx(_, { size: "sm", marginBottom: "none", className: "p-2 text-center text-accent-dark-red dark:text-accent-red", children: d }), a[1] = d, a[2] = u) : u = a[2];
|
|
37
37
|
let x;
|
|
38
|
-
return a[3] !==
|
|
38
|
+
return a[3] !== m || a[4] !== u ? (x = /* @__PURE__ */ o.jsx("div", { className: m, style: p, children: u }), a[3] = m, a[4] = u, a[5] = x) : x = a[5], x;
|
|
39
39
|
}
|
|
40
40
|
let b;
|
|
41
41
|
a[6] === Symbol.for("react.memo_cache_sentinel") ? (b = {
|
|
42
|
-
threeDGlobe:
|
|
42
|
+
threeDGlobe: fe
|
|
43
43
|
}, a[6] = b) : b = a[6];
|
|
44
|
-
const
|
|
45
|
-
let
|
|
46
|
-
a[7] !==
|
|
47
|
-
switch (
|
|
44
|
+
const P = b;
|
|
45
|
+
let j;
|
|
46
|
+
a[7] !== d || a[8] !== r || a[9] !== V || a[10] !== t || a[11] !== I ? (j = (m) => {
|
|
47
|
+
switch (m) {
|
|
48
48
|
case "threeDGlobe":
|
|
49
49
|
return {
|
|
50
50
|
globeOffset: t?.globeOffset,
|
|
@@ -63,9 +63,9 @@ function je(D) {
|
|
|
63
63
|
sources: t?.sources,
|
|
64
64
|
colorDomain: t?.colorDomain,
|
|
65
65
|
colors: t?.colors,
|
|
66
|
-
colorLegendTitle: Object.keys(t || {}).indexOf("colorLegendTitle") !== -1 ? t?.colorLegendTitle : he("x", r || [],
|
|
66
|
+
colorLegendTitle: Object.keys(t || {}).indexOf("colorLegendTitle") !== -1 ? t?.colorLegendTitle : he("x", r || [], V || []),
|
|
67
67
|
scaleType: t?.scaleType,
|
|
68
|
-
data:
|
|
68
|
+
data: d,
|
|
69
69
|
centerPoint: t?.centerPoint,
|
|
70
70
|
backgroundColor: t?.backgroundColor,
|
|
71
71
|
mapNoDataColor: t?.mapNoDataColor,
|
|
@@ -100,26 +100,26 @@ function je(D) {
|
|
|
100
100
|
default:
|
|
101
101
|
return {};
|
|
102
102
|
}
|
|
103
|
-
}, a[7] =
|
|
104
|
-
const
|
|
103
|
+
}, a[7] = d, a[8] = r, a[9] = V, a[10] = t, a[11] = I, a[12] = j) : j = a[12];
|
|
104
|
+
const c = j, T = P[g];
|
|
105
105
|
let h;
|
|
106
|
-
a[13] !==
|
|
107
|
-
const
|
|
106
|
+
a[13] !== c || a[14] !== g ? (h = c(g), a[13] = c, a[14] = g, a[15] = h) : h = a[15];
|
|
107
|
+
const f = h, N = `grow my-0 mx-auto flex flex-col w-full justify-center ${t?.theme || "light"}`;
|
|
108
108
|
let y;
|
|
109
109
|
a[16] === Symbol.for("react.memo_cache_sentinel") ? (y = {
|
|
110
110
|
minHeight: "inherit"
|
|
111
111
|
}, a[16] = y) : y = a[16];
|
|
112
112
|
let s;
|
|
113
|
-
a[17] !== T || a[18] !== g || a[19] !==
|
|
113
|
+
a[17] !== T || a[18] !== g || a[19] !== f ? (s = T ? /* @__PURE__ */ o.jsx(T, { ...f }) : /* @__PURE__ */ o.jsx(_, { size: "sm", marginBottom: "none", className: "p-2 text-center text-accent-dark-red dark:text-accent-red", children: `Invalid chart type: ${g}` }), a[17] = T, a[18] = g, a[19] = f, a[20] = s) : s = a[20];
|
|
114
114
|
let G;
|
|
115
115
|
return a[21] !== N || a[22] !== s ? (G = /* @__PURE__ */ o.jsx("div", { className: N, style: y, children: s }), a[21] = N, a[22] = s, a[23] = G) : G = a[23], G;
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const W = (D, a) => {
|
|
118
118
|
const t = a?.map((g) => {
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
121
|
-
const w = D[
|
|
122
|
-
return w === -1 ? {} : D[
|
|
119
|
+
const d = D?.findIndex((r) => r.chartConfigId === g.chartConfigId);
|
|
120
|
+
if (d === -1) return {};
|
|
121
|
+
const w = D[d]?.allowedColumnIds?.findIndex((r) => r.value === g.columnId);
|
|
122
|
+
return w === -1 ? {} : D[d].allowedColumnIds[w].graphSettings || {};
|
|
123
123
|
}) || [];
|
|
124
124
|
return Object.assign({}, ...t);
|
|
125
125
|
};
|
|
@@ -128,96 +128,98 @@ function We(D) {
|
|
|
128
128
|
graphSettings: a,
|
|
129
129
|
dataSettings: t,
|
|
130
130
|
filters: g,
|
|
131
|
-
graphType:
|
|
131
|
+
graphType: d,
|
|
132
132
|
dataTransform: w,
|
|
133
133
|
graphDataConfiguration: r,
|
|
134
|
-
dataFilters:
|
|
134
|
+
dataFilters: V,
|
|
135
135
|
debugMode: I,
|
|
136
136
|
dataSelectionOptions: b,
|
|
137
|
-
advancedDataSelectionOptions:
|
|
138
|
-
readableHeader:
|
|
139
|
-
noOfFiltersPerRow:
|
|
137
|
+
advancedDataSelectionOptions: P,
|
|
138
|
+
readableHeader: j,
|
|
139
|
+
noOfFiltersPerRow: c = 4,
|
|
140
140
|
updateFilters: T,
|
|
141
141
|
uiMode: h = "normal",
|
|
142
|
-
highlightDataPointSettings:
|
|
143
|
-
} = D, [N, y] = S(void 0), [s, G] = S(void 0), [
|
|
142
|
+
highlightDataPointSettings: f
|
|
143
|
+
} = D, [N, y] = S(void 0), [s, G] = S(void 0), [m, p] = S(r), [u, x] = S({}), [O, le] = S(void 0), [ie, oe] = S([]), q = Q(null), Z = Q(r), [A, J] = S([]), R = {
|
|
144
144
|
ignoreCase: !0,
|
|
145
145
|
ignoreAccents: !0,
|
|
146
146
|
trim: !0
|
|
147
|
-
},
|
|
147
|
+
}, K = E(() => {
|
|
148
148
|
const e = (g || []).map((n) => ({
|
|
149
149
|
filter: n.column,
|
|
150
150
|
label: n.label || `Filter by ${n.column}`,
|
|
151
151
|
singleSelect: n.singleSelect,
|
|
152
152
|
clearable: n.clearable,
|
|
153
|
-
defaultValue:
|
|
154
|
-
value:
|
|
155
|
-
availableValues:
|
|
153
|
+
defaultValue: te(n.defaultValue),
|
|
154
|
+
value: te(n.defaultValue),
|
|
155
|
+
availableValues: ee(s, n.column).filter((l) => !n.excludeValues?.includes(`${l}`)).map((l) => ({
|
|
156
156
|
value: l,
|
|
157
157
|
label: l
|
|
158
158
|
})),
|
|
159
159
|
allowSelectAll: n.allowSelectAll,
|
|
160
160
|
width: n.width
|
|
161
161
|
}));
|
|
162
|
-
|
|
162
|
+
J(e);
|
|
163
163
|
});
|
|
164
|
-
|
|
164
|
+
$(() => {
|
|
165
165
|
(async () => {
|
|
166
166
|
try {
|
|
167
|
-
const n = t.dataURL ? typeof t.dataURL == "string" ? t.fileType === "json" ? await
|
|
167
|
+
const n = t.dataURL ? typeof t.dataURL == "string" ? t.fileType === "json" ? await me(t.dataURL, t.columnsToArray, t.dataTransformation, I) : t.fileType === "api" ? await Ce(t.dataURL, t.apiHeaders, t.columnsToArray, t.dataTransformation, I) : await be(t.dataURL, t.dataTransformation, t.columnsToArray, I, t.delimiter, !0) : await ve(t.dataURL, t.idColumnTitle) : await xe(t.data, t.columnsToArray);
|
|
168
168
|
G(n);
|
|
169
169
|
} catch (n) {
|
|
170
170
|
console.error("Data fetching error:", n);
|
|
171
171
|
}
|
|
172
|
-
})(),
|
|
173
|
-
}, [t,
|
|
172
|
+
})(), K();
|
|
173
|
+
}, [t, I]), $(() => {
|
|
174
|
+
K();
|
|
175
|
+
}, [g, s]);
|
|
174
176
|
const re = E(() => {
|
|
175
|
-
if (!s ||
|
|
177
|
+
if (!s || A.length === 0) y(s);
|
|
176
178
|
else {
|
|
177
|
-
const e = s.filter((n) =>
|
|
179
|
+
const e = s.filter((n) => A.every((l) => l.value && z([l.value]).length > 0 ? de(z([n[l.filter]]), z([l.value]).map((i) => i.value)).length > 0 : !0));
|
|
178
180
|
y(e);
|
|
179
181
|
}
|
|
180
182
|
});
|
|
181
|
-
|
|
183
|
+
$(() => {
|
|
182
184
|
re();
|
|
183
|
-
}, [
|
|
184
|
-
b && x(
|
|
185
|
+
}, [A, s]), $(() => {
|
|
186
|
+
b && x(W(b, r));
|
|
185
187
|
}, [b, r]);
|
|
186
188
|
const ne = E(() => {
|
|
187
|
-
|
|
189
|
+
f?.column && N && oe(ee(N, f.column).filter((e) => !f?.excludeValues?.includes(`${e}`)).map((e) => ({
|
|
188
190
|
value: e,
|
|
189
191
|
label: e
|
|
190
192
|
})));
|
|
191
193
|
});
|
|
192
|
-
|
|
194
|
+
$(() => {
|
|
193
195
|
ne();
|
|
194
|
-
}, [
|
|
195
|
-
|
|
196
|
+
}, [f]), $(() => {
|
|
197
|
+
ce(Z.current, r) || (p(r), Z.current = r);
|
|
196
198
|
}, [r]);
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
+
const H = (e, n) => {
|
|
200
|
+
J((l) => l.map((i) => i.filter === e ? {
|
|
199
201
|
...i,
|
|
200
202
|
value: n
|
|
201
203
|
} : i));
|
|
202
|
-
}, se = s ? Ie(w ? we(
|
|
203
|
-
return /* @__PURE__ */ o.jsx(Se, { className: a?.classNames?.graphContainer, style: a?.styles?.graphContainer, id: a?.graphID, ref:
|
|
204
|
-
|
|
205
|
-
title:
|
|
206
|
-
description:
|
|
204
|
+
}, se = s ? Ie(w ? we(ae(s, V || []), w.keyColumn, w.aggregationColumnsSetting) : ae(s, V || []), d, m) : void 0;
|
|
205
|
+
return /* @__PURE__ */ o.jsx(Se, { className: a?.classNames?.graphContainer, style: a?.styles?.graphContainer, id: a?.graphID, ref: q, "aria-label": a?.ariaLabel, backgroundColor: a?.backgroundColor ?? !1, theme: a?.theme || "light", language: a?.language || "en", width: a?.width, height: a?.height, padding: a?.padding, minHeight: a?.minHeight, relativeHeight: a?.relativeHeight, children: s || ye.filter((e) => e.geoHubMapPresentation).map((e) => e.graphID).indexOf(d) !== -1 ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
206
|
+
u?.graphTitle || u?.graphDescription || a?.graphTitle || a?.graphDescription || a?.graphDownload || a?.dataDownload ? /* @__PURE__ */ o.jsx(De, { styles: {
|
|
207
|
+
title: u?.styles?.title || a?.styles?.title,
|
|
208
|
+
description: u?.styles?.description || a?.styles?.description
|
|
207
209
|
}, classNames: {
|
|
208
|
-
title:
|
|
209
|
-
description:
|
|
210
|
-
}, graphTitle:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
width: e.width || `calc(${100 /
|
|
210
|
+
title: u?.classNames?.title || a?.classNames?.title,
|
|
211
|
+
description: u?.classNames?.description || a?.classNames?.description
|
|
212
|
+
}, graphTitle: u?.graphTitle || a?.graphTitle, graphDescription: u?.graphDescription || a?.graphDescription, width: u?.width || a?.width, graphDownload: a?.graphDownload ? q : void 0, dataDownload: a?.dataDownload && s && s.length > 0 ? s : null }) : null,
|
|
213
|
+
A.length !== 0 || (b || []).length !== 0 || (P || []).length !== 0 || f ? /* @__PURE__ */ o.jsxs("div", { className: "flex flex-wrap items-start gap-x-4 gap-y-0 w-full", children: [
|
|
214
|
+
P?.map((e, n) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
215
|
+
width: e.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
|
|
214
216
|
flexGrow: 1,
|
|
215
217
|
flexShrink: e.ui !== "radio" ? 0 : 1,
|
|
216
218
|
minWidth: "240px"
|
|
217
219
|
}, className: "pb-4", children: [
|
|
218
220
|
/* @__PURE__ */ o.jsx(M, { className: "mb-2", children: e.label || "Graph by" }),
|
|
219
221
|
e.ui !== "radio" ? /* @__PURE__ */ o.jsx(
|
|
220
|
-
|
|
222
|
+
k,
|
|
221
223
|
{
|
|
222
224
|
options: e.options.map((l) => ({
|
|
223
225
|
...l,
|
|
@@ -239,20 +241,20 @@ function We(D) {
|
|
|
239
241
|
x(l?.graphSettings || {}), p(l?.dataConfiguration);
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
|
-
) : /* @__PURE__ */ o.jsx(
|
|
244
|
+
) : /* @__PURE__ */ o.jsx(U, { defaultValue: e.defaultValue?.label || e.options[0].label, variant: h, onValueChange: (l) => {
|
|
243
245
|
const i = e.options[e.options.findIndex((v) => v.label === l)];
|
|
244
246
|
x(i.graphSettings || {}), p(i.dataConfiguration);
|
|
245
|
-
}, children: e.options.map((l, i) => /* @__PURE__ */ o.jsx(
|
|
247
|
+
}, children: e.options.map((l, i) => /* @__PURE__ */ o.jsx(B, { label: l.label, value: l.label }, i)) })
|
|
246
248
|
] }, n)),
|
|
247
249
|
b?.map((e, n) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
248
|
-
width: e.width || `calc(${100 /
|
|
250
|
+
width: e.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
|
|
249
251
|
flexGrow: 1,
|
|
250
252
|
flexShrink: e.ui !== "radio" ? 0 : 1,
|
|
251
253
|
minWidth: "240px"
|
|
252
254
|
}, className: "pb-4", children: [
|
|
253
255
|
/* @__PURE__ */ o.jsx(M, { className: "mb-2", children: e.label || `Visualize ${e.chartConfigId} by` }),
|
|
254
|
-
ge(e.chartConfigId,
|
|
255
|
-
|
|
256
|
+
ge(e.chartConfigId, m || []) ? e.ui !== "radio" ? /* @__PURE__ */ o.jsx(
|
|
257
|
+
k,
|
|
256
258
|
{
|
|
257
259
|
options: e.allowedColumnIds,
|
|
258
260
|
size: "sm",
|
|
@@ -261,7 +263,7 @@ function We(D) {
|
|
|
261
263
|
variant: h,
|
|
262
264
|
controlShouldRenderValue: !0,
|
|
263
265
|
defaultValue: r ? r[r.findIndex((l) => l.chartConfigId === e.chartConfigId)].columnId.map((l) => e.allowedColumnIds[e.allowedColumnIds.findIndex((i) => i.value === l)]) : void 0,
|
|
264
|
-
filterOption: L(
|
|
266
|
+
filterOption: L(R),
|
|
265
267
|
onChange: (l) => {
|
|
266
268
|
const i = {
|
|
267
269
|
columnId: (l || []).map(
|
|
@@ -269,18 +271,18 @@ function We(D) {
|
|
|
269
271
|
(C) => C.value
|
|
270
272
|
),
|
|
271
273
|
chartConfigId: e.chartConfigId
|
|
272
|
-
}, v =
|
|
274
|
+
}, v = m?.map((C) => C.chartConfigId === i.chartConfigId ? i : C);
|
|
273
275
|
p(v);
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
|
-
) : /* @__PURE__ */ o.jsx(
|
|
278
|
+
) : /* @__PURE__ */ o.jsx(X, { variant: h, defaultValue: r ? r[r.findIndex((l) => l.chartConfigId === e.chartConfigId)].columnId.map((l) => e.allowedColumnIds[e.allowedColumnIds.findIndex((i) => i.value === l)]).map((l) => l.value) : [], onValueChange: (l) => {
|
|
277
279
|
const i = {
|
|
278
280
|
columnId: l || [],
|
|
279
281
|
chartConfigId: e.chartConfigId
|
|
280
|
-
}, v =
|
|
282
|
+
}, v = m?.map((C) => C.chartConfigId === i.chartConfigId ? i : C);
|
|
281
283
|
p(v);
|
|
282
|
-
}, children: e.allowedColumnIds.map((l, i) => /* @__PURE__ */ o.jsx(
|
|
283
|
-
|
|
284
|
+
}, children: e.allowedColumnIds.map((l, i) => /* @__PURE__ */ o.jsx(Y, { label: l.label, value: l.label }, i)) }) : e.ui !== "radio" ? /* @__PURE__ */ o.jsx(
|
|
285
|
+
k,
|
|
284
286
|
{
|
|
285
287
|
options: e.allowedColumnIds,
|
|
286
288
|
size: "sm",
|
|
@@ -293,64 +295,66 @@ function We(D) {
|
|
|
293
295
|
const i = {
|
|
294
296
|
columnId: l?.value,
|
|
295
297
|
chartConfigId: e.chartConfigId
|
|
296
|
-
}, v =
|
|
297
|
-
x(
|
|
298
|
+
}, v = m?.map((C) => C.chartConfigId === i.chartConfigId ? i : C);
|
|
299
|
+
x(W(b, v)), p(v);
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
|
-
) : /* @__PURE__ */ o.jsx(
|
|
302
|
+
) : /* @__PURE__ */ o.jsx(U, { variant: h, defaultValue: r ? e.allowedColumnIds[e.allowedColumnIds.findIndex((l) => l.value === r[r.findIndex((i) => i.chartConfigId === e.chartConfigId)].columnId)].label : "", onValueChange: (l) => {
|
|
301
303
|
const v = {
|
|
302
304
|
columnId: e.allowedColumnIds[e.allowedColumnIds.findIndex((F) => F.label === l)].value,
|
|
303
305
|
chartConfigId: e.chartConfigId
|
|
304
|
-
}, C =
|
|
305
|
-
x(
|
|
306
|
-
}, children: e.allowedColumnIds.map((l, i) => /* @__PURE__ */ o.jsx(
|
|
306
|
+
}, C = m?.map((F) => F.chartConfigId === v.chartConfigId ? v : F);
|
|
307
|
+
x(W(b, C)), p(C);
|
|
308
|
+
}, children: e.allowedColumnIds.map((l, i) => /* @__PURE__ */ o.jsx(B, { label: l.label, value: l.label }, i)) })
|
|
307
309
|
] }, n)),
|
|
308
|
-
|
|
309
|
-
width: e.width || `calc(${100 /
|
|
310
|
+
A?.map((e, n) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
311
|
+
width: e.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
|
|
310
312
|
flexGrow: 1,
|
|
311
313
|
flexShrink: 0,
|
|
312
314
|
minWidth: "240px"
|
|
313
315
|
}, className: "pb-4", children: [
|
|
314
316
|
/* @__PURE__ */ o.jsx(M, { className: "mb-2", children: e.label }),
|
|
315
|
-
e.singleSelect ? /* @__PURE__ */ o.jsx(
|
|
316
|
-
|
|
317
|
-
}, value: e.value, defaultValue: e.defaultValue }) : /* @__PURE__ */ o.
|
|
318
|
-
e.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
},
|
|
317
|
+
e.singleSelect ? e.ui !== "radio" ? /* @__PURE__ */ o.jsx(k, { options: e.availableValues, variant: h, isClearable: e.clearable === void 0 ? !0 : e.clearable, isSearchable: !0, controlShouldRenderValue: !0, filterOption: L(R), onChange: (l) => {
|
|
318
|
+
H(e.filter, l);
|
|
319
|
+
}, value: e.value, defaultValue: e.defaultValue }) : /* @__PURE__ */ o.jsx(U, { variant: h, defaultValue: e.defaultValue.value, onValueChange: (l) => {
|
|
320
|
+
H(e.filter, e.availableValues.filter((i) => i.value === l));
|
|
321
|
+
}, children: e.availableValues.map((l, i) => /* @__PURE__ */ o.jsx(B, { label: `${l.label}`, value: `${l.value}` }, i)) }) : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
322
|
+
e.ui !== "radio" ? /* @__PURE__ */ o.jsx(k, { options: e.availableValues, variant: h, size: "sm", isMulti: !0, isClearable: e.clearable === void 0 ? !0 : e.clearable, isSearchable: !0, controlShouldRenderValue: !0, filterOption: L(R), onChange: (l) => {
|
|
323
|
+
H(e.filter, l);
|
|
324
|
+
}, value: e.value, defaultValue: e.defaultValue }) : /* @__PURE__ */ o.jsx(X, { variant: h, defaultValue: e.defaultValue ? e.defaultValue.map((l) => `${l.value}`) : [], value: e.value ? e.value.map((l) => `${l.value}`) : void 0, onValueChange: (l) => {
|
|
325
|
+
H(e.filter, e.availableValues.filter((i) => l.indexOf(`${i.value}`) !== -1));
|
|
326
|
+
}, children: e.availableValues.map((l, i) => /* @__PURE__ */ o.jsx(Y, { label: `${l.label}`, value: `${l.value}` }, i)) }),
|
|
323
327
|
e.allowSelectAll ? /* @__PURE__ */ o.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: () => {
|
|
324
|
-
|
|
328
|
+
H(e.filter, e.availableValues);
|
|
325
329
|
}, children: "Select all options" }) : null
|
|
326
330
|
] })
|
|
327
331
|
] }, n)),
|
|
328
|
-
|
|
329
|
-
width:
|
|
332
|
+
f ? /* @__PURE__ */ o.jsxs("div", { style: {
|
|
333
|
+
width: f.width || `calc(${100 / c}% - ${(c - 1) / c}rem)`,
|
|
330
334
|
flexGrow: 1,
|
|
331
335
|
flexShrink: 0,
|
|
332
336
|
minWidth: "240px"
|
|
333
337
|
}, className: "pb-4", children: [
|
|
334
|
-
/* @__PURE__ */ o.jsx(M, { className: "mb-2", children:
|
|
338
|
+
/* @__PURE__ */ o.jsx(M, { className: "mb-2", children: f.label || "Highlight data" }),
|
|
335
339
|
/* @__PURE__ */ o.jsx(
|
|
336
|
-
|
|
340
|
+
k,
|
|
337
341
|
{
|
|
338
|
-
options:
|
|
342
|
+
options: ie,
|
|
339
343
|
variant: h,
|
|
340
344
|
size: "sm",
|
|
341
345
|
isMulti: !0,
|
|
342
346
|
isClearable: !0,
|
|
343
347
|
isSearchable: !0,
|
|
344
348
|
controlShouldRenderValue: !0,
|
|
345
|
-
filterOption: L(
|
|
349
|
+
filterOption: L(R),
|
|
346
350
|
onChange: (e) => {
|
|
347
|
-
|
|
351
|
+
le(e?.map((n) => n.value));
|
|
348
352
|
},
|
|
349
|
-
value:
|
|
353
|
+
value: O?.map((e) => ({
|
|
350
354
|
label: e,
|
|
351
355
|
value: e
|
|
352
356
|
})),
|
|
353
|
-
defaultValue:
|
|
357
|
+
defaultValue: f.defaultValues?.map((e) => ({
|
|
354
358
|
label: e,
|
|
355
359
|
value: e
|
|
356
360
|
}))
|
|
@@ -358,9 +362,9 @@ function We(D) {
|
|
|
358
362
|
)
|
|
359
363
|
] }) : null
|
|
360
364
|
] }) : null,
|
|
361
|
-
/* @__PURE__ */ o.jsx(
|
|
365
|
+
/* @__PURE__ */ o.jsx(Ve, { graph: d, graphData: se, graphDataConfiguration: m, debugMode: I, readableHeader: j || [], updateFilters: T, settings: {
|
|
362
366
|
...a || {},
|
|
363
|
-
...
|
|
367
|
+
...u,
|
|
364
368
|
graphTitle: void 0,
|
|
365
369
|
graphDescription: void 0,
|
|
366
370
|
graphDownload: !1,
|
|
@@ -372,10 +376,10 @@ function We(D) {
|
|
|
372
376
|
relativeHeight: void 0,
|
|
373
377
|
minHeight: void 0,
|
|
374
378
|
theme: a?.theme,
|
|
375
|
-
...
|
|
376
|
-
highlightedDataPoints:
|
|
377
|
-
highlightedIds:
|
|
378
|
-
highlightedLines:
|
|
379
|
+
...O ? {
|
|
380
|
+
highlightedDataPoints: O,
|
|
381
|
+
highlightedIds: O?.map((e) => `${e}`),
|
|
382
|
+
highlightedLines: O?.map((e) => e)
|
|
379
383
|
} : {}
|
|
380
384
|
} })
|
|
381
385
|
] }) : /* @__PURE__ */ o.jsx("div", { className: "w-full flex justify-center p-4", children: /* @__PURE__ */ o.jsx(pe, {}) }) });
|