@undp/data-viz 2.2.2 → 2.3.0

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.
Files changed (123) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +1 -1
  3. package/dist/Axis-D56Gy0se.js +31 -0
  4. package/dist/Axis-D56Gy0se.js.map +1 -0
  5. package/dist/Axis-Jt_tmhxS.cjs +2 -0
  6. package/dist/Axis-Jt_tmhxS.cjs.map +1 -0
  7. package/dist/BarGraph.cjs +1 -1
  8. package/dist/BarGraph.cjs.map +1 -1
  9. package/dist/BarGraph.d.ts +6 -0
  10. package/dist/BarGraph.js +1759 -1750
  11. package/dist/BarGraph.js.map +1 -1
  12. package/dist/BeeSwarmChart.cjs +1 -1
  13. package/dist/BeeSwarmChart.cjs.map +1 -1
  14. package/dist/BeeSwarmChart.d.ts +2 -0
  15. package/dist/BeeSwarmChart.js +270 -267
  16. package/dist/BeeSwarmChart.js.map +1 -1
  17. package/dist/BiVariateChoroplethMap.cjs +1 -1
  18. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  19. package/dist/BiVariateChoroplethMap.d.ts +4 -0
  20. package/dist/BiVariateChoroplethMap.js +328 -401
  21. package/dist/BiVariateChoroplethMap.js.map +1 -1
  22. package/dist/BulletChart.cjs +1 -1
  23. package/dist/BulletChart.cjs.map +1 -1
  24. package/dist/BulletChart.d.ts +2 -0
  25. package/dist/BulletChart.js +544 -542
  26. package/dist/BulletChart.js.map +1 -1
  27. package/dist/ButterflyChart.cjs +1 -1
  28. package/dist/ButterflyChart.cjs.map +1 -1
  29. package/dist/ButterflyChart.d.ts +2 -0
  30. package/dist/ButterflyChart.js +332 -330
  31. package/dist/ButterflyChart.js.map +1 -1
  32. package/dist/ChoroplethMap.cjs +1 -1
  33. package/dist/ChoroplethMap.cjs.map +1 -1
  34. package/dist/ChoroplethMap.d.ts +4 -0
  35. package/dist/ChoroplethMap.js +341 -416
  36. package/dist/ChoroplethMap.js.map +1 -1
  37. package/dist/Data/01.json +4042 -0
  38. package/dist/Data/mapData.json +4543 -0
  39. package/dist/Data/testMap.json +361 -0
  40. package/dist/DifferenceLineChart.cjs +1 -1
  41. package/dist/DifferenceLineChart.js +1 -1
  42. package/dist/DotDensityMap.cjs +1 -1
  43. package/dist/DotDensityMap.cjs.map +1 -1
  44. package/dist/DotDensityMap.d.ts +4 -0
  45. package/dist/DotDensityMap.js +297 -311
  46. package/dist/DotDensityMap.js.map +1 -1
  47. package/dist/DualAxisLineChart.cjs +1 -1
  48. package/dist/DualAxisLineChart.js +1 -1
  49. package/dist/DumbbellChart.cjs +1 -1
  50. package/dist/DumbbellChart.cjs.map +1 -1
  51. package/dist/DumbbellChart.d.ts +2 -0
  52. package/dist/DumbbellChart.js +537 -536
  53. package/dist/DumbbellChart.js.map +1 -1
  54. package/dist/{GraphEl-DcNr5JzH.js → GraphEl-L5hNe7wJ.js} +84 -67
  55. package/dist/GraphEl-L5hNe7wJ.js.map +1 -0
  56. package/dist/GraphEl-ic8C5Ksc.cjs +2 -0
  57. package/dist/GraphEl-ic8C5Ksc.cjs.map +1 -0
  58. package/dist/GriddedGraphs.cjs +1 -1
  59. package/dist/GriddedGraphs.d.ts +3 -0
  60. package/dist/GriddedGraphs.js +1 -1
  61. package/dist/GriddedGraphsFromConfig.d.ts +3 -0
  62. package/dist/Histogram.cjs +1 -1
  63. package/dist/Histogram.cjs.map +1 -1
  64. package/dist/Histogram.d.ts +2 -0
  65. package/dist/Histogram.js +50 -49
  66. package/dist/Histogram.js.map +1 -1
  67. package/dist/HybridMap.cjs +1 -1
  68. package/dist/HybridMap.cjs.map +1 -1
  69. package/dist/HybridMap.d.ts +4 -0
  70. package/dist/HybridMap.js +368 -418
  71. package/dist/HybridMap.js.map +1 -1
  72. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  73. package/dist/LineChartWithConfidenceInterval.js +1 -1
  74. package/dist/MultiGraphDashboard.d.ts +3 -0
  75. package/dist/MultiGraphDashboardFromConfig.d.ts +3 -0
  76. package/dist/MultiLineAltChart.cjs +1 -1
  77. package/dist/MultiLineAltChart.js +1 -1
  78. package/dist/MultiLineChart.cjs +1 -1
  79. package/dist/MultiLineChart.js +1 -1
  80. package/dist/ParetoChart.cjs +1 -1
  81. package/dist/ParetoChart.js +1 -1
  82. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +3 -0
  83. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +3 -0
  84. package/dist/PerformanceIntensiveScrollStory.d.ts +3 -0
  85. package/dist/ScatterPlot.cjs +1 -1
  86. package/dist/ScatterPlot.js +1 -1
  87. package/dist/ScrollStory.d.ts +3 -0
  88. package/dist/SimpleLineChart.cjs +1 -1
  89. package/dist/SimpleLineChart.js +1 -1
  90. package/dist/SingleGraphDashboard.cjs +1 -1
  91. package/dist/SingleGraphDashboard.d.ts +3 -0
  92. package/dist/SingleGraphDashboard.js +1 -1
  93. package/dist/SingleGraphDashboardFromConfig.d.ts +3 -0
  94. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +3 -0
  95. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +3 -0
  96. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +3 -0
  97. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +3 -0
  98. package/dist/SlopeChart.cjs +1 -1
  99. package/dist/SlopeChart.js +1 -1
  100. package/dist/Types.d.ts +3 -0
  101. package/dist/WaterfallChart.cjs +1 -1
  102. package/dist/WaterfallChart.cjs.map +1 -1
  103. package/dist/WaterfallChart.d.ts +2 -0
  104. package/dist/WaterfallChart.js +263 -261
  105. package/dist/WaterfallChart.js.map +1 -1
  106. package/dist/index-DLFt97gy.cjs +2 -0
  107. package/dist/index-DLFt97gy.cjs.map +1 -0
  108. package/dist/index-Dp_SfsUA.js +2344 -0
  109. package/dist/index-Dp_SfsUA.js.map +1 -0
  110. package/dist/index.d.ts +37 -0
  111. package/package.json +2 -1
  112. package/readme.md +0 -7
  113. package/dist/Axis-DoOqnt6g.js +0 -32
  114. package/dist/Axis-DoOqnt6g.js.map +0 -1
  115. package/dist/Axis-Dtjn-EgM.cjs +0 -2
  116. package/dist/Axis-Dtjn-EgM.cjs.map +0 -1
  117. package/dist/GraphEl-CAjJLOGk.cjs +0 -2
  118. package/dist/GraphEl-CAjJLOGk.cjs.map +0 -1
  119. package/dist/GraphEl-DcNr5JzH.js.map +0 -1
  120. package/dist/zoom-5AkJSuWO.js +0 -1864
  121. package/dist/zoom-5AkJSuWO.js.map +0 -1
  122. package/dist/zoom-ChcvXFIz.cjs +0 -2
  123. package/dist/zoom-ChcvXFIz.cjs.map +0 -1
@@ -1,455 +1,380 @@
1
- import { j as t, m as yt, c as xt } from "./index-CHPV5EwG-DecW7_qr.js";
2
- import { useState as M, useRef as Oe, useEffect as Qe, useEffectEvent as vt } from "react";
3
- import { g as bt, N as kt } from "./getSliderMarks-Cvg8zHBU.js";
4
- import { w as jt } from "./Spinner--r2RrJV8.js";
5
- import { f as wt, p as $t } from "./parse-Dv4of-PN.js";
6
- import { i as Ct } from "./index-Bwrro8-q.js";
7
- import { z as Dt, i as Nt, g as St, a as Mt, b as Ot, c as Et, d as It } from "./zoom-5AkJSuWO.js";
8
- import { j as pt } from "./Typography-hWfh3H0J.js";
9
- import { i as Pt } from "./index-DCsFBfJ_.js";
10
- import { n as zt } from "./numberFormattingFunction-14YCbkN2.js";
11
- import { T as Lt } from "./Tooltip-BRnAz2Gv.js";
12
- import { c as At } from "./checkIfNullOrUndefined-DmfiKkNw.js";
13
- import { X as Bt, P as Wt, e as Ft } from "./index-BQYOuXdl.js";
14
- import { D as _t } from "./DetailsModal-BMCTgVsk.js";
15
- import { o as Tt } from "./ordinal-CHaxGJ_l.js";
16
- import { t as Vt } from "./threshold-DFfqcDMa.js";
17
- import { s as dt } from "./select-DKy99ogv.js";
18
- import { m as Ke } from "./proxy-DRuSUlPL.js";
19
- import { u as Ht } from "./use-in-view-Dl5L8LtP.js";
20
- import { A as Gt } from "./index-CtMBjvtq.js";
21
- import { GraphFooter as Ut } from "./GraphFooter.js";
22
- import { GraphHeader as qt } from "./GraphHeader.js";
23
- import { Colors as Ze } from "./Colors.js";
24
- import { f as Xt } from "./fetchAndParseData-BAXhgTDM.js";
25
- import { g as Rt } from "./getUniqValue-DsqSii6M.js";
26
- import { g as Yt } from "./getJenks-DTCcQSDi.js";
27
- import { a as Jt, G as Kt } from "./GraphContainer-CF6ws3pd.js";
28
- function Zt(u) {
1
+ import { j as t, m as wt, c as Dt } from "./index-CHPV5EwG-DecW7_qr.js";
2
+ import { useMemo as Ct, useState as j, useRef as Ie, useEffect as tt, useEffectEvent as Nt } from "react";
3
+ import { g as St, N as Ot } from "./getSliderMarks-Cvg8zHBU.js";
4
+ import { w as Mt } from "./Spinner--r2RrJV8.js";
5
+ import { f as It, p as Et } from "./parse-Dv4of-PN.js";
6
+ import { i as zt } from "./index-Bwrro8-q.js";
7
+ import { i as Pt, z as At, a as Bt, g as Lt, b as Ft, c as Wt, d as _t, e as Tt, f as $t } from "./index-Dp_SfsUA.js";
8
+ import { j as xt } from "./Typography-hWfh3H0J.js";
9
+ import { i as Ht } from "./index-DCsFBfJ_.js";
10
+ import { n as Gt } from "./numberFormattingFunction-14YCbkN2.js";
11
+ import { T as Vt } from "./Tooltip-BRnAz2Gv.js";
12
+ import { c as Rt } from "./checkIfNullOrUndefined-DmfiKkNw.js";
13
+ import { X as Ut, P as qt, e as Xt } from "./index-BQYOuXdl.js";
14
+ import { D as Yt } from "./DetailsModal-BMCTgVsk.js";
15
+ import { o as Jt } from "./ordinal-CHaxGJ_l.js";
16
+ import { t as Kt } from "./threshold-DFfqcDMa.js";
17
+ import { s as ft } from "./select-DKy99ogv.js";
18
+ import { m as Qe } from "./proxy-DRuSUlPL.js";
19
+ import { u as Zt } from "./use-in-view-Dl5L8LtP.js";
20
+ import { A as Qt } from "./index-CtMBjvtq.js";
21
+ import { GraphFooter as eo } from "./GraphFooter.js";
22
+ import { GraphHeader as to } from "./GraphHeader.js";
23
+ import { Colors as et } from "./Colors.js";
24
+ import { f as oo } from "./fetchAndParseData-BAXhgTDM.js";
25
+ import { g as ro } from "./getUniqValue-DsqSii6M.js";
26
+ import { g as ao } from "./getJenks-DTCcQSDi.js";
27
+ import { a as io, G as no } from "./GraphContainer-CF6ws3pd.js";
28
+ function so(c) {
29
29
  const {
30
30
  data: e,
31
- colorDomain: l,
32
- colors: d,
33
- mapData: b,
34
- colorLegendTitle: O,
35
- categorical: H,
36
- height: w,
37
- width: x,
38
- scale: k,
39
- centerPoint: G,
40
- tooltip: re,
41
- mapBorderWidth: U,
42
- mapBorderColor: Y,
43
- mapNoDataColor: ae,
44
- onSeriesMouseOver: ie,
45
- showColorScale: ve,
31
+ colorDomain: r,
32
+ colors: i,
33
+ mapData: W,
34
+ colorLegendTitle: k,
35
+ categorical: _,
36
+ height: f,
37
+ width: u,
38
+ scale: h,
39
+ centerPoint: T,
40
+ tooltip: K,
41
+ mapBorderWidth: Z,
42
+ mapBorderColor: he,
43
+ mapNoDataColor: ge,
44
+ onSeriesMouseOver: Q,
45
+ showColorScale: fe,
46
46
  zoomScaleExtend: Ee,
47
- zoomTranslateExtend: Ie,
48
- highlightedIds: S,
49
- onSeriesMouseClick: ne,
50
- mapProperty: j,
51
- resetSelectionOnDoubleClick: be,
52
- detailsOnClick: J,
47
+ zoomTranslateExtend: ze,
48
+ highlightedIds: b,
49
+ onSeriesMouseClick: ee,
50
+ mapProperty: g,
51
+ resetSelectionOnDoubleClick: ye,
52
+ detailsOnClick: V,
53
53
  styles: Pe,
54
- classNames: se,
55
- mapProjection: P,
56
- zoomInteraction: z,
57
- animate: D,
58
- dimmedOpacity: L,
59
- customLayers: le,
60
- collapseColorScaleByDefault: ke,
61
- zoomAndCenterByHighlightedIds: je
62
- } = u, [E, A] = M(void 0), ce = Oe(null), [ze, we] = M(ke === void 0 ? !(x < 680) : !ke), [K, de] = M(void 0), [q, g] = M(void 0), [y, Z] = M(void 0), [$e, me] = M(void 0), X = Oe(null), R = Ht(X, {
63
- once: D.once,
64
- amount: D.amount
65
- }), Q = Oe(null), Ce = H ? Tt().domain(l).range(d) : Vt().domain(l).range(d);
66
- Qe(() => {
67
- const o = dt(Q.current), s = dt(X.current), v = (r) => {
68
- if (z === "noZoom") return !1;
69
- if (z === "button") return !r.type.includes("wheel");
70
- const n = r.type === "wheel", c = r.type.startsWith("touch"), i = r.type === "mousedown" || r.type === "mousemove";
71
- return c ? !0 : n ? z === "scroll" ? !0 : r.ctrlKey : i && !r.button && !r.ctrlKey;
72
- }, a = Dt().scaleExtent(Ee).translateExtent(Ie || [[-20, -20], [x + 20, w + 20]]).filter(v).on("zoom", ({
73
- transform: r
54
+ classNames: te,
55
+ mapProjection: S,
56
+ zoomInteraction: O,
57
+ animate: w,
58
+ dimmedOpacity: M,
59
+ customLayers: oe,
60
+ collapseColorScaleByDefault: xe,
61
+ zoomAndCenterByHighlightedIds: ve,
62
+ projectionRotate: $,
63
+ rewindCoordinatesInMapData: be
64
+ } = c, y = Ct(() => be ? Pt(W, {
65
+ reverse: !0
66
+ }) : W, [W, be]), [D, I] = j(void 0), R = Ie(null), [Ae, re] = j(xe === void 0 ? !(u < 680) : !xe), [d, m] = j(void 0), [U, ae] = j(void 0), [je, ie] = j(void 0), [q, H] = j(void 0), E = Ie(null), X = Zt(E, {
67
+ once: w.once,
68
+ amount: w.amount
69
+ }), ke = Ie(null), Be = _ ? Jt().domain(r).range(i) : Kt().domain(r).range(i);
70
+ tt(() => {
71
+ const o = ft(ke.current), a = ft(E.current), v = (s) => {
72
+ if (O === "noZoom") return !1;
73
+ if (O === "button") return !s.type.includes("wheel");
74
+ const se = s.type === "wheel", le = s.type.startsWith("touch"), Se = s.type === "mousedown" || s.type === "mousemove";
75
+ return le ? !0 : se ? O === "scroll" ? !0 : s.ctrlKey : Se && !s.button && !s.ctrlKey;
76
+ }, N = At().scaleExtent(Ee).translateExtent(ze || [[-20, -20], [u + 20, f + 20]]).filter(v).on("zoom", ({
77
+ transform: s
74
78
  }) => {
75
- o.attr("transform", r);
79
+ o.attr("transform", s);
76
80
  });
77
- s.call(a), ce.current = a;
78
- }, [w, x, z]);
79
- const ee = Nt({
80
- ...b,
81
- features: je ? b.features.filter(
81
+ a.call(N), R.current = N;
82
+ }, [f, u, O]);
83
+ const x = Bt({
84
+ ...y,
85
+ features: ve ? y.features.filter(
82
86
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
83
- (o) => (S || []).length === 0 || S.indexOf(o.properties[j]) !== -1
84
- ) : b.features
85
- }), $ = Pt({
86
- ...b,
87
- features: je ? b.features.filter(
87
+ (o) => (b || []).length === 0 || b.indexOf(o.properties[g]) !== -1
88
+ ) : y.features
89
+ }), C = Ht({
90
+ ...y,
91
+ features: ve ? y.features.filter(
88
92
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
- (o) => (S || []).length === 0 || S.indexOf(o.properties[j]) !== -1
90
- ) : b.features
91
- }), pe = ee[2] - ee[0], B = ee[3] - ee[1], De = x * 190 / 960 * 360 / pe, Ne = w * 190 / 678 * 180 / B, W = k * Math.min(De, Ne), I = P === "mercator" ? St().rotate([0, 0]).center(G || $.geometry.coordinates).translate([x / 2, w / 2]).scale(W) : P === "equalEarth" ? Mt().rotate([0, 0]).center(G || $.geometry.coordinates).translate([x / 2, w / 2]).scale(W) : P === "naturalEarth" ? Ot().rotate([0, 0]).center(G || $.geometry.coordinates).translate([x / 2, w / 2]).scale(W) : P === "orthographic" ? Et().rotate([0, 0]).center(G || $.geometry.coordinates).translate([x / 2, w / 2]).scale(W) : It().rotate([0, 0]).center(G || $.geometry.coordinates).translate([x / 2, w / 2]).scale(W), he = (o) => {
92
- if (!X.current || !ce.current) return;
93
- dt(X.current).call(ce.current.scaleBy, o === "in" ? 1.2 : 1 / 1.2);
93
+ (o) => (b || []).length === 0 || b.indexOf(o.properties[g]) !== -1
94
+ ) : y.features
95
+ }), z = x[2] - x[0], we = x[3] - x[1], De = u * 190 / 960 * 360 / z, Ce = f * 190 / 678 * 180 / we, P = h * Math.min(De, Ce), Ne = S === "mercator" ? Lt().rotate($).center(T || C.geometry.coordinates).translate([u / 2, f / 2]).scale(P) : S === "equalEarth" ? Ft().rotate($).center(T || C.geometry.coordinates).translate([u / 2, f / 2]).scale(P) : S === "naturalEarth" ? Wt().rotate($).center(T || C.geometry.coordinates).translate([u / 2, f / 2]).scale(P) : S === "orthographic" ? _t().rotate($).center(T || C.geometry.coordinates).translate([u / 2, f / 2]).scale(P) : Tt().rotate($).center(T || C.geometry.coordinates).translate([u / 2, f / 2]).scale(P), G = $t().projection(Ne), ne = (o) => {
96
+ if (!E.current || !R.current) return;
97
+ ft(E.current).call(R.current.scaleBy, o === "in" ? 1.2 : 1 / 1.2);
94
98
  };
95
99
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
96
100
  /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
97
- /* @__PURE__ */ t.jsx(Ke.svg, { width: `${x}px`, height: `${w}px`, viewBox: `0 0 ${x} ${w}`, ref: X, direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { ref: Q, children: [
98
- le.filter((o) => o.position === "before").map((o) => o.layer),
99
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
100
- b.features.map((o, s) => e.findIndex((a) => a.id === o.properties[j]) !== -1 ? null : /* @__PURE__ */ t.jsx("g", { opacity: E ? L : S.length !== 0 ? S.indexOf(o.properties[j]) !== -1 ? 1 : L : 1, children: o.geometry.type === "MultiPolygon" ? (
101
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
- o.geometry.coordinates.map((a, r) => {
103
- let n = "";
104
- return a.forEach((c) => {
105
- let i = " M";
106
- c.forEach((p, N) => {
107
- const C = I([p[0], p[1]]);
108
- N !== c.length - 1 ? i = `${i}${C[0]} ${C[1]}L` : i = `${i}${C[0]} ${C[1]}`;
109
- }), n += i;
110
- }), /* @__PURE__ */ t.jsx("path", { d: n, style: {
111
- stroke: Y,
112
- strokeWidth: U,
113
- fill: ae
114
- } }, r);
115
- })
116
- ) : (
117
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
118
- o.geometry.coordinates.map((a, r) => {
119
- let n = "M";
120
- return a.forEach((c, i) => {
121
- const p = I([c[0], c[1]]);
122
- i !== a.length - 1 ? n = `${n}${p[0]} ${p[1]}L` : n = `${n}${p[0]} ${p[1]}`;
123
- }), /* @__PURE__ */ t.jsx("path", { d: n, style: {
124
- stroke: Y,
125
- strokeWidth: U,
126
- fill: ae
127
- } }, r);
128
- })
129
- ) }, s)),
130
- /* @__PURE__ */ t.jsx(Gt, { children: e.map((o) => {
131
- const s = b.features.findIndex(
101
+ /* @__PURE__ */ t.jsx(Qe.svg, { width: `${u}px`, height: `${f}px`, viewBox: `0 0 ${u} ${f}`, ref: E, direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { ref: ke, children: [
102
+ oe.filter((o) => o.position === "before").map((o) => o.layer),
103
+ y.features.map((o, a) => {
104
+ if (!o.properties?.[g]) return null;
105
+ const v = G(o);
106
+ return v ? /* @__PURE__ */ t.jsx(Qe.g, { opacity: D ? M : b.length !== 0 ? b.indexOf(o.properties[g]) !== -1 ? 1 : M : 1, children: /* @__PURE__ */ t.jsx("path", { d: v, style: {
107
+ stroke: he,
108
+ strokeWidth: Z,
109
+ fill: ge
110
+ } }) }, a) : null;
111
+ }),
112
+ /* @__PURE__ */ t.jsx(Qt, { children: e.map((o) => {
113
+ const a = y.features.findIndex(
132
114
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
133
- (a) => o.id === a.properties[j]
134
- ), v = At(o.x) ? ae : (
115
+ (s) => o.id === s.properties[g]
116
+ );
117
+ if (a === -1) return null;
118
+ const v = G(y.features[a]);
119
+ if (!v) return null;
120
+ const N = Rt(o.x) ? ge : (
135
121
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
136
- Ce(o.x)
122
+ Be(o.x)
137
123
  );
138
- return /* @__PURE__ */ t.jsx(Ke.g, { variants: {
124
+ return /* @__PURE__ */ t.jsx(Qe.g, { variants: {
139
125
  initial: {
140
126
  opacity: 0
141
127
  },
142
128
  whileInView: {
143
- opacity: E ? E === v ? 1 : L : S.length !== 0 ? S.indexOf(o.id) !== -1 ? 1 : L : 1,
129
+ opacity: D ? D === N ? 1 : M : b.length !== 0 ? b.indexOf(o.id) !== -1 ? 1 : M : 1,
144
130
  transition: {
145
- duration: D.duration
131
+ duration: w.duration
146
132
  }
147
133
  }
148
- }, initial: "initial", animate: R ? "whileInView" : "initial", exit: {
134
+ }, initial: "initial", animate: X ? "whileInView" : "initial", exit: {
149
135
  opacity: 0,
150
136
  transition: {
151
- duration: D.duration
137
+ duration: w.duration
152
138
  }
153
- }, onMouseEnter: (a) => {
154
- g(o), me(a.clientY), Z(a.clientX), ie?.(o);
155
- }, onMouseMove: (a) => {
156
- g(o), me(a.clientY), Z(a.clientX);
139
+ }, onMouseEnter: (s) => {
140
+ ae(o), H(s.clientY), ie(s.clientX), Q?.(o);
141
+ }, onMouseMove: (s) => {
142
+ ae(o), H(s.clientY), ie(s.clientX);
157
143
  }, onMouseLeave: () => {
158
- g(void 0), Z(void 0), me(void 0), ie?.(void 0);
144
+ ae(void 0), ie(void 0), H(void 0), Q?.(void 0);
159
145
  }, onClick: () => {
160
- (ne || J) && (Ct(K, o) && be ? (de(void 0), ne?.(void 0)) : (de(o), ne?.(o)));
161
- }, children: s === -1 ? null : b.features[s].geometry.type === "MultiPolygon" ? b.features[s].geometry.coordinates.map(
162
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
163
- (a, r) => {
164
- let n = "";
165
- return a.forEach((c) => {
166
- let i = " M";
167
- c.forEach((p, N) => {
168
- const C = I([p[0], p[1]]);
169
- N !== c.length - 1 ? i = `${i}${C[0]} ${C[1]}L` : i = `${i}${C[0]} ${C[1]}`;
170
- }), n += i;
171
- }), /* @__PURE__ */ t.jsx(Ke.path, { d: n, variants: {
172
- initial: {
173
- fill: v,
174
- opacity: 0
175
- },
176
- whileInView: {
177
- fill: v,
178
- opacity: 1,
179
- transition: {
180
- duration: D.duration
181
- }
182
- }
183
- }, initial: "initial", animate: R ? "whileInView" : "initial", exit: {
184
- opacity: 0,
185
- transition: {
186
- duration: D.duration
187
- }
188
- }, style: {
189
- stroke: Y,
190
- strokeWidth: U
191
- } }, `${o.id}-${r}`);
146
+ (ee || V) && (zt(d, o) && ye ? (m(void 0), ee?.(void 0)) : (m(o), ee?.(o)));
147
+ }, children: /* @__PURE__ */ t.jsx(Qe.path, { d: v, variants: {
148
+ initial: {
149
+ fill: N,
150
+ opacity: 0
151
+ },
152
+ whileInView: {
153
+ fill: N,
154
+ opacity: 1,
155
+ transition: {
156
+ duration: w.duration
157
+ }
192
158
  }
193
- ) : b.features[s].geometry.coordinates.map(
194
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
195
- (a, r) => {
196
- let n = "M";
197
- return a.forEach((c, i) => {
198
- const p = I([c[0], c[1]]);
199
- i !== a.length - 1 ? n = `${n}${p[0]} ${p[1]}L` : n = `${n}${p[0]} ${p[1]}`;
200
- }), /* @__PURE__ */ t.jsx(Ke.path, { d: n, variants: {
201
- initial: {
202
- fill: v,
203
- opacity: 0
204
- },
205
- whileInView: {
206
- fill: v,
207
- opacity: 1,
208
- transition: {
209
- duration: D.duration
210
- }
211
- }
212
- }, initial: "initial", animate: R ? "whileInView" : "initial", exit: {
213
- opacity: 0,
214
- transition: {
215
- duration: D.duration
216
- }
217
- }, style: {
218
- stroke: Y,
219
- strokeWidth: U
220
- } }, `${o.id}-${r}`);
159
+ }, initial: "initial", animate: X ? "whileInView" : "initial", exit: {
160
+ opacity: 0,
161
+ transition: {
162
+ duration: w.duration
221
163
  }
222
- ) }, o.id);
164
+ }, style: {
165
+ stroke: he,
166
+ strokeWidth: Z
167
+ } }, `${o.id}`) }, o.id);
223
168
  }) }),
224
- q ? b.features.filter(
225
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
226
- (o) => o.properties[j] === q.id
227
- ).map((o, s) => /* @__PURE__ */ t.jsx("g", { children: o.geometry.type === "MultiPolygon" ? (
228
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
229
- o.geometry.coordinates.map((v, a) => {
230
- let r = "";
231
- return v.forEach((n) => {
232
- let c = " M";
233
- n.forEach((i, p) => {
234
- const N = I([i[0], i[1]]);
235
- p !== n.length - 1 ? c = `${c}${N[0]} ${N[1]}L` : c = `${c}${N[0]} ${N[1]}`;
236
- }), r += c;
237
- }), /* @__PURE__ */ t.jsx("path", { d: r, className: "stroke-primary-gray-700 dark:stroke-primary-gray-300", style: {
238
- fill: "none",
239
- fillOpacity: 0,
240
- strokeWidth: "0.5"
241
- } }, a);
242
- })
243
- ) : (
169
+ U ? y.features.filter(
244
170
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
245
- o.geometry.coordinates.map((v, a) => {
246
- let r = "M";
247
- return v.forEach((n, c) => {
248
- const i = I([n[0], n[1]]);
249
- c !== v.length - 1 ? r = `${r}${i[0]} ${i[1]}L` : r = `${r}${i[0]} ${i[1]}`;
250
- }), /* @__PURE__ */ t.jsx("path", { d: r, className: "stroke-primary-gray-700 dark:stroke-primary-gray-300", style: {
251
- fill: "none",
252
- fillOpacity: 0,
253
- strokeWidth: "0.5"
254
- } }, a);
255
- })
256
- ) }, s)) : null,
257
- le.filter((o) => o.position === "after").map((o) => o.layer)
171
+ (o) => o.properties[g] === U.id
172
+ ).map((o, a) => /* @__PURE__ */ t.jsx("path", { d: G(o) || "", className: "stroke-primary-gray-700 dark:stroke-primary-gray-300", style: {
173
+ fill: "none",
174
+ fillOpacity: 0,
175
+ strokeWidth: "0.5"
176
+ } }, a)) : null,
177
+ oe.filter((o) => o.position === "after").map((o) => o.layer)
258
178
  ] }) }),
259
- ve === !1 ? null : /* @__PURE__ */ t.jsx("div", { className: yt("absolute left-4 bottom-4 map-color-legend", se?.colorLegend), children: ze ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
179
+ fe === !1 ? null : /* @__PURE__ */ t.jsx("div", { className: wt("absolute left-4 bottom-4 map-color-legend", te?.colorLegend), children: Ae ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
260
180
  /* @__PURE__ */ t.jsx("div", { className: "color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]", onClick: () => {
261
- we(!1);
262
- }, children: /* @__PURE__ */ t.jsx(Bt, {}) }),
181
+ re(!1);
182
+ }, children: /* @__PURE__ */ t.jsx(Ut, {}) }),
263
183
  /* @__PURE__ */ t.jsxs("div", { className: "color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]", style: {
264
- width: H ? void 0 : "340px"
184
+ width: _ ? void 0 : "340px"
265
185
  }, children: [
266
- O && O !== "" ? /* @__PURE__ */ t.jsx(pt, { size: "xs", marginBottom: "xs", className: "p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300", style: {
186
+ k && k !== "" ? /* @__PURE__ */ t.jsx(xt, { size: "xs", marginBottom: "xs", className: "p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300", style: {
267
187
  display: "-webkit-box",
268
188
  WebkitLineClamp: "1",
269
189
  WebkitBoxOrient: "vertical"
270
- }, children: O }) : null,
271
- H ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-3", children: l.map((o, s) => /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-center", onMouseOver: () => {
272
- A(d[s % d.length]);
190
+ }, children: k }) : null,
191
+ _ ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-3", children: r.map((o, a) => /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-center", onMouseOver: () => {
192
+ I(i[a % i.length]);
273
193
  }, onMouseLeave: () => {
274
- A(void 0);
194
+ I(void 0);
275
195
  }, children: [
276
196
  /* @__PURE__ */ t.jsx("div", { className: "w-2 h-2 rounded-full", style: {
277
- backgroundColor: d[s % d.length]
197
+ backgroundColor: i[a % i.length]
278
198
  } }),
279
- /* @__PURE__ */ t.jsx(pt, { size: "sm", marginBottom: "none", leading: "none", children: o })
280
- ] }, s)) }) : /* @__PURE__ */ t.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { children: [
281
- l.map((o, s) => /* @__PURE__ */ t.jsxs("g", { onMouseOver: () => {
282
- A(d[s]);
199
+ /* @__PURE__ */ t.jsx(xt, { size: "sm", marginBottom: "none", leading: "none", children: o })
200
+ ] }, a)) }) : /* @__PURE__ */ t.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { children: [
201
+ r.map((o, a) => /* @__PURE__ */ t.jsxs("g", { onMouseOver: () => {
202
+ I(i[a]);
283
203
  }, onMouseLeave: () => {
284
- A(void 0);
204
+ I(void 0);
285
205
  }, className: "cursor-pointer", children: [
286
- /* @__PURE__ */ t.jsx("rect", { x: s * 320 / d.length + 1, y: 1, width: 320 / d.length - 2, height: 8, className: E === d[s] ? "stroke-primary-gray-700 dark:stroke-primary-gray-300" : "", style: {
287
- fill: d[s],
288
- ...E === d[s] ? {} : {
289
- stroke: d[s]
206
+ /* @__PURE__ */ t.jsx("rect", { x: a * 320 / i.length + 1, y: 1, width: 320 / i.length - 2, height: 8, className: D === i[a] ? "stroke-primary-gray-700 dark:stroke-primary-gray-300" : "", style: {
207
+ fill: i[a],
208
+ ...D === i[a] ? {} : {
209
+ stroke: i[a]
290
210
  }
291
211
  } }),
292
- /* @__PURE__ */ t.jsx("text", { x: (s + 1) * 320 / d.length, y: 25, className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs", style: {
212
+ /* @__PURE__ */ t.jsx("text", { x: (a + 1) * 320 / i.length, y: 25, className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs", style: {
293
213
  textAnchor: "middle"
294
- }, children: zt(o, "NA") })
295
- ] }, s)),
214
+ }, children: Gt(o, "NA") })
215
+ ] }, a)),
296
216
  /* @__PURE__ */ t.jsx("g", { children: /* @__PURE__ */ t.jsx("rect", { onMouseOver: () => {
297
- A(d[l.length]);
217
+ I(i[r.length]);
298
218
  }, onMouseLeave: () => {
299
- A(void 0);
300
- }, x: l.length * 320 / d.length + 1, y: 1, width: 320 / d.length - 2, height: 8, className: `cursor-pointer ${E === d[l.length] ? "stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300" : ""}`, style: {
301
- fill: d[l.length],
302
- ...E === d[l.length] ? {} : {
303
- stroke: d[l.length]
219
+ I(void 0);
220
+ }, x: r.length * 320 / i.length + 1, y: 1, width: 320 / i.length - 2, height: 8, className: `cursor-pointer ${D === i[r.length] ? "stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300" : ""}`, style: {
221
+ fill: i[r.length],
222
+ ...D === i[r.length] ? {} : {
223
+ stroke: i[r.length]
304
224
  }
305
225
  } }) })
306
226
  ] }) })
307
227
  ] })
308
228
  ] }) : /* @__PURE__ */ t.jsx("button", { type: "button", className: "mb-0 border-0 bg-transparent p-0 self-start map-legend-button", onClick: () => {
309
- we(!0);
229
+ re(!0);
310
230
  }, children: /* @__PURE__ */ t.jsx("div", { className: "show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500", children: "Show Legend" }) }) }),
311
- z === "button" && /* @__PURE__ */ t.jsxs("div", { className: "absolute left-4 top-4 flex flex-col zoom-buttons", children: [
312
- /* @__PURE__ */ t.jsx("button", { onClick: () => he("in"), className: "leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "+" }),
313
- /* @__PURE__ */ t.jsx("button", { onClick: () => he("out"), className: "leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "–" })
231
+ O === "button" && /* @__PURE__ */ t.jsxs("div", { className: "absolute left-4 top-4 flex flex-col zoom-buttons", children: [
232
+ /* @__PURE__ */ t.jsx("button", { onClick: () => ne("in"), className: "leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "+" }),
233
+ /* @__PURE__ */ t.jsx("button", { onClick: () => ne("out"), className: "leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100", children: "–" })
314
234
  ] })
315
235
  ] }),
316
- J && K !== void 0 ? /* @__PURE__ */ t.jsx(_t, { body: J, data: K, setData: de, className: se?.modal }) : null,
317
- q && re && y && $e ? /* @__PURE__ */ t.jsx(Lt, { data: q, body: re, xPos: y, yPos: $e, backgroundStyle: Pe?.tooltip, className: se?.tooltip }) : null
236
+ V && d !== void 0 ? /* @__PURE__ */ t.jsx(Yt, { body: V, data: d, setData: m, className: te?.modal }) : null,
237
+ U && K && je && q ? /* @__PURE__ */ t.jsx(Vt, { data: U, body: K, xPos: je, yPos: q, backgroundStyle: Pe?.tooltip, className: te?.tooltip }) : null
318
238
  ] });
319
239
  }
320
- function Ao(u) {
321
- const e = xt.c(122), {
322
- data: l,
323
- mapData: d,
324
- graphTitle: b,
325
- colors: O,
326
- sources: H,
327
- graphDescription: w,
328
- height: x,
329
- width: k,
330
- footNote: G,
331
- colorDomain: re,
332
- colorLegendTitle: U,
333
- scaleType: Y,
334
- scale: ae,
335
- centerPoint: ie,
336
- padding: ve,
240
+ function Ro(c) {
241
+ const e = Dt.c(126), {
242
+ data: r,
243
+ mapData: i,
244
+ graphTitle: W,
245
+ colors: k,
246
+ sources: _,
247
+ graphDescription: f,
248
+ height: u,
249
+ width: h,
250
+ footNote: T,
251
+ colorDomain: K,
252
+ colorLegendTitle: Z,
253
+ scaleType: he,
254
+ scale: ge,
255
+ centerPoint: Q,
256
+ padding: fe,
337
257
  mapBorderWidth: Ee,
338
- mapNoDataColor: Ie,
339
- backgroundColor: S,
340
- mapBorderColor: ne,
341
- relativeHeight: j,
342
- tooltip: be,
343
- onSeriesMouseOver: J,
258
+ mapNoDataColor: ze,
259
+ backgroundColor: b,
260
+ mapBorderColor: ee,
261
+ relativeHeight: g,
262
+ tooltip: ye,
263
+ onSeriesMouseOver: V,
344
264
  isWorldMap: Pe,
345
- showColorScale: se,
346
- zoomScaleExtend: P,
347
- zoomTranslateExtend: z,
348
- graphID: D,
349
- highlightedIds: L,
350
- onSeriesMouseClick: le,
351
- mapProperty: ke,
352
- graphDownload: je,
353
- dataDownload: E,
354
- showAntarctica: A,
355
- language: ce,
356
- minHeight: ze,
357
- theme: we,
358
- ariaLabel: K,
359
- resetSelectionOnDoubleClick: de,
360
- detailsOnClick: q,
361
- styles: g,
362
- classNames: y,
363
- mapProjection: Z,
364
- zoomInteraction: $e,
365
- animate: me,
366
- dimmedOpacity: X,
367
- customLayers: R,
368
- timeline: Q,
369
- collapseColorScaleByDefault: Ce,
370
- zoomAndCenterByHighlightedIds: ee
371
- } = u, $ = d === void 0 ? "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json" : d, pe = G === void 0 ? "The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries." : G, B = Y === void 0 ? "threshold" : Y, De = ae === void 0 ? 0.95 : ae, Ne = Ee === void 0 ? 0.5 : Ee, W = Ie === void 0 ? Ze.light.graphNoData : Ie, I = S === void 0 ? !1 : S, he = ne === void 0 ? Ze.light.grays["gray-500"] : ne, o = Pe === void 0 ? !0 : Pe, s = se === void 0 ? !0 : se;
265
+ showColorScale: te,
266
+ zoomScaleExtend: S,
267
+ zoomTranslateExtend: O,
268
+ graphID: w,
269
+ highlightedIds: M,
270
+ onSeriesMouseClick: oe,
271
+ mapProperty: xe,
272
+ graphDownload: ve,
273
+ dataDownload: $,
274
+ showAntarctica: be,
275
+ language: y,
276
+ minHeight: D,
277
+ theme: I,
278
+ ariaLabel: R,
279
+ resetSelectionOnDoubleClick: Ae,
280
+ detailsOnClick: re,
281
+ styles: d,
282
+ classNames: m,
283
+ mapProjection: U,
284
+ zoomInteraction: ae,
285
+ animate: je,
286
+ dimmedOpacity: ie,
287
+ customLayers: q,
288
+ timeline: H,
289
+ collapseColorScaleByDefault: E,
290
+ projectionRotate: X,
291
+ zoomAndCenterByHighlightedIds: ke,
292
+ rewindCoordinatesInMapData: Be
293
+ } = c, x = i === void 0 ? "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json" : i, C = T === void 0 ? "The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries." : T, z = he === void 0 ? "threshold" : he, we = ge === void 0 ? 0.95 : ge, De = Ee === void 0 ? 0.5 : Ee, Ce = ze === void 0 ? et.light.graphNoData : ze, P = b === void 0 ? !1 : b, Ne = ee === void 0 ? et.light.grays["gray-500"] : ee, G = Pe === void 0 ? !0 : Pe, ne = te === void 0 ? !0 : te;
294
+ let o;
295
+ e[0] !== S ? (o = S === void 0 ? [0.8, 6] : S, e[0] = S, e[1] = o) : o = e[1];
296
+ const a = o;
372
297
  let v;
373
- e[0] !== P ? (v = P === void 0 ? [0.8, 6] : P, e[0] = P, e[1] = v) : v = e[1];
374
- const a = v;
375
- let r;
376
- e[2] !== L ? (r = L === void 0 ? [] : L, e[2] = L, e[3] = r) : r = e[3];
377
- const n = r, c = ke === void 0 ? "ISO3" : ke, i = je === void 0 ? !1 : je, p = E === void 0 ? !1 : E, N = A === void 0 ? !1 : A, C = ce === void 0 ? "en" : ce, F = ze === void 0 ? 0 : ze, te = we === void 0 ? "light" : we, et = de === void 0 ? !0 : de, tt = $e === void 0 ? "button" : $e, Le = me === void 0 ? !1 : me, ot = X === void 0 ? 0.3 : X;
378
- let Ae;
379
- e[4] !== R ? (Ae = R === void 0 ? [] : R, e[4] = R, e[5] = Ae) : Ae = e[5];
380
- const rt = Ae;
381
- let Be;
382
- e[6] !== Q ? (Be = Q === void 0 ? {
298
+ e[2] !== M ? (v = M === void 0 ? [] : M, e[2] = M, e[3] = v) : v = e[3];
299
+ const N = v, s = xe === void 0 ? "ISO3" : xe, se = ve === void 0 ? !1 : ve, le = $ === void 0 ? !1 : $, Se = be === void 0 ? !1 : be, ot = y === void 0 ? "en" : y, A = D === void 0 ? 0 : D, Y = I === void 0 ? "light" : I, rt = Ae === void 0 ? !0 : Ae, at = U === void 0 ? "naturalEarth" : U, it = ae === void 0 ? "button" : ae, Le = je === void 0 ? !1 : je, nt = ie === void 0 ? 0.3 : ie;
300
+ let Fe;
301
+ e[4] !== q ? (Fe = q === void 0 ? [] : q, e[4] = q, e[5] = Fe) : Fe = e[5];
302
+ const st = Fe;
303
+ let We;
304
+ e[6] !== H ? (We = H === void 0 ? {
383
305
  enabled: !1,
384
306
  autoplay: !1,
385
307
  showOnlyActiveDate: !0
386
- } : Q, e[6] = Q, e[7] = Be) : Be = e[7];
387
- const m = Be, at = ee === void 0 ? !1 : ee, [oe, ht] = M(0), [Se, ut] = M(0), [_, gt] = M(m.autoplay);
308
+ } : H, e[6] = H, e[7] = We) : We = e[7];
309
+ const n = We;
310
+ let _e;
311
+ e[8] !== X ? (_e = X === void 0 ? [0, 0] : X, e[8] = X, e[9] = _e) : _e = e[9];
312
+ const lt = _e, ct = ke === void 0 ? !1 : ke, dt = Be === void 0 ? !0 : Be, [J, vt] = j(0), [Oe, bt] = j(0), [B, jt] = j(n.autoplay);
388
313
  let Me;
389
- if (e[8] !== l || e[9] !== m.dateFormat) {
390
- let f;
391
- e[11] !== m.dateFormat ? (f = (V) => $t(`${V.date}`, m.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime(), e[11] = m.dateFormat, e[12] = f) : f = e[12], Me = [...new Set(l.filter(so).map(f))], Me.sort(no), e[8] = l, e[9] = m.dateFormat, e[10] = Me;
314
+ if (e[10] !== r || e[11] !== n.dateFormat) {
315
+ let p;
316
+ e[13] !== n.dateFormat ? (p = (F) => Et(`${F.date}`, n.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime(), e[13] = n.dateFormat, e[14] = p) : p = e[14], Me = [...new Set(r.filter(yo).map(p))], Me.sort(fo), e[10] = r, e[11] = n.dateFormat, e[12] = Me;
392
317
  } else
393
- Me = e[10];
394
- const h = Me, [T, it] = M(m.autoplay ? 0 : h.length - 1), [ue, ft] = M(void 0), nt = Oe(null), mt = Oe(null);
395
- let We, Fe;
396
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (We = () => {
397
- const f = new ResizeObserver((V) => {
398
- ht(V[0].target.clientWidth || 620), ut(V[0].target.clientHeight || 480);
318
+ Me = e[12];
319
+ const l = Me, [L, mt] = j(n.autoplay ? 0 : l.length - 1), [ce, kt] = j(void 0), pt = Ie(null), yt = Ie(null);
320
+ let Te, $e;
321
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Te = () => {
322
+ const p = new ResizeObserver((F) => {
323
+ vt(F[0].target.clientWidth || 620), bt(F[0].target.clientHeight || 480);
399
324
  });
400
- return nt.current && f.observe(nt.current), () => f.disconnect();
401
- }, Fe = [], e[13] = We, e[14] = Fe) : (We = e[13], Fe = e[14]), Qe(We, Fe);
402
- let _e;
403
- e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_e = (f) => {
404
- ft(f);
405
- }, e[15] = _e) : _e = e[15];
406
- const Te = vt(_e);
407
- let Ve;
408
- e[16] !== $ || e[17] !== Te ? (Ve = () => {
409
- typeof $ == "string" ? Xt($).then((V) => {
410
- Te(V);
411
- }) : Te($);
412
- }, e[16] = $, e[17] = Te, e[18] = Ve) : Ve = e[18];
325
+ return pt.current && p.observe(pt.current), () => p.disconnect();
326
+ }, $e = [], e[15] = Te, e[16] = $e) : (Te = e[15], $e = e[16]), tt(Te, $e);
413
327
  let He;
414
- e[19] !== $ ? (He = [$], e[19] = $, e[20] = He) : He = e[20], Qe(Ve, He);
415
- let Ge;
416
- e[21] !== re || e[22] !== O?.length || e[23] !== l || e[24] !== B ? (Ge = re || (B === "categorical" ? Rt(l, "x") : Yt(l.map(io), O?.length || 4)), e[21] = re, e[22] = O?.length, e[23] = l, e[24] = B, e[25] = Ge) : Ge = e[25];
417
- const Ue = Ge;
418
- let qe, Xe;
419
- e[26] !== _ || e[27] !== m.speed || e[28] !== h ? (qe = () => {
420
- const f = setInterval(() => {
421
- it((V) => V < h.length - 1 ? V + 1 : 0);
422
- }, (m.speed || 2) * 1e3);
423
- return _ || clearInterval(f), () => clearInterval(f);
424
- }, Xe = [h, _, m.speed], e[26] = _, e[27] = m.speed, e[28] = h, e[29] = qe, e[30] = Xe) : (qe = e[29], Xe = e[30]), Qe(qe, Xe);
425
- const st = m.dateFormat || "yyyy";
328
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (He = (p) => {
329
+ kt(p);
330
+ }, e[17] = He) : He = e[17];
331
+ const Ge = Nt(He);
332
+ let Ve;
333
+ e[18] !== x || e[19] !== Ge ? (Ve = () => {
334
+ typeof x == "string" ? oo(x).then((F) => {
335
+ Ge(F);
336
+ }) : Ge(x);
337
+ }, e[18] = x, e[19] = Ge, e[20] = Ve) : Ve = e[20];
426
338
  let Re;
427
- e[31] !== T || e[32] !== st || e[33] !== m.showOnlyActiveDate || e[34] !== h ? (Re = bt(h, T, m.showOnlyActiveDate, st), e[31] = T, e[32] = st, e[33] = m.showOnlyActiveDate, e[34] = h, e[35] = Re) : Re = e[35];
428
- const Ye = Re, lt = y?.graphContainer, ct = g?.graphContainer;
429
- let ge;
430
- e[36] !== y?.description || e[37] !== y?.title || e[38] !== l || e[39] !== p || e[40] !== w || e[41] !== i || e[42] !== b || e[43] !== g?.description || e[44] !== g?.title || e[45] !== k ? (ge = b || w || i || p ? /* @__PURE__ */ t.jsx(qt, { styles: {
431
- title: g?.title,
432
- description: g?.description
339
+ e[21] !== x ? (Re = [x], e[21] = x, e[22] = Re) : Re = e[22], tt(Ve, Re);
340
+ let Ue;
341
+ e[23] !== K || e[24] !== k?.length || e[25] !== r || e[26] !== z ? (Ue = K || (z === "categorical" ? ro(r, "x") : ao(r.map(go), k?.length || 4)), e[23] = K, e[24] = k?.length, e[25] = r, e[26] = z, e[27] = Ue) : Ue = e[27];
342
+ const qe = Ue;
343
+ let Xe, Ye;
344
+ e[28] !== B || e[29] !== n.speed || e[30] !== l ? (Xe = () => {
345
+ const p = setInterval(() => {
346
+ mt((F) => F < l.length - 1 ? F + 1 : 0);
347
+ }, (n.speed || 2) * 1e3);
348
+ return B || clearInterval(p), () => clearInterval(p);
349
+ }, Ye = [l, B, n.speed], e[28] = B, e[29] = n.speed, e[30] = l, e[31] = Xe, e[32] = Ye) : (Xe = e[31], Ye = e[32]), tt(Xe, Ye);
350
+ const ut = n.dateFormat || "yyyy";
351
+ let Je;
352
+ e[33] !== L || e[34] !== ut || e[35] !== n.showOnlyActiveDate || e[36] !== l ? (Je = St(l, L, n.showOnlyActiveDate, ut), e[33] = L, e[34] = ut, e[35] = n.showOnlyActiveDate, e[36] = l, e[37] = Je) : Je = e[37];
353
+ const Ke = Je, ht = m?.graphContainer, gt = d?.graphContainer;
354
+ let de;
355
+ e[38] !== m?.description || e[39] !== m?.title || e[40] !== r || e[41] !== le || e[42] !== f || e[43] !== se || e[44] !== W || e[45] !== d?.description || e[46] !== d?.title || e[47] !== h ? (de = W || f || se || le ? /* @__PURE__ */ t.jsx(to, { styles: {
356
+ title: d?.title,
357
+ description: d?.description
433
358
  }, classNames: {
434
- title: y?.title,
435
- description: y?.description
436
- }, graphTitle: b, graphDescription: w, width: k, graphDownload: i ? mt : void 0, dataDownload: p ? l.map(ao).filter(ro).length > 0 ? l.map(oo).filter(to) : l.filter(eo) : null }) : null, e[36] = y?.description, e[37] = y?.title, e[38] = l, e[39] = p, e[40] = w, e[41] = i, e[42] = b, e[43] = g?.description, e[44] = g?.title, e[45] = k, e[46] = ge) : ge = e[46];
437
- let fe;
438
- e[47] !== T || e[48] !== Ye || e[49] !== _ || e[50] !== m.enabled || e[51] !== h ? (fe = m.enabled && h.length > 0 && Ye ? /* @__PURE__ */ t.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
359
+ title: m?.title,
360
+ description: m?.description
361
+ }, graphTitle: W, graphDescription: f, width: h, graphDownload: se ? yt : void 0, dataDownload: le ? r.map(ho).filter(uo).length > 0 ? r.map(po).filter(mo) : r.filter(co) : null }) : null, e[38] = m?.description, e[39] = m?.title, e[40] = r, e[41] = le, e[42] = f, e[43] = se, e[44] = W, e[45] = d?.description, e[46] = d?.title, e[47] = h, e[48] = de) : de = e[48];
362
+ let me;
363
+ e[49] !== L || e[50] !== Ke || e[51] !== B || e[52] !== n.enabled || e[53] !== l ? (me = n.enabled && l.length > 0 && Ke ? /* @__PURE__ */ t.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
439
364
  /* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => {
440
- gt(!_);
441
- }, className: "p-0 border-0 cursor-pointer bg-transparent", "aria-label": _ ? "Click to pause animation" : "Click to play animation", children: _ ? /* @__PURE__ */ t.jsx(Wt, {}) : /* @__PURE__ */ t.jsx(Ft, {}) }),
442
- /* @__PURE__ */ t.jsx(kt, { min: h[0], max: h[h.length - 1], marks: Ye, step: null, defaultValue: h[h.length - 1], value: h[T], onChangeComplete: (f) => {
443
- it(h.indexOf(f));
444
- }, onChange: (f) => {
445
- it(h.indexOf(f));
365
+ jt(!B);
366
+ }, className: "p-0 border-0 cursor-pointer bg-transparent", "aria-label": B ? "Click to pause animation" : "Click to play animation", children: B ? /* @__PURE__ */ t.jsx(qt, {}) : /* @__PURE__ */ t.jsx(Xt, {}) }),
367
+ /* @__PURE__ */ t.jsx(Ot, { min: l[0], max: l[l.length - 1], marks: Ke, step: null, defaultValue: l[l.length - 1], value: l[L], onChangeComplete: (p) => {
368
+ mt(l.indexOf(p));
369
+ }, onChange: (p) => {
370
+ mt(l.indexOf(p));
446
371
  }, "aria-label": "Time slider. Use arrow keys to adjust selected time period." })
447
- ] }) : null, e[47] = T, e[48] = Ye, e[49] = _, e[50] = m.enabled, e[51] = h, e[52] = fe) : fe = e[52];
448
- let ye;
449
- e[53] !== Le || e[54] !== ie || e[55] !== y || e[56] !== Ce || e[57] !== U || e[58] !== O || e[59] !== rt || e[60] !== l || e[61] !== q || e[62] !== ot || e[63] !== Ue || e[64] !== x || e[65] !== n || e[66] !== T || e[67] !== o || e[68] !== he || e[69] !== Ne || e[70] !== W || e[71] !== Z || e[72] !== c || e[73] !== ue || e[74] !== F || e[75] !== le || e[76] !== J || e[77] !== j || e[78] !== et || e[79] !== De || e[80] !== B || e[81] !== N || e[82] !== s || e[83] !== g || e[84] !== Se || e[85] !== oe || e[86] !== te || e[87] !== m.dateFormat || e[88] !== m.enabled || e[89] !== be || e[90] !== h || e[91] !== k || e[92] !== at || e[93] !== tt || e[94] !== a || e[95] !== z ? (ye = /* @__PURE__ */ t.jsx(Jt, { ref: nt, children: oe && Se && ue ? /* @__PURE__ */ t.jsx(Zt, { data: l.filter((f) => m.enabled ? f.date === wt(new Date(h[T]), m.dateFormat || "yyyy") : f), mapData: N ? ue : {
450
- ...ue,
451
- features: ue.features.filter(Qt)
452
- }, colorDomain: Ue, width: oe, height: Se, scale: De, centerPoint: ie, colors: O || (B === "categorical" ? Ze[te].categoricalColors.colors : Ze[te].sequentialColors[`neutralColorsx0${Ue.length + 1}`]), colorLegendTitle: U, mapBorderWidth: Ne, mapNoDataColor: W, categorical: B === "categorical", mapBorderColor: he, tooltip: be, onSeriesMouseOver: J, isWorldMap: o, showColorScale: s, zoomScaleExtend: a, zoomTranslateExtend: z, onSeriesMouseClick: le, mapProperty: c, highlightedIds: n, resetSelectionOnDoubleClick: et, styles: g, classNames: y, detailsOnClick: q, mapProjection: Z || (o ? "naturalEarth" : "mercator"), zoomInteraction: tt, dimmedOpacity: ot, animate: Le === !0 ? {
372
+ ] }) : null, e[49] = L, e[50] = Ke, e[51] = B, e[52] = n.enabled, e[53] = l, e[54] = me) : me = e[54];
373
+ let pe;
374
+ e[55] !== Le || e[56] !== Q || e[57] !== m || e[58] !== E || e[59] !== Z || e[60] !== k || e[61] !== st || e[62] !== r || e[63] !== re || e[64] !== nt || e[65] !== qe || e[66] !== u || e[67] !== N || e[68] !== L || e[69] !== G || e[70] !== Ne || e[71] !== De || e[72] !== Ce || e[73] !== at || e[74] !== s || e[75] !== ce || e[76] !== A || e[77] !== oe || e[78] !== V || e[79] !== lt || e[80] !== g || e[81] !== rt || e[82] !== dt || e[83] !== we || e[84] !== z || e[85] !== Se || e[86] !== ne || e[87] !== d || e[88] !== Oe || e[89] !== J || e[90] !== Y || e[91] !== n.dateFormat || e[92] !== n.enabled || e[93] !== ye || e[94] !== l || e[95] !== h || e[96] !== ct || e[97] !== it || e[98] !== a || e[99] !== O ? (pe = /* @__PURE__ */ t.jsx(io, { ref: pt, children: J && Oe && ce ? /* @__PURE__ */ t.jsx(so, { data: r.filter((p) => n.enabled ? p.date === It(new Date(l[L]), n.dateFormat || "yyyy") : p), mapData: Se ? ce : {
375
+ ...ce,
376
+ features: ce.features.filter(lo)
377
+ }, colorDomain: qe, width: J, height: Oe, scale: we, centerPoint: Q, colors: k || (z === "categorical" ? et[Y].categoricalColors.colors : et[Y].sequentialColors[`neutralColorsx0${qe.length + 1}`]), colorLegendTitle: Z, mapBorderWidth: De, mapNoDataColor: Ce, categorical: z === "categorical", mapBorderColor: Ne, tooltip: ye, onSeriesMouseOver: V, isWorldMap: G, showColorScale: ne, zoomScaleExtend: a, zoomTranslateExtend: O, onSeriesMouseClick: oe, mapProperty: s, highlightedIds: N, resetSelectionOnDoubleClick: rt, styles: d, classNames: m, detailsOnClick: re, mapProjection: at || (G ? "naturalEarth" : "mercator"), zoomInteraction: it, dimmedOpacity: nt, animate: Le === !0 ? {
453
378
  duration: 0.5,
454
379
  once: !0,
455
380
  amount: 0.5
@@ -457,53 +382,53 @@ function Ao(u) {
457
382
  duration: 0,
458
383
  once: !0,
459
384
  amount: 0
460
- }, customLayers: rt, zoomAndCenterByHighlightedIds: at, collapseColorScaleByDefault: Ce }) : /* @__PURE__ */ t.jsx("div", { style: {
461
- height: `${Math.max(F, x || (j ? F ? (k || oe) * j > F ? (k || oe) * j : F : (k || oe) * j : Se))}px`
462
- }, className: "flex items-center justify-center", children: /* @__PURE__ */ t.jsx(jt, { "aria-label": "Loading graph" }) }) }), e[53] = Le, e[54] = ie, e[55] = y, e[56] = Ce, e[57] = U, e[58] = O, e[59] = rt, e[60] = l, e[61] = q, e[62] = ot, e[63] = Ue, e[64] = x, e[65] = n, e[66] = T, e[67] = o, e[68] = he, e[69] = Ne, e[70] = W, e[71] = Z, e[72] = c, e[73] = ue, e[74] = F, e[75] = le, e[76] = J, e[77] = j, e[78] = et, e[79] = De, e[80] = B, e[81] = N, e[82] = s, e[83] = g, e[84] = Se, e[85] = oe, e[86] = te, e[87] = m.dateFormat, e[88] = m.enabled, e[89] = be, e[90] = h, e[91] = k, e[92] = at, e[93] = tt, e[94] = a, e[95] = z, e[96] = ye) : ye = e[96];
463
- let xe;
464
- e[97] !== y?.footnote || e[98] !== y?.source || e[99] !== pe || e[100] !== H || e[101] !== g?.footnote || e[102] !== g?.source || e[103] !== k ? (xe = H || pe ? /* @__PURE__ */ t.jsx(Ut, { styles: {
465
- footnote: g?.footnote,
466
- source: g?.source
385
+ }, customLayers: st, zoomAndCenterByHighlightedIds: ct, collapseColorScaleByDefault: E, projectionRotate: lt, rewindCoordinatesInMapData: dt }) : /* @__PURE__ */ t.jsx("div", { style: {
386
+ height: `${Math.max(A, u || (g ? A ? (h || J) * g > A ? (h || J) * g : A : (h || J) * g : Oe))}px`
387
+ }, className: "flex items-center justify-center", children: /* @__PURE__ */ t.jsx(Mt, { "aria-label": "Loading graph" }) }) }), e[55] = Le, e[56] = Q, e[57] = m, e[58] = E, e[59] = Z, e[60] = k, e[61] = st, e[62] = r, e[63] = re, e[64] = nt, e[65] = qe, e[66] = u, e[67] = N, e[68] = L, e[69] = G, e[70] = Ne, e[71] = De, e[72] = Ce, e[73] = at, e[74] = s, e[75] = ce, e[76] = A, e[77] = oe, e[78] = V, e[79] = lt, e[80] = g, e[81] = rt, e[82] = dt, e[83] = we, e[84] = z, e[85] = Se, e[86] = ne, e[87] = d, e[88] = Oe, e[89] = J, e[90] = Y, e[91] = n.dateFormat, e[92] = n.enabled, e[93] = ye, e[94] = l, e[95] = h, e[96] = ct, e[97] = it, e[98] = a, e[99] = O, e[100] = pe) : pe = e[100];
388
+ let ue;
389
+ e[101] !== m?.footnote || e[102] !== m?.source || e[103] !== C || e[104] !== _ || e[105] !== d?.footnote || e[106] !== d?.source || e[107] !== h ? (ue = _ || C ? /* @__PURE__ */ t.jsx(eo, { styles: {
390
+ footnote: d?.footnote,
391
+ source: d?.source
467
392
  }, classNames: {
468
- footnote: y?.footnote,
469
- source: y?.source
470
- }, sources: H, footNote: pe, width: k }) : null, e[97] = y?.footnote, e[98] = y?.source, e[99] = pe, e[100] = H, e[101] = g?.footnote, e[102] = g?.source, e[103] = k, e[104] = xe) : xe = e[104];
471
- let Je;
472
- return e[105] !== K || e[106] !== I || e[107] !== D || e[108] !== x || e[109] !== C || e[110] !== F || e[111] !== ve || e[112] !== j || e[113] !== lt || e[114] !== ct || e[115] !== ge || e[116] !== fe || e[117] !== ye || e[118] !== xe || e[119] !== te || e[120] !== k ? (Je = /* @__PURE__ */ t.jsxs(Kt, { className: lt, style: ct, id: D, ref: mt, "aria-label": K, backgroundColor: I, theme: te, language: C, minHeight: F, width: k, height: x, relativeHeight: j, padding: ve, children: [
473
- ge,
474
- fe,
475
- ye,
476
- xe
477
- ] }), e[105] = K, e[106] = I, e[107] = D, e[108] = x, e[109] = C, e[110] = F, e[111] = ve, e[112] = j, e[113] = lt, e[114] = ct, e[115] = ge, e[116] = fe, e[117] = ye, e[118] = xe, e[119] = te, e[120] = k, e[121] = Je) : Je = e[121], Je;
393
+ footnote: m?.footnote,
394
+ source: m?.source
395
+ }, sources: _, footNote: C, width: h }) : null, e[101] = m?.footnote, e[102] = m?.source, e[103] = C, e[104] = _, e[105] = d?.footnote, e[106] = d?.source, e[107] = h, e[108] = ue) : ue = e[108];
396
+ let Ze;
397
+ return e[109] !== R || e[110] !== P || e[111] !== w || e[112] !== u || e[113] !== ot || e[114] !== A || e[115] !== fe || e[116] !== g || e[117] !== ht || e[118] !== gt || e[119] !== de || e[120] !== me || e[121] !== pe || e[122] !== ue || e[123] !== Y || e[124] !== h ? (Ze = /* @__PURE__ */ t.jsxs(no, { className: ht, style: gt, id: w, ref: yt, "aria-label": R, backgroundColor: P, theme: Y, language: ot, minHeight: A, width: h, height: u, relativeHeight: g, padding: fe, children: [
398
+ de,
399
+ me,
400
+ pe,
401
+ ue
402
+ ] }), e[109] = R, e[110] = P, e[111] = w, e[112] = u, e[113] = ot, e[114] = A, e[115] = fe, e[116] = g, e[117] = ht, e[118] = gt, e[119] = de, e[120] = me, e[121] = pe, e[122] = ue, e[123] = Y, e[124] = h, e[125] = Ze) : Ze = e[125], Ze;
478
403
  }
479
- function Qt(u) {
480
- return u.properties.NAME !== "Antarctica";
404
+ function lo(c) {
405
+ return c.properties.NAME !== "Antarctica";
481
406
  }
482
- function eo(u) {
483
- return u !== void 0;
407
+ function co(c) {
408
+ return c !== void 0;
484
409
  }
485
- function to(u) {
486
- return u !== void 0;
410
+ function mo(c) {
411
+ return c !== void 0;
487
412
  }
488
- function oo(u) {
489
- return u.data;
413
+ function po(c) {
414
+ return c.data;
490
415
  }
491
- function ro(u) {
492
- return u !== void 0;
416
+ function uo(c) {
417
+ return c !== void 0;
493
418
  }
494
- function ao(u) {
495
- return u.data;
419
+ function ho(c) {
420
+ return c.data;
496
421
  }
497
- function io(u) {
498
- return u.x;
422
+ function go(c) {
423
+ return c.x;
499
424
  }
500
- function no(u, e) {
501
- return u - e;
425
+ function fo(c, e) {
426
+ return c - e;
502
427
  }
503
- function so(u) {
504
- return u.date;
428
+ function yo(c) {
429
+ return c.date;
505
430
  }
506
431
  export {
507
- Ao as ChoroplethMap
432
+ Ro as ChoroplethMap
508
433
  };
509
434
  //# sourceMappingURL=ChoroplethMap.js.map