@undp/data-viz 1.4.12 → 1.4.14
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.d.ts +3 -1
- package/dist/DualAxisLineChart.js +265 -261
- 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-s3ctz7oA.js → GraphEl-N6vuMRw_.js} +6 -2
- package/dist/GraphEl-N6vuMRw_.js.map +1 -0
- package/dist/GraphEl-Zl0W-LK9.cjs +2 -0
- package/dist/GraphEl-Zl0W-LK9.cjs.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +2 -2
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- 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.d.ts +4 -0
- package/dist/ParetoChart.js +317 -312
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- 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/ScrollStory.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +2 -2
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- 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/Types.d.ts +1 -0
- 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.d.ts +8 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/GraphEl-OzC-icbr.cjs +0 -2
- package/dist/GraphEl-OzC-icbr.cjs.map +0 -1
- package/dist/GraphEl-s3ctz7oA.js.map +0 -1
package/dist/ChoroplethMap.js
CHANGED
|
@@ -30,12 +30,12 @@ function at(he) {
|
|
|
30
30
|
const {
|
|
31
31
|
data: k,
|
|
32
32
|
colorDomain: g,
|
|
33
|
-
colors:
|
|
33
|
+
colors: c,
|
|
34
34
|
mapData: x,
|
|
35
35
|
colorLegendTitle: V,
|
|
36
36
|
categorical: E,
|
|
37
37
|
height: h,
|
|
38
|
-
width:
|
|
38
|
+
width: s,
|
|
39
39
|
scale: oe,
|
|
40
40
|
centerPoint: T,
|
|
41
41
|
tooltip: ie,
|
|
@@ -58,12 +58,12 @@ function at(he) {
|
|
|
58
58
|
animate: j,
|
|
59
59
|
dimmedOpacity: U,
|
|
60
60
|
customLayers: ne
|
|
61
|
-
} = he, [w, M] = b(void 0), J = ae(null), [K, v] = b(!(
|
|
61
|
+
} = he, [w, M] = b(void 0), J = ae(null), [K, v] = b(!(s < 680)), [D, Z] = b(void 0), [_, Q] = b(void 0), [S, $] = b(void 0), [se, ee] = b(void 0), L = ae(null), te = Ye(L, {
|
|
62
62
|
once: j.once,
|
|
63
63
|
amount: j.amount
|
|
64
|
-
}), le = ae(null), f = E ? Ge().domain(g).range(
|
|
64
|
+
}), le = ae(null), f = E ? Ge().domain(g).range(c) : Re().domain(g).range(c);
|
|
65
65
|
pe(() => {
|
|
66
|
-
const r = be(le.current),
|
|
66
|
+
const r = be(le.current), l = be(L.current), m = (o) => {
|
|
67
67
|
if (B === "noZoom") return !1;
|
|
68
68
|
if (B === "button") return !o.type.includes("wheel");
|
|
69
69
|
const n = o.type === "wheel", e = o.type.startsWith("touch"), a = o.type === "mousedown" || o.type === "mousemove";
|
|
@@ -71,14 +71,14 @@ function at(he) {
|
|
|
71
71
|
}, i = Ee().scaleExtent(ue).translateExtent(
|
|
72
72
|
I || [
|
|
73
73
|
[-20, -20],
|
|
74
|
-
[
|
|
74
|
+
[s + 20, h + 20]
|
|
75
75
|
]
|
|
76
76
|
).filter(m).on("zoom", ({ transform: o }) => {
|
|
77
77
|
r.attr("transform", o);
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
}, [h,
|
|
81
|
-
const u = Pe(x), z = Ie(x), re = u[2] - u[0], ce = u[3] - u[1], A =
|
|
79
|
+
l.call(i), J.current = i;
|
|
80
|
+
}, [h, s, B]);
|
|
81
|
+
const u = Pe(x), z = Ie(x), re = u[2] - u[0], ce = u[3] - u[1], A = s * 190 / 960 * 360 / re, ve = h * 190 / 678 * 180 / ce, d = oe * Math.min(A, ve), N = X === "mercator" ? Le().rotate([0, 0]).center(T || z.geometry.coordinates).translate([s / 2, h / 2]).scale(d) : X === "equalEarth" ? ze().rotate([0, 0]).center(T || z.geometry.coordinates).translate([s / 2, h / 2]).scale(d) : X === "naturalEarth" ? We().rotate([0, 0]).center(T || z.geometry.coordinates).translate([s / 2, h / 2]).scale(d) : X === "orthographic" ? Te().rotate([0, 0]).center(T || z.geometry.coordinates).translate([s / 2, h / 2]).scale(d) : Be().rotate([0, 0]).center(T || z.geometry.coordinates).translate([s / 2, h / 2]).scale(d), G = (r) => {
|
|
82
82
|
if (!L.current || !J.current) return;
|
|
83
83
|
be(L.current).call(J.current.scaleBy, r === "in" ? 1.2 : 1 / 1.2);
|
|
84
84
|
};
|
|
@@ -87,15 +87,15 @@ function at(he) {
|
|
|
87
87
|
/* @__PURE__ */ t.jsx(
|
|
88
88
|
de.svg,
|
|
89
89
|
{
|
|
90
|
-
width: `${
|
|
90
|
+
width: `${s}px`,
|
|
91
91
|
height: `${h}px`,
|
|
92
|
-
viewBox: `0 0 ${
|
|
92
|
+
viewBox: `0 0 ${s} ${h}`,
|
|
93
93
|
ref: L,
|
|
94
94
|
direction: "ltr",
|
|
95
95
|
children: /* @__PURE__ */ t.jsxs("g", { ref: le, children: [
|
|
96
96
|
ne.filter((r) => r.position === "before").map((r) => r.layer),
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
-
x.features.map((r,
|
|
98
|
+
x.features.map((r, l) => k.findIndex((i) => i.id === r.properties[q]) !== -1 ? null : /* @__PURE__ */ t.jsx(
|
|
99
99
|
"g",
|
|
100
100
|
{
|
|
101
101
|
opacity: w ? U : H.length !== 0 ? H.indexOf(r.properties[q]) !== -1 ? 1 : U : 1,
|
|
@@ -144,10 +144,10 @@ function at(he) {
|
|
|
144
144
|
})
|
|
145
145
|
)
|
|
146
146
|
},
|
|
147
|
-
|
|
147
|
+
l
|
|
148
148
|
)),
|
|
149
149
|
/* @__PURE__ */ t.jsx(Je, { children: k.map((r) => {
|
|
150
|
-
const
|
|
150
|
+
const l = x.features.findIndex(
|
|
151
151
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
152
|
(i) => r.id === i.properties[q]
|
|
153
153
|
), m = qe(r.x) ? R : (
|
|
@@ -179,7 +179,7 @@ function at(he) {
|
|
|
179
179
|
onClick: () => {
|
|
180
180
|
(y || C) && (Oe(D, r) && ye ? (Z(void 0), y?.(void 0)) : (Z(r), y?.(r)));
|
|
181
181
|
},
|
|
182
|
-
children:
|
|
182
|
+
children: l === -1 ? null : x.features[l].geometry.type === "MultiPolygon" ? x.features[l].geometry.coordinates.map(
|
|
183
183
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
184
184
|
(i, o) => {
|
|
185
185
|
let n = "";
|
|
@@ -212,7 +212,7 @@ function at(he) {
|
|
|
212
212
|
`${r.id}-${o}`
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
|
-
) : x.features[
|
|
215
|
+
) : x.features[l].geometry.coordinates.map(
|
|
216
216
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
217
217
|
(i, o) => {
|
|
218
218
|
let n = "M";
|
|
@@ -250,7 +250,7 @@ function at(he) {
|
|
|
250
250
|
_ ? x.features.filter(
|
|
251
251
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
252
|
(r) => r.properties[q] === _.id
|
|
253
|
-
).map((r,
|
|
253
|
+
).map((r, l) => /* @__PURE__ */ t.jsx("g", { children: r.geometry.type === "MultiPolygon" ? (
|
|
254
254
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
255
255
|
r.geometry.coordinates.map((m, i) => {
|
|
256
256
|
let o = "";
|
|
@@ -295,7 +295,7 @@ function at(he) {
|
|
|
295
295
|
i
|
|
296
296
|
);
|
|
297
297
|
})
|
|
298
|
-
) },
|
|
298
|
+
) }, l)) : null,
|
|
299
299
|
ne.filter((r) => r.position === "after").map((r) => r.layer)
|
|
300
300
|
] })
|
|
301
301
|
}
|
|
@@ -346,12 +346,12 @@ function at(he) {
|
|
|
346
346
|
children: V
|
|
347
347
|
}
|
|
348
348
|
) : null,
|
|
349
|
-
E ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-3", children: g.map((r,
|
|
349
|
+
E ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-3", children: g.map((r, l) => /* @__PURE__ */ t.jsxs(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
352
|
className: "flex gap-2 items-center",
|
|
353
353
|
onMouseOver: () => {
|
|
354
|
-
M(l
|
|
354
|
+
M(c[l % c.length]);
|
|
355
355
|
},
|
|
356
356
|
onMouseLeave: () => {
|
|
357
357
|
M(void 0);
|
|
@@ -361,19 +361,19 @@ function at(he) {
|
|
|
361
361
|
"div",
|
|
362
362
|
{
|
|
363
363
|
className: "w-2 h-2 rounded-full",
|
|
364
|
-
style: { backgroundColor: l
|
|
364
|
+
style: { backgroundColor: c[l % c.length] }
|
|
365
365
|
}
|
|
366
366
|
),
|
|
367
367
|
/* @__PURE__ */ t.jsx(ke, { size: "sm", marginBottom: "none", leading: "none", children: r })
|
|
368
368
|
]
|
|
369
369
|
},
|
|
370
|
-
|
|
370
|
+
l
|
|
371
371
|
)) }) : /* @__PURE__ */ t.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { children: [
|
|
372
|
-
g.map((r,
|
|
372
|
+
g.map((r, l) => /* @__PURE__ */ t.jsxs(
|
|
373
373
|
"g",
|
|
374
374
|
{
|
|
375
375
|
onMouseOver: () => {
|
|
376
|
-
M(l
|
|
376
|
+
M(c[l]);
|
|
377
377
|
},
|
|
378
378
|
onMouseLeave: () => {
|
|
379
379
|
M(void 0);
|
|
@@ -383,21 +383,21 @@ function at(he) {
|
|
|
383
383
|
/* @__PURE__ */ t.jsx(
|
|
384
384
|
"rect",
|
|
385
385
|
{
|
|
386
|
-
x:
|
|
386
|
+
x: l * 320 / c.length + 1,
|
|
387
387
|
y: 1,
|
|
388
|
-
width: 320 /
|
|
388
|
+
width: 320 / c.length - 2,
|
|
389
389
|
height: 8,
|
|
390
|
-
className: w === l
|
|
390
|
+
className: w === c[l] ? "stroke-primary-gray-700 dark:stroke-primary-gray-300" : "",
|
|
391
391
|
style: {
|
|
392
|
-
fill: l
|
|
393
|
-
...w === l
|
|
392
|
+
fill: c[l],
|
|
393
|
+
...w === c[l] ? {} : { stroke: c[l] }
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
),
|
|
397
397
|
/* @__PURE__ */ t.jsx(
|
|
398
398
|
"text",
|
|
399
399
|
{
|
|
400
|
-
x: (
|
|
400
|
+
x: (l + 1) * 320 / c.length,
|
|
401
401
|
y: 25,
|
|
402
402
|
className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",
|
|
403
403
|
style: { textAnchor: "middle" },
|
|
@@ -406,25 +406,25 @@ function at(he) {
|
|
|
406
406
|
)
|
|
407
407
|
]
|
|
408
408
|
},
|
|
409
|
-
|
|
409
|
+
l
|
|
410
410
|
)),
|
|
411
411
|
/* @__PURE__ */ t.jsx("g", { children: /* @__PURE__ */ t.jsx(
|
|
412
412
|
"rect",
|
|
413
413
|
{
|
|
414
414
|
onMouseOver: () => {
|
|
415
|
-
M(
|
|
415
|
+
M(c[g.length]);
|
|
416
416
|
},
|
|
417
417
|
onMouseLeave: () => {
|
|
418
418
|
M(void 0);
|
|
419
419
|
},
|
|
420
|
-
x: g.length * 320 /
|
|
420
|
+
x: g.length * 320 / c.length + 1,
|
|
421
421
|
y: 1,
|
|
422
|
-
width: 320 /
|
|
422
|
+
width: 320 / c.length - 2,
|
|
423
423
|
height: 8,
|
|
424
|
-
className: `cursor-pointer ${w ===
|
|
424
|
+
className: `cursor-pointer ${w === c[g.length] ? "stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300" : ""}`,
|
|
425
425
|
style: {
|
|
426
|
-
fill:
|
|
427
|
-
...w ===
|
|
426
|
+
fill: c[g.length],
|
|
427
|
+
...w === c[g.length] ? {} : { stroke: c[g.length] }
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
) })
|
|
@@ -496,12 +496,12 @@ function Pt(he) {
|
|
|
496
496
|
const {
|
|
497
497
|
data: k,
|
|
498
498
|
mapData: g = "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",
|
|
499
|
-
graphTitle:
|
|
499
|
+
graphTitle: c,
|
|
500
500
|
colors: x,
|
|
501
501
|
sources: V,
|
|
502
502
|
graphDescription: E,
|
|
503
503
|
height: h,
|
|
504
|
-
width:
|
|
504
|
+
width: s,
|
|
505
505
|
footNote: oe = "The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",
|
|
506
506
|
colorDomain: T,
|
|
507
507
|
colorLegendTitle: ie,
|
|
@@ -547,16 +547,16 @@ function Pt(he) {
|
|
|
547
547
|
(e) => e.date
|
|
548
548
|
).map((e) => Me(`${e.date}`, f.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
549
549
|
(e, a) => rt(e, a)
|
|
550
|
-
), [N, G] = b(f.autoplay ? 0 : d.length - 1), [r,
|
|
550
|
+
), [N, G] = b(f.autoplay ? 0 : d.length - 1), [r, l] = b(void 0), m = ae(null), i = ae(null);
|
|
551
551
|
pe(() => {
|
|
552
552
|
const e = new ResizeObserver((a) => {
|
|
553
|
-
z(
|
|
553
|
+
z(s || a[0].target.clientWidth || 760), ce(h || a[0].target.clientHeight || 480);
|
|
554
554
|
});
|
|
555
|
-
return m.current && (ce(m.current.clientHeight || 480), z(m.current.clientWidth || 760),
|
|
556
|
-
}, [
|
|
555
|
+
return m.current && (ce(m.current.clientHeight || 480), z(m.current.clientWidth || 760), s || e.observe(m.current)), () => e.disconnect();
|
|
556
|
+
}, [s, h]), pe(() => {
|
|
557
557
|
typeof g == "string" ? Qe(g).then((a) => {
|
|
558
|
-
|
|
559
|
-
}) :
|
|
558
|
+
l(a);
|
|
559
|
+
}) : l(g);
|
|
560
560
|
}, [g]);
|
|
561
561
|
const o = T || (P === "categorical" ? et(k, "x") : tt(
|
|
562
562
|
k.map((e) => e.x),
|
|
@@ -580,13 +580,14 @@ function Pt(he) {
|
|
|
580
580
|
return /* @__PURE__ */ t.jsx(
|
|
581
581
|
"div",
|
|
582
582
|
{
|
|
583
|
-
className: `${D || "light"} flex ${
|
|
583
|
+
className: `${D || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
|
|
584
584
|
dir: K === "he" || K === "ar" ? "rtl" : void 0,
|
|
585
585
|
children: /* @__PURE__ */ t.jsx(
|
|
586
586
|
"div",
|
|
587
587
|
{
|
|
588
588
|
className: je(
|
|
589
589
|
`${I ? I === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${K || "en"}`,
|
|
590
|
+
s ? "w-fit" : "w-full",
|
|
590
591
|
$?.graphContainer
|
|
591
592
|
),
|
|
592
593
|
style: {
|
|
@@ -595,14 +596,14 @@ function Pt(he) {
|
|
|
595
596
|
},
|
|
596
597
|
id: B,
|
|
597
598
|
ref: i,
|
|
598
|
-
"aria-label": Z || `${
|
|
599
|
+
"aria-label": Z || `${c ? `The graph shows ${c}. ` : ""}This is a choropleth map where geographic areas are colored in proportion to a specific variable.${E ? ` ${E}` : ""}`,
|
|
599
600
|
children: /* @__PURE__ */ t.jsx(
|
|
600
601
|
"div",
|
|
601
602
|
{
|
|
602
603
|
className: "flex grow",
|
|
603
604
|
style: { padding: I ? Y || "1rem" : Y || 0 },
|
|
604
605
|
children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
605
|
-
|
|
606
|
+
c || E || w || M ? /* @__PURE__ */ t.jsx(
|
|
606
607
|
Ze,
|
|
607
608
|
{
|
|
608
609
|
styles: {
|
|
@@ -613,9 +614,9 @@ function Pt(he) {
|
|
|
613
614
|
title: $?.title,
|
|
614
615
|
description: $?.description
|
|
615
616
|
},
|
|
616
|
-
graphTitle:
|
|
617
|
+
graphTitle: c,
|
|
617
618
|
graphDescription: E,
|
|
618
|
-
width:
|
|
619
|
+
width: s,
|
|
619
620
|
graphDownload: w ? i.current : void 0,
|
|
620
621
|
dataDownload: M ? k.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? k.map((e) => e.data).filter((e) => e !== void 0) : k.filter((e) => e !== void 0) : null
|
|
621
622
|
}
|
|
@@ -658,7 +659,7 @@ function Pt(he) {
|
|
|
658
659
|
className: "flex flex-col grow justify-center leading-0",
|
|
659
660
|
ref: m,
|
|
660
661
|
"aria-label": "Map area",
|
|
661
|
-
children: (
|
|
662
|
+
children: (s || u) && (h || re) && r ? /* @__PURE__ */ t.jsx(
|
|
662
663
|
at,
|
|
663
664
|
{
|
|
664
665
|
data: k.filter(
|
|
@@ -672,10 +673,10 @@ function Pt(he) {
|
|
|
672
673
|
)
|
|
673
674
|
},
|
|
674
675
|
colorDomain: o,
|
|
675
|
-
width:
|
|
676
|
+
width: s || u,
|
|
676
677
|
height: Math.max(
|
|
677
678
|
v,
|
|
678
|
-
h || (y ? v ? (
|
|
679
|
+
h || (y ? v ? (s || u) * y > v ? (s || u) * y : v : (s || u) * y : re)
|
|
679
680
|
),
|
|
680
681
|
scale: F,
|
|
681
682
|
centerPoint: R,
|
|
@@ -710,7 +711,7 @@ function Pt(he) {
|
|
|
710
711
|
style: {
|
|
711
712
|
height: `${Math.max(
|
|
712
713
|
v,
|
|
713
|
-
h || (y ? v ? (
|
|
714
|
+
h || (y ? v ? (s || u) * y > v ? (s || u) * y : v : (s || u) * y : re)
|
|
714
715
|
)}px`
|
|
715
716
|
},
|
|
716
717
|
className: "flex items-center justify-center",
|
|
@@ -729,7 +730,7 @@ function Pt(he) {
|
|
|
729
730
|
},
|
|
730
731
|
sources: V,
|
|
731
732
|
footNote: oe,
|
|
732
|
-
width:
|
|
733
|
+
width: s
|
|
733
734
|
}
|
|
734
735
|
) : null
|
|
735
736
|
] })
|