@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
package/dist/GriddedGraphs.js
CHANGED
|
@@ -1,107 +1,115 @@
|
|
|
1
1
|
import { j as o } from "./index-CHPV5EwG-Curnpaqc.js";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { i as
|
|
2
|
+
import { useState as C, useRef as na, useMemo as B, useEffect as I, useEffectEvent as J, useCallback as sa } from "react";
|
|
3
|
+
import { i as ua } from "./index-BuwmuDFJ.js";
|
|
4
4
|
import { f as T } from "./index-EArKRVKg.js";
|
|
5
|
-
import { b as
|
|
5
|
+
import { b as $, y as A, h as F, c as ca, $ as K, P as Q } from "./checkIfMultiple-Y9iKaV_u.js";
|
|
6
6
|
import { w as da } from "./Spinner-D7rnnwnA.js";
|
|
7
|
-
import { j as
|
|
8
|
-
import { G as
|
|
9
|
-
import { G as
|
|
10
|
-
import { f as
|
|
11
|
-
import { Colors as
|
|
12
|
-
import { a as wa, t as
|
|
13
|
-
import { g as
|
|
14
|
-
import { GraphHeader as
|
|
15
|
-
import { GraphFooter as
|
|
16
|
-
import { f as
|
|
17
|
-
import { ColorLegend as
|
|
18
|
-
import { c as
|
|
19
|
-
import { t as
|
|
20
|
-
function
|
|
7
|
+
import { j as V, D as O } from "./DropdownSelect-BbdPQa2k.js";
|
|
8
|
+
import { G as ha } from "./GraphContainer-CRqzdKu2.js";
|
|
9
|
+
import { G as fa } from "./GraphEl-CGq1EWRn.js";
|
|
10
|
+
import { f as pa, a as ga, b as ma, c as Ca, t as va } from "./fetchAndParseData-BpqkBPQL.js";
|
|
11
|
+
import { Colors as ba } from "./Colors.js";
|
|
12
|
+
import { a as wa, t as xa } from "./transformDataForAggregation-DEU__LUl.js";
|
|
13
|
+
import { g as X } from "./getUniqValue-DsqSii6M.js";
|
|
14
|
+
import { GraphHeader as Ia } from "./GraphHeader.js";
|
|
15
|
+
import { GraphFooter as Va } from "./GraphFooter.js";
|
|
16
|
+
import { f as Y } from "./filterData-DsAiFzKY.js";
|
|
17
|
+
import { ColorLegend as Sa } from "./ColorLegend.js";
|
|
18
|
+
import { c as ja } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
19
|
+
import { t as Z } from "./transformDataForSelect-D8AuvYdf.js";
|
|
20
|
+
function qa(_) {
|
|
21
21
|
const {
|
|
22
22
|
graphSettings: l,
|
|
23
|
-
dataSettings:
|
|
24
|
-
filters:
|
|
25
|
-
graphType:
|
|
23
|
+
dataSettings: i,
|
|
24
|
+
filters: R,
|
|
25
|
+
graphType: k,
|
|
26
26
|
dataTransform: D,
|
|
27
|
-
graphDataConfiguration:
|
|
28
|
-
noOfColumns:
|
|
29
|
-
columnGridBy:
|
|
30
|
-
dataFilters:
|
|
31
|
-
showCommonColorScale:
|
|
32
|
-
minGraphHeight:
|
|
33
|
-
minGraphWidth:
|
|
34
|
-
debugMode:
|
|
35
|
-
dataSelectionOptions:
|
|
36
|
-
advancedDataSelectionOptions:
|
|
37
|
-
readableHeader:
|
|
38
|
-
noOfFiltersPerRow:
|
|
39
|
-
uiMode:
|
|
40
|
-
theme:
|
|
41
|
-
} =
|
|
27
|
+
graphDataConfiguration: n,
|
|
28
|
+
noOfColumns: N,
|
|
29
|
+
columnGridBy: S,
|
|
30
|
+
dataFilters: L,
|
|
31
|
+
showCommonColorScale: M,
|
|
32
|
+
minGraphHeight: aa,
|
|
33
|
+
minGraphWidth: H,
|
|
34
|
+
debugMode: v,
|
|
35
|
+
dataSelectionOptions: U,
|
|
36
|
+
advancedDataSelectionOptions: E,
|
|
37
|
+
readableHeader: ea,
|
|
38
|
+
noOfFiltersPerRow: h = 4,
|
|
39
|
+
uiMode: u = "normal",
|
|
40
|
+
theme: la = "light"
|
|
41
|
+
} = _, [m, ta] = C(void 0), [f, oa] = C(void 0), [b, ra] = C([]), P = na(null), [p, g] = C(n), [w, W] = C([]), [c, j] = C({}), G = B(() => ({
|
|
42
42
|
ignoreCase: !0,
|
|
43
43
|
ignoreAccents: !0,
|
|
44
44
|
trim: !0
|
|
45
|
-
}), []),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
|
|
45
|
+
}), []), z = B(() => !f || w.length === 0 ? f : f.filter((r) => w.every((e) => e.value && T([e.value]).length > 0 ? ua(T([r[e.filter]]), T([e.value]).map((t) => t.value)).length > 0 : !0)), [w, f]);
|
|
46
|
+
I(() => {
|
|
47
|
+
ta(z);
|
|
48
|
+
}, [z]);
|
|
49
|
+
const q = J(() => {
|
|
50
|
+
const a = (R || []).map((r) => ({
|
|
51
|
+
filter: r.column,
|
|
52
|
+
label: r.label || `Filter by ${r.column}`,
|
|
53
|
+
singleSelect: r.singleSelect,
|
|
54
|
+
clearable: r.clearable,
|
|
55
|
+
ui: r.ui,
|
|
56
|
+
defaultValue: Z(r.defaultValue),
|
|
57
|
+
value: Z(r.defaultValue),
|
|
58
|
+
availableValues: X(f, r.column).filter((e) => !r.excludeValues?.includes(`${e}`)).map((e) => ({
|
|
59
|
+
value: e,
|
|
60
|
+
label: e
|
|
61
|
+
})),
|
|
62
|
+
allowSelectAll: r.allowSelectAll,
|
|
63
|
+
width: r.width
|
|
64
|
+
}));
|
|
65
|
+
W(a);
|
|
66
|
+
});
|
|
67
|
+
I(() => {
|
|
68
|
+
(async () => {
|
|
51
69
|
try {
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const t = (F || []).map((r) => ({
|
|
57
|
-
filter: r.column,
|
|
58
|
-
label: r.label || `Filter by ${r.column}`,
|
|
59
|
-
singleSelect: r.singleSelect,
|
|
60
|
-
clearable: r.clearable,
|
|
61
|
-
defaultValue: X(r.defaultValue),
|
|
62
|
-
value: X(r.defaultValue),
|
|
63
|
-
availableValues: K(d, r.column).filter((i) => !r.excludeValues?.includes(`${i}`)).map((i) => ({
|
|
64
|
-
value: i,
|
|
65
|
-
label: i
|
|
66
|
-
})),
|
|
67
|
-
allowSelectAll: r.allowSelectAll,
|
|
68
|
-
width: r.width
|
|
69
|
-
}));
|
|
70
|
-
P(t);
|
|
71
|
-
} catch (a) {
|
|
72
|
-
console.error("Data fetching error:", a);
|
|
70
|
+
const r = i.dataURL ? typeof i.dataURL == "string" ? i.fileType === "json" ? await pa(i.dataURL, i.columnsToArray, i.dataTransformation, v) : i.fileType === "api" ? await ga(i.dataURL, i.apiHeaders, i.columnsToArray, i.dataTransformation, v) : await ma(i.dataURL, i.dataTransformation, i.columnsToArray, v, i.delimiter, !0) : await Ca(i.dataURL, i.idColumnTitle) : await va(i.data, i.columnsToArray);
|
|
71
|
+
oa(r);
|
|
72
|
+
} catch (r) {
|
|
73
|
+
console.error("Data fetching error:", r);
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
})(), q();
|
|
76
|
+
}, [i, v]), I(() => {
|
|
77
|
+
q();
|
|
78
|
+
}, [R, f]);
|
|
79
|
+
const ia = J(() => {
|
|
80
|
+
const a = X(f, S);
|
|
81
|
+
ra(a);
|
|
82
|
+
});
|
|
83
|
+
I(() => {
|
|
84
|
+
ia();
|
|
85
|
+
}, [S, f]), I(() => {
|
|
86
|
+
g(n);
|
|
87
|
+
}, [n]);
|
|
88
|
+
const x = sa((a, r) => {
|
|
89
|
+
W((e) => e.map((t) => t.filter === a ? {
|
|
82
90
|
...t,
|
|
83
|
-
value:
|
|
91
|
+
value: r
|
|
84
92
|
} : t));
|
|
85
93
|
}, []);
|
|
86
|
-
return /* @__PURE__ */ o.jsxs(
|
|
87
|
-
c?.graphTitle || c?.graphDescription || l?.graphTitle || l?.graphDescription || l?.graphDownload || l?.dataDownload ? /* @__PURE__ */ o.jsx(
|
|
94
|
+
return /* @__PURE__ */ o.jsxs(ha, { className: l?.classNames?.graphContainer, style: l?.styles?.graphContainer, id: l?.graphID, ref: P, "aria-label": l?.ariaLabel || "This is a gridded graph", backgroundColor: l?.backgroundColor ?? !1, theme: l?.theme || "light", language: l?.language || "en", width: l?.width, height: l?.height, padding: l?.padding, children: [
|
|
95
|
+
c?.graphTitle || c?.graphDescription || l?.graphTitle || l?.graphDescription || l?.graphDownload || l?.dataDownload ? /* @__PURE__ */ o.jsx(Ia, { styles: {
|
|
88
96
|
title: c?.styles?.title || l?.styles?.title,
|
|
89
97
|
description: c?.styles?.description || l?.styles?.description
|
|
90
98
|
}, classNames: {
|
|
91
99
|
title: c?.classNames?.title || l?.classNames?.title,
|
|
92
100
|
description: c?.classNames?.description || l?.classNames?.description
|
|
93
|
-
}, graphTitle: c?.graphTitle || l?.graphTitle, graphDescription: c?.graphDescription || l?.graphDescription, width: c?.width || l?.width, graphDownload: l?.graphDownload ?
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
width: a.width || `calc(${100 /
|
|
101
|
+
}, graphTitle: c?.graphTitle || l?.graphTitle, graphDescription: c?.graphDescription || l?.graphDescription, width: c?.width || l?.width, graphDownload: l?.graphDownload ? P : void 0, dataDownload: l?.dataDownload && m && m.length > 0 ? m : null }) : null,
|
|
102
|
+
m && b.length > 0 ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
103
|
+
w.length !== 0 || (U || []).length !== 0 || (E || []).length !== 0 ? /* @__PURE__ */ o.jsxs("div", { className: "flex flex-wrap items-start gap-x-4 gap-y-0 w-full", children: [
|
|
104
|
+
E?.map((a, r) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
105
|
+
width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
98
106
|
flexGrow: 1,
|
|
99
107
|
flexShrink: a.ui !== "radio" ? 0 : 1,
|
|
100
108
|
minWidth: "240px"
|
|
101
109
|
}, className: "pb-4", children: [
|
|
102
|
-
/* @__PURE__ */ o.jsx(
|
|
110
|
+
/* @__PURE__ */ o.jsx($, { className: "mb-2", children: a.label || "Graph by" }),
|
|
103
111
|
a.ui !== "radio" ? /* @__PURE__ */ o.jsx(
|
|
104
|
-
|
|
112
|
+
V,
|
|
105
113
|
{
|
|
106
114
|
options: a.options.map((e) => ({
|
|
107
115
|
...e,
|
|
@@ -109,7 +117,7 @@ function Ea(Y) {
|
|
|
109
117
|
})),
|
|
110
118
|
isClearable: !1,
|
|
111
119
|
isSearchable: !0,
|
|
112
|
-
variant:
|
|
120
|
+
variant: u,
|
|
113
121
|
controlShouldRenderValue: !0,
|
|
114
122
|
defaultValue: a.defaultValue ? {
|
|
115
123
|
...a.defaultValue,
|
|
@@ -119,111 +127,115 @@ function Ea(Y) {
|
|
|
119
127
|
value: a.options[0].label
|
|
120
128
|
},
|
|
121
129
|
onChange: (e) => {
|
|
122
|
-
|
|
130
|
+
j(e?.graphSettings || {}), g(e?.dataConfiguration);
|
|
123
131
|
}
|
|
124
132
|
}
|
|
125
|
-
) : /* @__PURE__ */ o.jsx(
|
|
126
|
-
const t = a.options[a.options.findIndex((
|
|
127
|
-
|
|
128
|
-
}, children: a.options.map((e, t) => /* @__PURE__ */ o.jsx(
|
|
129
|
-
] },
|
|
130
|
-
|
|
131
|
-
width: a.width || `calc(${100 /
|
|
133
|
+
) : /* @__PURE__ */ o.jsx(A, { defaultValue: a.defaultValue?.label || a.options[0].label, variant: u, onValueChange: (e) => {
|
|
134
|
+
const t = a.options[a.options.findIndex((d) => d.label === e)];
|
|
135
|
+
j(t.graphSettings || {}), g(t.dataConfiguration);
|
|
136
|
+
}, children: a.options.map((e, t) => /* @__PURE__ */ o.jsx(F, { label: e.label, value: e.label }, t)) })
|
|
137
|
+
] }, r)),
|
|
138
|
+
U?.map((a, r) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
139
|
+
width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
132
140
|
flexGrow: 1,
|
|
133
141
|
flexShrink: a.ui !== "radio" ? 0 : 1,
|
|
134
142
|
minWidth: "240px"
|
|
135
143
|
}, className: "pb-4", children: [
|
|
136
|
-
/* @__PURE__ */ o.jsx(
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
/* @__PURE__ */ o.jsx($, { className: "mb-2", children: a.label || `Visualize ${a.chartConfigId} by` }),
|
|
145
|
+
ca(a.chartConfigId, p || []) ? a.ui !== "radio" ? /* @__PURE__ */ o.jsx(
|
|
146
|
+
V,
|
|
139
147
|
{
|
|
140
148
|
options: a.allowedColumnIds,
|
|
141
149
|
isMulti: !0,
|
|
142
|
-
variant:
|
|
150
|
+
variant: u,
|
|
143
151
|
isSearchable: !0,
|
|
144
152
|
controlShouldRenderValue: !0,
|
|
145
|
-
defaultValue:
|
|
146
|
-
filterOption:
|
|
153
|
+
defaultValue: n ? n[n.findIndex((e) => e.chartConfigId === a.chartConfigId)].columnId.map((e) => a.allowedColumnIds[a.allowedColumnIds.findIndex((t) => t.value === e)]) : void 0,
|
|
154
|
+
filterOption: O(G),
|
|
147
155
|
onChange: (e) => {
|
|
148
156
|
const t = {
|
|
149
157
|
columnId: e.map(
|
|
150
158
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
-
(
|
|
159
|
+
(s) => s.value
|
|
152
160
|
),
|
|
153
161
|
chartConfigId: a.chartConfigId
|
|
154
|
-
},
|
|
155
|
-
g(
|
|
162
|
+
}, d = p?.map((s) => s.chartConfigId === t.chartConfigId ? t : s);
|
|
163
|
+
g(d);
|
|
156
164
|
},
|
|
157
165
|
isRtl: l?.language === "ar" || l?.language === "he"
|
|
158
166
|
}
|
|
159
|
-
) : /* @__PURE__ */ o.jsx(
|
|
167
|
+
) : /* @__PURE__ */ o.jsx(K, { variant: u, defaultValue: n ? n[n.findIndex((e) => e.chartConfigId === a.chartConfigId)].columnId.map((e) => a.allowedColumnIds[a.allowedColumnIds.findIndex((t) => t.value === e)]).map((e) => e.value) : [], onValueChange: (e) => {
|
|
160
168
|
const t = {
|
|
161
169
|
columnId: e || [],
|
|
162
170
|
chartConfigId: a.chartConfigId
|
|
163
|
-
},
|
|
164
|
-
g(
|
|
165
|
-
}, children: a.allowedColumnIds.map((e, t) => /* @__PURE__ */ o.jsx(
|
|
166
|
-
|
|
171
|
+
}, d = p?.map((s) => s.chartConfigId === t.chartConfigId ? t : s);
|
|
172
|
+
g(d);
|
|
173
|
+
}, children: a.allowedColumnIds.map((e, t) => /* @__PURE__ */ o.jsx(Q, { label: e.label, value: e.label }, t)) }) : a.ui !== "radio" ? /* @__PURE__ */ o.jsx(
|
|
174
|
+
V,
|
|
167
175
|
{
|
|
168
176
|
options: a.allowedColumnIds,
|
|
169
177
|
isClearable: !1,
|
|
170
178
|
isSearchable: !0,
|
|
171
|
-
variant:
|
|
172
|
-
defaultValue:
|
|
179
|
+
variant: u,
|
|
180
|
+
defaultValue: n ? a.allowedColumnIds[a.allowedColumnIds.findIndex((e) => e.value === n[n.findIndex((t) => t.chartConfigId === a.chartConfigId)].columnId)] : void 0,
|
|
173
181
|
controlShouldRenderValue: !0,
|
|
174
182
|
onChange: (e) => {
|
|
175
183
|
const t = {
|
|
176
184
|
columnId: e?.value,
|
|
177
185
|
chartConfigId: a.chartConfigId
|
|
178
|
-
},
|
|
179
|
-
|
|
186
|
+
}, d = p?.map((s) => s.chartConfigId === t.chartConfigId ? t : s);
|
|
187
|
+
j(e?.graphSettings || {}), g(d);
|
|
180
188
|
}
|
|
181
189
|
}
|
|
182
|
-
) : /* @__PURE__ */ o.jsx(
|
|
183
|
-
const t = a.allowedColumnIds[a.allowedColumnIds.findIndex((y) => y.label === e)],
|
|
190
|
+
) : /* @__PURE__ */ o.jsx(A, { variant: u, defaultValue: n ? a.allowedColumnIds[a.allowedColumnIds.findIndex((e) => e.value === n[n.findIndex((t) => t.chartConfigId === a.chartConfigId)].columnId)].label : "", onValueChange: (e) => {
|
|
191
|
+
const t = a.allowedColumnIds[a.allowedColumnIds.findIndex((y) => y.label === e)], d = {
|
|
184
192
|
columnId: t.value,
|
|
185
193
|
chartConfigId: a.chartConfigId
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
}, children: a.allowedColumnIds.map((e, t) => /* @__PURE__ */ o.jsx(
|
|
189
|
-
] },
|
|
190
|
-
|
|
191
|
-
width: a.width || `calc(${100 /
|
|
194
|
+
}, s = p?.map((y) => y.chartConfigId === d.chartConfigId ? d : y);
|
|
195
|
+
j(t.graphSettings || {}), g(s);
|
|
196
|
+
}, children: a.allowedColumnIds.map((e, t) => /* @__PURE__ */ o.jsx(F, { label: e.label, value: e.label }, t)) })
|
|
197
|
+
] }, r)),
|
|
198
|
+
w?.map((a, r) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
199
|
+
width: a.width || `calc(${100 / h}% - ${(h - 1) / h}rem)`,
|
|
192
200
|
flexGrow: 1,
|
|
193
201
|
flexShrink: 0,
|
|
194
202
|
flexWrap: "wrap"
|
|
195
203
|
}, className: "pb-4", children: [
|
|
196
|
-
/* @__PURE__ */ o.jsx(
|
|
197
|
-
a.singleSelect ? /* @__PURE__ */ o.jsx(
|
|
198
|
-
|
|
199
|
-
}, defaultValue: a.defaultValue }) : /* @__PURE__ */ o.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
204
|
+
/* @__PURE__ */ o.jsx($, { className: "mb-2", children: a.label }),
|
|
205
|
+
a.singleSelect ? a.ui !== "radio" ? /* @__PURE__ */ o.jsx(V, { options: a.availableValues, variant: u, isClearable: a.clearable === void 0 ? !0 : a.clearable, isSearchable: !0, controlShouldRenderValue: !0, filterOption: O(G), onChange: (e) => {
|
|
206
|
+
x(a.filter, e);
|
|
207
|
+
}, value: a.value, defaultValue: a.defaultValue }) : /* @__PURE__ */ o.jsx(A, { variant: u, defaultValue: a.defaultValue.value, onValueChange: (e) => {
|
|
208
|
+
x(a.filter, a.availableValues.filter((t) => t.value === e));
|
|
209
|
+
}, children: a.availableValues.map((e, t) => /* @__PURE__ */ o.jsx(F, { label: `${e.label}`, value: `${e.value}` }, t)) }) : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
210
|
+
a.ui !== "radio" ? /* @__PURE__ */ o.jsx(V, { options: a.availableValues, variant: u, size: "sm", isMulti: !0, isClearable: a.clearable === void 0 ? !0 : a.clearable, isSearchable: !0, controlShouldRenderValue: !0, filterOption: O(G), onChange: (e) => {
|
|
211
|
+
x(a.filter, e);
|
|
212
|
+
}, value: a.value, defaultValue: a.defaultValue }) : /* @__PURE__ */ o.jsx(K, { variant: u, defaultValue: a.defaultValue ? a.defaultValue.map((e) => `${e.value}`) : [], value: a.value ? a.value.map((e) => `${e.value}`) : void 0, onValueChange: (e) => {
|
|
213
|
+
x(a.filter, a.availableValues.filter((t) => e.indexOf(`${t.value}`) !== -1));
|
|
214
|
+
}, children: a.availableValues.map((e, t) => /* @__PURE__ */ o.jsx(Q, { label: `${e.label}`, value: `${e.value}` }, t)) }),
|
|
215
|
+
a.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: () => {
|
|
216
|
+
x(a.filter, a.availableValues);
|
|
205
217
|
}, children: "Select all options" }) : null
|
|
206
218
|
] })
|
|
207
|
-
] },
|
|
219
|
+
] }, r))
|
|
208
220
|
] }) : null,
|
|
209
|
-
|
|
210
|
-
/* @__PURE__ */ o.jsx("div", { className: `flex flex-wrap gap-4 justify-center ${l?.language === "ar" || l?.language === "he" ? "flex-row-reverse" : "flex-row"}`, children:
|
|
211
|
-
width: `calc(${100 / (
|
|
212
|
-
minWidth:
|
|
213
|
-
}, children: /* @__PURE__ */ o.jsx(
|
|
221
|
+
M !== !1 && l?.showColorScale !== !1 ? /* @__PURE__ */ o.jsx(Sa, { width: l?.width, colorLegendTitle: l?.colorLegendTitle, colors: l?.colors || l?.lineColors || ba[l?.theme || "light"].categoricalColors.colors, colorDomain: l?.colorDomain || l?.labels || [], showNAColor: l?.showNAColor === void 0 || l?.showNAColor === null ? !0 : l?.showNAColor }) : null,
|
|
222
|
+
/* @__PURE__ */ o.jsx("div", { className: `flex flex-wrap gap-4 justify-center ${l?.language === "ar" || l?.language === "he" ? "flex-row-reverse" : "flex-row"}`, children: b.map((a, r) => /* @__PURE__ */ o.jsx("div", { style: {
|
|
223
|
+
width: `calc(${100 / (N || Math.min(4, b.length || 0))}% - ${((N || Math.min(4, b.length || 0)) - 1) / (N || Math.min(4, b.length || 0))}rem)`,
|
|
224
|
+
minWidth: ja(H) ? "280px" : `${H}px`
|
|
225
|
+
}, children: /* @__PURE__ */ o.jsx(fa, { graph: k, graphDataConfiguration: p, graphData: wa(D ? xa(Y(m, L || []).filter(
|
|
214
226
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
215
|
-
(e) => e[
|
|
216
|
-
), D.keyColumn, D.aggregationColumnsSetting) :
|
|
227
|
+
(e) => e[S] === a
|
|
228
|
+
), D.keyColumn, D.aggregationColumnsSetting) : Y(m, L || []).filter(
|
|
217
229
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
218
|
-
(e) => e[
|
|
219
|
-
),
|
|
230
|
+
(e) => e[S] === a
|
|
231
|
+
), k, p) || [], debugMode: v, settings: {
|
|
220
232
|
...l || {},
|
|
221
233
|
...c,
|
|
222
|
-
theme: l?.theme ||
|
|
234
|
+
theme: l?.theme || la,
|
|
223
235
|
width: void 0,
|
|
224
236
|
height: void 0,
|
|
225
237
|
relativeHeight: l?.relativeHeight || 0.67,
|
|
226
|
-
minHeight:
|
|
238
|
+
minHeight: aa,
|
|
227
239
|
graphTitle: `${a}`,
|
|
228
240
|
graphDescription: void 0,
|
|
229
241
|
graphDownload: !1,
|
|
@@ -232,10 +244,10 @@ function Ea(Y) {
|
|
|
232
244
|
padding: "0",
|
|
233
245
|
footNote: void 0,
|
|
234
246
|
sources: void 0,
|
|
235
|
-
showColorScale: l?.showColorScale === !1 ? !1 :
|
|
236
|
-
}, readableHeader:
|
|
247
|
+
showColorScale: l?.showColorScale === !1 ? !1 : M === !1
|
|
248
|
+
}, readableHeader: ea || [] }) }, r)) })
|
|
237
249
|
] }) : /* @__PURE__ */ o.jsx("div", { className: "w-full flex justify-center p-4", children: /* @__PURE__ */ o.jsx(da, {}) }),
|
|
238
|
-
l?.sources || l?.footNote ? /* @__PURE__ */ o.jsx(
|
|
250
|
+
l?.sources || l?.footNote ? /* @__PURE__ */ o.jsx(Va, { styles: {
|
|
239
251
|
footnote: l?.styles?.footnote,
|
|
240
252
|
source: l?.styles?.source
|
|
241
253
|
}, classNames: {
|
|
@@ -245,6 +257,6 @@ function Ea(Y) {
|
|
|
245
257
|
] });
|
|
246
258
|
}
|
|
247
259
|
export {
|
|
248
|
-
|
|
260
|
+
qa as GriddedGraphs
|
|
249
261
|
};
|
|
250
262
|
//# sourceMappingURL=GriddedGraphs.js.map
|