@undp/data-viz 2.4.1 → 2.5.1
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.d.ts +11 -9
- package/dist/AreaChart.js +320 -322
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.d.ts +15 -25
- package/dist/BarGraph.js +1694 -1694
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.cjs.map +1 -1
- package/dist/BasicStatCard.d.ts +13 -9
- package/dist/BasicStatCard.js +79 -81
- package/dist/BasicStatCard.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.d.ts +11 -9
- package/dist/BeeSwarmChart.js +335 -336
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +13 -3
- package/dist/BiVariateChoroplethMap.js +309 -304
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.d.ts +11 -5
- package/dist/BulletChart.js +560 -559
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.d.ts +11 -9
- package/dist/ButterflyChart.js +348 -350
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +11 -3
- package/dist/ChoroplethMap.js +314 -311
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.d.ts +11 -9
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.d.ts +1 -1
- package/dist/DataCards.js +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.d.ts +4 -5
- package/dist/DataTable.js +114 -116
- package/dist/DataTable.js.map +1 -1
- package/dist/{DetailsModal-jmmKRMRM.cjs → DetailsModal-Du8Fr1QD.cjs} +2 -2
- package/dist/{DetailsModal-jmmKRMRM.cjs.map → DetailsModal-Du8Fr1QD.cjs.map} +1 -1
- package/dist/{DetailsModal-B2XBWR7w.js → DetailsModal-GqEbGHY2.js} +2 -2
- package/dist/{DetailsModal-B2XBWR7w.js.map → DetailsModal-GqEbGHY2.js.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.d.ts +11 -9
- package/dist/DifferenceLineChart.js +502 -504
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.d.ts +14 -9
- package/dist/DonutChart.js +174 -179
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +1 -1
- package/dist/DotDensityMap.js +270 -267
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.d.ts +13 -9
- package/dist/DualAxisLineChart.js +341 -351
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.d.ts +11 -9
- package/dist/DumbbellChart.js +592 -593
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.d.ts +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.d.ts +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.d.ts +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +1 -1
- package/dist/GraphEl-BgkDbq50.cjs +2 -0
- package/dist/GraphEl-BgkDbq50.cjs.map +1 -0
- package/dist/GraphEl-Ch0uAeZw.js +1830 -0
- package/dist/GraphEl-Ch0uAeZw.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +29 -16
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +29 -16
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.d.ts +11 -9
- package/dist/HeatMap.js +203 -205
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.cjs.map +1 -1
- package/dist/Histogram.d.ts +11 -5
- package/dist/Histogram.js +88 -89
- package/dist/Histogram.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.d.ts +11 -3
- package/dist/HybridMap.js +339 -336
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.d.ts +11 -9
- package/dist/LineChartWithConfidenceInterval.js +393 -395
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +1 -1
- package/dist/MultiGraphDashboard.d.ts +29 -16
- package/dist/MultiGraphDashboardFromConfig.d.ts +29 -16
- package/dist/MultiGraphDashboardWideToLongFormat.d.ts +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.d.ts +11 -9
- package/dist/MultiLineAltChart.js +411 -413
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.d.ts +11 -9
- package/dist/MultiLineChart.js +438 -440
- 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 +13 -13
- package/dist/ParetoChart.js +347 -355
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +29 -16
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +29 -16
- package/dist/PerformanceIntensiveScrollStory.d.ts +29 -16
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.d.ts +11 -5
- package/dist/RadarChart.js +213 -213
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.d.ts +11 -9
- package/dist/SankeyChart.js +448 -450
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +15 -13
- package/dist/ScatterPlot.js +477 -483
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.d.ts +29 -16
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.d.ts +11 -9
- package/dist/SimpleLineChart.js +362 -364
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +29 -16
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +29 -16
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +29 -16
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +29 -16
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +29 -16
- package/dist/SingleGraphDashboardThreeDGraphs.js +40 -39
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +29 -16
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.d.ts +1 -1
- package/dist/SlopeChart.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.d.ts +1 -1
- package/dist/SparkLine.js +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.cjs.map +1 -1
- package/dist/StatCardFromData.d.ts +11 -9
- package/dist/StatCardFromData.js +113 -116
- package/dist/StatCardFromData.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.d.ts +11 -9
- package/dist/StripChart.js +434 -435
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +11 -3
- package/dist/ThreeDGlobe.js +143 -143
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +1 -1
- package/dist/{Tooltip-Bj-s__cI.js → Tooltip-3EYDVa3w.js} +2 -2
- package/dist/{Tooltip-Bj-s__cI.js.map → Tooltip-3EYDVa3w.js.map} +1 -1
- package/dist/{Tooltip-Hr46paWP.cjs → Tooltip-C9F3uYG0.cjs} +2 -2
- package/dist/{Tooltip-Hr46paWP.cjs.map → Tooltip-C9F3uYG0.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.d.ts +11 -9
- package/dist/TreeMapGraph.js +369 -371
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +29 -16
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.d.ts +11 -5
- package/dist/UnitChart.js +118 -119
- package/dist/UnitChart.js.map +1 -1
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.cjs.map +1 -1
- package/dist/WaterfallChart.d.ts +11 -9
- package/dist/WaterfallChart.js +306 -308
- package/dist/WaterfallChart.js.map +1 -1
- package/dist/XTicksAndGridLines-B4UhDVyU.cjs +2 -0
- package/dist/XTicksAndGridLines-B4UhDVyU.cjs.map +1 -0
- package/dist/XTicksAndGridLines-CkYwVshF.js +40 -0
- package/dist/XTicksAndGridLines-CkYwVshF.js.map +1 -0
- package/dist/YTicksAndGridLines-BbujwxOB.js +40 -0
- package/dist/YTicksAndGridLines-BbujwxOB.js.map +1 -0
- package/dist/YTicksAndGridLines-sT3zdCs6.cjs +2 -0
- package/dist/YTicksAndGridLines-sT3zdCs6.cjs.map +1 -0
- package/dist/{imageDownload-Diofs_vY.js → imageDownload-BYsNEtMS.js} +11 -11
- package/dist/{imageDownload-Diofs_vY.js.map → imageDownload-BYsNEtMS.js.map} +1 -1
- package/dist/{imageDownload-61q6jyJW.cjs → imageDownload-CkMwA7Cw.cjs} +4 -4
- package/dist/{imageDownload-61q6jyJW.cjs.map → imageDownload-CkMwA7Cw.cjs.map} +1 -1
- package/dist/index-BPyj_6hG.js +375 -0
- package/dist/index-BPyj_6hG.js.map +1 -0
- package/dist/index-DuLvdHo2.cjs +2 -0
- package/dist/index-DuLvdHo2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +108 -245
- package/dist/index.js +3 -3
- package/dist/numberFormattingFunction-BUUV_luR.js +28 -0
- package/dist/numberFormattingFunction-BUUV_luR.js.map +1 -0
- package/dist/numberFormattingFunction-u2iNHL_c.cjs +2 -0
- package/dist/numberFormattingFunction-u2iNHL_c.cjs.map +1 -0
- package/dist/{string2HTML-ZoGd08P_.cjs → string2HTML-30nfIm8R.cjs} +2 -2
- package/dist/{string2HTML-ZoGd08P_.cjs.map → string2HTML-30nfIm8R.cjs.map} +1 -1
- package/dist/{string2HTML-BrFperRM.js → string2HTML-DL-pInUB.js} +2 -2
- package/dist/{string2HTML-BrFperRM.js.map → string2HTML-DL-pInUB.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -2
- package/dist/GraphEl-B73N4RIA.js +0 -1906
- package/dist/GraphEl-B73N4RIA.js.map +0 -1
- package/dist/GraphEl-Lt1og0C-.cjs +0 -2
- package/dist/GraphEl-Lt1og0C-.cjs.map +0 -1
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs +0 -2
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs.map +0 -1
- package/dist/XTicksAndGridLines-gdbGX2rm.js +0 -39
- package/dist/XTicksAndGridLines-gdbGX2rm.js.map +0 -1
- package/dist/YTicksAndGridLines-CsNSq9W9.js +0 -39
- package/dist/YTicksAndGridLines-CsNSq9W9.js.map +0 -1
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs +0 -2
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs.map +0 -1
- package/dist/index-B0Awa_de.js +0 -377
- package/dist/index-B0Awa_de.js.map +0 -1
- package/dist/index-CP8cmNzt.cjs +0 -2
- package/dist/index-CP8cmNzt.cjs.map +0 -1
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs +0 -2
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs.map +0 -1
- package/dist/numberFormattingFunction-DqMf_v1m.js +0 -28
- package/dist/numberFormattingFunction-DqMf_v1m.js.map +0 -1
package/dist/StatCardFromData.js
CHANGED
|
@@ -1,170 +1,167 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { s as
|
|
3
|
-
import { R as
|
|
4
|
-
import { GraphFooter as
|
|
5
|
-
import { GraphHeader as
|
|
6
|
-
import { n as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
year:
|
|
10
|
-
data:
|
|
1
|
+
import { c as oe, m as ie, j as a } from "./index-CHPV5EwG-BzibaIRc.js";
|
|
2
|
+
import { s as M } from "./index-CeVNqhMO.js";
|
|
3
|
+
import { R as Y } from "./Typography-BO0gQDIT.js";
|
|
4
|
+
import { GraphFooter as ee } from "./GraphFooter.js";
|
|
5
|
+
import { GraphHeader as te } from "./GraphHeader.js";
|
|
6
|
+
import { n as d } from "./numberFormattingFunction-BUUV_luR.js";
|
|
7
|
+
function _e(r) {
|
|
8
|
+
const e = oe.c(53), {
|
|
9
|
+
year: g,
|
|
10
|
+
data: i,
|
|
11
11
|
graphTitle: p,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
sources: x,
|
|
13
|
+
graphDescription: f,
|
|
14
|
+
footNote: h,
|
|
15
|
+
padding: R,
|
|
16
|
+
backgroundColor: E,
|
|
17
|
+
graphID: A,
|
|
18
|
+
aggregationMethod: G,
|
|
19
|
+
language: I,
|
|
20
|
+
countOnly: u,
|
|
21
|
+
theme: q,
|
|
22
|
+
ariaLabel: re,
|
|
23
|
+
textBackground: J,
|
|
24
|
+
headingFontSize: K,
|
|
25
|
+
centerAlign: P,
|
|
26
|
+
verticalAlign: Q,
|
|
27
|
+
layout: U,
|
|
28
|
+
styles: o,
|
|
29
|
+
classNames: n,
|
|
30
|
+
naLabel: V,
|
|
31
|
+
numberDisplayOptions: t
|
|
32
|
+
} = r, m = E === void 0 ? !1 : E, s = G === void 0 ? "count" : G, c = I === void 0 ? "en" : I, X = q === void 0 ? "light" : q, w = J === void 0 ? !1 : J, F = K === void 0 ? "4.375rem" : K, S = P === void 0 ? !1 : P, Z = Q === void 0 ? "center" : Q, _ = U === void 0 ? "primary" : U, l = V === void 0 ? "NA" : V, L = `${X || "light"} w-full`, T = c === "he" || c === "ar" ? "rtl" : void 0, z = `${X || "light"} flex flex-col w-full box-border h-full ${m ? m === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650" : "" : "bg-transparent"} ${c || "en"}`, B = n?.graphContainer;
|
|
33
|
+
let y;
|
|
34
|
+
e[0] !== z || e[1] !== B ? (y = ie(z, B), e[0] = z, e[1] = B, e[2] = y) : y = e[2];
|
|
35
|
+
let v;
|
|
36
|
+
e[3] !== o?.graphContainer ? (v = o?.graphContainer || {}, e[3] = o?.graphContainer, e[4] = v) : v = e[4];
|
|
37
|
+
let b;
|
|
38
|
+
e[5] !== m ? (b = m && m !== !0 ? {
|
|
39
|
+
backgroundColor: m
|
|
40
|
+
} : {}, e[5] = m, e[6] = b) : b = e[6];
|
|
41
|
+
const D = m ? R || "1rem" : R || 0;
|
|
36
42
|
let j;
|
|
37
|
-
|
|
43
|
+
e[7] !== v || e[8] !== b || e[9] !== D ? (j = {
|
|
44
|
+
...v,
|
|
45
|
+
...b,
|
|
46
|
+
padding: D
|
|
47
|
+
}, e[7] = v, e[8] = b, e[9] = D, e[10] = j) : j = e[10];
|
|
48
|
+
const O = re || `${p ? `The graph shows ${p}. ` : ""}This is a statistic card.${f ? ` ${f}` : ""}`, W = `flex flex-col w-full grow ${_ !== "secondary" ? "gap-12 justify-between" : "gap-4 justify-center"}`;
|
|
38
49
|
let k;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const R = x ? K || "1rem" : K || 0;
|
|
45
|
-
let $;
|
|
46
|
-
t[7] !== k || t[8] !== N || t[9] !== R ? ($ = {
|
|
47
|
-
...k,
|
|
48
|
-
...N,
|
|
49
|
-
padding: R
|
|
50
|
-
}, t[7] = k, t[8] = N, t[9] = R, t[10] = $) : $ = t[10];
|
|
51
|
-
const E = ct || `${p ? `The graph shows ${p}. ` : ""}This is a statistic card.${d ? ` ${d}` : ""}`, G = `flex flex-col w-full grow ${S !== "secondary" ? "gap-12 justify-between" : "gap-4 justify-center"}`;
|
|
52
|
-
let _;
|
|
53
|
-
t[11] !== l || t[12] !== A || t[13] !== r?.description || t[14] !== r?.footnote || t[15] !== r?.source || t[16] !== r?.title || t[17] !== g || t[18] !== o || t[19] !== b || t[20] !== d || t[21] !== p || t[22] !== M || t[23] !== f || t[24] !== S || t[25] !== m || t[26] !== u || t[27] !== c || t[28] !== s || t[29] !== v || t[30] !== n?.description || t[31] !== n?.footnote || t[32] !== n?.source || t[33] !== n?.title || t[34] !== a || t[35] !== C || t[36] !== L || t[37] !== y ? (_ = S !== "secondary" ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
54
|
-
p || d ? /* @__PURE__ */ i.jsx(lt, { styles: {
|
|
50
|
+
e[11] !== s || e[12] !== S || e[13] !== n?.description || e[14] !== n?.footnote || e[15] !== n?.source || e[16] !== n?.title || e[17] !== u || e[18] !== i || e[19] !== h || e[20] !== f || e[21] !== p || e[22] !== F || e[23] !== c || e[24] !== _ || e[25] !== l || e[26] !== t?.locale || e[27] !== t?.padZeros || e[28] !== t?.precision || e[29] !== t?.prefix || e[30] !== t?.suffix || e[31] !== x || e[32] !== o?.description || e[33] !== o?.footnote || e[34] !== o?.source || e[35] !== o?.title || e[36] !== w || e[37] !== Z || e[38] !== g ? (k = _ !== "secondary" ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
51
|
+
p || f ? /* @__PURE__ */ a.jsx(te, { styles: {
|
|
52
|
+
title: o?.title,
|
|
53
|
+
description: o?.description
|
|
54
|
+
}, classNames: {
|
|
55
55
|
title: n?.title,
|
|
56
56
|
description: n?.description
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, graphTitle: p, graphDescription: d }) : null,
|
|
61
|
-
/* @__PURE__ */ i.jsx("div", { className: `flex flex-col justify-between grow ${L === "top" ? "justify-start" : L === "bottom" ? "justify-end" : "justify-center"}`, children: /* @__PURE__ */ i.jsxs(at, { marginBottom: "base", className: `leading-none text-outline font-heading ${A ? "text-center" : f === "he" || f === "ar" ? "text-right" : "text-left"} ${C ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
|
|
62
|
-
fontSize: M,
|
|
57
|
+
}, graphTitle: p, graphDescription: f }) : null,
|
|
58
|
+
/* @__PURE__ */ a.jsx("div", { className: `flex flex-col justify-between grow ${Z === "top" ? "justify-start" : Z === "bottom" ? "justify-end" : "justify-center"}`, children: /* @__PURE__ */ a.jsxs(Y, { marginBottom: "base", className: `leading-none text-outline font-heading ${S ? "text-center" : c === "he" || c === "ar" ? "text-right" : "text-left"} ${w ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
|
|
59
|
+
fontSize: F,
|
|
63
60
|
letterSpacing: "0.05rem"
|
|
64
61
|
}, children: [
|
|
65
|
-
|
|
62
|
+
i.filter(ye).length > 0 || s === "count" ? u && u?.length !== 0 ? i.filter((H) => u.indexOf(H.value) !== -1).length : i.length : s === "sum" ? d(M(i.map(he)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros) : s === "average" ? d(parseFloat((M(i.map(xe)) / i.length).toFixed(2)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros) : s === "max" ? d(Math.max(...i.map(ge).filter(de)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros) : d(Math.min(...i.map(me).filter(ue)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros),
|
|
66
63
|
" ",
|
|
67
|
-
|
|
64
|
+
g ? /* @__PURE__ */ a.jsxs("span", { className: "text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400", style: {
|
|
68
65
|
marginLeft: "-8px",
|
|
69
66
|
lineHeight: "1.09",
|
|
70
67
|
textShadow: "none",
|
|
71
68
|
WebkitTextStrokeWidth: 0
|
|
72
69
|
}, children: [
|
|
73
70
|
"(",
|
|
74
|
-
|
|
71
|
+
g,
|
|
75
72
|
")"
|
|
76
73
|
] }) : null
|
|
77
74
|
] }) }),
|
|
78
|
-
|
|
75
|
+
x || h ? /* @__PURE__ */ a.jsx(ee, { styles: {
|
|
76
|
+
footnote: o?.footnote,
|
|
77
|
+
source: o?.source
|
|
78
|
+
}, classNames: {
|
|
79
79
|
footnote: n?.footnote,
|
|
80
80
|
source: n?.source
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
] }) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
86
|
-
/* @__PURE__ */ i.jsxs(at, { marginBottom: S === "secondary" ? "none" : "base", className: `leading-none text-outline font-heading ${A ? "text-center" : f === "he" || f === "ar" ? "text-right" : "text-left"} ${C ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
|
|
87
|
-
fontSize: M,
|
|
81
|
+
}, sources: x, footNote: h }) : null
|
|
82
|
+
] }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
83
|
+
/* @__PURE__ */ a.jsxs(Y, { marginBottom: _ === "secondary" ? "none" : "base", className: `leading-none text-outline font-heading ${S ? "text-center" : c === "he" || c === "ar" ? "text-right" : "text-left"} ${w ? "text-primary-black dark:text-primary-white" : "transparent"}`, style: {
|
|
84
|
+
fontSize: F,
|
|
88
85
|
letterSpacing: "0.05rem"
|
|
89
86
|
}, children: [
|
|
90
|
-
|
|
87
|
+
i.filter(fe).length > 0 || s === "count" ? u && u?.length !== 0 ? i.filter((H) => u.indexOf(H.value) !== -1).length : i.length : s === "sum" ? d(M(i.map(pe)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros) : s === "average" ? d(parseFloat((M(i.map(ce)) / i.length).toFixed(2)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros) : s === "max" ? d(Math.max(...i.map(le).filter(se)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros) : d(Math.min(...i.map(ae).filter(ne)), l, t?.precision ?? 2, t?.prefix, t?.suffix, t?.locale, t?.padZeros),
|
|
91
88
|
" ",
|
|
92
|
-
|
|
89
|
+
g ? /* @__PURE__ */ a.jsxs("span", { className: "text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400", style: {
|
|
93
90
|
marginLeft: "-8px",
|
|
94
91
|
lineHeight: "1.09",
|
|
95
92
|
textShadow: "none",
|
|
96
93
|
WebkitTextStrokeWidth: 0
|
|
97
94
|
}, children: [
|
|
98
95
|
"(",
|
|
99
|
-
|
|
96
|
+
g,
|
|
100
97
|
")"
|
|
101
98
|
] }) : null
|
|
102
99
|
] }),
|
|
103
|
-
p ||
|
|
100
|
+
p || f ? /* @__PURE__ */ a.jsx(te, { styles: {
|
|
101
|
+
title: o?.title,
|
|
102
|
+
description: o?.description
|
|
103
|
+
}, classNames: {
|
|
104
104
|
title: n?.title,
|
|
105
105
|
description: n?.description
|
|
106
|
+
}, graphTitle: p, graphDescription: f }) : null,
|
|
107
|
+
x || h ? /* @__PURE__ */ a.jsx(ee, { styles: {
|
|
108
|
+
footnote: o?.footnote,
|
|
109
|
+
source: o?.source
|
|
106
110
|
}, classNames: {
|
|
107
|
-
title: r?.title,
|
|
108
|
-
description: r?.description
|
|
109
|
-
}, graphTitle: p, graphDescription: d }) : null,
|
|
110
|
-
v || b ? /* @__PURE__ */ i.jsx(st, { styles: {
|
|
111
111
|
footnote: n?.footnote,
|
|
112
112
|
source: n?.source
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
t[42] !== B || t[43] !== D || t[44] !== j || t[45] !== $ || t[46] !== E || t[47] !== w ? (F = /* @__PURE__ */ i.jsx("div", { id: B, dir: D, className: j, style: $, "aria-label": E, children: w }), t[42] = B, t[43] = D, t[44] = j, t[45] = $, t[46] = E, t[47] = w, t[48] = F) : F = t[48];
|
|
122
|
-
let T;
|
|
123
|
-
return t[49] !== W || t[50] !== F ? (T = /* @__PURE__ */ i.jsx("div", { className: W, children: F }), t[49] = W, t[50] = F, t[51] = T) : T = t[51], T;
|
|
113
|
+
}, sources: x, footNote: h }) : null
|
|
114
|
+
] }), e[11] = s, e[12] = S, e[13] = n?.description, e[14] = n?.footnote, e[15] = n?.source, e[16] = n?.title, e[17] = u, e[18] = i, e[19] = h, e[20] = f, e[21] = p, e[22] = F, e[23] = c, e[24] = _, e[25] = l, e[26] = t?.locale, e[27] = t?.padZeros, e[28] = t?.precision, e[29] = t?.prefix, e[30] = t?.suffix, e[31] = x, e[32] = o?.description, e[33] = o?.footnote, e[34] = o?.source, e[35] = o?.title, e[36] = w, e[37] = Z, e[38] = g, e[39] = k) : k = e[39];
|
|
115
|
+
let N;
|
|
116
|
+
e[40] !== W || e[41] !== k ? (N = /* @__PURE__ */ a.jsx("div", { className: W, children: k }), e[40] = W, e[41] = k, e[42] = N) : N = e[42];
|
|
117
|
+
let $;
|
|
118
|
+
e[43] !== A || e[44] !== T || e[45] !== y || e[46] !== j || e[47] !== O || e[48] !== N ? ($ = /* @__PURE__ */ a.jsx("div", { id: A, dir: T, className: y, style: j, "aria-label": O, children: N }), e[43] = A, e[44] = T, e[45] = y, e[46] = j, e[47] = O, e[48] = N, e[49] = $) : $ = e[49];
|
|
119
|
+
let C;
|
|
120
|
+
return e[50] !== L || e[51] !== $ ? (C = /* @__PURE__ */ a.jsx("div", { className: L, children: $ }), e[50] = L, e[51] = $, e[52] = C) : C = e[52], C;
|
|
124
121
|
}
|
|
125
|
-
function
|
|
126
|
-
return
|
|
122
|
+
function ne(r) {
|
|
123
|
+
return r !== void 0;
|
|
127
124
|
}
|
|
128
|
-
function
|
|
129
|
-
return
|
|
125
|
+
function ae(r) {
|
|
126
|
+
return r.value;
|
|
130
127
|
}
|
|
131
|
-
function
|
|
132
|
-
return
|
|
128
|
+
function se(r) {
|
|
129
|
+
return r !== void 0;
|
|
133
130
|
}
|
|
134
|
-
function
|
|
135
|
-
return
|
|
131
|
+
function le(r) {
|
|
132
|
+
return r.value;
|
|
136
133
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
134
|
+
function ce(r) {
|
|
135
|
+
return r.value;
|
|
139
136
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
137
|
+
function pe(r) {
|
|
138
|
+
return r.value;
|
|
142
139
|
}
|
|
143
|
-
function
|
|
144
|
-
return typeof
|
|
140
|
+
function fe(r) {
|
|
141
|
+
return typeof r.value == "string";
|
|
145
142
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
143
|
+
function ue(r) {
|
|
144
|
+
return r !== void 0;
|
|
148
145
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
146
|
+
function me(r) {
|
|
147
|
+
return r.value;
|
|
151
148
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
149
|
+
function de(r) {
|
|
150
|
+
return r !== void 0;
|
|
154
151
|
}
|
|
155
|
-
function
|
|
156
|
-
return
|
|
152
|
+
function ge(r) {
|
|
153
|
+
return r.value;
|
|
157
154
|
}
|
|
158
|
-
function
|
|
159
|
-
return
|
|
155
|
+
function xe(r) {
|
|
156
|
+
return r.value;
|
|
160
157
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
158
|
+
function he(r) {
|
|
159
|
+
return r.value;
|
|
163
160
|
}
|
|
164
|
-
function
|
|
165
|
-
return typeof
|
|
161
|
+
function ye(r) {
|
|
162
|
+
return typeof r.value == "string";
|
|
166
163
|
}
|
|
167
164
|
export {
|
|
168
|
-
|
|
165
|
+
_e as StatCardFromData
|
|
169
166
|
};
|
|
170
167
|
//# sourceMappingURL=StatCardFromData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatCardFromData.js","sources":["../src/Components/Graphs/StatCard/StatCardFromData.tsx"],"sourcesContent":["import sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { H3 } from '@undp/design-system-react/Typography';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport {\r\n Languages,\r\n SourcesDataType,\r\n StatCardsFromDataSheetDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: StatCardsFromDataSheetDataType[];\r\n\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 /** Defines the layout for the cards */\r\n layout?: 'primary' | 'secondary';\r\n /** Font size of the main text */\r\n headingFontSize?: string;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Toggle the fill color of the main text. */\r\n textBackground?: boolean;\r\n /** Toggle is the text is center aligned. */\r\n centerAlign?: boolean;\r\n /** Vertical alignment of the main text */\r\n verticalAlign?: 'center' | 'top' | 'bottom';\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 // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Sub text next to main text */\r\n year?: number | string;\r\n /** Locale for number formatting. Must matches what `Intl.NumberFormat` expects. */\r\n locale?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n\r\n // Graph Parameters\r\n /** Data points that need to counted for aggregation. */\r\n countOnly?: (string | number)[];\r\n /** Method for aggregating the data to show as a single number in the card. If the data type of value in data object is string then only count is applicable. */\r\n aggregationMethod?: 'count' | 'max' | 'min' | 'average' | 'sum';\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\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 /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function StatCardFromData(props: Props) {\r\n const {\r\n year,\r\n data,\r\n graphTitle,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n footNote,\r\n padding,\r\n backgroundColor = false,\r\n graphID,\r\n aggregationMethod = 'count',\r\n language = 'en',\r\n countOnly,\r\n theme = 'light',\r\n ariaLabel,\r\n textBackground = false,\r\n headingFontSize = '4.375rem',\r\n centerAlign = false,\r\n verticalAlign = 'center',\r\n layout = 'primary',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n locale = 'en',\r\n naLabel = 'NA',\r\n } = props;\r\n\r\n return (\r\n <div className={`${theme || 'light'} w-full`}>\r\n <div\r\n id={graphID}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n className={cn(\r\n `${theme || 'light'} flex flex-col w-full box-border h-full ${\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 } ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n padding: backgroundColor ? padding || '1rem' : padding || 0,\r\n }}\r\n aria-label={\r\n ariaLabel ||\r\n `${graphTitle ? `The graph shows ${graphTitle}. ` : ''}This is a statistic card.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className={`flex flex-col w-full grow ${layout !== 'secondary' ? 'gap-12 justify-between' : 'gap-4 justify-center'}`}\r\n >\r\n {layout !== 'secondary' ? (\r\n <>\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 />\r\n ) : null}\r\n <div\r\n className={`flex flex-col justify-between grow ${\r\n verticalAlign === 'top'\r\n ? 'justify-start'\r\n : verticalAlign === 'bottom'\r\n ? 'justify-end'\r\n : 'justify-center'\r\n }`}\r\n >\r\n <H3\r\n marginBottom='base'\r\n className={`leading-none text-outline font-heading ${\r\n centerAlign\r\n ? 'text-center'\r\n : language === 'he' || language === 'ar'\r\n ? 'text-right'\r\n : 'text-left'\r\n } ${textBackground ? 'text-primary-black dark:text-primary-white' : 'transparent'}`}\r\n style={{\r\n fontSize: headingFontSize,\r\n letterSpacing: '0.05rem',\r\n }}\r\n >\r\n {data.filter(d => typeof d.value === 'string').length > 0 ||\r\n aggregationMethod === 'count'\r\n ? countOnly && countOnly?.length !== 0\r\n ? data.filter(d => countOnly.indexOf(d.value) !== -1).length\r\n : data.length\r\n : aggregationMethod === 'sum'\r\n ? numberFormattingFunction(\r\n sum(data.map(d => d.value)),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )\r\n : aggregationMethod === 'average'\r\n ? numberFormattingFunction(\r\n parseFloat((sum(data.map(d => d.value)) / data.length).toFixed(2)),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )\r\n : aggregationMethod === 'max'\r\n ? numberFormattingFunction(\r\n Math.max(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )\r\n : numberFormattingFunction(\r\n Math.min(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )}{' '}\r\n {year ? (\r\n <span\r\n className='text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400'\r\n style={{\r\n marginLeft: '-8px',\r\n lineHeight: '1.09',\r\n textShadow: 'none',\r\n WebkitTextStrokeWidth: 0,\r\n }}\r\n >\r\n ({year})\r\n </span>\r\n ) : null}\r\n </H3>\r\n </div>\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 />\r\n ) : null}\r\n </>\r\n ) : (\r\n <>\r\n <H3\r\n marginBottom={layout === 'secondary' ? 'none' : 'base'}\r\n className={`leading-none text-outline font-heading ${\r\n centerAlign\r\n ? 'text-center'\r\n : language === 'he' || language === 'ar'\r\n ? 'text-right'\r\n : 'text-left'\r\n } ${textBackground ? 'text-primary-black dark:text-primary-white' : 'transparent'}`}\r\n style={{\r\n fontSize: headingFontSize,\r\n letterSpacing: '0.05rem',\r\n }}\r\n >\r\n {data.filter(d => typeof d.value === 'string').length > 0 ||\r\n aggregationMethod === 'count'\r\n ? countOnly && countOnly?.length !== 0\r\n ? data.filter(d => countOnly.indexOf(d.value) !== -1).length\r\n : data.length\r\n : aggregationMethod === 'sum'\r\n ? numberFormattingFunction(\r\n sum(data.map(d => d.value)),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )\r\n : aggregationMethod === 'average'\r\n ? numberFormattingFunction(\r\n parseFloat((sum(data.map(d => d.value)) / data.length).toFixed(2)),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )\r\n : aggregationMethod === 'max'\r\n ? numberFormattingFunction(\r\n Math.max(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )\r\n : numberFormattingFunction(\r\n Math.min(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n precision,\r\n prefix,\r\n suffix,\r\n locale,\r\n )}{' '}\r\n {year ? (\r\n <span\r\n className='text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400'\r\n style={{\r\n marginLeft: '-8px',\r\n lineHeight: '1.09',\r\n textShadow: 'none',\r\n WebkitTextStrokeWidth: 0,\r\n }}\r\n >\r\n ({year})\r\n </span>\r\n ) : null}\r\n </H3>\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 />\r\n ) : null}\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 />\r\n ) : null}\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["StatCardFromData","props","$","_c","year","data","graphTitle","suffix","t0","sources","prefix","t1","graphDescription","footNote","padding","backgroundColor","t2","graphID","aggregationMethod","t3","language","t4","countOnly","theme","t5","ariaLabel","textBackground","t6","headingFontSize","t7","centerAlign","t8","verticalAlign","t9","layout","t10","styles","classNames","precision","t11","locale","t12","naLabel","t13","undefined","t14","t15","t16","t17","graphContainer","t18","cn","t19","t20","t21","t22","t23","t24","t25","description","footnote","source","title","jsxs","Fragment","jsx","GraphHeader","H3","fontSize","letterSpacing","filter","_temp","length","d","indexOf","value","numberFormattingFunction","sum","map","_temp2","parseFloat","_temp3","toFixed","Math","max","_temp4","_temp5","min","_temp6","_temp7","marginLeft","lineHeight","textShadow","WebkitTextStrokeWidth","GraphFooter","_temp8","d_7","_temp9","_temp0","_temp1","_temp10","_temp11","_temp12","t26","t27","t28","d_13","d_12","d_11","d_10","d_9","d_8","d_14","d_5","d_4","d_3","d_2","d_1","d_0","d_6"],"mappings":";;;;;;AAiFO,SAAAA,GAAAC,GAAA;AAAA,QAAAC,IAAAC,GAAAA,EAAA,EAAA,GACL;AAAA,IAAAC,MAAAA;AAAAA,IAAAC,MAAAA;AAAAA,IAAAC,YAAAA;AAAAA,IAAAC,QAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,QAAAC;AAAAA,IAAAC,kBAAAA;AAAAA,IAAAC,UAAAA;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,iBAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,mBAAAC;AAAAA,IAAAC,UAAAC;AAAAA,IAAAC,WAAAA;AAAAA,IAAAC,OAAAC;AAAAA,IAAAC,WAAAA;AAAAA,IAAAC,gBAAAC;AAAAA,IAAAC,iBAAAC;AAAAA,IAAAC,aAAAC;AAAAA,IAAAC,eAAAC;AAAAA,IAAA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S;AA3IvD,SAAA4C,GAAA0B,GAAA;AAAA,SA0IqCzC,EAACE;AAA4B;AA1IlE,SAAAW,GAAA6B,GAAA;AAAA,SA+HwC1C,MAAM7B;AAAS;AA/HvD,SAAAyC,GAAA+B,GAAA;AAAA,SA8HqC3C,EAACE;AAA4B;AA9HlE,SAAAM,GAAAoC,GAAA;AAAA,SAmHmD5C,EAACE;AAAM;AAnH1D,SAAAI,GAAAuC,GAAA;AAAA,SA0GqC7C,EAACE;AAAM;AA1G5C,SAAAJ,GAAAgD,GAAA;AAAA,SAmG6B,OAAO9C,EAACE,SAAW;AAAQ;"}
|
|
1
|
+
{"version":3,"file":"StatCardFromData.js","sources":["../src/Components/Graphs/StatCard/StatCardFromData.tsx"],"sourcesContent":["import sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { H3 } from '@undp/design-system-react/Typography';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport {\r\n Languages,\r\n SourcesDataType,\r\n StatCardsFromDataSheetDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n NumberFormatOptions,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: StatCardsFromDataSheetDataType[];\r\n\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 /** Defines the layout for the cards */\r\n layout?: 'primary' | 'secondary';\r\n /** Font size of the main text */\r\n headingFontSize?: string;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Toggle the fill color of the main text. */\r\n textBackground?: boolean;\r\n /** Toggle is the text is center aligned. */\r\n centerAlign?: boolean;\r\n /** Vertical alignment of the main text */\r\n verticalAlign?: 'center' | 'top' | 'bottom';\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 // Values and Ticks\r\n /** Sub text next to main text */\r\n year?: number | string;\r\n /** Configuration options for controlling number formatting, localization, prefixes/suffixes, precision, and zero padding. */\r\n numberDisplayOptions?: NumberFormatOptions;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n\r\n // Graph Parameters\r\n /** Data points that need to counted for aggregation. */\r\n countOnly?: (string | number)[];\r\n /** Method for aggregating the data to show as a single number in the card. If the data type of value in data object is string then only count is applicable. */\r\n aggregationMethod?: 'count' | 'max' | 'min' | 'average' | 'sum';\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 /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function StatCardFromData(props: Props) {\r\n const {\r\n year,\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n footNote,\r\n padding,\r\n backgroundColor = false,\r\n graphID,\r\n aggregationMethod = 'count',\r\n language = 'en',\r\n countOnly,\r\n theme = 'light',\r\n ariaLabel,\r\n textBackground = false,\r\n headingFontSize = '4.375rem',\r\n centerAlign = false,\r\n verticalAlign = 'center',\r\n layout = 'primary',\r\n styles,\r\n classNames,\r\n naLabel = 'NA',\r\n numberDisplayOptions,\r\n } = props;\r\n\r\n return (\r\n <div className={`${theme || 'light'} w-full`}>\r\n <div\r\n id={graphID}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n className={cn(\r\n `${theme || 'light'} flex flex-col w-full box-border h-full ${\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 } ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n padding: backgroundColor ? padding || '1rem' : padding || 0,\r\n }}\r\n aria-label={\r\n ariaLabel ||\r\n `${graphTitle ? `The graph shows ${graphTitle}. ` : ''}This is a statistic card.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className={`flex flex-col w-full grow ${layout !== 'secondary' ? 'gap-12 justify-between' : 'gap-4 justify-center'}`}\r\n >\r\n {layout !== 'secondary' ? (\r\n <>\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 />\r\n ) : null}\r\n <div\r\n className={`flex flex-col justify-between grow ${\r\n verticalAlign === 'top'\r\n ? 'justify-start'\r\n : verticalAlign === 'bottom'\r\n ? 'justify-end'\r\n : 'justify-center'\r\n }`}\r\n >\r\n <H3\r\n marginBottom='base'\r\n className={`leading-none text-outline font-heading ${\r\n centerAlign\r\n ? 'text-center'\r\n : language === 'he' || language === 'ar'\r\n ? 'text-right'\r\n : 'text-left'\r\n } ${textBackground ? 'text-primary-black dark:text-primary-white' : 'transparent'}`}\r\n style={{\r\n fontSize: headingFontSize,\r\n letterSpacing: '0.05rem',\r\n }}\r\n >\r\n {data.filter(d => typeof d.value === 'string').length > 0 ||\r\n aggregationMethod === 'count'\r\n ? countOnly && countOnly?.length !== 0\r\n ? data.filter(d => countOnly.indexOf(d.value) !== -1).length\r\n : data.length\r\n : aggregationMethod === 'sum'\r\n ? numberFormattingFunction(\r\n sum(data.map(d => d.value)),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )\r\n : aggregationMethod === 'average'\r\n ? numberFormattingFunction(\r\n parseFloat((sum(data.map(d => d.value)) / data.length).toFixed(2)),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )\r\n : aggregationMethod === 'max'\r\n ? numberFormattingFunction(\r\n Math.max(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )\r\n : numberFormattingFunction(\r\n Math.min(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )}{' '}\r\n {year ? (\r\n <span\r\n className='text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400'\r\n style={{\r\n marginLeft: '-8px',\r\n lineHeight: '1.09',\r\n textShadow: 'none',\r\n WebkitTextStrokeWidth: 0,\r\n }}\r\n >\r\n ({year})\r\n </span>\r\n ) : null}\r\n </H3>\r\n </div>\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 />\r\n ) : null}\r\n </>\r\n ) : (\r\n <>\r\n <H3\r\n marginBottom={layout === 'secondary' ? 'none' : 'base'}\r\n className={`leading-none text-outline font-heading ${\r\n centerAlign\r\n ? 'text-center'\r\n : language === 'he' || language === 'ar'\r\n ? 'text-right'\r\n : 'text-left'\r\n } ${textBackground ? 'text-primary-black dark:text-primary-white' : 'transparent'}`}\r\n style={{\r\n fontSize: headingFontSize,\r\n letterSpacing: '0.05rem',\r\n }}\r\n >\r\n {data.filter(d => typeof d.value === 'string').length > 0 ||\r\n aggregationMethod === 'count'\r\n ? countOnly && countOnly?.length !== 0\r\n ? data.filter(d => countOnly.indexOf(d.value) !== -1).length\r\n : data.length\r\n : aggregationMethod === 'sum'\r\n ? numberFormattingFunction(\r\n sum(data.map(d => d.value)),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )\r\n : aggregationMethod === 'average'\r\n ? numberFormattingFunction(\r\n parseFloat((sum(data.map(d => d.value)) / data.length).toFixed(2)),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )\r\n : aggregationMethod === 'max'\r\n ? numberFormattingFunction(\r\n Math.max(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )\r\n : numberFormattingFunction(\r\n Math.min(\r\n ...data\r\n .map(d => d.value as number | undefined)\r\n .filter(d => d !== undefined),\r\n ),\r\n naLabel,\r\n numberDisplayOptions?.precision ?? 2,\r\n numberDisplayOptions?.prefix,\r\n numberDisplayOptions?.suffix,\r\n numberDisplayOptions?.locale,\r\n numberDisplayOptions?.padZeros,\r\n )}{' '}\r\n {year ? (\r\n <span\r\n className='text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400'\r\n style={{\r\n marginLeft: '-8px',\r\n lineHeight: '1.09',\r\n textShadow: 'none',\r\n WebkitTextStrokeWidth: 0,\r\n }}\r\n >\r\n ({year})\r\n </span>\r\n ) : null}\r\n </H3>\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 />\r\n ) : null}\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 />\r\n ) : null}\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["StatCardFromData","props","$","_c","year","data","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","t0","graphID","aggregationMethod","t1","language","t2","countOnly","theme","t3","ariaLabel","textBackground","t4","headingFontSize","t5","centerAlign","t6","verticalAlign","t7","layout","t8","styles","classNames","naLabel","t9","numberDisplayOptions","undefined","t10","t11","t12","t13","graphContainer","t14","cn","t15","t16","t17","t18","t19","t20","t21","description","footnote","source","title","locale","padZeros","precision","prefix","suffix","jsxs","Fragment","jsx","GraphHeader","H3","fontSize","letterSpacing","filter","_temp","length","d","indexOf","value","numberFormattingFunction","sum","map","_temp2","parseFloat","_temp3","toFixed","Math","max","_temp4","_temp5","min","_temp6","_temp7","marginLeft","lineHeight","textShadow","WebkitTextStrokeWidth","GraphFooter","_temp8","d_7","_temp9","_temp0","_temp1","_temp10","_temp11","_temp12","t22","t23","t24","d_13","d_12","d_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AA;AAAA,SA6HqC3C,EAACE;AAA4B;AA7HlE,SAAAM,GAAAoC,GAAA;AAAA,SAiHmD5C,EAACE;AAAM;AAjH1D,SAAAI,GAAAuC,GAAA;AAAA,SAuGqC7C,EAACE;AAAM;AAvG5C,SAAAJ,GAAAgD,GAAA;AAAA,SAgG6B,OAAO9C,EAACE,SAAW;AAAQ;"}
|
package/dist/StripChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-D4pAp7u0.cjs"),B=require("react"),Zt=require("./index-DQA8q5sC.cjs"),_t=require("./index-Cno4Q0YE.cjs"),te=require("./Tooltip-Hr46paWP.cjs"),z=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Lt=require("./numberFormattingFunction-Cn9R7CM9.cjs"),x=require("./Colors.cjs"),ee=require("./DetailsModal-jmmKRMRM.cjs"),ie=require("./linear-CgUCbw9F.cjs"),rt=require("./proxy-CqH8m8IQ.cjs"),oe=require("./use-in-view-dnRv_qqF.cjs"),ne=require("./index-FXfr51ZM.cjs"),Kt=require("./uniqBy-O05lp2S5.cjs"),Qt=require("./GraphContainer-Cul9b74X.cjs"),le=require("./EmptyState-CFmiFPHz.cjs"),ae=require("./ColorLegendWithMouseOver.cjs"),se=require("./GraphFooter.cjs"),ce=require("./GraphHeader.cjs");function re(e,t){if(e<2)return[];const o=t/(e-1);return Array.from({length:e},(R,y)=>y*o)}function ue(e){const t=l.compilerRuntimeExports.c(102),{data:o,width:R,height:y,colors:n,colorDomain:a,radius:u,leftMargin:V,rightMargin:bt,topMargin:dt,bottomMargin:kt,tooltip:xt,onSeriesMouseOver:lt,highlightedDataPoints:r,selectedColor:at,minValue:D,maxValue:N,onSeriesMouseClick:J,noOfTicks:st,prefix:K,suffix:ct,stripType:j,highlightColor:v,dotOpacity:Ot,resetSelectionOnDoubleClick:Q,detailsOnClick:O,styles:p,classNames:w,valueColor:f,animate:m,dimmedOpacity:et,precision:it,customLayers:C,showDataMinMax:jt,locale:Z}=e,wt=V===void 0?20:V,Ct=bt===void 0?20:bt,Mt=dt===void 0?10:dt,Vt=kt===void 0?10:kt,Rt=B.useRef(null);let ut;t[0]!==m.amount||t[1]!==m.once?(ut={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=ut):ut=t[2];const M=oe.useInView(Rt,ut),[pt,It]=B.useState(void 0),[s,d]=B.useState(void 0),[ht,Et]=B.useState(void 0),[gt,yt]=B.useState(void 0);let vt;t[3]!==Vt||t[4]!==wt||t[5]!==Ct||t[6]!==Mt?(vt={top:Mt,bottom:Vt,left:wt,right:Ct},t[3]=Vt,t[4]=wt,t[5]=Ct,t[6]=Mt,t[7]=vt):vt=t[7];const h=vt,X=R-h.left-h.right,Y=y-h.top-h.bottom;let S,$,b,I,q,A,T,F,U,L,P,g;if(t[8]!==m.duration||t[9]!==w?.graphObjectValues||t[10]!==w?.yAxis?.labels||t[11]!==a||t[12]!==n||t[13]!==C||t[14]!==o||t[15]!==O||t[16]!==et||t[17]!==Ot||t[18]!==Y||t[19]!==X||t[20]!==y||t[21]!==v||t[22]!==r||t[23]!==M||t[24]!==Z||t[25]!==h.left||t[26]!==h.top||t[27]!==N||t[28]!==D||t[29]!==s||t[30]!==st||t[31]!==J||t[32]!==lt||t[33]!==it||t[34]!==K||t[35]!==u||t[36]!==Q||t[37]!==at||t[38]!==jt||t[39]!==j||t[40]!==p?.graphObjectValues||t[41]!==p?.yAxis?.labels||t[42]!==ct||t[43]!==f||t[44]!==R){const Dt=o.map(Ue);let mt;t[57]!==r?(mt=i=>{const c=(r||[]).indexOf(i.label);return c===-1?1/0:c},t[57]=r,t[58]=mt):mt=t[58];const Nt=_t.orderBy(Dt,[mt],["desc"]);let ot;t[59]!==o||t[60]!==N?(ot=z.checkIfNullOrUndefined(N)?Math.max(...o.filter(Fe).map(Te))<0?0:Math.max(...o.filter(Ae).map(qe)):N,t[59]=o,t[60]=N,t[61]=ot):ot=t[61];const Pt=ot;let nt;t[62]!==o||t[63]!==D?(nt=z.checkIfNullOrUndefined(D)?Math.min(...o.filter($e).map(Se))>=0?0:Math.min(...o.filter(Ne).map(De)):D,t[62]=o,t[63]=D,t[64]=nt):nt=t[64];const Ht=nt,tt=ie.linear().domain([Ht,Pt]).range([Y,0]).nice(),St=re(st,Y);$=rt.motion.svg,I=`${R}px`,q=`${y}px`,A=`0 0 ${R} ${y}`,T="ltr",F=Rt,g=`translate(${h.left},${h.top})`,t[65]!==C?(b=C.filter(Re).map(ke),t[65]=C,t[66]=b):b=t[66],S=ne.AnimatePresence,U=Nt.map(i=>l.jsxRuntimeExports.jsxs(rt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:X/2,y:tt(0)},whileInView:{x:X/2,y:tt(i.position),opacity:at?i.color&&n[a.indexOf(i.color)]===at?.95:et:r?r.indexOf(i.label)!==-1?.95:et:Ot,transition:{duration:m.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:c=>{It(i),yt(c.clientY),Et(c.clientX),lt?.(i)},onClick:()=>{(J||O)&&(Zt.isEqual(s,i)&&Q?(d(void 0),J?.(void 0)):(d(i),J?.(i)))},onMouseMove:c=>{It(i),yt(c.clientY),Et(c.clientX)},onMouseLeave:()=>{It(void 0),Et(void 0),yt(void 0),lt?.(void 0)},children:[j==="dot"?l.jsxRuntimeExports.jsx(rt.motion.circle,{cy:0,cx:0,variants:{initial:{fill:v&&r?r.indexOf(i.label)!==-1?v:o.filter(Ee).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(Ie).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray},whileInView:{fill:v&&r?r.indexOf(i.label)!==-1?v:o.filter(Ve).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(Me).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},r:u}):l.jsxRuntimeExports.jsx(rt.motion.rect,{y:-1,height:2,variants:{initial:{x:0-u,width:u*2,fill:v&&r?r.indexOf(i.label)!==-1?v:o.filter(Ce).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(we).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray},whileInView:{x:0-u,width:u*2,fill:v&&r?r.indexOf(i.label)!==-1?v:o.filter(je).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(be).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}}}),r&&r.indexOf(i.label)!==-1?l.jsxRuntimeExports.jsx(rt.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+u+3,fill:f||(v&&r?r.indexOf(i.label)!==-1?v:o.filter(Oe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(ve).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray)},whileInView:{opacity:1,x:0+u+3,fill:f||(v&&r?r.indexOf(i.label)!==-1?v:o.filter(ye).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(ge).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray),transition:{duration:m.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{textAnchor:"start",...p?.graphObjectValues||{}},className:l.mo("graph-value text-sm font-bold",w?.graphObjectValues),children:Lt.numberFormattingFunction(i.position,void 0,it,K,ct,Z)}):null]},i.label)),L=jt?[Math.min(...o.filter(he).map(xe)),Math.max(...o.filter(de).map(me))].map((i,c)=>l.jsxRuntimeExports.jsx(rt.motion.g,{variants:{initial:{opacity:0,x:X/2,y:tt(0)},whileInView:{x:X/2,y:tt(i),opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:l.jsxRuntimeExports.jsx(rt.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+u+3},whileInView:{opacity:1,x:0+u+3,transition:{duration:m.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{textAnchor:"start",...p?.graphObjectValues||{}},className:l.mo("graph-value text-sm text-primary-gray-550 dark:text-primary-gray-200",w?.graphObjectValues),children:Lt.numberFormattingFunction(i,void 0,it,K,ct,Z)},c)},c)):null,P=St.map((i,c)=>l.jsxRuntimeExports.jsx("text",{y:i,x:X/2+u+5,style:{textAnchor:"start",...p?.yAxis?.labels||{}},className:l.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",w?.yAxis?.labels),children:Lt.numberFormattingFunction(tt.invert(i),void 0,it,K,ct,Z)},c)),t[8]=m.duration,t[9]=w?.graphObjectValues,t[10]=w?.yAxis?.labels,t[11]=a,t[12]=n,t[13]=C,t[14]=o,t[15]=O,t[16]=et,t[17]=Ot,t[18]=Y,t[19]=X,t[20]=y,t[21]=v,t[22]=r,t[23]=M,t[24]=Z,t[25]=h.left,t[26]=h.top,t[27]=N,t[28]=D,t[29]=s,t[30]=st,t[31]=J,t[32]=lt,t[33]=it,t[34]=K,t[35]=u,t[36]=Q,t[37]=at,t[38]=jt,t[39]=j,t[40]=p?.graphObjectValues,t[41]=p?.yAxis?.labels,t[42]=ct,t[43]=f,t[44]=R,t[45]=S,t[46]=$,t[47]=b,t[48]=I,t[49]=q,t[50]=A,t[51]=T,t[52]=F,t[53]=U,t[54]=L,t[55]=P,t[56]=g}else S=t[45],$=t[46],b=t[47],I=t[48],q=t[49],A=t[50],T=t[51],F=t[52],U=t[53],L=t[54],P=t[55],g=t[56];let H;t[67]!==S||t[68]!==U||t[69]!==L||t[70]!==P?(H=l.jsxRuntimeExports.jsxs(S,{children:[U,L,P]}),t[67]=S,t[68]=U,t[69]=L,t[70]=P,t[71]=H):H=t[71];let _;t[72]!==C?(_=C.filter(fe).map(pe),t[72]=C,t[73]=_):_=t[73];let E;t[74]!==b||t[75]!==H||t[76]!==_||t[77]!==g?(E=l.jsxRuntimeExports.jsxs("g",{transform:g,children:[b,H,_]}),t[74]=b,t[75]=H,t[76]=_,t[77]=g,t[78]=E):E=t[78];let G;t[79]!==$||t[80]!==I||t[81]!==q||t[82]!==A||t[83]!==T||t[84]!==F||t[85]!==E?(G=l.jsxRuntimeExports.jsx($,{width:I,height:q,viewBox:A,direction:T,ref:F,children:E}),t[79]=$,t[80]=I,t[81]=q,t[82]=A,t[83]=T,t[84]=F,t[85]=E,t[86]=G):G=t[86];let W;t[87]!==w?.tooltip||t[88]!==ht||t[89]!==gt||t[90]!==pt||t[91]!==p?.tooltip||t[92]!==xt?(W=pt&&xt&&ht&>?l.jsxRuntimeExports.jsx(te.Tooltip,{data:pt,body:xt,xPos:ht,yPos:gt,backgroundStyle:p?.tooltip,className:w?.tooltip}):null,t[87]=w?.tooltip,t[88]=ht,t[89]=gt,t[90]=pt,t[91]=p?.tooltip,t[92]=xt,t[93]=W):W=t[93];let k;t[94]!==w?.modal||t[95]!==O||t[96]!==s?(k=O&&s!==void 0?l.jsxRuntimeExports.jsx(ee.DetailsModal,{body:O,data:s,setData:d,className:w?.modal}):null,t[94]=w?.modal,t[95]=O,t[96]=s,t[97]=k):k=t[97];let ft;return t[98]!==G||t[99]!==W||t[100]!==k?(ft=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[G,W,k]}),t[98]=G,t[99]=W,t[100]=k,t[101]=ft):ft=t[101],ft}function pe(e){return e.layer}function fe(e){return e.position==="after"}function me(e){return e.position}function de(e){return!z.checkIfNullOrUndefined(e.position)}function xe(e){return e.position}function he(e){return!z.checkIfNullOrUndefined(e.position)}function ge(e){return e.color}function ye(e){return e.color}function ve(e){return e.color}function Oe(e){return e.color}function be(e){return e.color}function je(e){return e.color}function we(e){return e.color}function Ce(e){return e.color}function Me(e){return e.color}function Ve(e){return e.color}function Ie(e){return e.color}function Ee(e){return e.color}function ke(e){return e.layer}function Re(e){return e.position==="before"}function De(e){return e.position}function Ne(e){return!z.checkIfNullOrUndefined(e.position)}function Se(e){return e.position}function $e(e){return!z.checkIfNullOrUndefined(e.position)}function qe(e){return e.position}function Ae(e){return!z.checkIfNullOrUndefined(e.position)}function Te(e){return e.position}function Fe(e){return!z.checkIfNullOrUndefined(e.position)}function Ue(e,t){return{...e,id:`${t}`}}function Le(e){const t=l.compilerRuntimeExports.c(102),{data:o,width:R,height:y,colors:n,colorDomain:a,radius:u,leftMargin:V,rightMargin:bt,topMargin:dt,bottomMargin:kt,tooltip:xt,onSeriesMouseOver:lt,highlightedDataPoints:r,selectedColor:at,minValue:D,maxValue:N,onSeriesMouseClick:J,prefix:st,suffix:K,stripType:ct,highlightColor:j,dotOpacity:v,resetSelectionOnDoubleClick:Ot,detailsOnClick:Q,styles:O,classNames:p,valueColor:w,animate:f,noOfTicks:m,dimmedOpacity:et,precision:it,customLayers:C,showDataMinMax:jt,locale:Z}=e,wt=V===void 0?5:V,Ct=bt===void 0?5:bt,Mt=dt===void 0?10:dt,Vt=kt===void 0?10:kt,Rt=B.useRef(null);let ut;t[0]!==f.amount||t[1]!==f.once?(ut={once:f.once,amount:f.amount},t[0]=f.amount,t[1]=f.once,t[2]=ut):ut=t[2];const M=oe.useInView(Rt,ut),[pt,It]=B.useState(void 0),[s,d]=B.useState(void 0),[ht,Et]=B.useState(void 0),[gt,yt]=B.useState(void 0);let vt;t[3]!==Vt||t[4]!==wt||t[5]!==Ct||t[6]!==Mt?(vt={top:Mt,bottom:Vt,left:wt,right:Ct},t[3]=Vt,t[4]=wt,t[5]=Ct,t[6]=Mt,t[7]=vt):vt=t[7];const h=vt,X=R-h.left-h.right,Y=y-h.top-h.bottom;let S,$,b,I,q,A,T,F,U,L,P,g;if(t[8]!==f.duration||t[9]!==p?.graphObjectValues||t[10]!==p?.xAxis?.labels||t[11]!==a||t[12]!==n||t[13]!==C||t[14]!==o||t[15]!==Q||t[16]!==et||t[17]!==v||t[18]!==Y||t[19]!==X||t[20]!==y||t[21]!==j||t[22]!==r||t[23]!==M||t[24]!==Z||t[25]!==h.left||t[26]!==h.top||t[27]!==N||t[28]!==D||t[29]!==s||t[30]!==m||t[31]!==J||t[32]!==lt||t[33]!==it||t[34]!==st||t[35]!==u||t[36]!==Ot||t[37]!==at||t[38]!==jt||t[39]!==ct||t[40]!==O?.graphObjectValues||t[41]!==O?.xAxis?.labels||t[42]!==K||t[43]!==w||t[44]!==R){const Dt=o.map(xi);let mt;t[57]!==r?(mt=i=>{const c=(r||[]).indexOf(i.label);return c===-1?1/0:c},t[57]=r,t[58]=mt):mt=t[58];const Nt=_t.orderBy(Dt,[mt],["desc"]);let ot;t[59]!==o||t[60]!==N?(ot=z.checkIfNullOrUndefined(N)?Math.max(...o.filter(di).map(mi))<0?0:Math.max(...o.filter(fi).map(pi)):N,t[59]=o,t[60]=N,t[61]=ot):ot=t[61];const Pt=ot;let nt;t[62]!==o||t[63]!==D?(nt=z.checkIfNullOrUndefined(D)?Math.min(...o.filter(ui).map(ci))>=0?0:Math.min(...o.filter(si).map(ai)):D,t[62]=o,t[63]=D,t[64]=nt):nt=t[64];const Ht=nt,tt=ie.linear().domain([Ht,Pt]).range([0,X]).nice(),St=re(m,X);$=rt.motion.svg,I=`${R}px`,q=`${y}px`,A=`0 0 ${R} ${y}`,T="ltr",F=Rt,g=`translate(${h.left},${h.top})`,t[65]!==C?(b=C.filter(li).map(ri),t[65]=C,t[66]=b):b=t[66],S=ne.AnimatePresence,U=Nt.map(i=>l.jsxRuntimeExports.jsxs(rt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:tt(0),y:Y/2},whileInView:{x:tt(i.position),y:Y/2,opacity:at?i.color&&n[a.indexOf(i.color)]===at?.95:et:r?r.indexOf(i.label)!==-1?.95:et:v,transition:{duration:f.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:f.duration}},onMouseEnter:c=>{It(i),yt(c.clientY),Et(c.clientX),lt?.(i)},onClick:()=>{(J||Q)&&(Zt.isEqual(s,i)&&Ot?(d(void 0),J?.(void 0)):(d(i),J?.(i)))},onMouseMove:c=>{It(i),yt(c.clientY),Et(c.clientX)},onMouseLeave:()=>{It(void 0),Et(void 0),yt(void 0),lt?.(void 0)},children:[ct==="dot"?l.jsxRuntimeExports.jsx(rt.motion.circle,{cy:0,cx:0,variants:{initial:{fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(ni).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(oi).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray},whileInView:{fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(ii).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(ei).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray,transition:{duration:f.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:f.duration}},r:u}):l.jsxRuntimeExports.jsx(rt.motion.rect,{x:-1,width:2,variants:{initial:{y:0-u,height:u*2,fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(ti).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(_e).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray},whileInView:{y:0-u,height:u*2,fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(Ze).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(Qe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray,transition:{duration:f.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:f.duration}}}),r&&r.indexOf(i.label)!==-1?l.jsxRuntimeExports.jsx(rt.motion.text,{x:0,variants:{initial:{opacity:0,y:0-u-5,fill:w||(j&&r?r.indexOf(i.label)!==-1?j:o.filter(Ke).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(Je).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray)},whileInView:{opacity:1,y:0-u-5,fill:w||(j&&r?r.indexOf(i.label)!==-1?j:o.filter(ze).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray:o.filter(Be).length===0?n[0]:i.color?n[a.indexOf(i.color)]:x.Colors.gray),transition:{duration:f.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:f.duration}},style:{textAnchor:"middle",...O?.graphObjectValues||{}},className:l.mo("graph-value text-sm font-bold",p?.graphObjectValues),children:Lt.numberFormattingFunction(i.position,void 0,it,st,K,Z)}):null]},i.label)),L=jt?[Math.min(...o.filter(Ye).map(Xe)),Math.max(...o.filter(We).map(Ge))].map((i,c)=>l.jsxRuntimeExports.jsx(rt.motion.g,{variants:{initial:{opacity:0,x:tt(0),y:Y/2},whileInView:{x:tt(i),y:Y/2,opacity:1,transition:{duration:f.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:f.duration}},children:l.jsxRuntimeExports.jsx(rt.motion.text,{x:0,variants:{initial:{opacity:0,y:0-u-5},whileInView:{opacity:1,y:0-u-5,transition:{duration:f.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:f.duration}},style:{textAnchor:"middle",...O?.graphObjectValues||{}},className:l.mo("graph-value text-sm text-primary-gray-550 dark:text-primary-gray-200",p?.graphObjectValues),children:Lt.numberFormattingFunction(i,void 0,it,st,K,Z)})},c)):null,P=St.map((i,c)=>l.jsxRuntimeExports.jsx("text",{x:i,y:Y/2+u,style:{textAnchor:c===0?"start":c===St.length-1?"end":"middle",...O?.xAxis?.labels||{}},className:l.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",p?.xAxis?.labels),dy:"1em",children:Lt.numberFormattingFunction(tt.invert(i),void 0,it,st,K,Z)},c)),t[8]=f.duration,t[9]=p?.graphObjectValues,t[10]=p?.xAxis?.labels,t[11]=a,t[12]=n,t[13]=C,t[14]=o,t[15]=Q,t[16]=et,t[17]=v,t[18]=Y,t[19]=X,t[20]=y,t[21]=j,t[22]=r,t[23]=M,t[24]=Z,t[25]=h.left,t[26]=h.top,t[27]=N,t[28]=D,t[29]=s,t[30]=m,t[31]=J,t[32]=lt,t[33]=it,t[34]=st,t[35]=u,t[36]=Ot,t[37]=at,t[38]=jt,t[39]=ct,t[40]=O?.graphObjectValues,t[41]=O?.xAxis?.labels,t[42]=K,t[43]=w,t[44]=R,t[45]=S,t[46]=$,t[47]=b,t[48]=I,t[49]=q,t[50]=A,t[51]=T,t[52]=F,t[53]=U,t[54]=L,t[55]=P,t[56]=g}else S=t[45],$=t[46],b=t[47],I=t[48],q=t[49],A=t[50],T=t[51],F=t[52],U=t[53],L=t[54],P=t[55],g=t[56];let H;t[67]!==S||t[68]!==U||t[69]!==L||t[70]!==P?(H=l.jsxRuntimeExports.jsxs(S,{children:[U,L,P]}),t[67]=S,t[68]=U,t[69]=L,t[70]=P,t[71]=H):H=t[71];let _;t[72]!==C?(_=C.filter(He).map(Pe),t[72]=C,t[73]=_):_=t[73];let E;t[74]!==b||t[75]!==H||t[76]!==_||t[77]!==g?(E=l.jsxRuntimeExports.jsxs("g",{transform:g,children:[b,H,_]}),t[74]=b,t[75]=H,t[76]=_,t[77]=g,t[78]=E):E=t[78];let G;t[79]!==$||t[80]!==I||t[81]!==q||t[82]!==A||t[83]!==T||t[84]!==F||t[85]!==E?(G=l.jsxRuntimeExports.jsx($,{width:I,height:q,viewBox:A,direction:T,ref:F,children:E}),t[79]=$,t[80]=I,t[81]=q,t[82]=A,t[83]=T,t[84]=F,t[85]=E,t[86]=G):G=t[86];let W;t[87]!==p?.tooltip||t[88]!==ht||t[89]!==gt||t[90]!==pt||t[91]!==O?.tooltip||t[92]!==xt?(W=pt&&xt&&ht&>?l.jsxRuntimeExports.jsx(te.Tooltip,{data:pt,body:xt,xPos:ht,yPos:gt,backgroundStyle:O?.tooltip,className:p?.tooltip}):null,t[87]=p?.tooltip,t[88]=ht,t[89]=gt,t[90]=pt,t[91]=O?.tooltip,t[92]=xt,t[93]=W):W=t[93];let k;t[94]!==p?.modal||t[95]!==Q||t[96]!==s?(k=Q&&s!==void 0?l.jsxRuntimeExports.jsx(ee.DetailsModal,{body:Q,data:s,setData:d,className:p?.modal}):null,t[94]=p?.modal,t[95]=Q,t[96]=s,t[97]=k):k=t[97];let ft;return t[98]!==G||t[99]!==W||t[100]!==k?(ft=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[G,W,k]}),t[98]=G,t[99]=W,t[100]=k,t[101]=ft):ft=t[101],ft}function Pe(e){return e.layer}function He(e){return e.position==="after"}function Ge(e){return e.position}function We(e){return!z.checkIfNullOrUndefined(e.position)}function Xe(e){return e.position}function Ye(e){return!z.checkIfNullOrUndefined(e.position)}function Be(e){return e.color}function ze(e){return e.color}function Je(e){return e.color}function Ke(e){return e.color}function Qe(e){return e.color}function Ze(e){return e.color}function _e(e){return e.color}function ti(e){return e.color}function ei(e){return e.color}function ii(e){return e.color}function oi(e){return e.color}function ni(e){return e.color}function ri(e){return e.layer}function li(e){return e.position==="before"}function ai(e){return e.position}function si(e){return!z.checkIfNullOrUndefined(e.position)}function ci(e){return e.position}function ui(e){return!z.checkIfNullOrUndefined(e.position)}function pi(e){return e.position}function fi(e){return!z.checkIfNullOrUndefined(e.position)}function mi(e){return e.position}function di(e){return!z.checkIfNullOrUndefined(e.position)}function xi(e,t){return{...e,id:`${t}`}}function hi(e){const t=l.compilerRuntimeExports.c(92),{data:o,graphTitle:R,colors:y,sources:n,graphDescription:a,height:u,width:V,footNote:bt,colorDomain:dt,colorLegendTitle:kt,radius:xt,padding:lt,backgroundColor:r,leftMargin:at,rightMargin:D,topMargin:N,bottomMargin:J,tooltip:st,relativeHeight:K,onSeriesMouseOver:ct,showColorScale:j,highlightedDataPoints:v,graphID:Ot,minValue:Q,maxValue:O,onSeriesMouseClick:p,noOfTicks:w,graphDownload:f,dataDownload:m,prefix:et,suffix:it,stripType:C,language:jt,highlightColor:Z,dotOpacity:wt,showNAColor:Ct,minHeight:Mt,theme:Vt,ariaLabel:Rt,valueColor:ut,resetSelectionOnDoubleClick:M,detailsOnClick:pt,orientation:It,styles:s,classNames:d,animate:ht,dimmedOpacity:Et,precision:gt,customLayers:yt,showDataMinMax:vt,locale:h}=e,X=xt===void 0?5:xt,Y=r===void 0?!1:r,S=j===void 0?!0:j,$=w===void 0?2:w,b=f===void 0?!1:f,I=m===void 0?!1:m,q=et===void 0?"":et,A=it===void 0?"":it,T=C===void 0?"dot":C,F=jt===void 0?"en":jt,U=wt===void 0?.3:wt,L=Ct===void 0?!0:Ct,P=Mt===void 0?0:Mt,g=Vt===void 0?"light":Vt,H=M===void 0?!0:M,_=It===void 0?"vertical":It,E=ht===void 0?!1:ht,G=Et===void 0?.3:Et,W=gt===void 0?2:gt;let k;t[0]!==yt?(k=yt===void 0?[]:yt,t[0]=yt,t[1]=k):k=t[1];const ft=k,Dt=vt===void 0?!1:vt,mt=h===void 0?"en":h,Nt=_==="horizontal"?Le:ue,[ot,Pt]=B.useState(0),[nt,Ht]=B.useState(0),[tt,St]=B.useState(void 0),i=B.useRef(null),c=B.useRef(null);let Gt,Wt;t[2]===Symbol.for("react.memo_cache_sentinel")?(Gt=()=>{const zt=new ResizeObserver(Jt=>{Pt(Jt[0].target.clientWidth||620),Ht(Jt[0].target.clientHeight||480)});return i.current&&zt.observe(i.current),()=>zt.disconnect()},Wt=[],t[2]=Gt,t[3]=Wt):(Gt=t[2],Wt=t[3]),B.useEffect(Gt,Wt);const Yt=d?.graphContainer,Bt=s?.graphContainer;let $t;t[4]!==d?.description||t[5]!==d?.title||t[6]!==o||t[7]!==I||t[8]!==a||t[9]!==b||t[10]!==R||t[11]!==s?.description||t[12]!==s?.title||t[13]!==V?($t=R||a||b||I?l.jsxRuntimeExports.jsx(ce.GraphHeader,{styles:{title:s?.title,description:s?.description},classNames:{title:d?.title,description:d?.description},graphTitle:R,graphDescription:a,width:V,graphDownload:b?c:void 0,dataDownload:I?o.map(Ci).filter(wi).length>0?o.map(ji).filter(bi):o.filter(Oi):null}):null,t[4]=d?.description,t[5]=d?.title,t[6]=o,t[7]=I,t[8]=a,t[9]=b,t[10]=R,t[11]=s?.description,t[12]=s?.title,t[13]=V,t[14]=$t):$t=t[14];let qt;t[15]!==d?.colorLegend||t[16]!==dt||t[17]!==kt||t[18]!==y||t[19]!==o||t[20]!==S||t[21]!==L||t[22]!==g||t[23]!==V?(qt=S!==!1&&o.filter(vi).length!==0&&o.length>0?l.jsxRuntimeExports.jsx(ae.ColorLegendWithMouseOver,{width:V,colorLegendTitle:kt,colors:y||x.Colors[g].categoricalColors.colors,colorDomain:dt||Kt.uniqBy(o,"color",!0),setSelectedColor:St,showNAColor:L,className:d?.colorLegend}):null,t[15]=d?.colorLegend,t[16]=dt,t[17]=kt,t[18]=y,t[19]=o,t[20]=S,t[21]=L,t[22]=g,t[23]=V,t[24]=qt):qt=t[24];let At;t[25]!==o.length?(At=o.length===0&&l.jsxRuntimeExports.jsx(le.EmptyState,{}),t[25]=o.length,t[26]=At):At=t[26];let Tt;t[27]!==Nt||t[28]!==E||t[29]!==J||t[30]!==d||t[31]!==dt||t[32]!==y||t[33]!==ft||t[34]!==o||t[35]!==pt||t[36]!==G||t[37]!==U||t[38]!==Z||t[39]!==v||t[40]!==at||t[41]!==mt||t[42]!==O||t[43]!==Q||t[44]!==$||t[45]!==p||t[46]!==ct||t[47]!==W||t[48]!==q||t[49]!==X||t[50]!==H||t[51]!==D||t[52]!==tt||t[53]!==Dt||t[54]!==T||t[55]!==s||t[56]!==A||t[57]!==nt||t[58]!==ot||t[59]!==g||t[60]!==st||t[61]!==N||t[62]!==ut?(Tt=ot&&nt&&o.length>0?l.jsxRuntimeExports.jsx(Nt,{data:o,width:ot,showDataMinMax:Dt,height:nt,colorDomain:o.filter(yi).length===0?[]:dt||Kt.uniqBy(o,"color",!0),colors:o.filter(gi).length===0?y?[y]:[x.Colors.primaryColors["blue-600"]]:y||x.Colors[g].categoricalColors.colors,selectedColor:tt,radius:X,leftMargin:at,rightMargin:D,topMargin:N,bottomMargin:J,tooltip:st,onSeriesMouseOver:ct,highlightedDataPoints:v,minValue:Q,maxValue:O,onSeriesMouseClick:p,prefix:q,suffix:A,stripType:T,highlightColor:Z,dotOpacity:U,resetSelectionOnDoubleClick:H,detailsOnClick:pt,styles:s,classNames:d,valueColor:ut,animate:E===!0?{duration:.5,once:!0,amount:.5}:E||{duration:0,once:!0,amount:0},noOfTicks:$,dimmedOpacity:G,precision:W,customLayers:ft,locale:mt}):null,t[27]=Nt,t[28]=E,t[29]=J,t[30]=d,t[31]=dt,t[32]=y,t[33]=ft,t[34]=o,t[35]=pt,t[36]=G,t[37]=U,t[38]=Z,t[39]=v,t[40]=at,t[41]=mt,t[42]=O,t[43]=Q,t[44]=$,t[45]=p,t[46]=ct,t[47]=W,t[48]=q,t[49]=X,t[50]=H,t[51]=D,t[52]=tt,t[53]=Dt,t[54]=T,t[55]=s,t[56]=A,t[57]=nt,t[58]=ot,t[59]=g,t[60]=st,t[61]=N,t[62]=ut,t[63]=Tt):Tt=t[63];let Ft;t[64]!==At||t[65]!==Tt?(Ft=l.jsxRuntimeExports.jsxs(Qt.GraphArea,{ref:i,children:[At,Tt]}),t[64]=At,t[65]=Tt,t[66]=Ft):Ft=t[66];let Ut;t[67]!==d?.footnote||t[68]!==d?.source||t[69]!==bt||t[70]!==n||t[71]!==s?.footnote||t[72]!==s?.source||t[73]!==V?(Ut=n||bt?l.jsxRuntimeExports.jsx(se.GraphFooter,{styles:{footnote:s?.footnote,source:s?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:n,footNote:bt,width:V}):null,t[67]=d?.footnote,t[68]=d?.source,t[69]=bt,t[70]=n,t[71]=s?.footnote,t[72]=s?.source,t[73]=V,t[74]=Ut):Ut=t[74];let Xt;return t[75]!==Rt||t[76]!==Y||t[77]!==Ot||t[78]!==u||t[79]!==F||t[80]!==P||t[81]!==lt||t[82]!==K||t[83]!==Yt||t[84]!==Bt||t[85]!==$t||t[86]!==qt||t[87]!==Ft||t[88]!==Ut||t[89]!==g||t[90]!==V?(Xt=l.jsxRuntimeExports.jsxs(Qt.GraphContainer,{className:Yt,style:Bt,id:Ot,ref:c,"aria-label":Rt,backgroundColor:Y,theme:g,language:F,minHeight:P,width:V,height:u,relativeHeight:K,padding:lt,children:[$t,qt,Ft,Ut]}),t[75]=Rt,t[76]=Y,t[77]=Ot,t[78]=u,t[79]=F,t[80]=P,t[81]=lt,t[82]=K,t[83]=Yt,t[84]=Bt,t[85]=$t,t[86]=qt,t[87]=Ft,t[88]=Ut,t[89]=g,t[90]=V,t[91]=Xt):Xt=t[91],Xt}function gi(e){return e.color}function yi(e){return e.color}function vi(e){return e.color}function Oi(e){return e!==void 0}function bi(e){return e!==void 0}function ji(e){return e.data}function wi(e){return e!==void 0}function Ci(e){return e.data}exports.StripChart=hi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-D4pAp7u0.cjs"),B=require("react"),Xt=require("./index-DQA8q5sC.cjs"),Yt=require("./index-Cno4Q0YE.cjs"),Bt=require("./Tooltip-C9F3uYG0.cjs"),z=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ft=require("./numberFormattingFunction-u2iNHL_c.cjs"),d=require("./Colors.cjs"),zt=require("./DetailsModal-Du8Fr1QD.cjs"),Zt=require("./linear-CgUCbw9F.cjs"),lt=require("./proxy-CqH8m8IQ.cjs"),Jt=require("./use-in-view-dnRv_qqF.cjs"),Kt=require("./index-FXfr51ZM.cjs"),Gt=require("./uniqBy-O05lp2S5.cjs"),Wt=require("./GraphContainer-Cul9b74X.cjs"),_t=require("./EmptyState-CFmiFPHz.cjs"),te=require("./ColorLegendWithMouseOver.cjs"),ee=require("./GraphFooter.cjs"),ie=require("./GraphHeader.cjs");function Qt(e,t){if(e<2)return[];const o=t/(e-1);return Array.from({length:e},(S,v)=>v*o)}function oe(e){const t=l.compilerRuntimeExports.c(103),{data:o,width:S,height:v,colors:n,colorDomain:a,radius:u,leftMargin:V,rightMargin:Vt,topMargin:ht,bottomMargin:Dt,tooltip:gt,onSeriesMouseOver:at,highlightedDataPoints:r,selectedColor:st,minValue:$,maxValue:q,onSeriesMouseClick:Z,noOfTicks:ct,prefix:J,suffix:ut,stripType:j,highlightColor:O,dotOpacity:bt,resetSelectionOnDoubleClick:K,detailsOnClick:b,styles:f,classNames:w,valueColor:m,animate:x,dimmedOpacity:et,precision:it,customLayers:C,showDataMinMax:It,locale:ot,padZeros:nt}=e,Et=V===void 0?20:V,jt=Vt===void 0?20:Vt,wt=ht===void 0?10:ht,kt=Dt===void 0?10:Dt,Nt=B.useRef(null);let yt;t[0]!==x.amount||t[1]!==x.once?(yt={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=yt):yt=t[2];const s=Jt.useInView(Nt,yt),[p,Rt]=B.useState(void 0),[I,vt]=B.useState(void 0),[Ot,g]=B.useState(void 0),[pt,Ct]=B.useState(void 0);let ft;t[3]!==kt||t[4]!==Et||t[5]!==jt||t[6]!==wt?(ft={top:wt,bottom:kt,left:Et,right:jt},t[3]=kt,t[4]=Et,t[5]=jt,t[6]=wt,t[7]=ft):ft=t[7];const h=ft,A=S-h.left-h.right,T=v-h.top-h.bottom;let F,U,M,L,P,y,H,Q,E,G,k,W;if(t[8]!==x.duration||t[9]!==w?.graphObjectValues||t[10]!==w?.yAxis?.labels||t[11]!==a||t[12]!==n||t[13]!==C||t[14]!==o||t[15]!==b||t[16]!==et||t[17]!==bt||t[18]!==T||t[19]!==A||t[20]!==v||t[21]!==O||t[22]!==r||t[23]!==s||t[24]!==ot||t[25]!==h.left||t[26]!==h.top||t[27]!==q||t[28]!==$||t[29]!==I||t[30]!==ct||t[31]!==Z||t[32]!==at||t[33]!==nt||t[34]!==it||t[35]!==J||t[36]!==u||t[37]!==K||t[38]!==st||t[39]!==It||t[40]!==j||t[41]!==f?.graphObjectValues||t[42]!==f?.yAxis?.labels||t[43]!==ut||t[44]!==m||t[45]!==S){const Ut=o.map(Ne);let xt;t[58]!==r?(xt=i=>{const c=(r||[]).indexOf(i.label);return c===-1?1/0:c},t[58]=r,t[59]=xt):xt=t[59];const qt=Yt.orderBy(Ut,[xt],["desc"]);let rt;t[60]!==o||t[61]!==q?(rt=z.checkIfNullOrUndefined(q)?Math.max(...o.filter(De).map(Re))<0?0:Math.max(...o.filter(ke).map(Ee)):q,t[60]=o,t[61]=q,t[62]=rt):rt=t[62];const St=rt;let dt;t[63]!==o||t[64]!==$?(dt=z.checkIfNullOrUndefined($)?Math.min(...o.filter(Ie).map(Ve))>=0?0:Math.min(...o.filter(Me).map(Ce)):$,t[63]=o,t[64]=$,t[65]=dt):dt=t[65];const $t=dt,N=Zt.linear().domain([$t,St]).range([T,0]).nice(),Mt=Qt(ct,T);U=lt.motion.svg,L=`${S}px`,P=`${v}px`,y=`0 0 ${S} ${v}`,H="ltr",Q=Nt,W=`translate(${h.left},${h.top})`,t[66]!==C?(M=C.filter(we).map(je),t[66]=C,t[67]=M):M=t[67],F=Kt.AnimatePresence,E=qt.map(i=>l.jsxRuntimeExports.jsxs(lt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:A/2,y:N(0)},whileInView:{x:A/2,y:N(i.position),opacity:st?i.color&&n[a.indexOf(i.color)]===st?.95:et:r?r.indexOf(i.label)!==-1?.95:et:bt,transition:{duration:x.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:c=>{Rt(i),Ct(c.clientY),g(c.clientX),at?.(i)},onClick:()=>{(Z||b)&&(Xt.isEqual(I,i)&&K?(vt(void 0),Z?.(void 0)):(vt(i),Z?.(i)))},onMouseMove:c=>{Rt(i),Ct(c.clientY),g(c.clientX)},onMouseLeave:()=>{Rt(void 0),g(void 0),Ct(void 0),at?.(void 0)},children:[j==="dot"?l.jsxRuntimeExports.jsx(lt.motion.circle,{cy:0,cx:0,variants:{initial:{fill:O&&r?r.indexOf(i.label)!==-1?O:o.filter(be).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(Oe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray},whileInView:{fill:O&&r?r.indexOf(i.label)!==-1?O:o.filter(ve).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(ye).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray,transition:{duration:x.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},r:u}):l.jsxRuntimeExports.jsx(lt.motion.rect,{y:-1,height:2,variants:{initial:{x:0-u,width:u*2,fill:O&&r?r.indexOf(i.label)!==-1?O:o.filter(ge).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(he).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray},whileInView:{x:0-u,width:u*2,fill:O&&r?r.indexOf(i.label)!==-1?O:o.filter(de).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(xe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray,transition:{duration:x.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}),r&&r.indexOf(i.label)!==-1?l.jsxRuntimeExports.jsx(lt.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+u+3,fill:m||(O&&r?r.indexOf(i.label)!==-1?O:o.filter(me).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(fe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray)},whileInView:{opacity:1,x:0+u+3,fill:m||(O&&r?r.indexOf(i.label)!==-1?O:o.filter(pe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(ue).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray),transition:{duration:x.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{textAnchor:"start",...f?.graphObjectValues||{}},className:l.mo("graph-value text-sm font-bold",w?.graphObjectValues),children:Ft.numberFormattingFunction(i.position,void 0,it,J,ut,ot,nt)}):null]},i.label)),G=It?[Math.min(...o.filter(ce).map(se)),Math.max(...o.filter(ae).map(le))].map((i,c)=>l.jsxRuntimeExports.jsx(lt.motion.g,{variants:{initial:{opacity:0,x:A/2,y:N(i)},whileInView:{x:A/2,y:N(i),opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:l.jsxRuntimeExports.jsx(lt.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+u+3},whileInView:{opacity:1,x:0+u+3,transition:{duration:x.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{textAnchor:"start",...f?.graphObjectValues||{}},className:l.mo("graph-min-max-value text-sm text-primary-gray-550 dark:text-primary-gray-200",w?.graphObjectValues),children:Ft.numberFormattingFunction(i,void 0,it,J,ut,ot,nt)})},c===0?"min-value":"max-value")):null,k=Mt.map((i,c)=>l.jsxRuntimeExports.jsx("text",{y:i,x:A/2+u+5,style:{textAnchor:"start",...f?.yAxis?.labels||{}},className:l.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",w?.yAxis?.labels),children:Ft.numberFormattingFunction(N.invert(i),void 0,it,J,ut,ot,nt)},`tick-${c}`)),t[8]=x.duration,t[9]=w?.graphObjectValues,t[10]=w?.yAxis?.labels,t[11]=a,t[12]=n,t[13]=C,t[14]=o,t[15]=b,t[16]=et,t[17]=bt,t[18]=T,t[19]=A,t[20]=v,t[21]=O,t[22]=r,t[23]=s,t[24]=ot,t[25]=h.left,t[26]=h.top,t[27]=q,t[28]=$,t[29]=I,t[30]=ct,t[31]=Z,t[32]=at,t[33]=nt,t[34]=it,t[35]=J,t[36]=u,t[37]=K,t[38]=st,t[39]=It,t[40]=j,t[41]=f?.graphObjectValues,t[42]=f?.yAxis?.labels,t[43]=ut,t[44]=m,t[45]=S,t[46]=F,t[47]=U,t[48]=M,t[49]=L,t[50]=P,t[51]=y,t[52]=H,t[53]=Q,t[54]=E,t[55]=G,t[56]=k,t[57]=W}else F=t[46],U=t[47],M=t[48],L=t[49],P=t[50],y=t[51],H=t[52],Q=t[53],E=t[54],G=t[55],k=t[56],W=t[57];let X;t[68]!==F||t[69]!==E||t[70]!==G||t[71]!==k?(X=l.jsxRuntimeExports.jsxs(F,{children:[E,G,k]}),t[68]=F,t[69]=E,t[70]=G,t[71]=k,t[72]=X):X=t[72];let Y;t[73]!==C?(Y=C.filter(re).map(ne),t[73]=C,t[74]=Y):Y=t[74];let R;t[75]!==M||t[76]!==X||t[77]!==Y||t[78]!==W?(R=l.jsxRuntimeExports.jsxs("g",{transform:W,children:[M,X,Y]}),t[75]=M,t[76]=X,t[77]=Y,t[78]=W,t[79]=R):R=t[79];let _;t[80]!==U||t[81]!==L||t[82]!==P||t[83]!==y||t[84]!==H||t[85]!==Q||t[86]!==R?(_=l.jsxRuntimeExports.jsx(U,{width:L,height:P,viewBox:y,direction:H,ref:Q,children:R}),t[80]=U,t[81]=L,t[82]=P,t[83]=y,t[84]=H,t[85]=Q,t[86]=R,t[87]=_):_=t[87];let D;t[88]!==w?.tooltip||t[89]!==Ot||t[90]!==pt||t[91]!==p||t[92]!==f?.tooltip||t[93]!==gt?(D=p&>&&Ot&&pt?l.jsxRuntimeExports.jsx(Bt.Tooltip,{data:p,body:gt,xPos:Ot,yPos:pt,backgroundStyle:f?.tooltip,className:w?.tooltip}):null,t[88]=w?.tooltip,t[89]=Ot,t[90]=pt,t[91]=p,t[92]=f?.tooltip,t[93]=gt,t[94]=D):D=t[94];let tt;t[95]!==w?.modal||t[96]!==b||t[97]!==I?(tt=b&&I!==void 0?l.jsxRuntimeExports.jsx(zt.DetailsModal,{body:b,data:I,setData:vt,className:w?.modal}):null,t[95]=w?.modal,t[96]=b,t[97]=I,t[98]=tt):tt=t[98];let mt;return t[99]!==_||t[100]!==D||t[101]!==tt?(mt=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[_,D,tt]}),t[99]=_,t[100]=D,t[101]=tt,t[102]=mt):mt=t[102],mt}function ne(e){return e.layer}function re(e){return e.position==="after"}function le(e){return e.position}function ae(e){return!z.checkIfNullOrUndefined(e.position)}function se(e){return e.position}function ce(e){return!z.checkIfNullOrUndefined(e.position)}function ue(e){return e.color}function pe(e){return e.color}function fe(e){return e.color}function me(e){return e.color}function xe(e){return e.color}function de(e){return e.color}function he(e){return e.color}function ge(e){return e.color}function ye(e){return e.color}function ve(e){return e.color}function Oe(e){return e.color}function be(e){return e.color}function je(e){return e.layer}function we(e){return e.position==="before"}function Ce(e){return e.position}function Me(e){return!z.checkIfNullOrUndefined(e.position)}function Ve(e){return e.position}function Ie(e){return!z.checkIfNullOrUndefined(e.position)}function Ee(e){return e.position}function ke(e){return!z.checkIfNullOrUndefined(e.position)}function Re(e){return e.position}function De(e){return!z.checkIfNullOrUndefined(e.position)}function Ne(e,t){return{...e,id:`${t}`}}function Se(e){const t=l.compilerRuntimeExports.c(103),{data:o,width:S,height:v,colors:n,colorDomain:a,radius:u,leftMargin:V,rightMargin:Vt,topMargin:ht,bottomMargin:Dt,tooltip:gt,onSeriesMouseOver:at,highlightedDataPoints:r,selectedColor:st,minValue:$,maxValue:q,onSeriesMouseClick:Z,prefix:ct,suffix:J,stripType:ut,highlightColor:j,dotOpacity:O,resetSelectionOnDoubleClick:bt,detailsOnClick:K,styles:b,classNames:f,valueColor:w,animate:m,noOfTicks:x,dimmedOpacity:et,precision:it,customLayers:C,showDataMinMax:It,locale:ot,padZeros:nt}=e,Et=V===void 0?5:V,jt=Vt===void 0?5:Vt,wt=ht===void 0?10:ht,kt=Dt===void 0?10:Dt,Nt=B.useRef(null);let yt;t[0]!==m.amount||t[1]!==m.once?(yt={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=yt):yt=t[2];const s=Jt.useInView(Nt,yt),[p,Rt]=B.useState(void 0),[I,vt]=B.useState(void 0),[Ot,g]=B.useState(void 0),[pt,Ct]=B.useState(void 0);let ft;t[3]!==kt||t[4]!==Et||t[5]!==jt||t[6]!==wt?(ft={top:wt,bottom:kt,left:Et,right:jt},t[3]=kt,t[4]=Et,t[5]=jt,t[6]=wt,t[7]=ft):ft=t[7];const h=ft,A=S-h.left-h.right,T=v-h.top-h.bottom;let F,U,M,L,P,y,H,Q,E,G,k,W;if(t[8]!==m.duration||t[9]!==f?.graphObjectValues||t[10]!==f?.xAxis?.labels||t[11]!==a||t[12]!==n||t[13]!==C||t[14]!==o||t[15]!==K||t[16]!==et||t[17]!==O||t[18]!==T||t[19]!==A||t[20]!==v||t[21]!==j||t[22]!==r||t[23]!==s||t[24]!==ot||t[25]!==h.left||t[26]!==h.top||t[27]!==q||t[28]!==$||t[29]!==I||t[30]!==x||t[31]!==Z||t[32]!==at||t[33]!==nt||t[34]!==it||t[35]!==ct||t[36]!==u||t[37]!==bt||t[38]!==st||t[39]!==It||t[40]!==ut||t[41]!==b?.graphObjectValues||t[42]!==b?.xAxis?.labels||t[43]!==J||t[44]!==w||t[45]!==S){const Ut=o.map(si);let xt;t[58]!==r?(xt=i=>{const c=(r||[]).indexOf(i.label);return c===-1?1/0:c},t[58]=r,t[59]=xt):xt=t[59];const qt=Yt.orderBy(Ut,[xt],["desc"]);let rt;t[60]!==o||t[61]!==q?(rt=z.checkIfNullOrUndefined(q)?Math.max(...o.filter(ai).map(li))<0?0:Math.max(...o.filter(ri).map(ni)):q,t[60]=o,t[61]=q,t[62]=rt):rt=t[62];const St=rt;let dt;t[63]!==o||t[64]!==$?(dt=z.checkIfNullOrUndefined($)?Math.min(...o.filter(oi).map(ii))>=0?0:Math.min(...o.filter(ei).map(ti)):$,t[63]=o,t[64]=$,t[65]=dt):dt=t[65];const $t=dt,N=Zt.linear().domain([$t,St]).range([0,A]).nice(),Mt=Qt(x,A);U=lt.motion.svg,L=`${S}px`,P=`${v}px`,y=`0 0 ${S} ${v}`,H="ltr",Q=Nt,W=`translate(${h.left},${h.top})`,t[66]!==C?(M=C.filter(_e).map(Qe),t[66]=C,t[67]=M):M=t[67],F=Kt.AnimatePresence,E=qt.map(i=>l.jsxRuntimeExports.jsxs(lt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:N(0),y:T/2},whileInView:{x:N(i.position),y:T/2,opacity:st?i.color&&n[a.indexOf(i.color)]===st?.95:et:r?r.indexOf(i.label)!==-1?.95:et:O,transition:{duration:m.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:c=>{Rt(i),Ct(c.clientY),g(c.clientX),at?.(i)},onClick:()=>{(Z||K)&&(Xt.isEqual(I,i)&&bt?(vt(void 0),Z?.(void 0)):(vt(i),Z?.(i)))},onMouseMove:c=>{Rt(i),Ct(c.clientY),g(c.clientX)},onMouseLeave:()=>{Rt(void 0),g(void 0),Ct(void 0),at?.(void 0)},children:[ut==="dot"?l.jsxRuntimeExports.jsx(lt.motion.circle,{cy:0,cx:0,variants:{initial:{fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(Ke).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(Je).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray},whileInView:{fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(Ze).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(ze).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},r:u}):l.jsxRuntimeExports.jsx(lt.motion.rect,{x:-1,width:2,variants:{initial:{y:0-u,height:u*2,fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(Be).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(Ye).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray},whileInView:{y:0-u,height:u*2,fill:j&&r?r.indexOf(i.label)!==-1?j:o.filter(Xe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(We).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}}}),r&&r.indexOf(i.label)!==-1?l.jsxRuntimeExports.jsx(lt.motion.text,{x:0,variants:{initial:{opacity:0,y:0-u-5,fill:w||(j&&r?r.indexOf(i.label)!==-1?j:o.filter(Ge).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(He).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray)},whileInView:{opacity:1,y:0-u-5,fill:w||(j&&r?r.indexOf(i.label)!==-1?j:o.filter(Pe).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray:o.filter(Le).length===0?n[0]:i.color?n[a.indexOf(i.color)]:d.Colors.gray),transition:{duration:m.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{textAnchor:"middle",...b?.graphObjectValues||{}},className:l.mo("graph-value text-sm font-bold",f?.graphObjectValues),children:Ft.numberFormattingFunction(i.position,void 0,it,ct,J,ot,nt)}):null]},i.label)),G=It?[Math.min(...o.filter(Ue).map(Fe)),Math.max(...o.filter(Te).map(Ae))].map((i,c)=>l.jsxRuntimeExports.jsx(lt.motion.g,{variants:{initial:{opacity:0,x:N(i),y:T/2},whileInView:{x:N(i),y:T/2,opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:l.jsxRuntimeExports.jsx(lt.motion.text,{x:0,variants:{initial:{opacity:0,y:0-u-5},whileInView:{opacity:1,y:0-u-5,transition:{duration:m.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{textAnchor:"middle",...b?.graphObjectValues||{}},className:l.mo("graph-min-max-value text-sm text-primary-gray-550 dark:text-primary-gray-200",f?.graphObjectValues),children:Ft.numberFormattingFunction(i,void 0,it,ct,J,ot,nt)})},c===0?"min-value":"max-value")):null,k=Mt.map((i,c)=>l.jsxRuntimeExports.jsx("text",{x:i,y:T/2+u,style:{textAnchor:c===0?"start":c===Mt.length-1?"end":"middle",...b?.xAxis?.labels||{}},className:l.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",f?.xAxis?.labels),dy:"1em",children:Ft.numberFormattingFunction(N.invert(i),void 0,it,ct,J,ot,nt)},`tick-${c}`)),t[8]=m.duration,t[9]=f?.graphObjectValues,t[10]=f?.xAxis?.labels,t[11]=a,t[12]=n,t[13]=C,t[14]=o,t[15]=K,t[16]=et,t[17]=O,t[18]=T,t[19]=A,t[20]=v,t[21]=j,t[22]=r,t[23]=s,t[24]=ot,t[25]=h.left,t[26]=h.top,t[27]=q,t[28]=$,t[29]=I,t[30]=x,t[31]=Z,t[32]=at,t[33]=nt,t[34]=it,t[35]=ct,t[36]=u,t[37]=bt,t[38]=st,t[39]=It,t[40]=ut,t[41]=b?.graphObjectValues,t[42]=b?.xAxis?.labels,t[43]=J,t[44]=w,t[45]=S,t[46]=F,t[47]=U,t[48]=M,t[49]=L,t[50]=P,t[51]=y,t[52]=H,t[53]=Q,t[54]=E,t[55]=G,t[56]=k,t[57]=W}else F=t[46],U=t[47],M=t[48],L=t[49],P=t[50],y=t[51],H=t[52],Q=t[53],E=t[54],G=t[55],k=t[56],W=t[57];let X;t[68]!==F||t[69]!==E||t[70]!==G||t[71]!==k?(X=l.jsxRuntimeExports.jsxs(F,{children:[E,G,k]}),t[68]=F,t[69]=E,t[70]=G,t[71]=k,t[72]=X):X=t[72];let Y;t[73]!==C?(Y=C.filter(qe).map($e),t[73]=C,t[74]=Y):Y=t[74];let R;t[75]!==M||t[76]!==X||t[77]!==Y||t[78]!==W?(R=l.jsxRuntimeExports.jsxs("g",{transform:W,children:[M,X,Y]}),t[75]=M,t[76]=X,t[77]=Y,t[78]=W,t[79]=R):R=t[79];let _;t[80]!==U||t[81]!==L||t[82]!==P||t[83]!==y||t[84]!==H||t[85]!==Q||t[86]!==R?(_=l.jsxRuntimeExports.jsx(U,{width:L,height:P,viewBox:y,direction:H,ref:Q,children:R}),t[80]=U,t[81]=L,t[82]=P,t[83]=y,t[84]=H,t[85]=Q,t[86]=R,t[87]=_):_=t[87];let D;t[88]!==f?.tooltip||t[89]!==Ot||t[90]!==pt||t[91]!==p||t[92]!==b?.tooltip||t[93]!==gt?(D=p&>&&Ot&&pt?l.jsxRuntimeExports.jsx(Bt.Tooltip,{data:p,body:gt,xPos:Ot,yPos:pt,backgroundStyle:b?.tooltip,className:f?.tooltip}):null,t[88]=f?.tooltip,t[89]=Ot,t[90]=pt,t[91]=p,t[92]=b?.tooltip,t[93]=gt,t[94]=D):D=t[94];let tt;t[95]!==f?.modal||t[96]!==K||t[97]!==I?(tt=K&&I!==void 0?l.jsxRuntimeExports.jsx(zt.DetailsModal,{body:K,data:I,setData:vt,className:f?.modal}):null,t[95]=f?.modal,t[96]=K,t[97]=I,t[98]=tt):tt=t[98];let mt;return t[99]!==_||t[100]!==D||t[101]!==tt?(mt=l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[_,D,tt]}),t[99]=_,t[100]=D,t[101]=tt,t[102]=mt):mt=t[102],mt}function $e(e){return e.layer}function qe(e){return e.position==="after"}function Ae(e){return e.position}function Te(e){return!z.checkIfNullOrUndefined(e.position)}function Fe(e){return e.position}function Ue(e){return!z.checkIfNullOrUndefined(e.position)}function Le(e){return e.color}function Pe(e){return e.color}function He(e){return e.color}function Ge(e){return e.color}function We(e){return e.color}function Xe(e){return e.color}function Ye(e){return e.color}function Be(e){return e.color}function ze(e){return e.color}function Ze(e){return e.color}function Je(e){return e.color}function Ke(e){return e.color}function Qe(e){return e.layer}function _e(e){return e.position==="before"}function ti(e){return e.position}function ei(e){return!z.checkIfNullOrUndefined(e.position)}function ii(e){return e.position}function oi(e){return!z.checkIfNullOrUndefined(e.position)}function ni(e){return e.position}function ri(e){return!z.checkIfNullOrUndefined(e.position)}function li(e){return e.position}function ai(e){return!z.checkIfNullOrUndefined(e.position)}function si(e,t){return{...e,id:`${t}`}}function ci(e){const t=l.compilerRuntimeExports.c(93),{data:o,graphTitle:S,colors:v,sources:n,graphDescription:a,height:u,width:V,footNote:Vt,colorDomain:ht,colorLegendTitle:Dt,radius:gt,padding:at,backgroundColor:r,leftMargin:st,rightMargin:$,topMargin:q,bottomMargin:Z,tooltip:ct,relativeHeight:J,onSeriesMouseOver:ut,showColorScale:j,highlightedDataPoints:O,graphID:bt,minValue:K,maxValue:b,onSeriesMouseClick:f,noOfTicks:w,graphDownload:m,dataDownload:x,stripType:et,language:it,highlightColor:C,dotOpacity:It,showNAColor:ot,minHeight:nt,theme:Et,ariaLabel:jt,valueColor:wt,resetSelectionOnDoubleClick:kt,detailsOnClick:Nt,orientation:yt,styles:s,classNames:p,animate:Rt,dimmedOpacity:I,customLayers:vt,showDataMinMax:Ot,numberDisplayOptions:g}=e,pt=gt===void 0?5:gt,Ct=r===void 0?!1:r,ft=j===void 0?!0:j,h=w===void 0?2:w,A=m===void 0?!1:m,T=x===void 0?!1:x,F=et===void 0?"dot":et,U=it===void 0?"en":it,M=It===void 0?.3:It,L=ot===void 0?!0:ot,P=nt===void 0?0:nt,y=Et===void 0?"light":Et,H=kt===void 0?!0:kt,Q=yt===void 0?"vertical":yt,E=Rt===void 0?!1:Rt,G=I===void 0?.3:I;let k;t[0]!==vt?(k=vt===void 0?[]:vt,t[0]=vt,t[1]=k):k=t[1];const W=k,X=Ot===void 0?!1:Ot,Y=Q==="horizontal"?Se:oe,[R,_]=B.useState(0),[D,tt]=B.useState(0),[mt,Ut]=B.useState(void 0),xt=B.useRef(null),qt=B.useRef(null);let rt,St;t[2]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{const Pt=new ResizeObserver(Ht=>{_(Ht[0].target.clientWidth||620),tt(Ht[0].target.clientHeight||480)});return xt.current&&Pt.observe(xt.current),()=>Pt.disconnect()},St=[],t[2]=rt,t[3]=St):(rt=t[2],St=t[3]),B.useEffect(rt,St);const dt=p?.graphContainer,$t=s?.graphContainer;let N;t[4]!==p?.description||t[5]!==p?.title||t[6]!==o||t[7]!==T||t[8]!==a||t[9]!==A||t[10]!==S||t[11]!==s?.description||t[12]!==s?.title||t[13]!==V?(N=S||a||A||T?l.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:s?.title,description:s?.description},classNames:{title:p?.title,description:p?.description},graphTitle:S,graphDescription:a,width:V,graphDownload:A?qt:void 0,dataDownload:T?o.map(gi).filter(hi).length>0?o.map(di).filter(xi):o.filter(mi):null}):null,t[4]=p?.description,t[5]=p?.title,t[6]=o,t[7]=T,t[8]=a,t[9]=A,t[10]=S,t[11]=s?.description,t[12]=s?.title,t[13]=V,t[14]=N):N=t[14];let Mt;t[15]!==p?.colorLegend||t[16]!==ht||t[17]!==Dt||t[18]!==v||t[19]!==o||t[20]!==ft||t[21]!==L||t[22]!==y||t[23]!==V?(Mt=ft!==!1&&o.filter(fi).length!==0&&o.length>0?l.jsxRuntimeExports.jsx(te.ColorLegendWithMouseOver,{width:V,colorLegendTitle:Dt,colors:v||d.Colors[y].categoricalColors.colors,colorDomain:ht||Gt.uniqBy(o,"color",!0),setSelectedColor:Ut,showNAColor:L,className:p?.colorLegend}):null,t[15]=p?.colorLegend,t[16]=ht,t[17]=Dt,t[18]=v,t[19]=o,t[20]=ft,t[21]=L,t[22]=y,t[23]=V,t[24]=Mt):Mt=t[24];let i;t[25]!==o.length?(i=o.length===0&&l.jsxRuntimeExports.jsx(_t.EmptyState,{}),t[25]=o.length,t[26]=i):i=t[26];let c;t[27]!==Y||t[28]!==E||t[29]!==Z||t[30]!==p||t[31]!==ht||t[32]!==v||t[33]!==W||t[34]!==o||t[35]!==Nt||t[36]!==G||t[37]!==M||t[38]!==C||t[39]!==O||t[40]!==st||t[41]!==b||t[42]!==K||t[43]!==h||t[44]!==g?.locale||t[45]!==g?.padZeros||t[46]!==g?.precision||t[47]!==g?.prefix||t[48]!==g?.suffix||t[49]!==f||t[50]!==ut||t[51]!==pt||t[52]!==H||t[53]!==$||t[54]!==mt||t[55]!==X||t[56]!==F||t[57]!==s||t[58]!==D||t[59]!==R||t[60]!==y||t[61]!==ct||t[62]!==q||t[63]!==wt?(c=R&&D&&o.length>0?l.jsxRuntimeExports.jsx(Y,{data:o,width:R,showDataMinMax:X,height:D,colorDomain:o.filter(pi).length===0?[]:ht||Gt.uniqBy(o,"color",!0),colors:o.filter(ui).length===0?v?[v]:[d.Colors.primaryColors["blue-600"]]:v||d.Colors[y].categoricalColors.colors,selectedColor:mt,radius:pt,leftMargin:st,rightMargin:$,topMargin:q,bottomMargin:Z,tooltip:ct,onSeriesMouseOver:ut,highlightedDataPoints:O,minValue:K,maxValue:b,onSeriesMouseClick:f,stripType:F,highlightColor:C,dotOpacity:M,resetSelectionOnDoubleClick:H,detailsOnClick:Nt,styles:s,classNames:p,valueColor:wt,animate:E===!0?{duration:.5,once:!0,amount:.5}:E||{duration:0,once:!0,amount:0},noOfTicks:h,dimmedOpacity:G,customLayers:W,locale:g?.locale||"en",padZeros:g?.padZeros||!1,suffix:g?.suffix||"",prefix:g?.prefix||"",precision:g?.precision??2}):null,t[27]=Y,t[28]=E,t[29]=Z,t[30]=p,t[31]=ht,t[32]=v,t[33]=W,t[34]=o,t[35]=Nt,t[36]=G,t[37]=M,t[38]=C,t[39]=O,t[40]=st,t[41]=b,t[42]=K,t[43]=h,t[44]=g?.locale,t[45]=g?.padZeros,t[46]=g?.precision,t[47]=g?.prefix,t[48]=g?.suffix,t[49]=f,t[50]=ut,t[51]=pt,t[52]=H,t[53]=$,t[54]=mt,t[55]=X,t[56]=F,t[57]=s,t[58]=D,t[59]=R,t[60]=y,t[61]=ct,t[62]=q,t[63]=wt,t[64]=c):c=t[64];let At;t[65]!==i||t[66]!==c?(At=l.jsxRuntimeExports.jsxs(Wt.GraphArea,{ref:xt,children:[i,c]}),t[65]=i,t[66]=c,t[67]=At):At=t[67];let Tt;t[68]!==p?.footnote||t[69]!==p?.source||t[70]!==Vt||t[71]!==n||t[72]!==s?.footnote||t[73]!==s?.source||t[74]!==V?(Tt=n||Vt?l.jsxRuntimeExports.jsx(ee.GraphFooter,{styles:{footnote:s?.footnote,source:s?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:n,footNote:Vt,width:V}):null,t[68]=p?.footnote,t[69]=p?.source,t[70]=Vt,t[71]=n,t[72]=s?.footnote,t[73]=s?.source,t[74]=V,t[75]=Tt):Tt=t[75];let Lt;return t[76]!==jt||t[77]!==Ct||t[78]!==bt||t[79]!==u||t[80]!==U||t[81]!==P||t[82]!==at||t[83]!==J||t[84]!==dt||t[85]!==$t||t[86]!==N||t[87]!==Mt||t[88]!==At||t[89]!==Tt||t[90]!==y||t[91]!==V?(Lt=l.jsxRuntimeExports.jsxs(Wt.GraphContainer,{className:dt,style:$t,id:bt,ref:qt,"aria-label":jt,backgroundColor:Ct,theme:y,language:U,minHeight:P,width:V,height:u,relativeHeight:J,padding:at,children:[N,Mt,At,Tt]}),t[76]=jt,t[77]=Ct,t[78]=bt,t[79]=u,t[80]=U,t[81]=P,t[82]=at,t[83]=J,t[84]=dt,t[85]=$t,t[86]=N,t[87]=Mt,t[88]=At,t[89]=Tt,t[90]=y,t[91]=V,t[92]=Lt):Lt=t[92],Lt}function ui(e){return e.color}function pi(e){return e.color}function fi(e){return e.color}function mi(e){return e!==void 0}function xi(e){return e!==void 0}function di(e){return e.data}function hi(e){return e!==void 0}function gi(e){return e.data}exports.StripChart=ci;
|
|
2
2
|
//# sourceMappingURL=StripChart.cjs.map
|