@undp/data-viz 1.4.16 → 1.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.
Files changed (225) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +3 -3
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +8 -8
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.js +5 -5
  7. package/dist/BiVariateChoroplethMap.cjs +1 -1
  8. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  9. package/dist/BiVariateChoroplethMap.js +35 -34
  10. package/dist/BiVariateChoroplethMap.js.map +1 -1
  11. package/dist/BulletChart.cjs +1 -1
  12. package/dist/BulletChart.js +5 -5
  13. package/dist/ButterflyChart.cjs +1 -1
  14. package/dist/ButterflyChart.js +5 -5
  15. package/dist/ChoroplethMap.cjs +1 -1
  16. package/dist/ChoroplethMap.cjs.map +1 -1
  17. package/dist/ChoroplethMap.js +52 -51
  18. package/dist/ChoroplethMap.js.map +1 -1
  19. package/dist/CirclePackingGraph.cjs +1 -1
  20. package/dist/CirclePackingGraph.js +3 -3
  21. package/dist/DataCards.cjs +1 -1
  22. package/dist/DataCards.js +5 -5
  23. package/dist/DataTable.cjs +1 -1
  24. package/dist/DataTable.js +3 -3
  25. package/dist/DifferenceLineChart.cjs +1 -1
  26. package/dist/DifferenceLineChart.js +2 -2
  27. package/dist/DonutChart.cjs +1 -1
  28. package/dist/DonutChart.js +4 -4
  29. package/dist/DotDensityMap.cjs +1 -1
  30. package/dist/DotDensityMap.cjs.map +1 -1
  31. package/dist/DotDensityMap.js +39 -38
  32. package/dist/DotDensityMap.js.map +1 -1
  33. package/dist/DualAxisLineChart.cjs +1 -1
  34. package/dist/DualAxisLineChart.js +2 -2
  35. package/dist/DumbbellChart.cjs +1 -1
  36. package/dist/DumbbellChart.js +6 -6
  37. package/dist/GeoHubCompareMaps.cjs +1 -1
  38. package/dist/GeoHubCompareMaps.js +1 -1
  39. package/dist/GeoHubMap.cjs +1 -1
  40. package/dist/GeoHubMap.js +3 -3
  41. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  42. package/dist/GeoHubMapWithLayerSelection.js +4 -4
  43. package/dist/{GraphEl-Bz2jatkM.cjs → GraphEl-4RUlclvW.cjs} +2 -2
  44. package/dist/{GraphEl-Bz2jatkM.cjs.map → GraphEl-4RUlclvW.cjs.map} +1 -1
  45. package/dist/{GraphEl-zNOHBYrK.js → GraphEl-ClIxlWa3.js} +2 -2
  46. package/dist/{GraphEl-zNOHBYrK.js.map → GraphEl-ClIxlWa3.js.map} +1 -1
  47. package/dist/GriddedGraphs.cjs +1 -1
  48. package/dist/GriddedGraphs.d.ts +58 -1
  49. package/dist/GriddedGraphs.js +7 -7
  50. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  51. package/dist/GriddedGraphsFromConfig.d.ts +58 -1
  52. package/dist/GriddedGraphsFromConfig.js +1 -1
  53. package/dist/HeatMap.cjs +1 -1
  54. package/dist/HeatMap.js +4 -4
  55. package/dist/Histogram.cjs +1 -1
  56. package/dist/Histogram.js +1 -1
  57. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  58. package/dist/LineChartWithConfidenceInterval.js +2 -2
  59. package/dist/MultiGraphDashboard.cjs +1 -1
  60. package/dist/MultiGraphDashboard.d.ts +58 -1
  61. package/dist/MultiGraphDashboard.js +5 -5
  62. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  63. package/dist/MultiGraphDashboardFromConfig.d.ts +58 -1
  64. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  65. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  66. package/dist/MultiGraphDashboardWideToLongFormat.js +2 -2
  67. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  68. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  69. package/dist/MultiLineAltChart.cjs +1 -1
  70. package/dist/MultiLineAltChart.js +3 -3
  71. package/dist/MultiLineChart.cjs +1 -1
  72. package/dist/MultiLineChart.js +2 -2
  73. package/dist/ParetoChart.cjs +1 -1
  74. package/dist/ParetoChart.js +3 -3
  75. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  76. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +58 -1
  77. package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
  78. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  79. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +58 -1
  80. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  81. package/dist/PerformanceIntensiveScrollStory.d.ts +58 -1
  82. package/dist/RadarChart.cjs +1 -1
  83. package/dist/RadarChart.js +4 -4
  84. package/dist/SankeyChart.cjs +1 -1
  85. package/dist/SankeyChart.js +6 -6
  86. package/dist/ScatterPlot.cjs +1 -1
  87. package/dist/ScatterPlot.js +6 -6
  88. package/dist/ScrollStory.d.ts +58 -1
  89. package/dist/SimpleLineChart.cjs +1 -1
  90. package/dist/SimpleLineChart.js +2 -2
  91. package/dist/SingleGraphDashboard.cjs +1 -1
  92. package/dist/SingleGraphDashboard.d.ts +58 -1
  93. package/dist/SingleGraphDashboard.js +8 -8
  94. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  95. package/dist/SingleGraphDashboardFromConfig.d.ts +58 -1
  96. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  97. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +58 -1
  98. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  99. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +58 -1
  100. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  101. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  102. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  103. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +58 -1
  104. package/dist/SingleGraphDashboardThreeDGraphs.js +20 -19
  105. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  106. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  107. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +58 -1
  108. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  109. package/dist/SlopeChart.cjs +1 -1
  110. package/dist/SlopeChart.js +4 -4
  111. package/dist/SparkLine.cjs +1 -1
  112. package/dist/SparkLine.js +2 -2
  113. package/dist/StatCardFromData.cjs +1 -1
  114. package/dist/StatCardFromData.js +1 -1
  115. package/dist/StripChart.cjs +1 -1
  116. package/dist/StripChart.js +5 -5
  117. package/dist/ThreeDGlobe.cjs +1 -1
  118. package/dist/ThreeDGlobe.cjs.map +1 -1
  119. package/dist/ThreeDGlobe.d.ts +61 -6
  120. package/dist/ThreeDGlobe.js +385 -314
  121. package/dist/ThreeDGlobe.js.map +1 -1
  122. package/dist/{Tooltip-DyM5snqx.js → Tooltip-CVCGWyzw.js} +2 -2
  123. package/dist/{Tooltip-DyM5snqx.js.map → Tooltip-CVCGWyzw.js.map} +1 -1
  124. package/dist/{Tooltip-n8z5bfav.cjs → Tooltip-De16GWhY.cjs} +2 -2
  125. package/dist/{Tooltip-n8z5bfav.cjs.map → Tooltip-De16GWhY.cjs.map} +1 -1
  126. package/dist/TreeMapGraph.cjs +1 -1
  127. package/dist/TreeMapGraph.js +3 -3
  128. package/dist/Types.d.ts +58 -1
  129. package/dist/UnitChart.cjs +1 -1
  130. package/dist/UnitChart.js +1 -1
  131. package/dist/_commonjsHelpers-BH3jXuIh.cjs +2 -0
  132. package/dist/_commonjsHelpers-BH3jXuIh.cjs.map +1 -0
  133. package/dist/_commonjsHelpers-ByX85dGu.js +34 -0
  134. package/dist/_commonjsHelpers-ByX85dGu.js.map +1 -0
  135. package/dist/{ensureCompleteData-BBDZbDCE.js → ensureCompleteData-BALdOrsS.js} +2 -2
  136. package/dist/{ensureCompleteData-BBDZbDCE.js.map → ensureCompleteData-BALdOrsS.js.map} +1 -1
  137. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs → ensureCompleteData-BU5Zlccy.cjs} +2 -2
  138. package/dist/{ensureCompleteData-DqWQ2Zbi.cjs.map → ensureCompleteData-BU5Zlccy.cjs.map} +1 -1
  139. package/dist/{fetchAndParseData-4gsYTy6_.js → fetchAndParseData-DBOl1Icl.js} +2 -2
  140. package/dist/{fetchAndParseData-4gsYTy6_.js.map → fetchAndParseData-DBOl1Icl.js.map} +1 -1
  141. package/dist/{fetchAndParseData-CQyVGCul.cjs → fetchAndParseData-Dcy7AS_0.cjs} +2 -2
  142. package/dist/{fetchAndParseData-CQyVGCul.cjs.map → fetchAndParseData-Dcy7AS_0.cjs.map} +1 -1
  143. package/dist/fetchAndParseData.cjs +1 -1
  144. package/dist/fetchAndParseData.js +1 -1
  145. package/dist/{filterData-B8ocT57s.js → filterData-9nEcQ-Jp.js} +3 -3
  146. package/dist/{filterData-B8ocT57s.js.map → filterData-9nEcQ-Jp.js.map} +1 -1
  147. package/dist/{filterData-DN6py7y_.cjs → filterData-BoYadk0l.cjs} +2 -2
  148. package/dist/{filterData-DN6py7y_.cjs.map → filterData-BoYadk0l.cjs.map} +1 -1
  149. package/dist/{getJenks-VhM3GIoC.js → getJenks-DW96UYNE.js} +2 -2
  150. package/dist/{getJenks-VhM3GIoC.js.map → getJenks-DW96UYNE.js.map} +1 -1
  151. package/dist/{getJenks-TWQvbuOz.cjs → getJenks-vofIZmeb.cjs} +2 -2
  152. package/dist/{getJenks-TWQvbuOz.cjs.map → getJenks-vofIZmeb.cjs.map} +1 -1
  153. package/dist/{getUniqValue-CHqgSss5.cjs → getUniqValue-CfuE_l9c.cjs} +2 -2
  154. package/dist/{getUniqValue-CHqgSss5.cjs.map → getUniqValue-CfuE_l9c.cjs.map} +1 -1
  155. package/dist/{getUniqValue-BtUENB2H.js → getUniqValue-CttuU_wn.js} +4 -4
  156. package/dist/{getUniqValue-BtUENB2H.js.map → getUniqValue-CttuU_wn.js.map} +1 -1
  157. package/dist/{index-CaAIPGZo.js → index-AqnpA7_O.js} +2 -2
  158. package/dist/{index-CaAIPGZo.js.map → index-AqnpA7_O.js.map} +1 -1
  159. package/dist/{index-CZbIGs8q.cjs → index-BJOeaYTk.cjs} +2 -2
  160. package/dist/{index-CZbIGs8q.cjs.map → index-BJOeaYTk.cjs.map} +1 -1
  161. package/dist/{index-Bc5VF70V.js → index-BMgDMxKJ.js} +6 -6
  162. package/dist/{index-Bc5VF70V.js.map → index-BMgDMxKJ.js.map} +1 -1
  163. package/dist/{index-B0rbzOoC.cjs → index-BS2TADPj.cjs} +2 -2
  164. package/dist/{index-B0rbzOoC.cjs.map → index-BS2TADPj.cjs.map} +1 -1
  165. package/dist/{index-27yTRcko.js → index-Bwrro8-q.js} +2 -2
  166. package/dist/{index-27yTRcko.js.map → index-Bwrro8-q.js.map} +1 -1
  167. package/dist/{index-BczVvEBZ.cjs → index-CQ3e6Ewi.cjs} +2 -2
  168. package/dist/{index-BczVvEBZ.cjs.map → index-CQ3e6Ewi.cjs.map} +1 -1
  169. package/dist/{index-C21TvELx.cjs → index-CSNtgibC.cjs} +2 -2
  170. package/dist/{index-C21TvELx.cjs.map → index-CSNtgibC.cjs.map} +1 -1
  171. package/dist/{index-D7ltPi18.js → index-CeVNqhMO.js} +2 -2
  172. package/dist/{index-D7ltPi18.js.map → index-CeVNqhMO.js.map} +1 -1
  173. package/dist/index-D05lK1Te.cjs +2 -0
  174. package/dist/index-D05lK1Te.cjs.map +1 -0
  175. package/dist/{index-Ds0uHjK9.cjs → index-D72cOtq7.cjs} +2 -2
  176. package/dist/{index-Ds0uHjK9.cjs.map → index-D72cOtq7.cjs.map} +1 -1
  177. package/dist/{index-BXns0-ng.cjs → index-DQA8q5sC.cjs} +2 -2
  178. package/dist/{index-BXns0-ng.cjs.map → index-DQA8q5sC.cjs.map} +1 -1
  179. package/dist/{index-BzeLQvXk.cjs → index-DYH8g9WA.cjs} +2 -2
  180. package/dist/{index-BzeLQvXk.cjs.map → index-DYH8g9WA.cjs.map} +1 -1
  181. package/dist/{index-BbNoLJ_w.cjs → index-Da2GUKrr.cjs} +2 -2
  182. package/dist/{index-BbNoLJ_w.cjs.map → index-Da2GUKrr.cjs.map} +1 -1
  183. package/dist/{index-BLizQDlg.js → index-DvVprvy6.js} +2 -2
  184. package/dist/{index-BLizQDlg.js.map → index-DvVprvy6.js.map} +1 -1
  185. package/dist/{index-UV9hjG_S.js → index-EArKRVKg.js} +2 -2
  186. package/dist/{index-UV9hjG_S.js.map → index-EArKRVKg.js.map} +1 -1
  187. package/dist/{index-C1rRk_50.js → index-V_JXij1_.js} +2 -2
  188. package/dist/{index-C1rRk_50.js.map → index-V_JXij1_.js.map} +1 -1
  189. package/dist/{index-DxagiOHo.js → index-fwdktvAS.js} +2 -2
  190. package/dist/{index-DxagiOHo.js.map → index-fwdktvAS.js.map} +1 -1
  191. package/dist/index-qfWCwobm.js +682 -0
  192. package/dist/index-qfWCwobm.js.map +1 -0
  193. package/dist/index.cjs +1 -1
  194. package/dist/index.d.ts +63 -7
  195. package/dist/index.js +6 -6
  196. package/dist/{string2HTML-CWHGfz_d.js → string2HTML-oFCROsus.js} +2 -2
  197. package/dist/{string2HTML-CWHGfz_d.js.map → string2HTML-oFCROsus.js.map} +1 -1
  198. package/dist/{string2HTML-D2Avudmb.cjs → string2HTML-z7CwHXcx.cjs} +2 -2
  199. package/dist/{string2HTML-D2Avudmb.cjs.map → string2HTML-z7CwHXcx.cjs.map} +1 -1
  200. package/dist/style.css +1 -1
  201. package/dist/transformData.cjs +1 -1
  202. package/dist/transformData.js +3 -3
  203. package/dist/{transformDataForAggregation-CdcwlnNe.js → transformDataForAggregation-1BYVFqvF.js} +4 -4
  204. package/dist/{transformDataForAggregation-CdcwlnNe.js.map → transformDataForAggregation-1BYVFqvF.js.map} +1 -1
  205. package/dist/{transformDataForAggregation-Du-Hei-W.cjs → transformDataForAggregation-BVxVu4yY.cjs} +2 -2
  206. package/dist/{transformDataForAggregation-Du-Hei-W.cjs.map → transformDataForAggregation-BVxVu4yY.cjs.map} +1 -1
  207. package/dist/{transformDataForGraphFromFile-BCjsizvb.js → transformDataForGraphFromFile-BC9Ha8hF.js} +3 -3
  208. package/dist/{transformDataForGraphFromFile-BCjsizvb.js.map → transformDataForGraphFromFile-BC9Ha8hF.js.map} +1 -1
  209. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs → transformDataForGraphFromFile-b41aNQYY.cjs} +2 -2
  210. package/dist/{transformDataForGraphFromFile-B1A0AS-Z.cjs.map → transformDataForGraphFromFile-b41aNQYY.cjs.map} +1 -1
  211. package/dist/utils.cjs +1 -1
  212. package/dist/utils.js +2 -2
  213. package/dist/zoom-Bsbhil-K.cjs +2 -0
  214. package/dist/zoom-Bsbhil-K.cjs.map +1 -0
  215. package/dist/zoom-DAu91HKr.js +1864 -0
  216. package/dist/zoom-DAu91HKr.js.map +1 -0
  217. package/package.json +3 -3
  218. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -2
  219. package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +0 -1
  220. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -9
  221. package/dist/_commonjsHelpers-DaMA6jEr.js.map +0 -1
  222. package/dist/zoom-Lo7IAUfC.cjs +0 -2
  223. package/dist/zoom-Lo7IAUfC.cjs.map +0 -1
  224. package/dist/zoom-_lqdiGoI.js +0 -1983
  225. package/dist/zoom-_lqdiGoI.js.map +0 -1
@@ -1,147 +1,204 @@
1
- import { j as t, m as ue } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { useRef as he, useState as M, useEffect as L } from "react";
3
- import { y as fe } from "./Spinner-C85UF28E.js";
4
- import ye from "react-globe.gl";
5
- import { i as xe } from "./index-27yTRcko.js";
6
- import * as W from "three";
7
- import { X as ve } from "./Modal-DVVwpKhP.js";
8
- import { u as ge } from "./Typography-Ctgfl1J5.js";
9
- import { T as be } from "./Tooltip-DyM5snqx.js";
10
- import { n as we } from "./numberFormattingFunction-14YCbkN2.js";
11
- import { X as je } from "./index-BmCqpO1B.js";
12
- import { s as Ce } from "./string2HTML-CWHGfz_d.js";
13
- import { o as De } from "./ordinal-w9Lu4Stb.js";
14
- import { t as ke } from "./threshold-DFfqcDMa.js";
15
- import { GraphHeader as Ne } from "./GraphHeader.js";
16
- import { GraphFooter as Se } from "./GraphFooter.js";
17
- import { f as Le } from "./fetchAndParseData-4gsYTy6_.js";
18
- import { Colors as R } from "./Colors.js";
19
- import { g as Me } from "./getUniqValue-BtUENB2H.js";
20
- import { g as Oe } from "./getJenks-VhM3GIoC.js";
21
- function Te(Y) {
1
+ import { j as r, m as fe } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
+ import { useState as j, useRef as ge, useEffect as N, useCallback as me } from "react";
3
+ import { y as xe } from "./Spinner-C85UF28E.js";
4
+ import ve from "react-globe.gl";
5
+ import { i as we } from "./index-Bwrro8-q.js";
6
+ import * as O from "three";
7
+ import { X as be } from "./Modal-DVVwpKhP.js";
8
+ import { u as ue } from "./Typography-Ctgfl1J5.js";
9
+ import { t as Ce } from "./index-qfWCwobm.js";
10
+ import { T as je } from "./Tooltip-CVCGWyzw.js";
11
+ import { n as ke } from "./numberFormattingFunction-14YCbkN2.js";
12
+ import { X as Se } from "./index-BmCqpO1B.js";
13
+ import { s as De } from "./string2HTML-oFCROsus.js";
14
+ import { o as Ne } from "./ordinal-w9Lu4Stb.js";
15
+ import { t as Me } from "./threshold-DFfqcDMa.js";
16
+ import { GraphHeader as Le } from "./GraphHeader.js";
17
+ import { GraphFooter as ze } from "./GraphFooter.js";
18
+ import { f as Oe } from "./fetchAndParseData-DBOl1Icl.js";
19
+ import { Colors as A } from "./Colors.js";
20
+ import { g as Re } from "./getUniqValue-CttuU_wn.js";
21
+ import { g as Pe } from "./getJenks-DW96UYNE.js";
22
+ function Te(e) {
23
+ let a;
24
+ switch (e.type) {
25
+ case "ambient":
26
+ a = new O.AmbientLight(e.color, e.intensity);
27
+ break;
28
+ case "directional":
29
+ a = new O.DirectionalLight(e.color, e.intensity), e.position && (e.position === "camera" ? a.position.set(0, 0, 0) : a.position.set(e.position.x, e.position.y, e.position.z)), (e.target || e.position === "camera") && a.target.position.set(
30
+ e.target?.x || 0,
31
+ e.target?.y || 0,
32
+ e.target?.z === void 0 ? -1 : e.target.z
33
+ ), e.castShadow && (a.castShadow = !0, e.shadow && (a.shadow.mapSize.width = e.shadow.mapSize.width, a.shadow.mapSize.height = e.shadow.mapSize.height, a.shadow.camera.near = e.shadow.camera.near, a.shadow.camera.far = e.shadow.camera.far));
34
+ break;
35
+ case "point":
36
+ a = new O.PointLight(
37
+ e.color,
38
+ e.intensity,
39
+ e.distance || 0,
40
+ e.decay || 2
41
+ ), e.position && (e.position === "camera" ? a.position.set(0, 0, 0) : a.position.set(e.position.x, e.position.y, e.position.z));
42
+ break;
43
+ case "spot":
44
+ a = new O.SpotLight(
45
+ e.color,
46
+ e.intensity,
47
+ e.distance || 0,
48
+ e.angle || Math.PI / 3,
49
+ e.penumbra || 0,
50
+ e.decay || 2
51
+ ), e.position && (e.position === "camera" ? a.position.set(0, 0, 0) : a.position.set(e.position.x, e.position.y, e.position.z)), (e.target || e.position === "camera") && a.target.position.set(
52
+ e.target?.x || 0,
53
+ e.target?.y || 0,
54
+ e.target?.z || 0
55
+ ), e.castShadow && (a.castShadow = !0, e.shadow && (a.shadow.mapSize.width = e.shadow.mapSize.width, a.shadow.mapSize.height = e.shadow.mapSize.height, a.shadow.camera.near = e.shadow.camera.near, a.shadow.camera.far = e.shadow.camera.far));
56
+ break;
57
+ default:
58
+ throw new Error("Unknown light type");
59
+ }
60
+ return a;
61
+ }
62
+ function Ee(e) {
22
63
  const {
23
- width: p,
24
- autoRotate: u,
25
- data: f,
26
- enableZoom: E,
27
- categorical: O,
28
- colorDomain: l,
29
- colors: i,
30
- globeMaterial: s,
31
- height: z,
32
- polygonData: K,
33
- mapProperty: c,
34
- mapBorderColor: H,
35
- atmosphereColor: U,
64
+ width: a,
65
+ autoRotate: v,
66
+ data: w,
67
+ enableZoom: H,
68
+ categorical: R,
69
+ colorDomain: p,
70
+ colors: n,
71
+ globeMaterial: l,
72
+ height: W,
73
+ polygonData: oe,
74
+ mapProperty: h,
75
+ mapBorderColor: $,
76
+ atmosphereColor: _,
36
77
  tooltip: q,
37
- styles: v,
38
- classNames: Q,
39
- mapNoDataColor: d,
40
- colorLegendTitle: $,
41
- showColorScale: ee,
42
- hoverStrokeColor: te,
43
- detailsOnClick: y,
44
- onSeriesMouseClick: b,
45
- onSeriesMouseOver: g,
46
- resetSelectionOnDoubleClick: T,
47
- highlightedIds: X,
48
- scale: h,
49
- globeOffset: w,
50
- polygonAltitude: A,
51
- centerLng: F,
52
- centerLat: B,
53
- atmosphereAltitude: V,
54
- globeCurvatureResolution: oe,
55
- lightColor: G,
56
- fogSettings: D
57
- } = Y, a = he(void 0), [k, P] = M(void 0), [re, Z] = M(!(p < 680)), [J, ie] = M({ x: 0, y: 0 }), [j, ae] = M(void 0), _ = O ? De().domain(l).range(i) : ke().domain(l).range(i);
58
- L(() => {
59
- a.current && (a.current.controls().enableZoom = E);
60
- }, [E]), L(() => {
61
- a.current && (j ? a.current.controls().autoRotate = !1 : (a.current.controls().autoRotate = u !== 0, a.current.controls().autoRotateSpeed = u));
62
- }, [j, u]), L(() => {
63
- const e = a.current?.renderer().domElement;
64
- if (!e) return;
65
- const o = (r) => {
66
- ie({ x: r.clientX, y: r.clientY });
78
+ styles: k,
79
+ classNames: re,
80
+ mapNoDataColor: m,
81
+ colorLegendTitle: F,
82
+ showColorScale: ae,
83
+ hoverStrokeColor: ie,
84
+ detailsOnClick: b,
85
+ onSeriesMouseClick: M,
86
+ onSeriesMouseOver: f,
87
+ resetSelectionOnDoubleClick: P,
88
+ highlightedIds: V,
89
+ scale: u,
90
+ globeOffset: S,
91
+ polygonAltitude: G,
92
+ centerLng: B,
93
+ centerLat: I,
94
+ atmosphereAltitude: X,
95
+ globeCurvatureResolution: se,
96
+ fogSettings: L,
97
+ lights: z,
98
+ highlightedAltitude: Z
99
+ } = e, [J, ne] = j(!1), s = ge(void 0), [x, T] = j(void 0), [E, Y] = j(
100
+ void 0
101
+ ), [le, K] = j(!(a < 680)), [Q, de] = j({ x: 0, y: 0 }), [C, U] = j(void 0), g = R ? Ne().domain(p).range(n) : Me().domain(p).range(n);
102
+ N(() => {
103
+ s.current && (s.current.controls().enableZoom = H);
104
+ }, [H]), N(() => {
105
+ s.current && (C || x ? s.current.controls().autoRotate = !1 : (s.current.controls().autoRotate = v !== 0, s.current.controls().autoRotateSpeed = v));
106
+ }, [C, x, v]), N(() => {
107
+ s.current && E && s.current.pointOfView(
108
+ { lat: E[1], lng: E[0], altitude: u },
109
+ 1e3
110
+ );
111
+ }, [E, u]), N(() => {
112
+ const t = s.current?.renderer().domElement;
113
+ if (!t) return;
114
+ const i = (o) => {
115
+ de({ x: o.clientX, y: o.clientY });
67
116
  };
68
- return e.addEventListener("mousemove", o), () => e.removeEventListener("mousemove", o);
69
- }, []), L(() => {
70
- a.current && a.current.pointOfView({ lat: B, lng: F, altitude: h }, 1e3);
71
- }, [h, F, B]);
72
- const se = s || new W.MeshBasicMaterial({
117
+ return t.addEventListener("mousemove", i), () => t.removeEventListener("mousemove", i);
118
+ }, []), N(() => {
119
+ s.current && s.current.pointOfView({ lat: I, lng: B, altitude: u }, 1e3);
120
+ }, [u, B, I]);
121
+ const ee = l || new O.MeshBasicMaterial({
73
122
  color: "#FFF"
74
- });
75
- return L(() => {
76
- if (!a.current) return;
77
- const e = a.current.scene();
78
- e.children.filter((r) => r.type === "DirectionalLight" || r.type === "AmbientLight").forEach((r) => e.remove(r));
79
- const o = new W.AmbientLight(G, 0.2);
80
- e.add(o), setTimeout(() => {
81
- (e.children[3]?.children[0]?.children[4]?.children || []).forEach((m) => {
82
- const x = m.children[1];
83
- x && (x.renderOrder = 2);
84
- });
85
- }, 300), D && (e.fog = new W.Fog(D.color, D.near, D.far));
86
- }, [G, h, D]), /* @__PURE__ */ t.jsxs("div", { className: "relative", children: [
87
- /* @__PURE__ */ t.jsx(
88
- ye,
123
+ }), D = me(() => {
124
+ if (!s.current) return;
125
+ const t = s.current.scene(), i = s.current.camera();
126
+ let o = [];
127
+ t.traverse((d) => {
128
+ d instanceof O.Light && o.push(d);
129
+ }), o = [...o, ...i.children], o.forEach((d) => d.parent?.remove(d)), z.map((d) => Te(d)).forEach((d, y) => {
130
+ z[y].type !== "ambient" && z[y].position === "camera" ? (i.add(d), z[y].type !== "point" && i.add(d.target)) : t.add(d);
131
+ }), L && (t.fog = new O.Fog(L.color, L.near, L.far));
132
+ }, [z, L]), te = me(() => {
133
+ ne(!0), D();
134
+ }, [D]);
135
+ return N(() => {
136
+ J && D();
137
+ }, [J, D]), /* @__PURE__ */ r.jsxs("div", { className: "relative", children: [
138
+ /* @__PURE__ */ r.jsx(
139
+ ve,
89
140
  {
90
- ref: a,
91
- height: z,
92
- width: p,
93
- globeOffset: w,
141
+ ref: s,
142
+ height: W,
143
+ width: a,
144
+ globeOffset: S,
94
145
  lineHoverPrecision: 0,
95
- polygonsData: K,
96
- polygonAltitude: (e) => X.includes(e?.properties?.[c]) ? 0.1 : e?.properties?.[c] === j?.id ? 0.01 : A,
97
- polygonCapColor: (e) => {
98
- const o = e?.properties?.[c], r = f.find((m) => m.id === o)?.x;
99
- return r != null ? _(r) : d;
146
+ polygonsData: oe,
147
+ polygonAltitude: (t) => V.includes(t?.properties?.[h]) || t?.properties?.[h] === C?.id || t?.properties?.[h] === x?.id ? Z : G,
148
+ polygonCapColor: (t) => {
149
+ const i = t?.properties?.[h], o = w.find((c) => c.id === i)?.x;
150
+ return o != null ? g(o) : m;
151
+ },
152
+ polygonSideColor: (t) => {
153
+ const i = t?.properties?.[h], o = w.find((d) => d.id === i)?.x, c = o != null ? g(o) : m;
154
+ return V.includes(t?.properties?.[h]) ? c : "rgba(100,100,100,0)";
100
155
  },
101
- polygonSideColor: (e) => {
102
- const o = e?.properties?.[c], r = f.find((x) => x.id === o)?.x, m = r != null ? _(r) : d;
103
- return X.includes(e?.properties?.[c]) ? m : "rgba(100,100,100,0)";
156
+ polygonStrokeColor: (t) => t?.properties?.[h] === C?.id ? ie : $,
157
+ onGlobeClick: () => {
158
+ T(void 0);
104
159
  },
105
- polygonStrokeColor: (e) => e?.properties?.[c] === j?.id ? te : H,
106
- onPolygonClick: (e) => {
107
- const o = e?.properties?.[c] ? f.find((r) => r.id === e?.properties?.[c]) : void 0;
108
- (b || y) && (xe(k, o) && T && o ? (P(void 0), b?.(void 0)) : (P(o), b?.(o))), P(o), b?.(o);
160
+ onPolygonClick: (t) => {
161
+ const i = t?.properties?.[h] ? w.find((o) => o.id === t?.properties?.[h]) : void 0;
162
+ if (M || b)
163
+ if (we(x, i) && P && i)
164
+ T(void 0), M?.(void 0), Y(void 0);
165
+ else {
166
+ T(i), M?.(i);
167
+ const [o, c] = Ce(t).geometry.coordinates;
168
+ Y([o, c]);
169
+ }
109
170
  },
110
- onPolygonHover: (e) => {
111
- const o = e?.properties?.[c] ? f.find((r) => r.id === e?.properties?.[c]) : void 0;
112
- ae(o), g?.(o);
171
+ onPolygonHover: (t) => {
172
+ const i = t?.properties?.[h] ? w.find((o) => o.id === t?.properties?.[h]) : void 0;
173
+ U(i), f?.(i);
113
174
  },
114
- atmosphereColor: U,
115
- atmosphereAltitude: V,
116
- globeCurvatureResolution: oe,
117
- globeMaterial: se,
175
+ atmosphereColor: _,
176
+ atmosphereAltitude: X,
177
+ globeCurvatureResolution: se,
178
+ globeMaterial: ee,
118
179
  backgroundColor: "rgba(0, 0, 0, 0)",
119
180
  polygonsTransitionDuration: 100,
120
181
  onGlobeReady: () => {
121
- if (a.current) {
122
- a.current.pointOfView({
123
- lat: B,
124
- lng: F
182
+ if (s.current) {
183
+ s.current.pointOfView({
184
+ lat: I,
185
+ lng: B
125
186
  });
126
- const e = a.current.scene();
187
+ const t = s.current.scene();
127
188
  setTimeout(() => {
128
- e.children.filter((C) => C.type === "DirectionalLight").map((C) => {
129
- e.remove(C);
130
- });
131
- const m = new W.AmbientLight(G, 0.2);
132
- e.add(m), (e.children[3]?.children[0]?.children[4]?.children || []).forEach((C) => {
133
- const N = C.children[1];
134
- N.renderOrder = 2;
189
+ (t.children[3]?.children[0]?.children[4]?.children || []).forEach((c) => {
190
+ const d = c.children[1];
191
+ d.renderOrder = 2;
135
192
  });
136
193
  }, 300);
137
- const o = new W.DirectionalLight(16777215, 0.1), r = a.current.camera();
138
- o.position.set(0, 0, 1), r.add(o), e.add(r);
194
+ const i = s.current.camera();
195
+ t.add(i), te();
139
196
  }
140
197
  }
141
198
  }
142
199
  ),
143
- ee === !1 ? null : /* @__PURE__ */ t.jsx("div", { className: "absolute left-4 bottom-4", children: re ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
144
- /* @__PURE__ */ t.jsx(
200
+ ae === !1 ? null : /* @__PURE__ */ r.jsx("div", { className: "absolute left-4 bottom-4", children: le ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
201
+ /* @__PURE__ */ r.jsx(
145
202
  "div",
146
203
  {
147
204
  style: {
@@ -158,22 +215,22 @@ function Te(Y) {
158
215
  top: "-0.75rem"
159
216
  },
160
217
  onClick: () => {
161
- Z(!1);
218
+ K(!1);
162
219
  },
163
- children: /* @__PURE__ */ t.jsx(je, {})
220
+ children: /* @__PURE__ */ r.jsx(Se, {})
164
221
  }
165
222
  ),
166
- /* @__PURE__ */ t.jsxs(
223
+ /* @__PURE__ */ r.jsxs(
167
224
  "div",
168
225
  {
169
226
  className: "p-2",
170
227
  style: {
171
228
  backgroundColor: "rgba(240,240,240, 0.7)",
172
- width: O ? void 0 : "340px"
229
+ width: R ? void 0 : "340px"
173
230
  },
174
231
  children: [
175
- $ && $ !== "" ? /* @__PURE__ */ t.jsx(
176
- ge,
232
+ F && F !== "" ? /* @__PURE__ */ r.jsx(
233
+ ue,
177
234
  {
178
235
  size: "xs",
179
236
  marginBottom: "xs",
@@ -183,54 +240,54 @@ function Te(Y) {
183
240
  WebkitLineClamp: "1",
184
241
  WebkitBoxOrient: "vertical"
185
242
  },
186
- children: $
243
+ children: F
187
244
  }
188
245
  ) : null,
189
- O ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-3", children: l.map((e, o) => /* @__PURE__ */ t.jsxs("div", { className: "flex gap-2 items-center", children: [
190
- /* @__PURE__ */ t.jsx(
246
+ R ? /* @__PURE__ */ r.jsx("div", { className: "flex flex-col gap-3", children: p.map((t, i) => /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 items-center", children: [
247
+ /* @__PURE__ */ r.jsx(
191
248
  "div",
192
249
  {
193
250
  className: "w-2 h-2 rounded-full",
194
- style: { backgroundColor: i[o % i.length] }
251
+ style: { backgroundColor: n[i % n.length] }
195
252
  }
196
253
  ),
197
- /* @__PURE__ */ t.jsx(ge, { size: "sm", marginBottom: "none", leading: "none", children: e })
198
- ] }, o)) }) : /* @__PURE__ */ t.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ t.jsxs("g", { children: [
199
- l.map((e, o) => /* @__PURE__ */ t.jsxs("g", { className: "cursor-pointer", children: [
200
- /* @__PURE__ */ t.jsx(
254
+ /* @__PURE__ */ r.jsx(ue, { size: "sm", marginBottom: "none", leading: "none", children: t })
255
+ ] }, i)) }) : /* @__PURE__ */ r.jsx("svg", { width: "100%", viewBox: "0 0 320 30", direction: "ltr", children: /* @__PURE__ */ r.jsxs("g", { children: [
256
+ p.map((t, i) => /* @__PURE__ */ r.jsxs("g", { className: "cursor-pointer", children: [
257
+ /* @__PURE__ */ r.jsx(
201
258
  "rect",
202
259
  {
203
- x: o * 320 / i.length + 1,
260
+ x: i * 320 / n.length + 1,
204
261
  y: 1,
205
- width: 320 / i.length - 2,
262
+ width: 320 / n.length - 2,
206
263
  height: 8,
207
264
  style: {
208
- fill: i[o],
209
- stroke: i[o]
265
+ fill: n[i],
266
+ stroke: n[i]
210
267
  }
211
268
  }
212
269
  ),
213
- /* @__PURE__ */ t.jsx(
270
+ /* @__PURE__ */ r.jsx(
214
271
  "text",
215
272
  {
216
- x: (o + 1) * 320 / i.length,
273
+ x: (i + 1) * 320 / n.length,
217
274
  y: 25,
218
275
  className: "fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",
219
276
  style: { textAnchor: "middle" },
220
- children: we(e, "NA")
277
+ children: ke(t, "NA")
221
278
  }
222
279
  )
223
- ] }, o)),
224
- /* @__PURE__ */ t.jsx("g", { children: /* @__PURE__ */ t.jsx(
280
+ ] }, i)),
281
+ /* @__PURE__ */ r.jsx("g", { children: /* @__PURE__ */ r.jsx(
225
282
  "rect",
226
283
  {
227
- x: l.length * 320 / i.length + 1,
284
+ x: p.length * 320 / n.length + 1,
228
285
  y: 1,
229
- width: 320 / i.length - 2,
286
+ width: 320 / n.length - 2,
230
287
  height: 8,
231
288
  style: {
232
- fill: i[l.length],
233
- stroke: i[l.length]
289
+ fill: n[p.length],
290
+ stroke: n[p.length]
234
291
  }
235
292
  }
236
293
  ) })
@@ -238,240 +295,254 @@ function Te(Y) {
238
295
  ]
239
296
  }
240
297
  )
241
- ] }) : /* @__PURE__ */ t.jsx(
298
+ ] }) : /* @__PURE__ */ r.jsx(
242
299
  "button",
243
300
  {
244
301
  type: "button",
245
302
  className: "mb-0 border-0 bg-transparent p-0 self-start",
246
303
  onClick: () => {
247
- Z(!0);
304
+ K(!0);
248
305
  },
249
- children: /* @__PURE__ */ t.jsx("div", { className: "items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500", children: "Show Legend" })
306
+ children: /* @__PURE__ */ r.jsx("div", { className: "items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500", children: "Show Legend" })
250
307
  }
251
308
  ) }),
252
- j && q ? /* @__PURE__ */ t.jsx(
253
- be,
309
+ C && q ? /* @__PURE__ */ r.jsx(
310
+ je,
254
311
  {
255
- data: j,
312
+ data: C,
256
313
  body: q,
257
- xPos: J.x,
258
- yPos: J.y,
259
- backgroundStyle: v?.tooltip,
260
- className: Q?.tooltip
314
+ xPos: Q.x,
315
+ yPos: Q.y,
316
+ backgroundStyle: k?.tooltip,
317
+ className: re?.tooltip
261
318
  }
262
319
  ) : null,
263
- y && k !== void 0 ? /* @__PURE__ */ t.jsx(
264
- ve,
320
+ b && x !== void 0 ? /* @__PURE__ */ r.jsx(
321
+ be,
265
322
  {
266
- open: k !== void 0,
323
+ open: x !== void 0,
267
324
  onClose: () => {
268
- P(void 0);
325
+ T(void 0);
269
326
  },
270
- children: /* @__PURE__ */ t.jsx(
327
+ children: /* @__PURE__ */ r.jsx(
271
328
  "div",
272
329
  {
273
330
  className: "graph-modal-content m-0",
274
- dangerouslySetInnerHTML: typeof y == "string" ? { __html: Ce(y, k) } : void 0,
275
- children: typeof y == "function" ? y(k) : null
331
+ dangerouslySetInnerHTML: typeof b == "string" ? { __html: De(b, x) } : void 0,
332
+ children: typeof b == "function" ? b(x) : null
276
333
  }
277
334
  )
278
335
  }
279
336
  ) : null
280
337
  ] });
281
338
  }
282
- function Ye(Y) {
339
+ function ot(e) {
283
340
  const {
284
- data: p,
285
- mapData: u = "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",
286
- graphTitle: f,
287
- colors: E,
288
- sources: O,
289
- graphDescription: l,
290
- height: i,
291
- width: s,
292
- footNote: z = "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.",
293
- colorDomain: K,
294
- colorLegendTitle: c,
295
- scaleType: H = "threshold",
296
- padding: U,
297
- mapNoDataColor: q = R.light.graphNoData,
298
- backgroundColor: v = !1,
299
- mapBorderColor: Q = R.light.grays["gray-500"],
300
- relativeHeight: d,
301
- tooltip: $,
302
- graphID: ee,
303
- mapProperty: te = "ISO3",
304
- dataDownload: y = !1,
305
- language: b = "en",
306
- minHeight: g = 0,
307
- theme: T = "light",
308
- ariaLabel: X,
309
- styles: h,
310
- classNames: w,
311
- autoRotate: A = !0,
312
- enableZoom: F = !0,
313
- globeMaterial: B,
314
- centerPoint: V = [0, 0],
315
- atmosphereColor: oe = "#999",
316
- showColorScale: G = !0,
317
- resetSelectionOnDoubleClick: D = !0,
318
- detailsOnClick: a,
319
- onSeriesMouseOver: k,
320
- onSeriesMouseClick: P,
321
- highlightedIds: re = [],
322
- scale: Z = 1,
323
- globeOffset: J = [0, 0],
324
- polygonAltitude: ie = 0.01,
325
- globeCurvatureResolution: j = 4,
326
- atmosphereAltitude: ae = 0.15,
327
- lightColor: _ = "#dce9fe",
328
- fogSettings: se
329
- } = Y, [e, o] = M(void 0), [r, m] = M(0), [x, C] = M(0), N = he(null);
330
- L(() => {
331
- const n = new ResizeObserver((I) => {
332
- m(s || I[0].target.clientWidth || 760), C(i || I[0].target.clientHeight || 480);
341
+ data: a,
342
+ mapData: v = "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",
343
+ graphTitle: w,
344
+ colors: H,
345
+ sources: R,
346
+ graphDescription: p,
347
+ height: n,
348
+ width: l,
349
+ footNote: W = "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.",
350
+ colorDomain: oe,
351
+ colorLegendTitle: h,
352
+ scaleType: $ = "threshold",
353
+ padding: _,
354
+ mapNoDataColor: q = A.light.graphNoData,
355
+ backgroundColor: k = !1,
356
+ mapBorderColor: re = A.light.grays["gray-500"],
357
+ relativeHeight: m,
358
+ tooltip: F,
359
+ graphID: ae,
360
+ mapProperty: ie = "ISO3",
361
+ dataDownload: b = !1,
362
+ language: M = "en",
363
+ minHeight: f = 0,
364
+ theme: P = "light",
365
+ ariaLabel: V,
366
+ styles: u,
367
+ classNames: S,
368
+ autoRotate: G = !0,
369
+ enableZoom: B = !0,
370
+ globeMaterial: I,
371
+ centerPoint: X = [0, 0],
372
+ atmosphereColor: se = "#999",
373
+ showColorScale: L = !0,
374
+ resetSelectionOnDoubleClick: z = !0,
375
+ detailsOnClick: Z,
376
+ onSeriesMouseOver: J,
377
+ onSeriesMouseClick: ne,
378
+ highlightedIds: s = [],
379
+ highlightedAltitude: x = 0.1,
380
+ scale: T = 1,
381
+ globeOffset: E = [0, 0],
382
+ polygonAltitude: Y = 0.01,
383
+ globeCurvatureResolution: le = 4,
384
+ atmosphereAltitude: K = 0.15,
385
+ fogSettings: Q,
386
+ lights: de = [
387
+ {
388
+ type: "ambient",
389
+ color: 4210752,
390
+ intensity: 0.4
391
+ },
392
+ {
393
+ type: "directional",
394
+ color: 16777215,
395
+ intensity: 1,
396
+ position: { x: 5, y: 10, z: 5 }
397
+ }
398
+ ]
399
+ } = e, [C, U] = j(void 0), [g, ee] = j(0), [D, te] = j(0), t = ge(null);
400
+ N(() => {
401
+ const o = new ResizeObserver((c) => {
402
+ ee(l || c[0].target.clientWidth || 760), te(n || c[0].target.clientHeight || 480);
333
403
  });
334
- return N.current && (C(N.current.clientHeight || 480), m(N.current.clientWidth || 760), s || n.observe(N.current)), () => n.disconnect();
335
- }, [s, i]), L(() => {
336
- typeof u == "string" ? Le(u).then((I) => {
337
- if (u === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
338
- const me = I.features.map((S) => {
339
- if (S.geometry.type === "Polygon") {
340
- const le = [...S.geometry.coordinates[0]].reverse(), ce = { ...S.geometry, coordinates: [le] };
341
- return { ...S, geometry: ce };
404
+ return t.current && (te(t.current.clientHeight || 480), ee(t.current.clientWidth || 760), l || o.observe(t.current)), () => o.disconnect();
405
+ }, [l, n]), N(() => {
406
+ typeof v == "string" ? Oe(v).then((c) => {
407
+ if (v === "https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json") {
408
+ const d = c.features.map((y) => {
409
+ if (y.geometry.type === "Polygon") {
410
+ const ce = [...y.geometry.coordinates[0]].reverse(), he = { ...y.geometry, coordinates: [ce] };
411
+ return { ...y, geometry: he };
342
412
  }
343
- const de = [];
344
- S.geometry.coordinates.forEach((le) => {
345
- const ce = [...le[0]].reverse();
346
- de.push([ce]);
413
+ const pe = [];
414
+ y.geometry.coordinates.forEach((ce) => {
415
+ const he = [...ce[0]].reverse();
416
+ pe.push([he]);
347
417
  });
348
- const pe = { ...S.geometry, coordinates: de };
349
- return { ...S, geometry: pe };
418
+ const ye = { ...y.geometry, coordinates: pe };
419
+ return { ...y, geometry: ye };
350
420
  });
351
- o(me);
352
- } else o(I.features);
353
- }) : o(u.features);
354
- }, [u]);
355
- const ne = K || (H === "categorical" ? Me(p, "x") : Oe(
356
- p.map((n) => n.x),
357
- E?.length || 4
421
+ U(d);
422
+ } else U(c.features);
423
+ }) : U(v.features);
424
+ }, [v]);
425
+ const i = oe || ($ === "categorical" ? Re(a, "x") : Pe(
426
+ a.map((o) => o.x),
427
+ H?.length || 4
358
428
  ));
359
- return /* @__PURE__ */ t.jsx(
429
+ return /* @__PURE__ */ r.jsx(
360
430
  "div",
361
431
  {
362
- className: `${T || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
363
- dir: b === "he" || b === "ar" ? "rtl" : void 0,
364
- children: /* @__PURE__ */ t.jsx(
432
+ className: `${P || "light"} flex ${l ? "w-fit grow-0" : "w-full grow"}`,
433
+ dir: M === "he" || M === "ar" ? "rtl" : void 0,
434
+ children: /* @__PURE__ */ r.jsx(
365
435
  "div",
366
436
  {
367
- className: ue(
368
- `${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b || "en"}`,
369
- s ? "w-fit" : "w-full",
370
- w?.graphContainer
437
+ className: fe(
438
+ `${k ? k === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M || "en"}`,
439
+ l ? "w-fit" : "w-full",
440
+ S?.graphContainer
371
441
  ),
372
442
  style: {
373
- ...h?.graphContainer || {},
374
- ...v && v !== !0 ? { backgroundColor: v } : {}
443
+ ...u?.graphContainer || {},
444
+ ...k && k !== !0 ? { backgroundColor: k } : {}
375
445
  },
376
- id: ee,
377
- "aria-label": X || `${f ? `The graph shows ${f}. ` : ""}This is a map.${l ? ` ${l}` : ""}`,
378
- children: /* @__PURE__ */ t.jsx(
446
+ id: ae,
447
+ "aria-label": V || `${w ? `The graph shows ${w}. ` : ""}This is a map.${p ? ` ${p}` : ""}`,
448
+ children: /* @__PURE__ */ r.jsx(
379
449
  "div",
380
450
  {
381
451
  className: "flex grow",
382
- style: { padding: v ? U || "1rem" : U || 0 },
383
- children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
384
- f || l || y ? /* @__PURE__ */ t.jsx(
385
- Ne,
452
+ style: { padding: k ? _ || "1rem" : _ || 0 },
453
+ children: /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
454
+ w || p || b ? /* @__PURE__ */ r.jsx(
455
+ Le,
386
456
  {
387
457
  styles: {
388
- title: h?.title,
389
- description: h?.description
458
+ title: u?.title,
459
+ description: u?.description
390
460
  },
391
461
  classNames: {
392
- title: w?.title,
393
- description: w?.description
462
+ title: S?.title,
463
+ description: S?.description
394
464
  },
395
- graphTitle: f,
396
- graphDescription: l,
397
- width: s,
465
+ graphTitle: w,
466
+ graphDescription: p,
467
+ width: l,
398
468
  graphDownload: void 0,
399
- dataDownload: y ? p.map((n) => n.data).filter((n) => n !== void 0).length > 0 ? p.map((n) => n.data).filter((n) => n !== void 0) : p.filter((n) => n !== void 0) : null
469
+ dataDownload: b ? a.map((o) => o.data).filter((o) => o !== void 0).length > 0 ? a.map((o) => o.data).filter((o) => o !== void 0) : a.filter((o) => o !== void 0) : null
400
470
  }
401
471
  ) : null,
402
- /* @__PURE__ */ t.jsx(
472
+ /* @__PURE__ */ r.jsx(
403
473
  "div",
404
474
  {
405
475
  className: "flex flex-col grow justify-center leading-0",
406
- ref: N,
476
+ ref: t,
407
477
  "aria-label": "Map area",
408
- children: (s || r) && (i || x) && e ? /* @__PURE__ */ t.jsx(
409
- Te,
478
+ children: (l || g) && (n || D) && C ? /* @__PURE__ */ r.jsx(
479
+ Ee,
410
480
  {
411
- data: p,
412
- globeOffset: J,
413
- polygonData: e,
414
- colorDomain: ne,
415
- width: s || r,
481
+ data: a,
482
+ globeOffset: E,
483
+ polygonData: C,
484
+ colorDomain: i,
485
+ width: l || g,
416
486
  height: Math.max(
417
- g,
418
- i || (d ? g ? (s || r) * d > g ? (s || r) * d : g : (s || r) * d : x)
487
+ f,
488
+ n || (m ? f ? (l || g) * m > f ? (l || g) * m : f : (l || g) * m : D)
419
489
  ),
420
- colors: E || (H === "categorical" ? R[T].sequentialColors[`neutralColorsx0${ne.length}`] : R[T].sequentialColors[`neutralColorsx0${ne.length + 1}`]),
490
+ colors: H || ($ === "categorical" ? A[P].sequentialColors[`neutralColorsx0${i.length}`] : A[P].sequentialColors[`neutralColorsx0${i.length + 1}`]),
421
491
  mapNoDataColor: q,
422
- categorical: H === "categorical",
423
- mapBorderColor: Q,
424
- tooltip: $,
425
- mapProperty: te,
426
- styles: h,
427
- classNames: w,
428
- autoRotate: A === !0 ? 1.5 : A === !1 ? 0 : A,
429
- enableZoom: F,
430
- globeMaterial: B,
431
- atmosphereColor: oe,
432
- colorLegendTitle: c,
433
- showColorScale: G,
434
- hoverStrokeColor: T === "light" ? R.light.grays["gray-700"] : R.light.grays["gray-300"],
435
- highlightedIds: re,
436
- resetSelectionOnDoubleClick: D,
437
- detailsOnClick: a,
438
- onSeriesMouseOver: k,
439
- onSeriesMouseClick: P,
440
- scale: Z,
441
- polygonAltitude: ie,
442
- centerLat: V[0],
443
- centerLng: V[1],
444
- atmosphereAltitude: ae,
445
- globeCurvatureResolution: j,
446
- lightColor: _,
447
- fogSettings: se
492
+ categorical: $ === "categorical",
493
+ mapBorderColor: re,
494
+ tooltip: F,
495
+ mapProperty: ie,
496
+ styles: u,
497
+ classNames: S,
498
+ autoRotate: G === !0 ? 1.5 : G === !1 ? 0 : G,
499
+ enableZoom: B,
500
+ globeMaterial: I,
501
+ atmosphereColor: se,
502
+ colorLegendTitle: h,
503
+ showColorScale: L,
504
+ hoverStrokeColor: P === "light" ? A.light.grays["gray-700"] : A.light.grays["gray-300"],
505
+ highlightedIds: s,
506
+ resetSelectionOnDoubleClick: z,
507
+ detailsOnClick: Z,
508
+ onSeriesMouseOver: J,
509
+ onSeriesMouseClick: ne,
510
+ scale: T,
511
+ polygonAltitude: Y,
512
+ centerLat: X[0],
513
+ centerLng: X[1],
514
+ atmosphereAltitude: K,
515
+ globeCurvatureResolution: le,
516
+ fogSettings: Q,
517
+ lights: de,
518
+ highlightedAltitude: x
448
519
  }
449
- ) : /* @__PURE__ */ t.jsx(
520
+ ) : /* @__PURE__ */ r.jsx(
450
521
  "div",
451
522
  {
452
523
  style: {
453
524
  height: `${Math.max(
454
- g,
455
- i || (d ? g ? (s || r) * d > g ? (s || r) * d : g : (s || r) * d : x)
525
+ f,
526
+ n || (m ? f ? (l || g) * m > f ? (l || g) * m : f : (l || g) * m : D)
456
527
  )}px`
457
528
  },
458
529
  className: "flex items-center justify-center",
459
- children: /* @__PURE__ */ t.jsx(fe, { "aria-label": "Loading graph" })
530
+ children: /* @__PURE__ */ r.jsx(xe, { "aria-label": "Loading graph" })
460
531
  }
461
532
  )
462
533
  }
463
534
  ),
464
- O || z ? /* @__PURE__ */ t.jsx(
465
- Se,
535
+ R || W ? /* @__PURE__ */ r.jsx(
536
+ ze,
466
537
  {
467
- styles: { footnote: h?.footnote, source: h?.source },
538
+ styles: { footnote: u?.footnote, source: u?.source },
468
539
  classNames: {
469
- footnote: w?.footnote,
470
- source: w?.source
540
+ footnote: S?.footnote,
541
+ source: S?.source
471
542
  },
472
- sources: O,
473
- footNote: z,
474
- width: s
543
+ sources: R,
544
+ footNote: W,
545
+ width: l
475
546
  }
476
547
  ) : null
477
548
  ] })
@@ -483,6 +554,6 @@ function Ye(Y) {
483
554
  );
484
555
  }
485
556
  export {
486
- Ye as ThreeDGlobe
557
+ ot as ThreeDGlobe
487
558
  };
488
559
  //# sourceMappingURL=ThreeDGlobe.js.map