@undp/data-viz 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.js +3 -2
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +1221 -1247
- package/dist/BarGraph.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +130 -142
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +41 -41
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +483 -487
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +99 -99
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +125 -125
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +2 -2
- package/dist/Data/BureauPerformance.csv +8 -0
- package/dist/Data/EGDashboardData.csv +6 -0
- package/dist/DataCards.cjs +2 -2
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +6 -6
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.js +66 -68
- package/dist/DataTable.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +3 -2
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.js +205 -205
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +78 -81
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +3 -2
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +64 -65
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +1 -1
- package/dist/{GraphEl-4RUlclvW.cjs → GraphEl-BcYgMnN2.cjs} +2 -2
- package/dist/{GraphEl-4RUlclvW.cjs.map → GraphEl-BcYgMnN2.cjs.map} +1 -1
- package/dist/{GraphEl-ClIxlWa3.js → GraphEl-CMWeARJ3.js} +2 -2
- package/dist/{GraphEl-ClIxlWa3.js.map → GraphEl-CMWeARJ3.js.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +4 -4
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.js +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.js +83 -83
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +7 -6
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.js +2 -2
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +82 -91
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +3 -2
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +2 -2
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +124 -130
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.js +200 -200
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +149 -155
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +44 -43
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +4 -4
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.js +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +107 -113
- package/dist/SlopeChart.js.map +1 -1
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.cjs.map +1 -1
- package/dist/SparkLine.js +3 -2
- package/dist/SparkLine.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +159 -159
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +3 -3
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.js +194 -200
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/ensureCompleteData-DkQYPeDa.cjs +2 -0
- package/dist/ensureCompleteData-DkQYPeDa.cjs.map +1 -0
- package/dist/{ensureCompleteData-BALdOrsS.js → ensureCompleteData-DlmibgaI.js} +28 -8
- package/dist/ensureCompleteData-DlmibgaI.js.map +1 -0
- package/dist/fetchAndParseData-Ba-_CgxS.cjs +16 -0
- package/dist/fetchAndParseData-Ba-_CgxS.cjs.map +1 -0
- package/dist/fetchAndParseData-sapWbnYk.js +583 -0
- package/dist/fetchAndParseData-sapWbnYk.js.map +1 -0
- package/dist/fetchAndParseData.cjs +1 -1
- package/dist/fetchAndParseData.js +1 -1
- package/dist/getJenks-BbngDoBQ.js +19 -0
- package/dist/getJenks-BbngDoBQ.js.map +1 -0
- package/dist/getJenks-GYmdwBqm.cjs +2 -0
- package/dist/getJenks-GYmdwBqm.cjs.map +1 -0
- package/dist/getSliderMarks-9cNoRkDx.js +1023 -0
- package/dist/getSliderMarks-9cNoRkDx.js.map +1 -0
- package/dist/getSliderMarks-CRIbTGYV.cjs +6 -0
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +1 -0
- package/dist/getUniqValue-DiCh_MOD.js +13 -0
- package/dist/getUniqValue-DiCh_MOD.js.map +1 -0
- package/dist/getUniqValue-RViz8tTw.cjs +2 -0
- package/dist/getUniqValue-RViz8tTw.cjs.map +1 -0
- package/dist/{index-BMgDMxKJ.js → index-37q0ULNQ.js} +44 -50
- package/dist/index-37q0ULNQ.js.map +1 -0
- package/dist/index-CVlCtJbC.cjs +2 -0
- package/dist/index-CVlCtJbC.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/sort-DfK1b0F5.js +34 -0
- package/dist/sort-DfK1b0F5.js.map +1 -0
- package/dist/sort-O96oMZLb.cjs +2 -0
- package/dist/sort-O96oMZLb.cjs.map +1 -0
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +3 -3
- package/dist/transformDataForAggregation-KXGm6flX.cjs +2 -0
- package/dist/{transformDataForAggregation-BVxVu4yY.cjs.map → transformDataForAggregation-KXGm6flX.cjs.map} +1 -1
- package/dist/{transformDataForAggregation-1BYVFqvF.js → transformDataForAggregation-sBpdlX8n.js} +40 -44
- package/dist/{transformDataForAggregation-1BYVFqvF.js.map → transformDataForAggregation-sBpdlX8n.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js → transformDataForGraphFromFile-ComYvzuz.js} +3 -3
- package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js.map → transformDataForGraphFromFile-ComYvzuz.js.map} +1 -1
- package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs → transformDataForGraphFromFile-DVZodTHd.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs.map → transformDataForGraphFromFile-DVZodTHd.cjs.map} +1 -1
- package/dist/uniqBy-BHy4I8PK.js +8 -0
- package/dist/uniqBy-BHy4I8PK.js.map +1 -0
- package/dist/uniqBy-O05lp2S5.cjs +2 -0
- package/dist/uniqBy-O05lp2S5.cjs.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +1 -7
- package/dist/ensureCompleteData-BALdOrsS.js.map +0 -1
- package/dist/ensureCompleteData-BU5Zlccy.cjs +0 -2
- package/dist/ensureCompleteData-BU5Zlccy.cjs.map +0 -1
- package/dist/fetchAndParseData-DBOl1Icl.js +0 -1196
- package/dist/fetchAndParseData-DBOl1Icl.js.map +0 -1
- package/dist/fetchAndParseData-Dcy7AS_0.cjs +0 -16
- package/dist/fetchAndParseData-Dcy7AS_0.cjs.map +0 -1
- package/dist/getJenks-DW96UYNE.js +0 -23
- package/dist/getJenks-DW96UYNE.js.map +0 -1
- package/dist/getJenks-vofIZmeb.cjs +0 -2
- package/dist/getJenks-vofIZmeb.cjs.map +0 -1
- package/dist/getSliderMarks-C0jptXeP.js +0 -1054
- package/dist/getSliderMarks-C0jptXeP.js.map +0 -1
- package/dist/getSliderMarks-CtsEXiLV.cjs +0 -6
- package/dist/getSliderMarks-CtsEXiLV.cjs.map +0 -1
- package/dist/getUniqValue-CfuE_l9c.cjs +0 -2
- package/dist/getUniqValue-CfuE_l9c.cjs.map +0 -1
- package/dist/getUniqValue-CttuU_wn.js +0 -20
- package/dist/getUniqValue-CttuU_wn.js.map +0 -1
- package/dist/index-AqnpA7_O.js +0 -631
- package/dist/index-AqnpA7_O.js.map +0 -1
- package/dist/index-BJOeaYTk.cjs +0 -2
- package/dist/index-BJOeaYTk.cjs.map +0 -1
- package/dist/index-BMgDMxKJ.js.map +0 -1
- package/dist/index-DYH8g9WA.cjs +0 -2
- package/dist/index-DYH8g9WA.cjs.map +0 -1
- package/dist/index-Da2GUKrr.cjs +0 -2
- package/dist/index-Da2GUKrr.cjs.map +0 -1
- package/dist/index-fwdktvAS.js +0 -707
- package/dist/index-fwdktvAS.js.map +0 -1
- package/dist/transformDataForAggregation-BVxVu4yY.cjs +0 -2
package/dist/ButterflyChart.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { j as e, m as et } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
2
|
import { useRef as gt, useState as S, useEffect as yt } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { p as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { s as Dt } from "./string2HTML-oFCROsus.js";
|
|
3
|
+
import { g as Nt, x as At } from "./getSliderMarks-9cNoRkDx.js";
|
|
4
|
+
import { p as Ct, f as kt } from "./parse-DlCRUFh_.js";
|
|
5
|
+
import { i as bt } from "./index-Bwrro8-q.js";
|
|
6
|
+
import { X as Lt } from "./Modal-DVVwpKhP.js";
|
|
7
|
+
import { n as vt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
|
+
import { T as Vt } from "./Tooltip-CVCGWyzw.js";
|
|
9
|
+
import { s as Tt } from "./string2HTML-oFCROsus.js";
|
|
11
10
|
import { X as wt } from "./XTicksAndGridLines-Bn9u5gOM.js";
|
|
12
11
|
import { A as jt } from "./Axis-Ddg-seDi.js";
|
|
13
|
-
import { Y as
|
|
12
|
+
import { Y as Ot } from "./YAxesLabels-CPGZjmZJ.js";
|
|
14
13
|
import { a as Bt } from "./ReferenceLine-CfAW3vKJ.js";
|
|
15
|
-
import { b as
|
|
14
|
+
import { b as Dt } from "./band-BEjh2CHI.js";
|
|
16
15
|
import { a as Mt } from "./linear-DUdu7l2G.js";
|
|
17
|
-
import { u as
|
|
16
|
+
import { u as It } from "./use-in-view-yS6jzJAp.js";
|
|
18
17
|
import { m as I } from "./proxy-CkpFesk1.js";
|
|
19
|
-
import { A as
|
|
20
|
-
import { GraphFooter as
|
|
21
|
-
import { GraphHeader as
|
|
22
|
-
import { ColorLegend as
|
|
18
|
+
import { A as dt } from "./index-CNvov0eg.js";
|
|
19
|
+
import { GraphFooter as St } from "./GraphFooter.js";
|
|
20
|
+
import { GraphHeader as Ft } from "./GraphHeader.js";
|
|
21
|
+
import { ColorLegend as Ht } from "./ColorLegend.js";
|
|
23
22
|
import { Colors as $t } from "./Colors.js";
|
|
24
|
-
import { E as
|
|
25
|
-
import { P as
|
|
23
|
+
import { E as Pt } from "./EmptyState-DdTp-Mdn.js";
|
|
24
|
+
import { P as Rt, f as Xt } from "./index-BmCqpO1B.js";
|
|
26
25
|
import { c as ut } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
27
|
-
import { a as
|
|
26
|
+
import { a as Et } from "./ensureCompleteData-DlmibgaI.js";
|
|
27
|
+
import { u as Gt } from "./uniqBy-BHy4I8PK.js";
|
|
28
|
+
import { s as Yt } from "./sort-DfK1b0F5.js";
|
|
28
29
|
import { c as Wt } from "./init-BhZylTFx.js";
|
|
29
30
|
function zt(z) {
|
|
30
31
|
const {
|
|
@@ -32,7 +33,7 @@ function zt(z) {
|
|
|
32
33
|
width: y,
|
|
33
34
|
height: j,
|
|
34
35
|
barColors: m,
|
|
35
|
-
centerGap:
|
|
36
|
+
centerGap: d,
|
|
36
37
|
refValues: s,
|
|
37
38
|
maxValue: B,
|
|
38
39
|
minValue: q,
|
|
@@ -55,21 +56,21 @@ function zt(z) {
|
|
|
55
56
|
styles: u,
|
|
56
57
|
classNames: l,
|
|
57
58
|
noOfTicks: N,
|
|
58
|
-
animate:
|
|
59
|
+
animate: x,
|
|
59
60
|
precision: G,
|
|
60
61
|
customLayers: rt,
|
|
61
62
|
minValueLeftBar: L,
|
|
62
63
|
minValueRightBar: V,
|
|
63
64
|
naLabel: K
|
|
64
|
-
} = z, Q = gt(null),
|
|
65
|
-
once:
|
|
66
|
-
amount:
|
|
67
|
-
}), [st,
|
|
65
|
+
} = z, Q = gt(null), b = It(Q, {
|
|
66
|
+
once: x.once,
|
|
67
|
+
amount: x.amount
|
|
68
|
+
}), [st, v] = S(void 0), [T, P] = S(void 0), [lt, O] = S(void 0), [A, f] = S(void 0), h = {
|
|
68
69
|
top: _,
|
|
69
70
|
bottom: ct,
|
|
70
71
|
left: ot,
|
|
71
72
|
right: nt
|
|
72
|
-
}, C = y - h.left - h.right, w = j - h.top - h.bottom, Y = c.map((t, r) => ({ ...t, id: `${r}` })), a =
|
|
73
|
+
}, C = y - h.left - h.right, w = j - h.top - h.bottom, Y = c.map((t, r) => ({ ...t, id: `${r}` })), a = Dt().domain(Y.map((t) => `${t.id}`)).range([w, 0]).paddingInner(mt), o = Mt().domain([q, B]).range([0, (C - d) / 2]).nice(), D = o.ticks(N), n = Mt().domain([q, B]).range([(C - d) / 2, 0]).nice(), Z = n.ticks(N);
|
|
73
74
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
74
75
|
/* @__PURE__ */ e.jsx(
|
|
75
76
|
I.svg,
|
|
@@ -105,23 +106,23 @@ function zt(z) {
|
|
|
105
106
|
precision: G
|
|
106
107
|
}
|
|
107
108
|
) : null,
|
|
108
|
-
/* @__PURE__ */ e.jsxs(
|
|
109
|
+
/* @__PURE__ */ e.jsxs(dt, { children: [
|
|
109
110
|
Y.map((t, r) => /* @__PURE__ */ e.jsxs(
|
|
110
111
|
I.g,
|
|
111
112
|
{
|
|
112
113
|
className: "undp-viz-g-with-hover",
|
|
113
114
|
opacity: 0.85,
|
|
114
115
|
onMouseEnter: (p) => {
|
|
115
|
-
|
|
116
|
+
v(t), f(p.clientY), O(p.clientX), F?.(t);
|
|
116
117
|
},
|
|
117
118
|
onClick: () => {
|
|
118
|
-
(k || $) && (
|
|
119
|
+
(k || $) && (bt(T, t) && at ? (P(void 0), k?.(void 0)) : (P(t), k?.(t)));
|
|
119
120
|
},
|
|
120
121
|
onMouseMove: (p) => {
|
|
121
|
-
|
|
122
|
+
v(t), f(p.clientY), O(p.clientX);
|
|
122
123
|
},
|
|
123
124
|
onMouseLeave: () => {
|
|
124
|
-
|
|
125
|
+
v(void 0), O(void 0), f(void 0), F?.(void 0);
|
|
125
126
|
},
|
|
126
127
|
children: [
|
|
127
128
|
t.leftBar ? /* @__PURE__ */ e.jsx(
|
|
@@ -138,15 +139,15 @@ function zt(z) {
|
|
|
138
139
|
whileInView: {
|
|
139
140
|
x: t.leftBar < 0 ? n(0) : n(t.leftBar),
|
|
140
141
|
width: t.leftBar < 0 ? n(t.leftBar) - n(0) : n(0) - n(t.leftBar),
|
|
141
|
-
transition: { duration:
|
|
142
|
+
transition: { duration: x.duration }
|
|
142
143
|
}
|
|
143
144
|
},
|
|
144
145
|
initial: "initial",
|
|
145
|
-
animate:
|
|
146
|
+
animate: b ? "whileInView" : "initial",
|
|
146
147
|
exit: {
|
|
147
148
|
x: n(0),
|
|
148
149
|
width: 0,
|
|
149
|
-
transition: { duration:
|
|
150
|
+
transition: { duration: x.duration }
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
) : null,
|
|
@@ -164,7 +165,7 @@ function zt(z) {
|
|
|
164
165
|
className: et("graph-value text-sm", l?.graphObjectValues),
|
|
165
166
|
exit: {
|
|
166
167
|
opacity: 0,
|
|
167
|
-
transition: { duration:
|
|
168
|
+
transition: { duration: x.duration }
|
|
168
169
|
},
|
|
169
170
|
variants: {
|
|
170
171
|
initial: {
|
|
@@ -174,12 +175,12 @@ function zt(z) {
|
|
|
174
175
|
whileInView: {
|
|
175
176
|
x: t.leftBar ? n(t.leftBar) : n(L < 0 ? 0 : L),
|
|
176
177
|
opacity: 1,
|
|
177
|
-
transition: { duration:
|
|
178
|
+
transition: { duration: x.duration }
|
|
178
179
|
}
|
|
179
180
|
},
|
|
180
181
|
initial: "initial",
|
|
181
|
-
animate:
|
|
182
|
-
children:
|
|
182
|
+
animate: b ? "whileInView" : "initial",
|
|
183
|
+
children: vt(t.rightBar, K, G, E, X)
|
|
183
184
|
}
|
|
184
185
|
) : null
|
|
185
186
|
]
|
|
@@ -208,14 +209,14 @@ function zt(z) {
|
|
|
208
209
|
textSide: "left",
|
|
209
210
|
classNames: t.classNames,
|
|
210
211
|
styles: t.styles,
|
|
211
|
-
animate:
|
|
212
|
-
isInView:
|
|
212
|
+
animate: x,
|
|
213
|
+
isInView: b
|
|
213
214
|
},
|
|
214
215
|
r
|
|
215
216
|
)) }) : null
|
|
216
217
|
] })
|
|
217
218
|
] }),
|
|
218
|
-
/* @__PURE__ */ e.jsxs("g", { transform: `translate(${(C +
|
|
219
|
+
/* @__PURE__ */ e.jsxs("g", { transform: `translate(${(C + d) / 2},0)`, children: [
|
|
219
220
|
it ? /* @__PURE__ */ e.jsx(
|
|
220
221
|
wt,
|
|
221
222
|
{
|
|
@@ -238,23 +239,23 @@ function zt(z) {
|
|
|
238
239
|
precision: G
|
|
239
240
|
}
|
|
240
241
|
) : null,
|
|
241
|
-
/* @__PURE__ */ e.jsxs(
|
|
242
|
+
/* @__PURE__ */ e.jsxs(dt, { children: [
|
|
242
243
|
Y.map((t, r) => /* @__PURE__ */ e.jsxs(
|
|
243
244
|
I.g,
|
|
244
245
|
{
|
|
245
246
|
className: "undp-viz-g-with-hover",
|
|
246
247
|
opacity: 0.85,
|
|
247
248
|
onMouseEnter: (p) => {
|
|
248
|
-
|
|
249
|
+
v(t), f(p.clientY), O(p.clientX), F?.(t);
|
|
249
250
|
},
|
|
250
251
|
onClick: () => {
|
|
251
|
-
(k || $) && (
|
|
252
|
+
(k || $) && (bt(T, t) && at ? (P(void 0), k?.(void 0)) : (P(t), k?.(t)));
|
|
252
253
|
},
|
|
253
254
|
onMouseMove: (p) => {
|
|
254
|
-
|
|
255
|
+
v(t), f(p.clientY), O(p.clientX);
|
|
255
256
|
},
|
|
256
257
|
onMouseLeave: () => {
|
|
257
|
-
|
|
258
|
+
v(void 0), O(void 0), f(void 0), F?.(void 0);
|
|
258
259
|
},
|
|
259
260
|
children: [
|
|
260
261
|
t.rightBar ? /* @__PURE__ */ e.jsx(
|
|
@@ -266,7 +267,7 @@ function zt(z) {
|
|
|
266
267
|
exit: {
|
|
267
268
|
x: o(0),
|
|
268
269
|
width: 0,
|
|
269
|
-
transition: { duration:
|
|
270
|
+
transition: { duration: x.duration }
|
|
270
271
|
},
|
|
271
272
|
variants: {
|
|
272
273
|
initial: {
|
|
@@ -276,11 +277,11 @@ function zt(z) {
|
|
|
276
277
|
whileInView: {
|
|
277
278
|
x: t.rightBar >= 0 ? o(0) : o(t.rightBar),
|
|
278
279
|
width: t.rightBar >= 0 ? o(t.rightBar) - o(0) : o(0) - o(t.rightBar),
|
|
279
|
-
transition: { duration:
|
|
280
|
+
transition: { duration: x.duration }
|
|
280
281
|
}
|
|
281
282
|
},
|
|
282
283
|
initial: "initial",
|
|
283
|
-
animate:
|
|
284
|
+
animate: b ? "whileInView" : "initial"
|
|
284
285
|
}
|
|
285
286
|
) : null,
|
|
286
287
|
U ? /* @__PURE__ */ e.jsx(
|
|
@@ -297,7 +298,7 @@ function zt(z) {
|
|
|
297
298
|
dy: "0.33em",
|
|
298
299
|
exit: {
|
|
299
300
|
opacity: 0,
|
|
300
|
-
transition: { duration:
|
|
301
|
+
transition: { duration: x.duration }
|
|
301
302
|
},
|
|
302
303
|
variants: {
|
|
303
304
|
initial: {
|
|
@@ -307,12 +308,12 @@ function zt(z) {
|
|
|
307
308
|
whileInView: {
|
|
308
309
|
x: t.rightBar ? o(t.rightBar) : o(V < 0 ? 0 : V),
|
|
309
310
|
opacity: 1,
|
|
310
|
-
transition: { duration:
|
|
311
|
+
transition: { duration: x.duration }
|
|
311
312
|
}
|
|
312
313
|
},
|
|
313
314
|
initial: "initial",
|
|
314
|
-
animate:
|
|
315
|
-
children:
|
|
315
|
+
animate: b ? "whileInView" : "initial",
|
|
316
|
+
children: vt(t.rightBar, K, G, E, X)
|
|
316
317
|
}
|
|
317
318
|
) : null
|
|
318
319
|
]
|
|
@@ -341,26 +342,26 @@ function zt(z) {
|
|
|
341
342
|
textSide: "right",
|
|
342
343
|
classNames: t.classNames,
|
|
343
344
|
styles: t.styles,
|
|
344
|
-
animate:
|
|
345
|
-
isInView:
|
|
345
|
+
animate: x,
|
|
346
|
+
isInView: b
|
|
346
347
|
},
|
|
347
348
|
r
|
|
348
349
|
)) }) : null
|
|
349
350
|
] })
|
|
350
351
|
] }),
|
|
351
|
-
/* @__PURE__ */ e.jsx(
|
|
352
|
-
|
|
352
|
+
/* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(I.g, { transform: `translate(${C / 2},0)`, children: Y.map((t, r) => /* @__PURE__ */ e.jsx(
|
|
353
|
+
Ot,
|
|
353
354
|
{
|
|
354
355
|
value: `${t.label}`.length < H ? `${t.label}` : `${`${t.label}`.substring(0, H)}...`,
|
|
355
356
|
y: a(`${t.id}`),
|
|
356
|
-
x: 0 -
|
|
357
|
-
width:
|
|
357
|
+
x: 0 - d / 2,
|
|
358
|
+
width: d,
|
|
358
359
|
height: a.bandwidth(),
|
|
359
360
|
alignment: "center",
|
|
360
361
|
style: u?.yAxis?.labels,
|
|
361
362
|
className: l?.yAxis?.labels,
|
|
362
|
-
animate:
|
|
363
|
-
isInView:
|
|
363
|
+
animate: x,
|
|
364
|
+
isInView: b
|
|
364
365
|
},
|
|
365
366
|
r
|
|
366
367
|
)) }) }),
|
|
@@ -374,7 +375,7 @@ function zt(z) {
|
|
|
374
375
|
...u?.yAxis?.title
|
|
375
376
|
},
|
|
376
377
|
className: et("text-base", l?.yAxis?.title),
|
|
377
|
-
x: C / 2 -
|
|
378
|
+
x: C / 2 - d / 2,
|
|
378
379
|
y: 0,
|
|
379
380
|
dx: -5,
|
|
380
381
|
dy: 20,
|
|
@@ -390,7 +391,7 @@ function zt(z) {
|
|
|
390
391
|
...u?.yAxis?.title
|
|
391
392
|
},
|
|
392
393
|
className: et("text-base", l?.yAxis?.title),
|
|
393
|
-
x: C / 2 +
|
|
394
|
+
x: C / 2 + d / 2,
|
|
394
395
|
y: 0,
|
|
395
396
|
dx: 5,
|
|
396
397
|
dy: 20,
|
|
@@ -403,7 +404,7 @@ function zt(z) {
|
|
|
403
404
|
}
|
|
404
405
|
),
|
|
405
406
|
st && J && lt && A ? /* @__PURE__ */ e.jsx(
|
|
406
|
-
|
|
407
|
+
Vt,
|
|
407
408
|
{
|
|
408
409
|
data: st,
|
|
409
410
|
body: J,
|
|
@@ -414,7 +415,7 @@ function zt(z) {
|
|
|
414
415
|
}
|
|
415
416
|
) : null,
|
|
416
417
|
$ && T !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
417
|
-
|
|
418
|
+
Lt,
|
|
418
419
|
{
|
|
419
420
|
open: T !== void 0,
|
|
420
421
|
onClose: () => {
|
|
@@ -424,7 +425,7 @@ function zt(z) {
|
|
|
424
425
|
"div",
|
|
425
426
|
{
|
|
426
427
|
className: "graph-modal-content m-0",
|
|
427
|
-
dangerouslySetInnerHTML: typeof $ == "string" ? { __html:
|
|
428
|
+
dangerouslySetInnerHTML: typeof $ == "string" ? { __html: Tt($, T) } : void 0,
|
|
428
429
|
children: typeof $ == "function" ? $(T) : null
|
|
429
430
|
}
|
|
430
431
|
)
|
|
@@ -433,16 +434,16 @@ function zt(z) {
|
|
|
433
434
|
] });
|
|
434
435
|
}
|
|
435
436
|
function W(z, c, y, j) {
|
|
436
|
-
const m = z.map((B) => B[c]).filter((B) => !ut(B)),
|
|
437
|
-
return { min:
|
|
437
|
+
const m = z.map((B) => B[c]).filter((B) => !ut(B)), d = ut(y) ? Math.min(...m) >= 0 ? 0 : Math.min(...m) : y, s = ut(j) ? Math.max(...m) < 0 ? 0 : Math.max(...m) : j;
|
|
438
|
+
return { min: d, max: s };
|
|
438
439
|
}
|
|
439
|
-
function
|
|
440
|
+
function je(z) {
|
|
440
441
|
const {
|
|
441
442
|
data: c,
|
|
442
443
|
graphTitle: y,
|
|
443
444
|
sources: j,
|
|
444
445
|
graphDescription: m,
|
|
445
|
-
height:
|
|
446
|
+
height: d,
|
|
446
447
|
width: s,
|
|
447
448
|
footNote: B,
|
|
448
449
|
padding: q,
|
|
@@ -468,16 +469,16 @@ function we(z) {
|
|
|
468
469
|
showValues: u = !0,
|
|
469
470
|
maxValue: l,
|
|
470
471
|
minValue: N,
|
|
471
|
-
refValues:
|
|
472
|
+
refValues: x = [],
|
|
472
473
|
suffix: G = "",
|
|
473
474
|
prefix: rt = "",
|
|
474
475
|
showTicks: L = !0,
|
|
475
476
|
showColorScale: V = !1,
|
|
476
477
|
graphDownload: K = !1,
|
|
477
478
|
dataDownload: Q = !1,
|
|
478
|
-
language:
|
|
479
|
+
language: b = "en",
|
|
479
480
|
colorLegendTitle: st,
|
|
480
|
-
minHeight:
|
|
481
|
+
minHeight: v = 0,
|
|
481
482
|
theme: T = "light",
|
|
482
483
|
ariaLabel: P,
|
|
483
484
|
resetSelectionOnDoubleClick: lt = !0,
|
|
@@ -490,28 +491,27 @@ function we(z) {
|
|
|
490
491
|
customLayers: Y = [],
|
|
491
492
|
timeline: a = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
492
493
|
naLabel: o = "NA"
|
|
493
|
-
} = z, [D, n] = S(0), [Z, t] = S(0), [r, p] = S(a.autoplay), g =
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
).map((i) => kt(`${i.date}`, a.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
494
|
+
} = z, [D, n] = S(0), [Z, t] = S(0), [r, p] = S(a.autoplay), g = Yt(
|
|
495
|
+
Gt(c, "date", !0).map(
|
|
496
|
+
(i) => Ct(`${i}`, a.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()
|
|
497
|
+
),
|
|
498
498
|
(i, R) => Wt(i, R)
|
|
499
|
-
), [ht,
|
|
499
|
+
), [ht, xt] = S(a.autoplay ? 0 : g.length - 1), tt = gt(null), ft = gt(null);
|
|
500
500
|
yt(() => {
|
|
501
501
|
const i = new ResizeObserver((R) => {
|
|
502
|
-
n(s || R[0].target.clientWidth || 620), t(
|
|
502
|
+
n(s || R[0].target.clientWidth || 620), t(d || R[0].target.clientHeight || 480);
|
|
503
503
|
});
|
|
504
504
|
return tt.current && (t(tt.current.clientHeight || 480), n(tt.current.clientWidth || 620), s || i.observe(tt.current)), () => i.disconnect();
|
|
505
|
-
}, [s,
|
|
505
|
+
}, [s, d]), yt(() => {
|
|
506
506
|
const i = setInterval(
|
|
507
507
|
() => {
|
|
508
|
-
|
|
508
|
+
xt((R) => R < g.length - 1 ? R + 1 : 0);
|
|
509
509
|
},
|
|
510
510
|
(a.speed || 2) * 1e3
|
|
511
511
|
);
|
|
512
512
|
return r || clearInterval(i), () => clearInterval(i);
|
|
513
513
|
}, [g, r, a.speed]);
|
|
514
|
-
const pt =
|
|
514
|
+
const pt = Nt(
|
|
515
515
|
g,
|
|
516
516
|
ht,
|
|
517
517
|
a.showOnlyActiveDate,
|
|
@@ -521,12 +521,12 @@ function we(z) {
|
|
|
521
521
|
"div",
|
|
522
522
|
{
|
|
523
523
|
className: `${T || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
|
|
524
|
-
dir:
|
|
524
|
+
dir: b === "he" || b === "ar" ? "rtl" : void 0,
|
|
525
525
|
children: /* @__PURE__ */ e.jsx(
|
|
526
526
|
"div",
|
|
527
527
|
{
|
|
528
528
|
className: et(
|
|
529
|
-
`${M ? M === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${
|
|
529
|
+
`${M ? M === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b || "en"}`,
|
|
530
530
|
s ? "w-fit" : "w-full",
|
|
531
531
|
f?.graphContainer
|
|
532
532
|
),
|
|
@@ -544,7 +544,7 @@ function we(z) {
|
|
|
544
544
|
style: { padding: M ? q || "1rem" : q || 0 },
|
|
545
545
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
546
546
|
y || m || K || Q ? /* @__PURE__ */ e.jsx(
|
|
547
|
-
|
|
547
|
+
Ft,
|
|
548
548
|
{
|
|
549
549
|
styles: {
|
|
550
550
|
title: A?.title,
|
|
@@ -571,11 +571,11 @@ function we(z) {
|
|
|
571
571
|
},
|
|
572
572
|
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
573
573
|
"aria-label": r ? "Click to pause animation" : "Click to play animation",
|
|
574
|
-
children: r ? /* @__PURE__ */ e.jsx(
|
|
574
|
+
children: r ? /* @__PURE__ */ e.jsx(Rt, {}) : /* @__PURE__ */ e.jsx(Xt, {})
|
|
575
575
|
}
|
|
576
576
|
),
|
|
577
577
|
/* @__PURE__ */ e.jsx(
|
|
578
|
-
|
|
578
|
+
At,
|
|
579
579
|
{
|
|
580
580
|
min: g[0],
|
|
581
581
|
max: g[g.length - 1],
|
|
@@ -584,18 +584,18 @@ function we(z) {
|
|
|
584
584
|
defaultValue: g[g.length - 1],
|
|
585
585
|
value: g[ht],
|
|
586
586
|
onChangeComplete: (i) => {
|
|
587
|
-
|
|
587
|
+
xt(g.indexOf(i));
|
|
588
588
|
},
|
|
589
589
|
onChange: (i) => {
|
|
590
|
-
|
|
590
|
+
xt(g.indexOf(i));
|
|
591
591
|
},
|
|
592
592
|
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
593
593
|
}
|
|
594
594
|
)
|
|
595
595
|
] }) : null,
|
|
596
|
-
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: c.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
596
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: c.length === 0 ? /* @__PURE__ */ e.jsx(Pt, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
597
597
|
V ? /* @__PURE__ */ e.jsx(
|
|
598
|
-
|
|
598
|
+
Ht,
|
|
599
599
|
{
|
|
600
600
|
colorLegendTitle: st,
|
|
601
601
|
colorDomain: [F, J],
|
|
@@ -609,14 +609,14 @@ function we(z) {
|
|
|
609
609
|
className: "flex flex-col grow justify-center leading-0",
|
|
610
610
|
ref: tt,
|
|
611
611
|
"aria-label": "Graph area",
|
|
612
|
-
children: (s || D) && (
|
|
612
|
+
children: (s || D) && (d || Z) ? /* @__PURE__ */ e.jsx(
|
|
613
613
|
zt,
|
|
614
614
|
{
|
|
615
|
-
data:
|
|
615
|
+
data: Et(
|
|
616
616
|
c,
|
|
617
617
|
a.dateFormat || "yyyy"
|
|
618
618
|
).filter(
|
|
619
|
-
(i) => a.enabled ? i.date ===
|
|
619
|
+
(i) => a.enabled ? i.date === kt(
|
|
620
620
|
new Date(g[ht]),
|
|
621
621
|
a.dateFormat || "yyyy"
|
|
622
622
|
) : i
|
|
@@ -625,8 +625,8 @@ function we(z) {
|
|
|
625
625
|
width: s || D,
|
|
626
626
|
centerGap: $,
|
|
627
627
|
height: Math.max(
|
|
628
|
-
|
|
629
|
-
|
|
628
|
+
v,
|
|
629
|
+
d || (H ? v ? (s || D) * H > v ? (s || D) * H : v : (s || D) * H : Z)
|
|
630
630
|
),
|
|
631
631
|
truncateBy: E,
|
|
632
632
|
leftMargin: nt,
|
|
@@ -637,7 +637,7 @@ function we(z) {
|
|
|
637
637
|
tooltip: mt,
|
|
638
638
|
onSeriesMouseOver: k,
|
|
639
639
|
barPadding: X,
|
|
640
|
-
refValues:
|
|
640
|
+
refValues: x,
|
|
641
641
|
maxValue: Math.max(
|
|
642
642
|
W(c, "leftBar", N, l).max,
|
|
643
643
|
W(c, "rightBar", N, l).max
|
|
@@ -668,7 +668,7 @@ function we(z) {
|
|
|
668
668
|
)
|
|
669
669
|
] }) }),
|
|
670
670
|
j || B ? /* @__PURE__ */ e.jsx(
|
|
671
|
-
|
|
671
|
+
St,
|
|
672
672
|
{
|
|
673
673
|
styles: { footnote: A?.footnote, source: A?.source },
|
|
674
674
|
classNames: {
|
|
@@ -689,6 +689,6 @@ function we(z) {
|
|
|
689
689
|
);
|
|
690
690
|
}
|
|
691
691
|
export {
|
|
692
|
-
|
|
692
|
+
je as ButterflyChart
|
|
693
693
|
};
|
|
694
694
|
//# sourceMappingURL=ButterflyChart.js.map
|