@undp/data-viz 1.4.13 → 1.4.15
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/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.js +25 -24
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +638 -632
- package/dist/BarGraph.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +134 -132
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +35 -34
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +226 -224
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +48 -47
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +56 -55
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +2 -1
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.js +9 -8
- package/dist/DataTable.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +1 -0
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.js +77 -76
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +1 -0
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CeHog_ih.js → DropdownSelect-CtOKZHD0.js} +22 -20
- package/dist/{DropdownSelect-CeHog_ih.js.map → DropdownSelect-CtOKZHD0.js.map} +1 -1
- package/dist/{DropdownSelect-BmE5JaeE.cjs → DropdownSelect-DBDM64B5.cjs} +2 -2
- package/dist/{DropdownSelect-BmE5JaeE.cjs.map → DropdownSelect-DBDM64B5.cjs.map} +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +54 -53
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +216 -214
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +1 -0
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +29 -28
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +34 -33
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphEl-Bz2jatkM.cjs +2 -0
- package/dist/GraphEl-Bz2jatkM.cjs.map +1 -0
- package/dist/{GraphEl-B3xVlimz.js → GraphEl-zNOHBYrK.js} +4 -4
- package/dist/GraphEl-zNOHBYrK.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.js +55 -54
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +22 -21
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +34 -33
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +72 -71
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +24 -23
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +27 -26
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.js +30 -29
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +119 -118
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +16 -15
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +46 -45
- package/dist/SlopeChart.js.map +1 -1
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.cjs.map +1 -1
- package/dist/SparkLine.js +12 -11
- package/dist/SparkLine.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +81 -79
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +1 -0
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.js +114 -113
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +10 -9
- package/dist/UnitChart.js.map +1 -1
- package/dist/{index-CZLvTu6p.cjs → index-BbNoLJ_w.cjs} +2 -2
- package/dist/{index-CZLvTu6p.cjs.map → index-BbNoLJ_w.cjs.map} +1 -1
- package/dist/{index-DGAaLNu9.js → index-Bc5VF70V.js} +46 -45
- package/dist/{index-DGAaLNu9.js.map → index-Bc5VF70V.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/GraphEl-B3xVlimz.js.map +0 -1
- package/dist/GraphEl-DO-juRN8.cjs +0 -2
- package/dist/GraphEl-DO-juRN8.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e, m as V } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import _, { useState as L, useRef as O, useEffect as H, useMemo as T } from "react";
|
|
3
3
|
import { f as W } from "./index-UV9hjG_S.js";
|
|
4
|
-
import { Z as E, H as G } from "./DropdownSelect-
|
|
4
|
+
import { Z as E, H as G } from "./DropdownSelect-CtOKZHD0.js";
|
|
5
5
|
import D from "maplibre-gl";
|
|
6
6
|
import * as P from "pmtiles";
|
|
7
7
|
/* empty css */
|
|
@@ -15,9 +15,9 @@ import { GraphFooter as X } from "./GraphFooter.js";
|
|
|
15
15
|
function q(I) {
|
|
16
16
|
const {
|
|
17
17
|
mapStyle: x,
|
|
18
|
-
height:
|
|
18
|
+
height: m,
|
|
19
19
|
width: i,
|
|
20
|
-
relativeHeight:
|
|
20
|
+
relativeHeight: s,
|
|
21
21
|
center: j,
|
|
22
22
|
zoomLevel: b,
|
|
23
23
|
minHeight: d,
|
|
@@ -25,20 +25,20 @@ function q(I) {
|
|
|
25
25
|
layerIdList: f,
|
|
26
26
|
excludeLayers: a,
|
|
27
27
|
mapLegend: h
|
|
28
|
-
} = I, [u, C] = L(0), [g, N] = L(0), [k, l] = L(!0), [v, M] = L(void 0), y = O(null),
|
|
28
|
+
} = I, [u, C] = L(0), [g, N] = L(0), [k, l] = L(!0), [v, M] = L(void 0), y = O(null), n = O(null), t = O(null);
|
|
29
29
|
return H(() => {
|
|
30
|
-
const r = new ResizeObserver((
|
|
31
|
-
C(i ||
|
|
30
|
+
const r = new ResizeObserver((c) => {
|
|
31
|
+
C(i || c[0].target.clientWidth || 620), N(m || c[0].target.clientHeight || 480);
|
|
32
32
|
});
|
|
33
33
|
return y.current && (N(y.current.clientHeight || 480), C(y.current.clientWidth || 620), i || r.observe(y.current)), () => r.disconnect();
|
|
34
|
-
}, [i,
|
|
35
|
-
|
|
36
|
-
M(r), F(
|
|
34
|
+
}, [i, m]), H(() => {
|
|
35
|
+
n.current && u && !t.current && $(x).then((r) => {
|
|
36
|
+
M(r), F(n.current).selectAll("div").remove();
|
|
37
37
|
const w = new P.Protocol();
|
|
38
38
|
D.addProtocol("pmtiles", w.tile);
|
|
39
39
|
const S = {
|
|
40
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
-
container:
|
|
41
|
+
container: n.current,
|
|
42
42
|
style: {
|
|
43
43
|
...r,
|
|
44
44
|
layers: z(r.layers, [
|
|
@@ -72,7 +72,7 @@ function q(I) {
|
|
|
72
72
|
column: "id",
|
|
73
73
|
excludeValues: [
|
|
74
74
|
...a,
|
|
75
|
-
...f.filter((
|
|
75
|
+
...f.filter((c) => p.indexOf(c) === -1)
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
])
|
|
@@ -80,7 +80,7 @@ function q(I) {
|
|
|
80
80
|
t.current.setStyle(r);
|
|
81
81
|
} else
|
|
82
82
|
$(x).then((r) => {
|
|
83
|
-
const
|
|
83
|
+
const c = {
|
|
84
84
|
...r,
|
|
85
85
|
layers: z(r.layers, [
|
|
86
86
|
{
|
|
@@ -92,7 +92,7 @@ function q(I) {
|
|
|
92
92
|
}
|
|
93
93
|
])
|
|
94
94
|
};
|
|
95
|
-
t.current.setStyle(
|
|
95
|
+
t.current.setStyle(c);
|
|
96
96
|
});
|
|
97
97
|
}, [a, f, x, v, p]), /* @__PURE__ */ e.jsx(
|
|
98
98
|
"div",
|
|
@@ -100,18 +100,18 @@ function q(I) {
|
|
|
100
100
|
className: "flex flex-col grow justify-center leading-0",
|
|
101
101
|
ref: y,
|
|
102
102
|
"aria-label": "Map area",
|
|
103
|
-
children: (i || u) && (
|
|
103
|
+
children: (i || u) && (m || g) ? /* @__PURE__ */ e.jsxs(
|
|
104
104
|
"div",
|
|
105
105
|
{
|
|
106
106
|
style: {
|
|
107
107
|
width: i || u,
|
|
108
108
|
height: Math.max(
|
|
109
109
|
d,
|
|
110
|
-
|
|
110
|
+
m || (s ? d ? (i || u) * s > d ? (i || u) * s : d : (i || u) * s : g)
|
|
111
111
|
)
|
|
112
112
|
},
|
|
113
113
|
children: [
|
|
114
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
114
|
+
/* @__PURE__ */ e.jsx("div", { ref: n, className: "map maplibre-show-control w-full h-full" }),
|
|
115
115
|
h ? /* @__PURE__ */ e.jsx("div", { className: "absolute left-[22px] bottom-13", children: k ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
116
116
|
/* @__PURE__ */ e.jsx(
|
|
117
117
|
"div",
|
|
@@ -166,9 +166,9 @@ function q(I) {
|
|
|
166
166
|
function ne(I) {
|
|
167
167
|
const {
|
|
168
168
|
mapStyle: x,
|
|
169
|
-
graphTitle:
|
|
169
|
+
graphTitle: m,
|
|
170
170
|
height: i,
|
|
171
|
-
width:
|
|
171
|
+
width: s,
|
|
172
172
|
relativeHeight: j,
|
|
173
173
|
sources: b,
|
|
174
174
|
graphDescription: d,
|
|
@@ -185,10 +185,10 @@ function ne(I) {
|
|
|
185
185
|
excludeLayers: v = [],
|
|
186
186
|
ariaLabel: M,
|
|
187
187
|
uiMode: y = "normal",
|
|
188
|
-
styles:
|
|
188
|
+
styles: n,
|
|
189
189
|
classNames: t,
|
|
190
190
|
mapLegend: r = []
|
|
191
|
-
} = I, [
|
|
191
|
+
} = I, [c, w] = L(l[0].layerID);
|
|
192
192
|
H(() => {
|
|
193
193
|
w(l[0].layerID);
|
|
194
194
|
}, [l]);
|
|
@@ -203,41 +203,42 @@ function ne(I) {
|
|
|
203
203
|
return /* @__PURE__ */ e.jsx(
|
|
204
204
|
"div",
|
|
205
205
|
{
|
|
206
|
-
className: `${k || "light"} flex ${
|
|
206
|
+
className: `${k || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
|
|
207
207
|
dir: g === "he" || g === "ar" ? "rtl" : void 0,
|
|
208
208
|
children: /* @__PURE__ */ e.jsx(
|
|
209
209
|
"div",
|
|
210
210
|
{
|
|
211
211
|
className: V(
|
|
212
212
|
`${a ? a === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${g || "en"}`,
|
|
213
|
+
s ? "w-fit" : "w-full",
|
|
213
214
|
t?.graphContainer
|
|
214
215
|
),
|
|
215
216
|
style: {
|
|
216
|
-
...
|
|
217
|
+
...n?.graphContainer || {},
|
|
217
218
|
...a && a !== !0 ? { backgroundColor: a } : {}
|
|
218
219
|
},
|
|
219
220
|
id: C,
|
|
220
|
-
"aria-label": M || `${
|
|
221
|
+
"aria-label": M || `${m ? `The graph shows ${m}. ` : ""}This is a map.${d ? ` ${d}` : ""}`,
|
|
221
222
|
children: /* @__PURE__ */ e.jsx(
|
|
222
223
|
"div",
|
|
223
224
|
{
|
|
224
225
|
className: "flex grow",
|
|
225
226
|
style: { padding: a ? f || "1rem" : f || 0 },
|
|
226
227
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
227
|
-
|
|
228
|
+
m || d ? /* @__PURE__ */ e.jsx(
|
|
228
229
|
J,
|
|
229
230
|
{
|
|
230
231
|
styles: {
|
|
231
|
-
title:
|
|
232
|
-
description:
|
|
232
|
+
title: n?.title,
|
|
233
|
+
description: n?.description
|
|
233
234
|
},
|
|
234
235
|
classNames: {
|
|
235
236
|
title: t?.title,
|
|
236
237
|
description: t?.description
|
|
237
238
|
},
|
|
238
|
-
graphTitle:
|
|
239
|
+
graphTitle: m,
|
|
239
240
|
graphDescription: d,
|
|
240
|
-
width:
|
|
241
|
+
width: s
|
|
241
242
|
}
|
|
242
243
|
) : null,
|
|
243
244
|
/* @__PURE__ */ e.jsx(
|
|
@@ -269,29 +270,29 @@ function ne(I) {
|
|
|
269
270
|
mapStyle: x,
|
|
270
271
|
center: h,
|
|
271
272
|
zoomLevel: u,
|
|
272
|
-
width:
|
|
273
|
+
width: s,
|
|
273
274
|
height: i,
|
|
274
275
|
relativeHeight: j,
|
|
275
276
|
minHeight: N,
|
|
276
|
-
selectedLayer:
|
|
277
|
+
selectedLayer: c,
|
|
277
278
|
layerIdList: W(l.map((o) => o.layerID)),
|
|
278
279
|
excludeLayers: v,
|
|
279
280
|
mapLegend: r.find(
|
|
280
|
-
(o) => o.mapStyleName === l.find((R) => R.layerID ===
|
|
281
|
+
(o) => o.mapStyleName === l.find((R) => R.layerID === c)?.name
|
|
281
282
|
)?.legend
|
|
282
283
|
}
|
|
283
284
|
),
|
|
284
285
|
b || p ? /* @__PURE__ */ e.jsx(
|
|
285
286
|
X,
|
|
286
287
|
{
|
|
287
|
-
styles: { footnote:
|
|
288
|
+
styles: { footnote: n?.footnote, source: n?.source },
|
|
288
289
|
classNames: {
|
|
289
290
|
footnote: t?.footnote,
|
|
290
291
|
source: t?.source
|
|
291
292
|
},
|
|
292
293
|
sources: b,
|
|
293
294
|
footNote: p,
|
|
294
|
-
width:
|
|
295
|
+
width: s
|
|
295
296
|
}
|
|
296
297
|
) : null
|
|
297
298
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoHubMapWithLayerSelection.js","sources":["../src/Components/Graphs/Maps/GeoHubMaps/MapWithLayerSelection/MapEl.tsx","../src/Components/Graphs/Maps/GeoHubMaps/MapWithLayerSelection/index.tsx"],"sourcesContent":["import { useRef, useEffect, useState } from 'react';\r\nimport maplibreGl from 'maplibre-gl';\r\nimport * as pmtiles from 'pmtiles';\r\nimport 'maplibre-gl/dist/maplibre-gl.css';\r\nimport { select } from 'd3-selection';\r\nimport React from 'react';\r\n\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { filterData } from '@/Utils/transformData/filterData';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { X } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n mapStyle: string;\r\n center?: [number, number];\r\n zoomLevel?: number;\r\n width?: number;\r\n height?: number;\r\n relativeHeight?: number;\r\n minHeight: number;\r\n selectedLayer: string[];\r\n layerIdList: string[];\r\n excludeLayers: string[];\r\n mapLegend?: string | React.ReactNode;\r\n}\r\n\r\nexport function MapEl(props: Props) {\r\n const {\r\n mapStyle,\r\n height,\r\n width,\r\n relativeHeight,\r\n center,\r\n zoomLevel,\r\n minHeight,\r\n selectedLayer,\r\n layerIdList,\r\n excludeLayers,\r\n mapLegend,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [showLegend, setShowLegend] = useState(true);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapStyleData, setMapStyleData] = useState<any>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const mapContainer = useRef<HTMLDivElement>(null);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapRef = useRef<any>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (mapContainer.current && svgWidth && !mapRef.current) {\r\n fetchAndParseJSON(mapStyle).then(d => {\r\n setMapStyleData(d);\r\n const mapDiv = select(mapContainer.current);\r\n mapDiv.selectAll('div').remove();\r\n const protocol = new pmtiles.Protocol();\r\n maplibreGl.addProtocol('pmtiles', protocol.tile);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapObj: any = {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n container: mapContainer.current as any,\r\n style: {\r\n ...d,\r\n layers: filterData(d.layers, [\r\n {\r\n column: 'id',\r\n excludeValues: [\r\n ...excludeLayers,\r\n ...layerIdList.filter(el => selectedLayer.indexOf(el) === -1),\r\n ],\r\n },\r\n ]),\r\n },\r\n attributionControl: true,\r\n };\r\n if (center) {\r\n mapObj.center = center;\r\n }\r\n if (zoomLevel) {\r\n mapObj.zoom = zoomLevel;\r\n }\r\n mapRef.current = new maplibreGl.Map(mapObj);\r\n mapRef.current.addControl(\r\n new maplibreGl.NavigationControl({\r\n visualizePitch: true,\r\n showZoom: true,\r\n showCompass: true,\r\n }),\r\n 'bottom-right',\r\n );\r\n mapRef.current.addControl(new maplibreGl.ScaleControl(), 'bottom-left');\r\n });\r\n }\r\n }, [svgWidth, center, zoomLevel, layerIdList, mapStyle, excludeLayers, selectedLayer]);\r\n useEffect(() => {\r\n if (mapRef.current) {\r\n if (mapStyleData) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapStyleObj: any = {\r\n ...mapStyleData,\r\n layers: filterData(mapStyleData.layers, [\r\n {\r\n column: 'id',\r\n excludeValues: [\r\n ...excludeLayers,\r\n ...layerIdList.filter(el => selectedLayer.indexOf(el) === -1),\r\n ],\r\n },\r\n ]),\r\n };\r\n mapRef.current.setStyle(mapStyleObj);\r\n } else\r\n fetchAndParseJSON(mapStyle).then(d => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapStyleObj: any = {\r\n ...d,\r\n layers: filterData(d.layers, [\r\n {\r\n column: 'id',\r\n excludeValues: [\r\n ...excludeLayers,\r\n ...layerIdList.filter(el => selectedLayer.indexOf(el) === -1),\r\n ],\r\n },\r\n ]),\r\n };\r\n mapRef.current.setStyle(mapStyleObj);\r\n });\r\n }\r\n }, [excludeLayers, layerIdList, mapStyle, mapStyleData, selectedLayer]);\r\n return (\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <div\r\n style={{\r\n width: width || svgWidth,\r\n height: Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n ),\r\n }}\r\n >\r\n <div ref={mapContainer} className='map maplibre-show-control w-full h-full' />\r\n\r\n {mapLegend ? (\r\n <div className='absolute left-[22px] bottom-13'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='p-2'\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n }}\r\n dangerouslySetInnerHTML={\r\n typeof mapLegend === 'string' ? { __html: string2HTML(mapLegend) } : undefined\r\n }\r\n >\r\n {React.isValidElement(mapLegend) ? mapLegend : null}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n ) : null}\r\n </div>\r\n ) : null}\r\n </div>\r\n );\r\n}\r\n","import { useEffect, useMemo, useState } from 'react';\r\nimport flattenDeep from 'lodash.flattendeep';\r\nimport { createFilter, DropdownSelect } from '@undp/design-system-react/DropdownSelect';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { MapEl } from './MapEl';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport {\r\n ClassNameObject,\r\n Languages,\r\n MapLegendDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** URL for mapStyle JSON */\r\n mapStyle: string;\r\n /** Starting center point of the map */\r\n center?: [number, number];\r\n /** Starting zoom level of the map */\r\n zoomLevel?: number;\r\n /** List of the layers that the user select and switch between sing a drop down */\r\n layerSelection: { layerID: string[]; name: string }[];\r\n /** Defines the legend for the map. mapLegend is of type { mapStyleName: string; legend: string | React.ReactNode }[] where mapStyleName corresponds to the each name in the layerSelection. */\r\n mapLegend?: MapLegendDataType[];\r\n /** List of layer IDs to be excluded from the visualization */\r\n excludeLayers?: string[];\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Theme for the UI elements */\r\n uiMode?: 'light' | 'normal';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\n/** For using these maps you will have to install [`maplibre`](https://maplibre.org/maplibre-gl-js/docs/#npm) and [pmtiles](https://www.npmjs.com/package/pmtiles) package to your project */\r\nexport function GeoHubMapWithLayerSelection(props: Props) {\r\n const {\r\n mapStyle,\r\n graphTitle,\r\n height,\r\n width,\r\n relativeHeight,\r\n sources,\r\n graphDescription,\r\n footNote,\r\n padding,\r\n backgroundColor = false,\r\n center,\r\n zoomLevel,\r\n graphID,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n layerSelection,\r\n excludeLayers = [],\r\n ariaLabel,\r\n uiMode = 'normal',\r\n styles,\r\n classNames,\r\n mapLegend = [],\r\n } = props;\r\n\r\n const [selectedLayer, setSelectedLayer] = useState(layerSelection[0].layerID);\r\n\r\n useEffect(() => {\r\n setSelectedLayer(layerSelection[0].layerID);\r\n }, [layerSelection]);\r\n\r\n const filterConfig = useMemo(\r\n () => ({\r\n ignoreCase: true,\r\n ignoreAccents: true,\r\n trim: true,\r\n }),\r\n [],\r\n );\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a map.${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n />\r\n ) : null}\r\n <DropdownSelect\r\n options={layerSelection.map(d => ({\r\n label: d.name,\r\n value: d.layerID,\r\n }))}\r\n size='sm'\r\n isClearable={false}\r\n variant={uiMode}\r\n isRtl={language === 'he' || language === 'ar'}\r\n isSearchable\r\n filterOption={createFilter(filterConfig)}\r\n defaultValue={{\r\n label: layerSelection[0].name,\r\n value: layerSelection[0].layerID,\r\n }}\r\n controlShouldRenderValue\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onChange={(el: any) => {\r\n if (el) setSelectedLayer(el.value);\r\n }}\r\n />\r\n <MapEl\r\n mapStyle={mapStyle}\r\n center={center}\r\n zoomLevel={zoomLevel}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n minHeight={minHeight}\r\n selectedLayer={selectedLayer}\r\n layerIdList={flattenDeep(layerSelection.map(d => d.layerID))}\r\n excludeLayers={excludeLayers}\r\n mapLegend={\r\n (mapLegend as MapLegendDataType[]).find(\r\n d =>\r\n d.mapStyleName ===\r\n layerSelection.find(el => el.layerID === selectedLayer)?.name,\r\n )?.legend\r\n }\r\n />\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["MapEl","props","mapStyle","height","width","relativeHeight","center","zoomLevel","minHeight","selectedLayer","layerIdList","excludeLayers","mapLegend","svgWidth","setSvgWidth","useState","svgHeight","setSvgHeight","showLegend","setShowLegend","mapStyleData","setMapStyleData","graphDiv","useRef","mapContainer","mapRef","useEffect","resizeObserver","entries","fetchAndParseJSON","d","select","protocol","pmtiles","maplibreGl","mapObj","filterData","el","mapStyleObj","jsx","jsxs","Fragment","X","string2HTML","React","GeoHubMapWithLayerSelection","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","graphID","language","theme","layerSelection","ariaLabel","uiMode","styles","classNames","setSelectedLayer","filterConfig","useMemo","cn","GraphHeader","DropdownSelect","createFilter","flattenDeep","GraphFooter"],"mappings":";;;;;;;;;;;;;;AA0BO,SAASA,EAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,IACEX,GAEE,CAACY,GAAUC,CAAW,IAAIC,EAAS,CAAC,GACpC,CAACC,GAAWC,CAAY,IAAIF,EAAS,CAAC,GACtC,CAACG,GAAYC,CAAa,IAAIJ,EAAS,EAAI,GAE3C,CAACK,GAAcC,CAAe,IAAIN,EAAc,MAAS,GACzDO,IAAWC,EAAuB,IAAI,GACtCC,IAAeD,EAAuB,IAAI,GAE1CE,IAASF,EAAY,IAAI;AAC/B,SAAAG,EAAU,MAAM;AACd,UAAMC,IAAiB,IAAI,eAAe,CAAAC,MAAW;AACnD,MAAAd,EAAYV,KAASwB,EAAQ,CAAC,EAAE,OAAO,eAAe,GAAG,GACzDX,EAAad,KAAUyB,EAAQ,CAAC,EAAE,OAAO,gBAAgB,GAAG;AAAA,IAC9D,CAAC;AAC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"file":"GeoHubMapWithLayerSelection.js","sources":["../src/Components/Graphs/Maps/GeoHubMaps/MapWithLayerSelection/MapEl.tsx","../src/Components/Graphs/Maps/GeoHubMaps/MapWithLayerSelection/index.tsx"],"sourcesContent":["import { useRef, useEffect, useState } from 'react';\r\nimport maplibreGl from 'maplibre-gl';\r\nimport * as pmtiles from 'pmtiles';\r\nimport 'maplibre-gl/dist/maplibre-gl.css';\r\nimport { select } from 'd3-selection';\r\nimport React from 'react';\r\n\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { filterData } from '@/Utils/transformData/filterData';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { X } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n mapStyle: string;\r\n center?: [number, number];\r\n zoomLevel?: number;\r\n width?: number;\r\n height?: number;\r\n relativeHeight?: number;\r\n minHeight: number;\r\n selectedLayer: string[];\r\n layerIdList: string[];\r\n excludeLayers: string[];\r\n mapLegend?: string | React.ReactNode;\r\n}\r\n\r\nexport function MapEl(props: Props) {\r\n const {\r\n mapStyle,\r\n height,\r\n width,\r\n relativeHeight,\r\n center,\r\n zoomLevel,\r\n minHeight,\r\n selectedLayer,\r\n layerIdList,\r\n excludeLayers,\r\n mapLegend,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [showLegend, setShowLegend] = useState(true);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapStyleData, setMapStyleData] = useState<any>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const mapContainer = useRef<HTMLDivElement>(null);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapRef = useRef<any>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (mapContainer.current && svgWidth && !mapRef.current) {\r\n fetchAndParseJSON(mapStyle).then(d => {\r\n setMapStyleData(d);\r\n const mapDiv = select(mapContainer.current);\r\n mapDiv.selectAll('div').remove();\r\n const protocol = new pmtiles.Protocol();\r\n maplibreGl.addProtocol('pmtiles', protocol.tile);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapObj: any = {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n container: mapContainer.current as any,\r\n style: {\r\n ...d,\r\n layers: filterData(d.layers, [\r\n {\r\n column: 'id',\r\n excludeValues: [\r\n ...excludeLayers,\r\n ...layerIdList.filter(el => selectedLayer.indexOf(el) === -1),\r\n ],\r\n },\r\n ]),\r\n },\r\n attributionControl: true,\r\n };\r\n if (center) {\r\n mapObj.center = center;\r\n }\r\n if (zoomLevel) {\r\n mapObj.zoom = zoomLevel;\r\n }\r\n mapRef.current = new maplibreGl.Map(mapObj);\r\n mapRef.current.addControl(\r\n new maplibreGl.NavigationControl({\r\n visualizePitch: true,\r\n showZoom: true,\r\n showCompass: true,\r\n }),\r\n 'bottom-right',\r\n );\r\n mapRef.current.addControl(new maplibreGl.ScaleControl(), 'bottom-left');\r\n });\r\n }\r\n }, [svgWidth, center, zoomLevel, layerIdList, mapStyle, excludeLayers, selectedLayer]);\r\n useEffect(() => {\r\n if (mapRef.current) {\r\n if (mapStyleData) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapStyleObj: any = {\r\n ...mapStyleData,\r\n layers: filterData(mapStyleData.layers, [\r\n {\r\n column: 'id',\r\n excludeValues: [\r\n ...excludeLayers,\r\n ...layerIdList.filter(el => selectedLayer.indexOf(el) === -1),\r\n ],\r\n },\r\n ]),\r\n };\r\n mapRef.current.setStyle(mapStyleObj);\r\n } else\r\n fetchAndParseJSON(mapStyle).then(d => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mapStyleObj: any = {\r\n ...d,\r\n layers: filterData(d.layers, [\r\n {\r\n column: 'id',\r\n excludeValues: [\r\n ...excludeLayers,\r\n ...layerIdList.filter(el => selectedLayer.indexOf(el) === -1),\r\n ],\r\n },\r\n ]),\r\n };\r\n mapRef.current.setStyle(mapStyleObj);\r\n });\r\n }\r\n }, [excludeLayers, layerIdList, mapStyle, mapStyleData, selectedLayer]);\r\n return (\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <div\r\n style={{\r\n width: width || svgWidth,\r\n height: Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n ),\r\n }}\r\n >\r\n <div ref={mapContainer} className='map maplibre-show-control w-full h-full' />\r\n\r\n {mapLegend ? (\r\n <div className='absolute left-[22px] bottom-13'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='p-2'\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n }}\r\n dangerouslySetInnerHTML={\r\n typeof mapLegend === 'string' ? { __html: string2HTML(mapLegend) } : undefined\r\n }\r\n >\r\n {React.isValidElement(mapLegend) ? mapLegend : null}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n ) : null}\r\n </div>\r\n ) : null}\r\n </div>\r\n );\r\n}\r\n","import { useEffect, useMemo, useState } from 'react';\r\nimport flattenDeep from 'lodash.flattendeep';\r\nimport { createFilter, DropdownSelect } from '@undp/design-system-react/DropdownSelect';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { MapEl } from './MapEl';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport {\r\n ClassNameObject,\r\n Languages,\r\n MapLegendDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** URL for mapStyle JSON */\r\n mapStyle: string;\r\n /** Starting center point of the map */\r\n center?: [number, number];\r\n /** Starting zoom level of the map */\r\n zoomLevel?: number;\r\n /** List of the layers that the user select and switch between sing a drop down */\r\n layerSelection: { layerID: string[]; name: string }[];\r\n /** Defines the legend for the map. mapLegend is of type { mapStyleName: string; legend: string | React.ReactNode }[] where mapStyleName corresponds to the each name in the layerSelection. */\r\n mapLegend?: MapLegendDataType[];\r\n /** List of layer IDs to be excluded from the visualization */\r\n excludeLayers?: string[];\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Theme for the UI elements */\r\n uiMode?: 'light' | 'normal';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\n/** For using these maps you will have to install [`maplibre`](https://maplibre.org/maplibre-gl-js/docs/#npm) and [pmtiles](https://www.npmjs.com/package/pmtiles) package to your project */\r\nexport function GeoHubMapWithLayerSelection(props: Props) {\r\n const {\r\n mapStyle,\r\n graphTitle,\r\n height,\r\n width,\r\n relativeHeight,\r\n sources,\r\n graphDescription,\r\n footNote,\r\n padding,\r\n backgroundColor = false,\r\n center,\r\n zoomLevel,\r\n graphID,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n layerSelection,\r\n excludeLayers = [],\r\n ariaLabel,\r\n uiMode = 'normal',\r\n styles,\r\n classNames,\r\n mapLegend = [],\r\n } = props;\r\n\r\n const [selectedLayer, setSelectedLayer] = useState(layerSelection[0].layerID);\r\n\r\n useEffect(() => {\r\n setSelectedLayer(layerSelection[0].layerID);\r\n }, [layerSelection]);\r\n\r\n const filterConfig = useMemo(\r\n () => ({\r\n ignoreCase: true,\r\n ignoreAccents: true,\r\n trim: true,\r\n }),\r\n [],\r\n );\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a map.${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n />\r\n ) : null}\r\n <DropdownSelect\r\n options={layerSelection.map(d => ({\r\n label: d.name,\r\n value: d.layerID,\r\n }))}\r\n size='sm'\r\n isClearable={false}\r\n variant={uiMode}\r\n isRtl={language === 'he' || language === 'ar'}\r\n isSearchable\r\n filterOption={createFilter(filterConfig)}\r\n defaultValue={{\r\n label: layerSelection[0].name,\r\n value: layerSelection[0].layerID,\r\n }}\r\n controlShouldRenderValue\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onChange={(el: any) => {\r\n if (el) setSelectedLayer(el.value);\r\n }}\r\n />\r\n <MapEl\r\n mapStyle={mapStyle}\r\n center={center}\r\n zoomLevel={zoomLevel}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n minHeight={minHeight}\r\n selectedLayer={selectedLayer}\r\n layerIdList={flattenDeep(layerSelection.map(d => d.layerID))}\r\n excludeLayers={excludeLayers}\r\n mapLegend={\r\n (mapLegend as MapLegendDataType[]).find(\r\n d =>\r\n d.mapStyleName ===\r\n layerSelection.find(el => el.layerID === selectedLayer)?.name,\r\n )?.legend\r\n }\r\n />\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["MapEl","props","mapStyle","height","width","relativeHeight","center","zoomLevel","minHeight","selectedLayer","layerIdList","excludeLayers","mapLegend","svgWidth","setSvgWidth","useState","svgHeight","setSvgHeight","showLegend","setShowLegend","mapStyleData","setMapStyleData","graphDiv","useRef","mapContainer","mapRef","useEffect","resizeObserver","entries","fetchAndParseJSON","d","select","protocol","pmtiles","maplibreGl","mapObj","filterData","el","mapStyleObj","jsx","jsxs","Fragment","X","string2HTML","React","GeoHubMapWithLayerSelection","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","graphID","language","theme","layerSelection","ariaLabel","uiMode","styles","classNames","setSelectedLayer","filterConfig","useMemo","cn","GraphHeader","DropdownSelect","createFilter","flattenDeep","GraphFooter"],"mappings":";;;;;;;;;;;;;;AA0BO,SAASA,EAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,WAAAC;A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AlB,MAAMA,EAAG,YAAY5B,CAAa,GAAG;AAAA,oBAAA,GAC1D;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGNsC,KAAWE,IACVV,gBAAAA,EAAAA;AAAAA,kBAAC6B;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUV,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAAZ;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA7C;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),c=require("./Typography-k-kOjICQ.cjs"),C=require("./ButterflyChart.cjs"),b=require("./index-BbNoLJ_w.cjs"),w=require("./DataTable.cjs"),T=require("./DonutChart.cjs"),k=require("./HeatMap.cjs"),x=require("./Histogram.cjs"),y=require("./DualAxisLineChart.cjs"),L=require("./SimpleLineChart.cjs"),M=require("./MultiLineChart.cjs"),O=require("./MultiLineAltChart.cjs"),S=require("./SparkLine.cjs"),V=require("./BiVariateChoroplethMap.cjs"),N=require("./ChoroplethMap.cjs"),H=require("./DotDensityMap.cjs"),A=require("./ParetoChart.cjs"),v=require("./ScatterPlot.cjs"),B=require("./SlopeChart.cjs"),I=require("./AreaChart.cjs"),P=require("./StatCardFromData.cjs"),W=require("./TreeMapGraph.cjs"),j=require("./UnitChart.cjs"),q=require("./DifferenceLineChart.cjs"),z=require("./SankeyChart.cjs"),F=require("./LineChartWithConfidenceInterval.cjs"),X=require("./DataCards.cjs"),g=require("./BarGraph.cjs"),Y=require("./DumbbellChart.cjs"),E=require("./StripChart.cjs"),G=require("./BeeSwarmChart.cjs"),R=require("./RadarChart.cjs"),$=require("./BulletChart.cjs"),i=require("./checkIfMultiple-BXbHUCWM.cjs");function U(d){const{settings:e,graph:l,graphData:a,debugMode:p,graphDataConfiguration:t,readableHeader:o,updateFilters:s}=d;if(p&&(console.log(`Graph: ${l}`),console.log("Transformed data:",a),console.log("Settings:",e)),typeof a=="string")return n.jsxRuntimeExports.jsx("div",{className:`flex my-0 mx-auto grow flex-col justify-center ${e?.width?"w-fit":"w-full"}`,style:{height:"inherit"},children:n.jsxRuntimeExports.jsx(c.u,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:a})});const u={barChart:g.SimpleBarGraph,bulletChart:$.BulletChart,groupedBarChart:g.GroupedBarGraph,stackedBarChart:g.StackedBarGraph,lineChart:L.SimpleLineChart,dualAxisLineChart:y.DualAxisLineChart,multiLineChart:M.MultiLineChart,multiLineAltChart:O.MultiLineAltChart,stackedAreaChart:I.AreaChart,choroplethMap:N.ChoroplethMap,biVariateChoroplethMap:V.BiVariateChoroplethMap,dotDensityMap:H.DotDensityMap,donutChart:T.DonutChart,slopeChart:B.SlopeChart,scatterPlot:v.ScatterPlot,dumbbellChart:Y.DumbbellChart,treeMap:W.TreeMapGraph,circlePacking:b.CirclePackingGraph,heatMap:k.HeatMap,stripChart:E.StripChart,beeSwarmChart:G.BeeSwarmChart,butterflyChart:C.ButterflyChart,histogram:x.Histogram,sparkLine:S.SparkLine,paretoChart:A.ParetoChart,dataTable:w.DataTable,statCard:P.StatCardFromData,unitChart:j.UnitChart,differenceLineChart:q.DifferenceLineChart,sankeyChart:z.SankeyChart,lineChartWithConfidenceInterval:F.LineChartWithConfidenceInterval,dataCards:X.DataCards,radarChart:R.RadarChart},m=f=>{switch(f){case"barChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,orientation:e?.orientation,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,height:e?.height,width:e?.width,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,barPadding:e?.barPadding,showValues:e?.showValues,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,showColorScale:e?.showColorScale,maxValue:e?.maxValue,minValue:e?.minValue,labelOrder:e?.labelOrder,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,sortData:e?.sortData,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,ariaLabel:e?.ariaLabel,onSeriesMouseClick:r=>{s?.(r.label)},resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,filterNA:e?.filterNA,animate:e?.animate,naLabel:e?.naLabel};case"groupedBarChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,orientation:e?.orientation,sortParameter:e?.sortParameter,sortData:e?.sortData,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,showColorScale:e?.showColorScale,sources:e?.sources,barPadding:e?.barPadding,showTicks:e?.showTicks,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain||i.getValues("size",t||[],o||[]),colorLegendTitle:e?.colorLegendTitle,suffix:e?.suffix,prefix:e?.prefix,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,showLabels:e?.showLabels,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,labelOrder:e?.labelOrder,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,maxBarThickness:e?.maxBarThickness,ariaLabel:e?.ariaLabel,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,animate:e?.animate,naLabel:e?.naLabel};case"stackedBarChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,orientation:e?.orientation,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,showColorScale:e?.showColorScale,width:e?.width,height:e?.height,sources:e?.sources,barPadding:e?.barPadding,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain||i.getValues("size",t||[],o||[]),colorLegendTitle:e?.colorLegendTitle,backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,suffix:e?.suffix,prefix:e?.prefix,labelOrder:e?.labelOrder,showValues:e?.showValues,showLabels:e?.showLabels,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,maxValue:e?.maxValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,sortParameter:e?.sortParameter,sortData:e?.sortData,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,animate:e?.animate,naLabel:e?.naLabel};case"bulletChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,orientation:e?.orientation,data:a,barColor:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,height:e?.height,width:e?.width,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,barPadding:e?.barPadding,showValues:e?.showValues,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,showColorScale:e?.showColorScale,maxValue:e?.maxValue,minValue:e?.minValue,labelOrder:e?.labelOrder,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,sortData:e?.sortData,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,ariaLabel:e?.ariaLabel,onSeriesMouseClick:r=>{s?.(r.label)},resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,detailsOnClick:e?.detailsOnClick,barAxisTitle:e?.barAxisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,filterNA:e?.filterNA,qualitativeRangeColors:e?.qualitativeRangeColors,targetStyle:e?.targetStyle,targetColor:e?.targetColor,measureBarWidthFactor:e?.measureBarWidthFactor,animate:e?.animate,naLabel:e?.naLabel};case"lineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,curveType:e?.curveType,data:a,graphID:e?.graphID,lineColor:e?.lineColor,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,regressionLine:e?.regressionLine,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames};case"lineChartWithConfidenceInterval":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:a,curveType:e?.curveType,graphID:e?.graphID,lineColor:e?.lineColor,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,regressionLine:e?.regressionLine,ariaLabel:e?.ariaLabel,showIntervalDots:e?.showIntervalDots,showIntervalValues:e?.showIntervalValues,intervalLineStrokeWidth:e?.intervalLineStrokeWidth,intervalLineColors:e?.intervalLineColors,intervalAreaColor:e?.intervalAreaColor,intervalAreaOpacity:e?.intervalAreaOpacity,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,colorLegendTitle:e?.colorLegendTitle,colorLegendColors:e?.colorLegendColors,colorLegendDomain:e?.colorLegendDomain,styles:e?.styles,classNames:e?.classNames};case"dualAxisLineChart":return{showAxisLabels:e?.showAxisLabels,showColorScale:e?.showColorScale,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:a,curveType:e?.curveType,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,labels:e?.labels||[i.getValues("y1",t||[],o||[]),i.getValues("y2",t||[],o||[])],footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,showValues:e?.showValues,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,lineColors:e?.lineColors,sameAxes:e?.sameAxes,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,ariaLabel:e?.ariaLabel,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,lineSuffixes:e?.lineSuffixes,linePrefixes:e?.linePrefixes,styles:e?.styles,classNames:e?.classNames};case"multiLineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,data:a,curveType:e?.curveType,lineColors:e?.lineColors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,suffix:e?.suffix,prefix:e?.prefix,showColorScale:e?.showColorScale,labels:e?.labels||i.getValues("y",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,showValues:e?.showValues,relativeHeight:e?.relativeHeight,showColorLegendAtTop:e?.showColorLegendAtTop,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,highlightedLines:e?.highlightedLines,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames,dashedLines:e?.dashedLines,dashSettings:e?.dashSettings,labelsToBeHidden:e?.labelsToBeHidden};case"multiLineAltChart":return{naLabel:e?.naLabel,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:a,dimmedOpacity:e?.dimmedOpacity,curveType:e?.curveType,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,suffix:e?.suffix,prefix:e?.prefix,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refValues:e?.refValues,showLabels:e?.showLabels,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,highlightedLines:e?.highlightedLines,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames,colorDomain:e?.colorDomain,showNAColor:e?.showNAColor};case"differenceLineChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:a,curveType:e?.curveType,lineColors:e?.lineColors,diffAreaColors:e?.diffAreaColors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,suffix:e?.suffix,prefix:e?.prefix,labels:e?.labels||[i.getValues("y1",t||[],o||[]),i.getValues("y2",t||[],o||[])],backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,showValues:e?.showValues,relativeHeight:e?.relativeHeight,showColorLegendAtTop:e?.showColorLegendAtTop,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,animate:e?.animate,strokeWidth:e?.strokeWidth,showDots:e?.showDots,colorLegendTitle:e?.colorLegendTitle,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,minDate:e?.minDate,maxDate:e?.maxDate,styles:e?.styles,classNames:e?.classNames};case"stackedAreaChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,data:a,curveType:e?.curveType,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,noOfXTicks:e?.noOfXTicks,dateFormat:e?.dateFormat,colorDomain:e?.colorDomain||i.getValues("y",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,colorLegendTitle:e?.colorLegendTitle,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,relativeHeight:e?.relativeHeight,bottomMargin:e?.bottomMargin,tooltip:e?.tooltip,refValues:e?.refValues,highlightAreaSettings:e?.highlightAreaSettings,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,showColorScale:e?.showColorScale,language:e?.language,minHeight:e?.minHeight,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,ariaLabel:e?.ariaLabel,yAxisTitle:e?.yAxisTitle,noOfYTicks:e?.noOfYTicks,suffix:e?.suffix,prefix:e?.prefix,styles:e?.styles,classNames:e?.classNames};case"choroplethMap":return{timeline:e?.timeline,customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,mapData:e?.mapData,mapProjection:e?.mapProjection,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,colorDomain:e?.colorDomain,colors:e?.colors,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("x",t||[],o||[]),scaleType:e?.scaleType,categorical:e?.categorical,data:a,scale:e?.scale,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapBorderWidth:e?.mapBorderWidth,mapNoDataColor:e?.mapNoDataColor,mapBorderColor:e?.mapBorderColor,relativeHeight:e?.relativeHeight,padding:e?.padding,isWorldMap:e?.isWorldMap,tooltip:e?.tooltip,showColorScale:e?.showColorScale,zoomScaleExtend:e?.zoomScaleExtend,zoomTranslateExtend:e?.zoomTranslateExtend,graphID:e?.graphID,highlightedIds:e?.highlightedIds,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,mapProperty:e?.mapProperty,showAntarctica:e?.showAntarctica,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,onSeriesMouseClick:r=>{s?.(r.id)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,zoomInteraction:e?.zoomInteraction,animate:e?.animate};case"biVariateChoroplethMap":return{timeline:e?.timeline,customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,mapData:e?.mapData,mapProjection:e?.mapProjection,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,xColorLegendTitle:Object.keys(e||{}).indexOf("xColorLegendTitle")!==-1?e?.xColorLegendTitle:i.getValues("x",t||[],o||[]),yColorLegendTitle:Object.keys(e||{}).indexOf("yColorLegendTitle")!==-1?e?.yColorLegendTitle:i.getValues("y",t||[],o||[]),xDomain:e?.xDomain,yDomain:e?.yDomain,colors:e?.colors,scale:e?.scale,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapBorderWidth:e?.mapBorderWidth,mapNoDataColor:e?.mapNoDataColor,padding:e?.padding,mapBorderColor:e?.mapBorderColor,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,isWorldMap:e?.isWorldMap,zoomScaleExtend:e?.zoomScaleExtend,zoomTranslateExtend:e?.zoomTranslateExtend,graphID:e?.graphID,highlightedIds:e?.highlightedIds,mapProperty:e?.mapProperty,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,showAntarctica:e?.showAntarctica,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,onSeriesMouseClick:r=>{s?.(r.id)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,zoomInteraction:e?.zoomInteraction,animate:e?.animate};case"dotDensityMap":return{timeline:e?.timeline,customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,mapData:e?.mapData,mapProjection:e?.mapProjection,graphDescription:e?.graphDescription,footNote:e?.footNote,maxRadiusValue:e?.maxRadiusValue,width:e?.width,height:e?.height,radius:e?.radius,sources:e?.sources,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),data:a,scale:e?.scale,centerPoint:e?.centerPoint,backgroundColor:e?.backgroundColor,mapBorderWidth:e?.mapBorderWidth,mapNoDataColor:e?.mapNoDataColor,mapBorderColor:e?.mapBorderColor,padding:e?.padding,showLabels:e?.showLabels,relativeHeight:e?.relativeHeight,isWorldMap:e?.isWorldMap,tooltip:e?.tooltip,showColorScale:e?.showColorScale,zoomScaleExtend:e?.zoomScaleExtend,zoomTranslateExtend:e?.zoomTranslateExtend,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,showAntarctica:e?.showAntarctica,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,zoomInteraction:e?.zoomInteraction,animate:e?.animate};case"donutChart":return{precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,mainText:e?.mainText,data:a,colors:e?.colors,graphTitle:e?.graphTitle,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,graphDescription:e?.graphDescription,subNote:e?.subNote,footNote:e?.footNote,radius:e?.radius,strokeWidth:e?.strokeWidth,showColorScale:e?.showColorScale,backgroundColor:e?.backgroundColor,padding:e?.padding,tooltip:e?.tooltip,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,colorDomain:e?.colorDomain,sortData:e?.sortData,language:e?.language,width:e?.width,height:e?.height,minHeight:e?.minHeight,relativeHeight:e?.relativeHeight,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,ariaLabel:e?.ariaLabel,legendMaxWidth:e?.legendMaxWidth,onSeriesMouseClick:r=>{s?.(r.label)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,colorScaleMaxWidth:e?.colorScaleMaxWidth};case"slopeChart":return{customLayers:e?.customLayers,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showLabels:e?.showLabels,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),radius:e?.radius,axisTitles:e?.axisTitles,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,highlightedDataPoints:e?.highlightedDataPoints,showColorScale:e?.showColorScale,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,fillContainer:e?.fillContainer,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"scatterPlot":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showLabels:e?.showLabels,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),radius:e?.radius,xAxisTitle:Object.keys(e||{}).indexOf("xAxisTitle")!==-1?e?.xAxisTitle:i.getValues("x",t||[],o||[]),yAxisTitle:Object.keys(e||{}).indexOf("yAxisTitle")!==-1?e?.yAxisTitle:i.getValues("y",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,refXValues:e?.refXValues,refYValues:e?.refYValues,highlightedDataPoints:e?.highlightedDataPoints,highlightAreaSettings:e?.highlightAreaSettings,showColorScale:e?.showColorScale,graphID:e?.graphID,maxRadiusValue:e?.maxRadiusValue,maxXValue:e?.maxXValue,minXValue:e?.minXValue,maxYValue:e?.maxYValue,minYValue:e?.minYValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,customHighlightAreaSettings:e?.customHighlightAreaSettings,annotations:e?.annotations,regressionLine:e?.regressionLine,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,noOfXTicks:e?.noOfXTicks,noOfYTicks:e?.noOfYTicks,labelColor:e?.labelColor,xSuffix:e?.xSuffix,ySuffix:e?.ySuffix,xPrefix:e?.xPrefix,yPrefix:e?.yPrefix,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"dumbbellChart":return{timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,orientation:e?.orientation,refValues:e?.refValues,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,barPadding:e?.barPadding,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,truncateBy:e?.truncateBy,labelOrder:e?.labelOrder,showColorScale:e?.showColorScale,colorDomain:e?.colorDomain||i.getValues("x",t||[],o||[]),colorLegendTitle:e?.colorLegendTitle,backgroundColor:e?.backgroundColor,padding:e?.padding,radius:e?.radius,relativeHeight:e?.relativeHeight,showValues:e?.showValues,showLabels:e?.showLabels,tooltip:e?.tooltip,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,suffix:e?.suffix,prefix:e?.prefix,language:e?.language,minHeight:e?.minHeight,sortParameter:e?.sortParameter,sortData:e?.sortData,arrowConnector:e?.arrowConnector,connectorStrokeWidth:e?.connectorStrokeWidth,maxBarThickness:e?.maxBarThickness,minBarThickness:e?.minBarThickness,maxNumberOfBars:e?.maxNumberOfBars,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,axisTitle:e?.axisTitle,noOfTicks:e?.noOfTicks,valueColor:e?.valueColor,styles:e?.styles,classNames:e?.classNames,animate:e?.animate,highlightedDataPoints:e?.highlightedDataPoints,dimmedOpacity:e?.dimmedOpacity};case"treeMap":return{precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,tooltip:e?.tooltip,showColorScale:e?.showColorScale,showValues:e?.showValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,onSeriesMouseClick:r=>{s?.(r.label)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"circlePacking":return{precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,tooltip:e?.tooltip,showColorScale:e?.showColorScale,showValues:e?.showValues,graphID:e?.graphID,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,radius:e?.radius,maxRadiusValue:e?.maxRadiusValue,onSeriesMouseClick:r=>{s?.(r.label)},detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"heatMap":return{precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,scaleType:e?.scaleType,colorDomain:e?.colorDomain,showColumnLabels:e?.showColumnLabels,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,truncateBy:e?.truncateBy,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,suffix:e?.suffix,prefix:e?.prefix,showValues:e?.showValues,showRowLabels:e?.showRowLabels,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,noDataColor:e?.noDataColor,showColorScale:e?.showColorScale,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,fillContainer:e?.fillContainer,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"stripChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,orientation:e?.orientation,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),radius:e?.radius,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,highlightedDataPoints:e?.highlightedDataPoints,showColorScale:e?.showColorScale,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,noOfTicks:e?.noOfTicks,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,prefix:e?.prefix,suffix:e?.suffix,stripType:e?.stripType,valueColor:e?.valueColor,language:e?.language,minHeight:e?.minHeight,highlightColor:e?.highlightColor,dotOpacity:e?.dotOpacity,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"beeSwarmChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,dimmedOpacity:e?.dimmedOpacity,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,colorDomain:e?.colorDomain,colorLegendTitle:Object.keys(e||{}).indexOf("colorLegendTitle")!==-1?e?.colorLegendTitle:i.getValues("color",t||[],o||[]),backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,showColorScale:e?.showColorScale,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,radius:e?.radius,maxRadiusValue:e?.maxRadiusValue,maxValue:e?.maxValue,minValue:e?.minValue,highlightedDataPoints:e?.highlightedDataPoints,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,showNAColor:e?.showNAColor,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,orientation:e?.orientation,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"butterflyChart":return{naLabel:e?.naLabel,timeline:e?.timeline,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,leftBarTitle:Object.keys(e||{}).indexOf("leftBarTitle")!==-1?e?.leftBarTitle:i.getValues("leftBar",t||[],o||[]),rightBarTitle:Object.keys(e||{}).indexOf("rightBarTitle")!==-1?e?.rightBarTitle:i.getValues("rightBar",t||[],o||[]),footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,barColors:e?.barColors,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,barPadding:e?.barPadding,truncateBy:e?.truncateBy,suffix:e?.suffix,prefix:e?.prefix,showTicks:e?.showTicks,showValues:e?.showValues,centerGap:e?.centerGap,maxValue:e?.maxValue,minValue:e?.minValue,showColorScale:e?.showColorScale,refValues:e?.refValues,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"histogram":return{precision:e?.precision,theme:e?.theme,data:a,colors:e?.colors,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,barPadding:e?.barPadding,showValues:e?.showValues,showTicks:e?.showTicks,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,backgroundColor:e?.backgroundColor,padding:e?.padding,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,showLabels:e?.showLabels,maxValue:e?.maxValue,tooltip:e?.tooltip,refValues:e?.refValues,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,numberOfBins:e?.numberOfBins,truncateBy:e?.truncateBy,donutStrokeWidth:e?.donutStrokeWidth,sortData:e?.sortData,barGraphLayout:e?.barGraphLayout,graphType:e?.graphType,language:e?.language,minHeight:e?.minHeight,maxBarThickness:e?.maxBarThickness,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames};case"sparkLine":return{customLayers:e?.customLayers,theme:e?.theme,data:a,curveType:e?.curveType,lineColor:e?.lineColor,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,dateFormat:e?.dateFormat,area:e?.area,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,maxValue:e?.maxValue,minValue:e?.minValue,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,styles:e?.styles,classNames:e?.classNames};case"paretoChart":return{showAxisLabels:e?.showAxisLabels,showColorScale:e?.showColorScale,naLabel:e?.naLabel,customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,showValues:e?.showValues,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,barTitle:Object.keys(e||{}).indexOf("barTitle")!==-1?e?.barTitle:i.getValues("barTitle",t||[],o||[]),lineTitle:Object.keys(e||{}).indexOf("lineTitle")!==-1?e?.lineTitle:i.getValues("lineTitle",t||[],o||[]),footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,backgroundColor:e?.backgroundColor,padding:e?.padding,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,barColor:e?.barColor,curveType:e?.curveType,lineColor:e?.lineColor,sameAxes:e?.sameAxes,relativeHeight:e?.relativeHeight,tooltip:e?.tooltip,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,barPadding:e?.barPadding,truncateBy:e?.truncateBy,showLabels:e?.showLabels,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,detailsOnClick:e?.detailsOnClick,noOfTicks:e?.noOfTicks,lineSuffix:e?.lineSuffix,barSuffix:e?.barSuffix,linePrefix:e?.lineSuffix,barPrefix:e?.barPrefix,barAxisTitle:e?.barAxisTitle,lineAxisTitle:e?.lineAxisTitle,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"dataTable":return{naLabel:e?.naLabel,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,graphID:e?.graphID,width:e?.width,height:e?.height,columnData:e?.columnData||[],data:a,language:e?.language,ariaLabel:e?.ariaLabel,minWidth:e?.minWidth,backgroundColor:e?.backgroundColor,padding:e?.padding,styles:e?.styles,classNames:e?.classNames};case"statCard":return{precision:e?.precision,theme:e?.theme,year:e?.year,data:a,graphTitle:e?.graphTitle||"",graphDescription:e?.graphDescription,suffix:e?.suffix,prefix:e?.prefix,sources:e?.sources||[],footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,graphID:e?.graphID,aggregationMethod:e?.aggregationMethod,language:e?.language,minHeight:e?.minHeight,countOnly:e?.countOnly,ariaLabel:e?.ariaLabel,textBackground:e?.textBackground,headingFontSize:e?.headingFontSize,centerAlign:e?.centerAlign,verticalAlign:e?.verticalAlign,styles:e?.styles,classNames:e?.classNames,layout:e?.layout};case"unitChart":return{precision:e?.precision,theme:e?.theme,totalNoOfDots:e?.totalNoOfDots,gridSize:e?.gridSize,unitPadding:e?.unitPadding,size:e?.size,graphTitle:e?.graphTitle,sources:e?.sources,colors:e?.colors,graphDescription:e?.graphDescription,footNote:e?.footNote,backgroundColor:e?.backgroundColor,padding:e?.padding,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,language:e?.language,showColorScale:e?.showColorScale,showStrokeForWhiteDots:e?.showStrokeForWhiteDots,note:e?.note,data:a,width:e?.width,height:e?.height,minHeight:e?.minHeight,relativeHeight:e?.relativeHeight,ariaLabel:e?.ariaLabel,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"sankeyChart":return{customLayers:e?.customLayers,precision:e?.precision,theme:e?.theme,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,data:a,graphTitle:e?.graphTitle,graphDescription:e?.graphDescription,footNote:e?.footNote,width:e?.width,height:e?.height,sources:e?.sources,showLabels:e?.showLabels,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,truncateBy:e?.truncateBy,padding:e?.padding,backgroundColor:e?.backgroundColor,tooltip:e?.tooltip,suffix:e?.suffix,prefix:e?.prefix,relativeHeight:e?.relativeHeight,showValues:e?.showValues,graphID:e?.graphID,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,fillContainer:e?.fillContainer,language:e?.language,minHeight:e?.minHeight,ariaLabel:e?.ariaLabel,sourceColors:e?.sourceColors,targetColors:e?.targetColors,sourceColorDomain:e?.sourceColorDomain,targetColorDomain:e?.targetColorDomain,nodePadding:e?.nodePadding,nodeWidth:e?.nodeWidth,highlightedSourceDataPoints:e?.highlightedSourceDataPoints,highlightedTargetDataPoints:e?.highlightedTargetDataPoints,defaultLinkOpacity:e?.defaultLinkOpacity,sourceTitle:e?.sourceTitle,targetTitle:e?.targetTitle,sortNodes:e?.sortNodes,detailsOnClick:e?.detailsOnClick,styles:e?.styles,classNames:e?.classNames,animate:e?.animate};case"dataCards":return{theme:e?.theme,graphTitle:e?.graphTitle,sources:e?.sources,graphDescription:e?.graphDescription,footNote:e?.footNote,graphID:e?.graphID,width:e?.width,height:e?.height,columnData:e?.columnData||[],data:a,language:e?.language,ariaLabel:e?.ariaLabel,cardTemplate:e?.cardTemplate,cardBackgroundColor:e?.cardBackgroundColor,cardFilters:e?.cardFilters||[],cardSortingOptions:e?.cardSortingOptions,cardSearchColumns:e?.cardSearchColumns,cardMinWidth:e?.cardMinWidth,backgroundColor:e?.backgroundColor,padding:e?.padding,detailsOnClick:e?.detailsOnClick,allowDataDownloadOnDetail:e?.allowDataDownloadOnDetail,noOfItemsInAPage:e?.noOfItemsInAPage,uiMode:e?.uiMode,styles:e?.styles,classNames:e?.classNames};case"radarChart":return{customLayers:e?.customLayers,precision:e?.precision,graphTitle:e?.graphTitle,dimmedOpacity:e?.dimmedOpacity,graphDescription:e?.graphDescription,footNote:e?.footNote,sources:e?.sources,ariaLabel:e?.ariaLabel,colors:e?.colors,colorDomain:e?.colorDomain,colorLegendTitle:e?.colorLegendTitle,backgroundColor:e?.backgroundColor,styles:e?.styles,classNames:e?.classNames,width:e?.width,height:e?.height,minHeight:e?.minHeight,relativeHeight:e?.relativeHeight,padding:e?.padding,radius:e?.radius,leftMargin:e?.leftMargin,rightMargin:e?.rightMargin,topMargin:e?.topMargin,bottomMargin:e?.bottomMargin,maxValue:e?.maxValue,minValue:e?.minValue,showValues:e?.showValues,showDots:e?.showDots,strokeWidth:e?.strokeWidth,fillShape:e?.fillShape,noOfTicks:e?.noOfTicks,showColorScale:e?.showColorScale,showNAColor:e?.showNAColor,highlightedLines:e?.highlightedLines,axisLabels:e?.axisLabels,curveType:e?.curveType,resetSelectionOnDoubleClick:e?.resetSelectionOnDoubleClick,graphDownload:e?.graphDownload,dataDownload:e?.dataDownload,tooltip:e?.tooltip,detailsOnClick:e?.detailsOnClick,language:e?.language,theme:e?.theme,graphID:e?.graphID,animate:e?.animate};default:return{}}},h=u[l],D=m(l);return n.jsxRuntimeExports.jsx("div",{className:`grow my-0 ${l!=="statCard"?"mx-auto":"mx-0"} flex flex-col h-inherit ${e?.width?"w-fit":"w-full"} ${l!=="unitChart"&&l!=="statCard"?"justify-center":"justify-start"} ${e?.theme||"light"}`,style:{minHeight:"inherit"},children:h?n.jsxRuntimeExports.jsx(h,{...D}):n.jsxRuntimeExports.jsx(c.u,{size:"sm",marginBottom:"none",className:"p-2 text-center text-accent-dark-red dark:text-accent-red",children:`Invalid chart type: ${l}`})})}exports.GraphEl=U;
|
|
2
|
+
//# sourceMappingURL=GraphEl-Bz2jatkM.cjs.map
|