@undp/data-viz 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +21 -21
  3. package/dist/BarGraph.cjs +1 -1
  4. package/dist/BarGraph.js +7 -7
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.js +2 -2
  7. package/dist/BiVariateChoroplethMap.cjs +1 -1
  8. package/dist/BiVariateChoroplethMap.js +5 -5
  9. package/dist/BulletChart.cjs +1 -1
  10. package/dist/BulletChart.js +14 -14
  11. package/dist/ButterflyChart.cjs +1 -1
  12. package/dist/ButterflyChart.js +9 -9
  13. package/dist/ChoroplethMap.cjs +1 -1
  14. package/dist/ChoroplethMap.js +9 -9
  15. package/dist/CirclePackingGraph.cjs +1 -1
  16. package/dist/CirclePackingGraph.js +1 -1
  17. package/dist/CopyTextButton.cjs +7 -7
  18. package/dist/CopyTextButton.cjs.map +1 -1
  19. package/dist/CopyTextButton.js +4 -4
  20. package/dist/CopyTextButton.js.map +1 -1
  21. package/dist/DataCards.cjs +9 -9
  22. package/dist/DataCards.cjs.map +1 -1
  23. package/dist/DataCards.js +93 -93
  24. package/dist/DataCards.js.map +1 -1
  25. package/dist/DifferenceLineChart.cjs +1 -1
  26. package/dist/DifferenceLineChart.js +18 -18
  27. package/dist/DonutChart.cjs +1 -1
  28. package/dist/DonutChart.js +1 -1
  29. package/dist/DotDensityMap.cjs +1 -1
  30. package/dist/DotDensityMap.js +8 -8
  31. package/dist/{DropdownSelect-0I2QxaVy.cjs → DropdownSelect-BmE5JaeE.cjs} +6 -6
  32. package/dist/{DropdownSelect-0I2QxaVy.cjs.map → DropdownSelect-BmE5JaeE.cjs.map} +1 -1
  33. package/dist/{DropdownSelect-CDC9lEqU.js → DropdownSelect-CeHog_ih.js} +4 -4
  34. package/dist/{DropdownSelect-CDC9lEqU.js.map → DropdownSelect-CeHog_ih.js.map} +1 -1
  35. package/dist/DualAxisLineChart.cjs +1 -1
  36. package/dist/DualAxisLineChart.js +15 -15
  37. package/dist/DumbbellChart.cjs +1 -1
  38. package/dist/DumbbellChart.js +13 -13
  39. package/dist/GeoHubMap.cjs +1 -1
  40. package/dist/GeoHubMap.js +2 -2
  41. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  42. package/dist/GeoHubMapWithLayerSelection.js +2 -2
  43. package/dist/{GraphEl-B6SoGRFW.cjs → GraphEl-B5gAX1IQ.cjs} +2 -2
  44. package/dist/{GraphEl-B6SoGRFW.cjs.map → GraphEl-B5gAX1IQ.cjs.map} +1 -1
  45. package/dist/{GraphEl-Cw2tDUb3.js → GraphEl-BdIyscdt.js} +3 -3
  46. package/dist/{GraphEl-Cw2tDUb3.js.map → GraphEl-BdIyscdt.js.map} +1 -1
  47. package/dist/GriddedGraphs.cjs +1 -1
  48. package/dist/GriddedGraphs.d.ts +4 -7
  49. package/dist/GriddedGraphs.js +4 -4
  50. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  51. package/dist/GriddedGraphsFromConfig.d.ts +4 -7
  52. package/dist/GriddedGraphsFromConfig.js +1 -1
  53. package/dist/HeatMap.cjs +1 -1
  54. package/dist/HeatMap.js +10 -10
  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 +21 -21
  59. package/dist/{Modal-CUU6ZK3U.js → Modal-DVVwpKhP.js} +2 -2
  60. package/dist/{Modal-CUU6ZK3U.js.map → Modal-DVVwpKhP.js.map} +1 -1
  61. package/dist/{Modal-C_dl0EtQ.cjs → Modal-tXZlLE5s.cjs} +4 -4
  62. package/dist/{Modal-C_dl0EtQ.cjs.map → Modal-tXZlLE5s.cjs.map} +1 -1
  63. package/dist/MultiGraphDashboard.cjs +1 -1
  64. package/dist/MultiGraphDashboard.d.ts +4 -7
  65. package/dist/MultiGraphDashboard.js +3 -3
  66. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  67. package/dist/MultiGraphDashboardFromConfig.d.ts +4 -7
  68. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  69. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  70. package/dist/MultiGraphDashboardWideToLongFormat.js +3 -3
  71. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  72. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  73. package/dist/MultiLineAltChart.cjs +1 -1
  74. package/dist/MultiLineAltChart.js +21 -21
  75. package/dist/MultiLineChart.cjs +1 -1
  76. package/dist/MultiLineChart.js +19 -19
  77. package/dist/ParetoChart.cjs +1 -1
  78. package/dist/ParetoChart.js +12 -12
  79. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  80. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +4 -7
  81. package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
  82. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  83. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +4 -7
  84. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  85. package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
  86. package/dist/PerformanceIntensiveScrollStory.d.ts +4 -7
  87. package/dist/PerformanceIntensiveScrollStory.js +2 -2
  88. package/dist/RadarChart.cjs +1 -1
  89. package/dist/RadarChart.js +8 -8
  90. package/dist/{ReferenceLine-CuFMk0cI.cjs → ReferenceLine-CFVBBN__.cjs} +2 -2
  91. package/dist/{ReferenceLine-CuFMk0cI.cjs.map → ReferenceLine-CFVBBN__.cjs.map} +1 -1
  92. package/dist/{ReferenceLine-C1GpoG9d.js → ReferenceLine-CfAW3vKJ.js} +2 -2
  93. package/dist/{ReferenceLine-C1GpoG9d.js.map → ReferenceLine-CfAW3vKJ.js.map} +1 -1
  94. package/dist/{RegressionLine-BFwDCTUU.js → RegressionLine-mH7UKOPi.js} +3 -3
  95. package/dist/{RegressionLine-BFwDCTUU.js.map → RegressionLine-mH7UKOPi.js.map} +1 -1
  96. package/dist/{RegressionLine-7_rKTHN_.cjs → RegressionLine-xKdiJ8sw.cjs} +2 -2
  97. package/dist/{RegressionLine-7_rKTHN_.cjs.map → RegressionLine-xKdiJ8sw.cjs.map} +1 -1
  98. package/dist/SankeyChart.cjs +1 -1
  99. package/dist/SankeyChart.js +4 -4
  100. package/dist/ScatterPlot.cjs +1 -1
  101. package/dist/ScatterPlot.js +13 -13
  102. package/dist/ScrollStory.cjs +1 -1
  103. package/dist/ScrollStory.d.ts +4 -7
  104. package/dist/ScrollStory.js +2 -2
  105. package/dist/SimpleLineChart.cjs +1 -1
  106. package/dist/SimpleLineChart.js +20 -20
  107. package/dist/SingleGraphDashboard.cjs +1 -1
  108. package/dist/SingleGraphDashboard.d.ts +4 -7
  109. package/dist/SingleGraphDashboard.js +4 -4
  110. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  111. package/dist/SingleGraphDashboardFromConfig.d.ts +4 -7
  112. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  113. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +4 -7
  114. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  115. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +4 -7
  116. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  117. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  118. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  119. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +4 -7
  120. package/dist/SingleGraphDashboardThreeDGraphs.js +30 -27
  121. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  122. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  123. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +4 -7
  124. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  125. package/dist/SlopeChart.cjs +1 -1
  126. package/dist/SlopeChart.js +7 -7
  127. package/dist/StripChart.cjs +1 -1
  128. package/dist/StripChart.js +9 -9
  129. package/dist/ThreeDGlobe.cjs +1 -1
  130. package/dist/ThreeDGlobe.cjs.map +1 -1
  131. package/dist/ThreeDGlobe.d.ts +11 -2
  132. package/dist/ThreeDGlobe.js +278 -253
  133. package/dist/ThreeDGlobe.js.map +1 -1
  134. package/dist/TreeMapGraph.cjs +1 -1
  135. package/dist/TreeMapGraph.js +4 -4
  136. package/dist/Types.d.ts +4 -7
  137. package/dist/UnitChart.cjs +1 -1
  138. package/dist/UnitChart.js +3 -3
  139. package/dist/{XAxesLabels-DQFo_z2R.js → XAxesLabels-CaV2q-6H.js} +2 -2
  140. package/dist/{XAxesLabels-DQFo_z2R.js.map → XAxesLabels-CaV2q-6H.js.map} +1 -1
  141. package/dist/{XAxesLabels-CJMQbfVy.cjs → XAxesLabels-OjBNl_lS.cjs} +2 -2
  142. package/dist/{XAxesLabels-CJMQbfVy.cjs.map → XAxesLabels-OjBNl_lS.cjs.map} +1 -1
  143. package/dist/{YAxesLabels-H5-002X5.js → YAxesLabels-CPGZjmZJ.js} +2 -2
  144. package/dist/{YAxesLabels-H5-002X5.js.map → YAxesLabels-CPGZjmZJ.js.map} +1 -1
  145. package/dist/{YAxesLabels-BXLTX7AI.cjs → YAxesLabels-D8IydyZj.cjs} +2 -2
  146. package/dist/{YAxesLabels-BXLTX7AI.cjs.map → YAxesLabels-D8IydyZj.cjs.map} +1 -1
  147. package/dist/{checkIfMultiple-Do4kADNr.cjs → checkIfMultiple-BXbHUCWM.cjs} +6 -6
  148. package/dist/{checkIfMultiple-Do4kADNr.cjs.map → checkIfMultiple-BXbHUCWM.cjs.map} +1 -1
  149. package/dist/{checkIfMultiple-CYp3vADF.js → checkIfMultiple-ChTJk2Tk.js} +5 -5
  150. package/dist/{checkIfMultiple-CYp3vADF.js.map → checkIfMultiple-ChTJk2Tk.js.map} +1 -1
  151. package/dist/{customArea-CaxScFmW.js → customArea-B-dWU0zZ.js} +2 -2
  152. package/dist/{customArea-CaxScFmW.js.map → customArea-B-dWU0zZ.js.map} +1 -1
  153. package/dist/{customArea-BYNyxAkm.cjs → customArea-CK768gCn.cjs} +2 -2
  154. package/dist/{customArea-BYNyxAkm.cjs.map → customArea-CK768gCn.cjs.map} +1 -1
  155. package/dist/{fetchAndParseData-Bcmr659B.js → fetchAndParseData-4gsYTy6_.js} +3 -3
  156. package/dist/fetchAndParseData-4gsYTy6_.js.map +1 -0
  157. package/dist/{fetchAndParseData-DmgQtB9n.cjs → fetchAndParseData-CQyVGCul.cjs} +6 -6
  158. package/dist/fetchAndParseData-CQyVGCul.cjs.map +1 -0
  159. package/dist/fetchAndParseData.cjs +1 -1
  160. package/dist/fetchAndParseData.js +1 -1
  161. package/dist/index-BW8iNx7E.cjs +10 -0
  162. package/dist/index-BW8iNx7E.cjs.map +1 -0
  163. package/dist/index-CNvov0eg.js +122 -0
  164. package/dist/index-CNvov0eg.js.map +1 -0
  165. package/dist/{index-D_n8aamX.cjs → index-CZLvTu6p.cjs} +2 -2
  166. package/dist/{index-D_n8aamX.cjs.map → index-CZLvTu6p.cjs.map} +1 -1
  167. package/dist/{index-n_RI8T0n.js → index-Cdcfp4nk.js} +2 -2
  168. package/dist/{index-n_RI8T0n.js.map → index-Cdcfp4nk.js.map} +1 -1
  169. package/dist/{index-BVnYktl4.js → index-DGAaLNu9.js} +2 -2
  170. package/dist/{index-BVnYktl4.js.map → index-DGAaLNu9.js.map} +1 -1
  171. package/dist/{index-CylX-pWB.cjs → index-DNj994Pv.cjs} +2 -2
  172. package/dist/{index-CylX-pWB.cjs.map → index-DNj994Pv.cjs.map} +1 -1
  173. package/dist/index.cjs +1 -1
  174. package/dist/index.d.ts +15 -9
  175. package/dist/index.js +3 -3
  176. package/dist/proxy-BHRoeZgd.cjs +2 -0
  177. package/dist/proxy-BHRoeZgd.cjs.map +1 -0
  178. package/dist/{proxy-DJxJg1kD.js → proxy-CkpFesk1.js} +4123 -4075
  179. package/dist/proxy-CkpFesk1.js.map +1 -0
  180. package/dist/style.css +1 -1
  181. package/dist/transformData.cjs +1 -1
  182. package/dist/transformData.js +2 -2
  183. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs → transformDataForGraphFromFile-B1A0AS-Z.cjs} +2 -2
  184. package/dist/{transformDataForGraphFromFile-D9G3ToQf.cjs.map → transformDataForGraphFromFile-B1A0AS-Z.cjs.map} +1 -1
  185. package/dist/{transformDataForGraphFromFile-CA0rw80A.js → transformDataForGraphFromFile-BCjsizvb.js} +2 -2
  186. package/dist/{transformDataForGraphFromFile-CA0rw80A.js.map → transformDataForGraphFromFile-BCjsizvb.js.map} +1 -1
  187. package/dist/{use-in-view-BCmzDU2O.cjs → use-in-view-sQJZ_xDO.cjs} +2 -2
  188. package/dist/use-in-view-sQJZ_xDO.cjs.map +1 -0
  189. package/dist/{use-in-view-BAHrBy6b.js → use-in-view-yS6jzJAp.js} +2 -2
  190. package/dist/use-in-view-yS6jzJAp.js.map +1 -0
  191. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs +27 -0
  192. package/dist/x-BBpi7a_7-Dz2vKSfu.cjs.map +1 -0
  193. package/dist/x-BBpi7a_7-WVdj1j6r.js +106 -0
  194. package/dist/x-BBpi7a_7-WVdj1j6r.js.map +1 -0
  195. package/package.json +50 -51
  196. package/dist/fetchAndParseData-Bcmr659B.js.map +0 -1
  197. package/dist/fetchAndParseData-DmgQtB9n.cjs.map +0 -1
  198. package/dist/index-BxAUvrua.js +0 -120
  199. package/dist/index-BxAUvrua.js.map +0 -1
  200. package/dist/index-DVOJ7vxH.cjs +0 -10
  201. package/dist/index-DVOJ7vxH.cjs.map +0 -1
  202. package/dist/proxy-DJxJg1kD.js.map +0 -1
  203. package/dist/proxy-PQd2AItT.cjs +0 -2
  204. package/dist/proxy-PQd2AItT.cjs.map +0 -1
  205. package/dist/use-in-view-BAHrBy6b.js.map +0 -1
  206. package/dist/use-in-view-BCmzDU2O.cjs.map +0 -1
  207. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +0 -27
  208. package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +0 -1
  209. package/dist/x-CnsEH4Ox-DDvAJndW.js +0 -101
  210. package/dist/x-CnsEH4Ox-DDvAJndW.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeDGlobe.js","sources":["../src/Components/Graphs/Maps/ThreeDGlobe/Graph.tsx","../src/Components/Graphs/Maps/ThreeDGlobe/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport Globe, { GlobeMethods } from 'react-globe.gl';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport { scaleOrdinal, scaleThreshold } from 'd3-scale';\r\nimport * as THREE from 'three';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\n\r\nimport { ChoroplethMapDataType, ClassNameObject, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { X } from '@/Components/Icons';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n width: number;\r\n data: ChoroplethMapDataType[];\r\n autoRotate: number;\r\n enableZoom: boolean;\r\n categorical: boolean;\r\n colorDomain: number[] | string[];\r\n colors: string[];\r\n height: number;\r\n globeMaterial?: THREE.MeshPhongMaterialProperties;\r\n polygonData: any;\r\n mapProperty: string;\r\n mapBorderColor: string;\r\n atmosphereColor: string;\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapNoDataColor: string;\r\n centerPoint: [number, number];\r\n colorLegendTitle?: string;\r\n showColorScale: boolean;\r\n hoverStrokeColor: string;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n resetSelectionOnDoubleClick: boolean;\r\n highlightedIds: string[];\r\n scale: number;\r\n globeOffset: [number, number];\r\n polygonAltitude: number;\r\n centerLng: number;\r\n centerLat: number;\r\n}\r\n\r\nfunction Graph(props: Props) {\r\n const {\r\n width,\r\n autoRotate,\r\n data,\r\n enableZoom,\r\n categorical,\r\n colorDomain,\r\n colors,\r\n globeMaterial,\r\n height,\r\n polygonData,\r\n mapProperty,\r\n mapBorderColor,\r\n atmosphereColor,\r\n tooltip,\r\n styles,\r\n classNames,\r\n mapNoDataColor,\r\n centerPoint,\r\n colorLegendTitle,\r\n showColorScale,\r\n hoverStrokeColor,\r\n detailsOnClick,\r\n onSeriesMouseClick,\r\n onSeriesMouseOver,\r\n resetSelectionOnDoubleClick,\r\n highlightedIds,\r\n scale,\r\n globeOffset,\r\n polygonAltitude,\r\n centerLng,\r\n centerLat,\r\n } = props;\r\n const globeEl = useRef<GlobeMethods | undefined>(undefined);\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [showLegend, setShowLegend] = useState(!(width < 680));\r\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 });\r\n const [mouseOverData, setMouseOverData] = useState<ChoroplethMapDataType | undefined>(undefined);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n if (globeEl?.current) {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n globeEl.current.controls().enableZoom = enableZoom;\r\n globeEl.current.controls().autoRotateSpeed = autoRotate;\r\n }\r\n }, [autoRotate, enableZoom]);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n if (mouseOverData) {\r\n globeEl.current.controls().autoRotate = false;\r\n } else {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n }\r\n }\r\n }, [mouseOverData, autoRotate]);\r\n\r\n useEffect(() => {\r\n const canvas = globeEl.current?.renderer().domElement;\r\n if (!canvas) return;\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n setMousePos({ x: e.clientX, y: e.clientY });\r\n };\r\n\r\n canvas.addEventListener('mousemove', handleMouseMove);\r\n return () => canvas.removeEventListener('mousemove', handleMouseMove);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({ lat: centerLat, lng: centerLng, altitude: scale }, 1000);\r\n }\r\n }, [scale, centerLng, centerLat]);\r\n const materials = new THREE.MeshLambertMaterial({\r\n color: '#fff',\r\n opacity: 1,\r\n transparent: false,\r\n ...(globeMaterial || {}),\r\n });\r\n return (\r\n <div className='relative'>\r\n <Globe\r\n ref={globeEl}\r\n width={width}\r\n height={height}\r\n globeOffset={globeOffset}\r\n lineHoverPrecision={0}\r\n polygonsData={polygonData}\r\n polygonAltitude={(polygon: any) =>\r\n highlightedIds.includes(polygon?.properties?.[mapProperty])\r\n ? 0.1\r\n : polygon?.properties?.[mapProperty] === mouseOverData?.id\r\n ? 0.01\r\n : polygonAltitude\r\n }\r\n polygonCapColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n if (val !== undefined && val !== null) {\r\n return colorScale(val as any);\r\n }\r\n return mapNoDataColor;\r\n }}\r\n polygonSideColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n const color = val !== undefined && val !== null ? colorScale(val as any) : mapNoDataColor;\r\n return highlightedIds.includes(polygon?.properties?.[mapProperty])\r\n ? color\r\n : 'rgba(100,100,100,0)';\r\n }}\r\n polygonStrokeColor={(polygon: any) =>\r\n polygon?.properties?.[mapProperty] === mouseOverData?.id\r\n ? hoverStrokeColor\r\n : mapBorderColor\r\n }\r\n onPolygonClick={(polygon: any) => {\r\n const clickedData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (\r\n isEqual(mouseClickData, clickedData) &&\r\n resetSelectionOnDoubleClick &&\r\n clickedData\r\n ) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(clickedData);\r\n onSeriesMouseClick?.(clickedData);\r\n }\r\n }\r\n setMouseClickData(clickedData);\r\n onSeriesMouseClick?.(clickedData);\r\n }}\r\n onPolygonHover={(polygon: any) => {\r\n const hoverData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n setMouseOverData(hoverData);\r\n onSeriesMouseOver?.(hoverData);\r\n }}\r\n atmosphereColor={atmosphereColor}\r\n globeMaterial={materials}\r\n backgroundColor='rgba(0, 0, 0, 0)'\r\n polygonsTransitionDuration={100}\r\n onGlobeReady={() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({\r\n lat: centerPoint[0],\r\n lng: centerPoint[1],\r\n });\r\n }\r\n }}\r\n />\r\n {showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='p-2'\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g key={i} className='cursor-pointer'>\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[i],\r\n stroke: colors[i],\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n stroke: colors[colorDomain.length],\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div key={i} className='flex gap-2 items-center'>\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <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'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {mouseOverData && tooltip ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={mousePos.x}\r\n yPos={mousePos.y}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </div>\r\n );\r\n}\r\n\r\nexport default Graph;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport * as THREE from 'three';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport Graph from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n Languages,\r\n ScaleDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines if the globe rotates automatically */\r\n autoRotate?: number | boolean;\r\n /** Defines the material property applied to the sphere of the globe */\r\n globeMaterial?: THREE.MeshPhongMaterialProperties;\r\n /** Defines the colo of the glow around the globe */\r\n atmosphereColor?: string;\r\n /** Defines if the globe can be zoomed when scrolled */\r\n enableZoom?: boolean;\r\n /** Position offset of the globe relative to the canvas center */\r\n globeOffset?: [number, number];\r\n /** Defines the camera distance from Earth. This helps in defining the default size of the globe. Smaller = closer camera therefore the globe is bigger) */\r\n scale?: number;\r\n /** Defines the spacing between the country shape polygon with the sphere */\r\n polygonAltitude?: number;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggles if the color scaling is categorical or not */\r\n categorical?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\n/** For using these maps you will have to install [`three`](https://threejs.org/manual/) and [react-globe.gl](https://www.npmjs.com/package/react-globe.gl) package to your project */\r\nexport function ThreeDGlobe(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = '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.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n padding,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n graphID,\r\n mapProperty = 'ISO3',\r\n dataDownload = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n styles,\r\n classNames,\r\n autoRotate = true,\r\n enableZoom = true,\r\n globeMaterial,\r\n centerPoint = [0, 0],\r\n atmosphereColor = '#999',\r\n showColorScale = true,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n highlightedIds = [],\r\n scale = 1,\r\n globeOffset = [0, 0],\r\n polygonAltitude = 0.01,\r\n } = props;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n if (\r\n mapData ===\r\n 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json'\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const features = d.features.map((el: any) => {\r\n if (el.geometry.type === 'Polygon') {\r\n const reversed = [...el.geometry.coordinates[0]].reverse();\r\n const geometry = { ...el.geometry, coordinates: [reversed] };\r\n return { ...el, geometry };\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const coord: any = [];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n el.geometry.coordinates.forEach((c: any) => {\r\n const reversed = [...c[0]].reverse();\r\n coord.push([reversed]);\r\n });\r\n const geometry = { ...el.geometry, coordinates: coord };\r\n return { ...el, geometry };\r\n });\r\n setMapShape(features);\r\n } else setMapShape(d.features);\r\n });\r\n } else {\r\n setMapShape(mapData.features);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a map.${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data}\r\n globeOffset={globeOffset}\r\n polygonData={mapShape}\r\n colorDomain={domain}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n mapProperty={mapProperty}\r\n styles={styles}\r\n classNames={classNames}\r\n autoRotate={autoRotate === true ? 1.5 : autoRotate === false ? 0 : autoRotate}\r\n enableZoom={enableZoom}\r\n globeMaterial={globeMaterial}\r\n atmosphereColor={atmosphereColor}\r\n centerPoint={centerPoint}\r\n colorLegendTitle={colorLegendTitle}\r\n showColorScale={showColorScale}\r\n hoverStrokeColor={\r\n theme === 'light'\r\n ? Colors.light.grays['gray-700']\r\n : Colors.light.grays['gray-300']\r\n }\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n scale={scale}\r\n polygonAltitude={polygonAltitude}\r\n centerLat={centerPoint[0]}\r\n centerLng={centerPoint[1]}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","width","autoRotate","data","enableZoom","categorical","colorDomain","colors","globeMaterial","height","polygonData","mapProperty","mapBorderColor","atmosphereColor","tooltip","styles","classNames","mapNoDataColor","centerPoint","colorLegendTitle","showColorScale","hoverStrokeColor","detailsOnClick","onSeriesMouseClick","onSeriesMouseOver","resetSelectionOnDoubleClick","highlightedIds","scale","globeOffset","polygonAltitude","centerLng","centerLat","globeEl","useRef","mouseClickData","setMouseClickData","useState","showLegend","setShowLegend","mousePos","setMousePos","mouseOverData","setMouseOverData","colorScale","scaleOrdinal","scaleThreshold","useEffect","canvas","handleMouseMove","e","materials","THREE","jsxs","jsx","Globe","polygon","id","val","el","color","clickedData","isEqual","hoverData","Fragment","X","P","d","i","numberFormattingFunction","Tooltip","Modal","string2HTML","ThreeDGlobe","mapData","graphTitle","sources","graphDescription","footNote","scaleType","padding","Colors","backgroundColor","relativeHeight","graphID","dataDownload","language","minHeight","theme","ariaLabel","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","resizeObserver","entries","fetchAndParseJSON","features","reversed","geometry","coord","c","domain","getUniqValue","getJenks","cn","GraphHeader","Spinner","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiDA,SAASA,GAAMC,GAAc;AAC3B,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,eAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,EAAA,IACE/B,GACEgC,IAAUC,GAAiC,MAAS,GACpD,CAACC,GAAgBC,CAAiB,IAAIC,EAAc,MAAS,GAC7D,CAACC,GAAYC,CAAa,IAAIF,EAAS,EAAEnC,IAAQ,IAA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WAAWA,EAAY,CAAC;AAAA,sBAAA;AAAA,oBAAA,IAG1BmC,gBAAAA,EAAAA;AAAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,OAAO;AAAA,0BACL,QAAQ,GAAG,KAAK;AAAA,4BACdiC;AAAA,4BACA7E,MACGyE,IACGI,KACGrF,KAAS0F,KAAYT,IAAiBI,KACpCrF,KAAS0F,KAAYT,IACtBI,KACDrF,KAAS0F,KAAYT,IACxBW;AAAA,0BAAA,CACP;AAAA,wBAAA;AAAA,wBAEH,WAAU;AAAA,wBAEV,UAAAxC,gBAAAA,EAAAA,IAACwD,IAAA,EAAQ,cAAW,gBAAA,CAAgB;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACtC;AAAA,gBAAA;AAAA,gBAGHlC,KAAWE,IACVxB,gBAAAA,EAAAA;AAAAA,kBAACyD;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAU/F,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAA2D;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA5E;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ThreeDGlobe.js","sources":["../src/Components/Graphs/Maps/ThreeDGlobe/Graph.tsx","../src/Components/Graphs/Maps/ThreeDGlobe/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport Globe, { GlobeMethods } from 'react-globe.gl';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport { scaleOrdinal, scaleThreshold } from 'd3-scale';\r\nimport * as THREE from 'three';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\n\r\nimport { ChoroplethMapDataType, ClassNameObject, StyleObject } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { X } from '@/Components/Icons';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n width: number;\r\n data: ChoroplethMapDataType[];\r\n autoRotate: number;\r\n enableZoom: boolean;\r\n categorical: boolean;\r\n colorDomain: number[] | string[];\r\n colors: string[];\r\n height: number;\r\n globeMaterial?: THREE.Material;\r\n polygonData: any;\r\n mapProperty: string;\r\n mapBorderColor: string;\r\n atmosphereColor: string;\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapNoDataColor: string;\r\n centerPoint: [number, number];\r\n colorLegendTitle?: string;\r\n showColorScale: boolean;\r\n hoverStrokeColor: string;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n resetSelectionOnDoubleClick: boolean;\r\n highlightedIds: string[];\r\n scale: number;\r\n globeOffset: [number, number];\r\n polygonAltitude: number;\r\n centerLng: number;\r\n centerLat: number;\r\n atmosphereAltitude: number;\r\n globeCurvatureResolution: number;\r\n lightColor: string;\r\n}\r\n\r\nfunction Graph(props: Props) {\r\n const {\r\n width,\r\n autoRotate,\r\n data,\r\n enableZoom,\r\n categorical,\r\n colorDomain,\r\n colors,\r\n globeMaterial,\r\n height,\r\n polygonData,\r\n mapProperty,\r\n mapBorderColor,\r\n atmosphereColor,\r\n tooltip,\r\n styles,\r\n classNames,\r\n mapNoDataColor,\r\n centerPoint,\r\n colorLegendTitle,\r\n showColorScale,\r\n hoverStrokeColor,\r\n detailsOnClick,\r\n onSeriesMouseClick,\r\n onSeriesMouseOver,\r\n resetSelectionOnDoubleClick,\r\n highlightedIds,\r\n scale,\r\n globeOffset,\r\n polygonAltitude,\r\n centerLng,\r\n centerLat,\r\n atmosphereAltitude,\r\n globeCurvatureResolution,\r\n lightColor,\r\n } = props;\r\n const globeEl = useRef<GlobeMethods | undefined>(undefined);\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [showLegend, setShowLegend] = useState(!(width < 680));\r\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 });\r\n const [mouseOverData, setMouseOverData] = useState<ChoroplethMapDataType | undefined>(undefined);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n if (globeEl?.current) {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n globeEl.current.controls().enableZoom = enableZoom;\r\n globeEl.current.controls().autoRotateSpeed = autoRotate;\r\n }\r\n }, [autoRotate, enableZoom]);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n if (mouseOverData) {\r\n globeEl.current.controls().autoRotate = false;\r\n } else {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n }\r\n }\r\n }, [mouseOverData, autoRotate]);\r\n\r\n useEffect(() => {\r\n const canvas = globeEl.current?.renderer().domElement;\r\n if (!canvas) return;\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n setMousePos({ x: e.clientX, y: e.clientY });\r\n };\r\n\r\n canvas.addEventListener('mousemove', handleMouseMove);\r\n return () => canvas.removeEventListener('mousemove', handleMouseMove);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({ lat: centerLat, lng: centerLng, altitude: scale }, 1000);\r\n }\r\n }, [scale, centerLng, centerLat]);\r\n const materials =\r\n globeMaterial ||\r\n new THREE.MeshPhysicalMaterial({\r\n color: '#FFF',\r\n roughness: 0.5,\r\n reflectivity: 1.2,\r\n });\r\n return (\r\n <div className='relative'>\r\n <Globe\r\n ref={globeEl}\r\n width={width}\r\n height={height}\r\n globeOffset={globeOffset}\r\n lineHoverPrecision={0}\r\n polygonsData={polygonData}\r\n polygonAltitude={(polygon: any) =>\r\n highlightedIds.includes(polygon?.properties?.[mapProperty])\r\n ? 0.1\r\n : polygon?.properties?.[mapProperty] === mouseOverData?.id\r\n ? 0.01\r\n : polygonAltitude\r\n }\r\n polygonCapColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n if (val !== undefined && val !== null) {\r\n return colorScale(val as any);\r\n }\r\n return mapNoDataColor;\r\n }}\r\n polygonSideColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n const color = val !== undefined && val !== null ? colorScale(val as any) : mapNoDataColor;\r\n return highlightedIds.includes(polygon?.properties?.[mapProperty])\r\n ? color\r\n : 'rgba(100,100,100,0)';\r\n }}\r\n polygonStrokeColor={(polygon: any) =>\r\n polygon?.properties?.[mapProperty] === mouseOverData?.id\r\n ? hoverStrokeColor\r\n : mapBorderColor\r\n }\r\n onPolygonClick={(polygon: any) => {\r\n const clickedData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (\r\n isEqual(mouseClickData, clickedData) &&\r\n resetSelectionOnDoubleClick &&\r\n clickedData\r\n ) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(clickedData);\r\n onSeriesMouseClick?.(clickedData);\r\n }\r\n }\r\n setMouseClickData(clickedData);\r\n onSeriesMouseClick?.(clickedData);\r\n }}\r\n onPolygonHover={(polygon: any) => {\r\n const hoverData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n setMouseOverData(hoverData);\r\n onSeriesMouseOver?.(hoverData);\r\n }}\r\n atmosphereColor={atmosphereColor}\r\n atmosphereAltitude={atmosphereAltitude}\r\n globeCurvatureResolution={globeCurvatureResolution}\r\n globeMaterial={materials}\r\n backgroundColor='rgba(0, 0, 0, 0)'\r\n polygonsTransitionDuration={100}\r\n onGlobeReady={() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({\r\n lat: centerPoint[0],\r\n lng: centerPoint[1],\r\n });\r\n const scene = globeEl.current.scene();\r\n setTimeout(() => {\r\n scene.children\r\n .filter(d => d.type === 'DirectionalLight')\r\n .map(d => {\r\n scene.remove(d);\r\n });\r\n const ambientLight = new THREE.AmbientLight(lightColor, 0.2);\r\n scene.add(ambientLight);\r\n\r\n const polygons = scene.children[3]?.children[0]?.children[4]?.children || [];\r\n polygons.forEach(d => {\r\n const line = d.children[1];\r\n line.renderOrder = 2;\r\n });\r\n }, 300);\r\n const light = new THREE.DirectionalLight(0xffffff, 0.1);\r\n const camera = globeEl.current.camera();\r\n light.position.set(0, 0, 1);\r\n camera.add(light);\r\n scene.add(camera);\r\n scene.fog = new THREE.Fog(lightColor, 150, 300);\r\n }\r\n }}\r\n />\r\n {showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='p-2'\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g key={i} className='cursor-pointer'>\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[i],\r\n stroke: colors[i],\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n stroke: colors[colorDomain.length],\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div key={i} className='flex gap-2 items-center'>\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <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'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {mouseOverData && tooltip ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={mousePos.x}\r\n yPos={mousePos.y}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </div>\r\n );\r\n}\r\n\r\nexport default Graph;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport * as THREE from 'three';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport Globe from 'react-globe.gl';\r\n\r\nimport Graph from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n Languages,\r\n ScaleDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\n\r\ntype GlobeProps = React.ComponentProps<typeof Globe>;\r\ninterface Props extends Partial<Omit<GlobeProps, 'backgroundColor'>> {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines if the globe rotates automatically */\r\n autoRotate?: number | boolean;\r\n /** Defines the material property applied to the sphere of the globe */\r\n globeMaterial?: THREE.Material;\r\n /** Defines the colo of the glow around the globe */\r\n atmosphereColor?: string;\r\n /** Defines if the globe can be zoomed when scrolled */\r\n enableZoom?: boolean;\r\n /** Position offset of the globe relative to the canvas center */\r\n globeOffset?: [number, number];\r\n /** Defines the camera distance from Earth. This helps in defining the default size of the globe. Smaller = closer camera therefore the globe is bigger) */\r\n scale?: number;\r\n /** Defines the spacing between the country shape polygon with the sphere */\r\n polygonAltitude?: number;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggles if the color scaling is categorical or not */\r\n categorical?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** The max altitude of the atmosphere, in terms of globe radius units. */\r\n atmosphereAltitude?: number;\r\n /** Resolution in angular degrees of the sphere curvature. The finer the resolution, the more the globe is fragmented into smaller faces to approximate the spheric surface, at the cost of performance. */\r\n globeCurvatureResolution?: number;\r\n /** Defines the color of the light and atmosphere. */\r\n lightColor?: string;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\n/** For using these maps you will have to install [`three`](https://threejs.org/manual/) and [react-globe.gl](https://www.npmjs.com/package/react-globe.gl) package to your project */\r\nexport function ThreeDGlobe(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = '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.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n padding,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n graphID,\r\n mapProperty = 'ISO3',\r\n dataDownload = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n styles,\r\n classNames,\r\n autoRotate = true,\r\n enableZoom = true,\r\n globeMaterial,\r\n centerPoint = [0, 0],\r\n atmosphereColor = '#999',\r\n showColorScale = true,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n highlightedIds = [],\r\n scale = 1,\r\n globeOffset = [0, 0],\r\n polygonAltitude = 0.01,\r\n globeCurvatureResolution = 4,\r\n atmosphereAltitude = 0.15,\r\n lightColor = '#dce9fe',\r\n } = props;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n if (\r\n mapData ===\r\n 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json'\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const features = d.features.map((el: any) => {\r\n if (el.geometry.type === 'Polygon') {\r\n const reversed = [...el.geometry.coordinates[0]].reverse();\r\n const geometry = { ...el.geometry, coordinates: [reversed] };\r\n return { ...el, geometry };\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const coord: any = [];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n el.geometry.coordinates.forEach((c: any) => {\r\n const reversed = [...c[0]].reverse();\r\n coord.push([reversed]);\r\n });\r\n const geometry = { ...el.geometry, coordinates: coord };\r\n return { ...el, geometry };\r\n });\r\n setMapShape(features);\r\n } else setMapShape(d.features);\r\n });\r\n } else {\r\n setMapShape(mapData.features);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a map.${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data}\r\n globeOffset={globeOffset}\r\n polygonData={mapShape}\r\n colorDomain={domain}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n mapProperty={mapProperty}\r\n styles={styles}\r\n classNames={classNames}\r\n autoRotate={autoRotate === true ? 1.5 : autoRotate === false ? 0 : autoRotate}\r\n enableZoom={enableZoom}\r\n globeMaterial={globeMaterial}\r\n atmosphereColor={atmosphereColor}\r\n centerPoint={centerPoint}\r\n colorLegendTitle={colorLegendTitle}\r\n showColorScale={showColorScale}\r\n hoverStrokeColor={\r\n theme === 'light'\r\n ? Colors.light.grays['gray-700']\r\n : Colors.light.grays['gray-300']\r\n }\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n scale={scale}\r\n polygonAltitude={polygonAltitude}\r\n centerLat={centerPoint[0]}\r\n centerLng={centerPoint[1]}\r\n atmosphereAltitude={atmosphereAltitude}\r\n globeCurvatureResolution={globeCurvatureResolution}\r\n lightColor={lightColor}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","width","autoRotate","data","enableZoom","categorical","colorDomain","colors","globeMaterial","height","polygonData","mapProperty","mapBorderColor","atmosphereColor","tooltip","styles","classNames","mapNoDataColor","centerPoint","colorLegendTitle","showColorScale","hoverStrokeColor","detailsOnClick","onSeriesMouseClick","onSeriesMouseOver","resetSelectionOnDoubleClick","highlightedIds","scale","globeOffset","polygonAltitude","centerLng","centerLat","atmosphereAltitude","globeCurvatureResolution","lightColor","globeEl","useRef","mouseClickData","setMouseClickData","useState","showLegend","setShowLegend","mousePos","setMousePos","mouseOverData","setMouseOverData","colorScale","scaleOrdinal","scaleThreshold","useEffect","canvas","handleMouseMove","e","materials","THREE","jsxs","jsx","Globe","polygon","id","val","el","color","clickedData","isEqual","hoverData","scene","d","ambientLight","line","light","camera","Fragment","X","P","i","numberFormattingFunction","Tooltip","Modal","string2HTML","ThreeDGlobe","mapData","graphTitle","sources","graphDescription","footNote","scaleType","padding","Colors","backgroundColor","relativeHeight","graphID","dataDownload","language","minHeight","theme","ariaLabel","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","resizeObserver","entries","fetchAndParseJSON","features","reversed","geometry","coord","c","domain","getUniqValue","getJenks","cn","GraphHeader","Spinner","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoDA,SAASA,GAAMC,GAAc;AAC3B,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,eAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAC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AE;AAAA,wBACA,oBAAAD;AAAA,wBACA,OAAAI;AAAA,wBACA,iBAAAE;AAAA,wBACA,WAAWX,EAAY,CAAC;AAAA,wBACxB,WAAWA,EAAY,CAAC;AAAA,wBACxB,oBAAAc;AAAA,wBACA,0BAAAC;AAAA,wBACA,YAAAC;AAAA,sBAAA;AAAA,oBAAA,IAGFsB,gBAAAA,EAAAA;AAAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,OAAO;AAAA,0BACL,QAAQ,GAAG,KAAK;AAAA,4BACdsC;AAAA,4BACArF,MACGiF,IACGI,KACG7F,KAASkG,KAAYT,IAAiBI,KACpC7F,KAASkG,KAAYT,IACtBI,KACD7F,KAASkG,KAAYT,IACxBW;AAAA,0BAAA,CACP;AAAA,wBAAA;AAAA,wBAEH,WAAU;AAAA,wBAEV,UAAA7C,gBAAAA,EAAAA,IAAC6D,IAAA,EAAQ,cAAW,gBAAA,CAAgB;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACtC;AAAA,gBAAA;AAAA,gBAGHlC,KAAWE,IACV7B,gBAAAA,EAAAA;AAAAA,kBAAC8D;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUvG,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAAmE;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAApF;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CHPV5EwG-DDoeWRVt.cjs"),le=require("./index-CZbIGs8q.cjs"),O=require("react"),se=require("./Typography-k-kOjICQ.cjs"),me=require("./Modal-C_dl0EtQ.cjs"),xe=require("./Tooltip-n8z5bfav.cjs"),ve=require("./numberFormattingFunction-02t-wJta.cjs"),ee=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),N=require("./Colors.cjs"),ye=require("./string2HTML-D2Avudmb.cjs"),we=require("./use-in-view-BCmzDU2O.cjs"),Z=require("./proxy-PQd2AItT.cjs"),je=require("./index-DVOJ7vxH.cjs"),Ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./GraphFooter.cjs"),Ee=require("./GraphHeader.cjs"),Me=require("./ColorLegendWithMouseOver.cjs"),Re=require("./EmptyState-d8_8SxeW.cjs");function Oe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ke(){return this.eachAfter(Oe)}function Be(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Se(e,t){for(var n=this,r=[n],a,s,l=-1;n=r.pop();)if(e.call(t,n,++l,this),a=n.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function Ie(e,t){for(var n=this,r=[n],a=[],s,l,h,m=-1;n=r.pop();)if(a.push(n),s=n.children)for(l=0,h=s.length;l<h;++l)r.push(s[l]);for(;n=a.pop();)e.call(t,n,++m,this);return this}function qe(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Ne(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function De(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Te(e){for(var t=this,n=Ve(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function Ve(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function _e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $e(){return Array.from(this)}function He(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Le(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ae(){var e=this,t,n=[e],r,a,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a<s;++a)n.push(r[a]);while(n.length)}function he(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ge)):t===void 0&&(t=Pe);for(var n=new F(e),r,a=[n],s,l,h,m;r=a.pop();)if((l=t(r.data))&&(m=(l=Array.from(l)).length))for(r.children=l,h=m-1;h>=0;--h)a.push(s=l[h]=new F(l[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(de)}function ze(){return he(this).eachBefore(We)}function Pe(e){return e.children}function Ge(e){return Array.isArray(e)?e[1]:null}function We(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function de(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}F.prototype=he.prototype={constructor:F,count:ke,each:Be,eachAfter:Ie,eachBefore:Se,find:qe,sum:Ne,sort:De,path:Te,ancestors:_e,descendants:$e,leaves:He,links:Le,copy:ze,[Symbol.iterator]:Ae};function te(e){return e==null?null:fe(e)}function fe(e){if(typeof e!="function")throw new Error;return e}function G(){return 0}function W(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Xe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(r-t)/e.value;++h<m;)l=s[h],l.y0=n,l.y1=a,l.x0=t,l.x1=t+=l.value*j}var Ye={depth:-1},ue={},ne={};function Ke(e){return e.id}function Ue(e){return e.parentId}function Ze(){var e=Ke,t=Ue,n;function r(a){var s=Array.from(a),l=e,h=t,m,j,c,v,i,u,f,y,p=new Map;if(n!=null){const d=s.map((w,E)=>Je(n(w,E,a))),C=d.map(ce),k=new Set(d).add("");for(const w of C)k.has(w)||(k.add(w),d.push(w),C.push(ce(w)),s.push(ne));l=(w,E)=>d[E],h=(w,E)=>C[E]}for(c=0,m=s.length;c<m;++c)j=s[c],u=s[c]=new F(j),(f=l(j,c,a))!=null&&(f+="")&&(y=u.id=f,p.set(y,p.has(y)?ue:u)),(f=h(j,c,a))!=null&&(f+="")&&(u.parent=f);for(c=0;c<m;++c)if(u=s[c],f=u.parent){if(i=p.get(f),!i)throw new Error("missing: "+f);if(i===ue)throw new Error("ambiguous: "+f);i.children?i.children.push(u):i.children=[u],u.parent=i}else{if(v)throw new Error("multiple roots");v=u}if(!v)throw new Error("no root");if(n!=null){for(;v.data===ne&&v.children.length===1;)v=v.children[0],--m;for(let d=s.length-1;d>=0&&(u=s[d],u.data===ne);--d)u.data=null}if(v.parent=Ye,v.eachBefore(function(d){d.depth=d.parent.depth+1,--m}).eachBefore(de),v.parent=null,m>0)throw new Error("cycle");return v}return r.id=function(a){return arguments.length?(e=te(a),r):e},r.parentId=function(a){return arguments.length?(t=te(a),r):t},r.path=function(a){return arguments.length?(n=te(a),r):n},r}function Je(e){e=`${e}`;let t=e.length;return ie(e,t-1)&&!ie(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ce(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ie(e,t););return e.slice(0,t)}function ie(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(a-n)/e.value;++h<m;)l=s[h],l.x0=t,l.x1=r,l.y0=n,l.y1=n+=l.value*j}var et=(1+Math.sqrt(5))/2;function tt(e,t,n,r,a,s){for(var l=[],h=t.children,m,j,c=0,v=0,i=h.length,u,f,y=t.value,p,d,C,k,w,E,R;c<i;){u=a-n,f=s-r;do p=h[v++].value;while(!p&&v<i);for(d=C=p,E=Math.max(f/u,u/f)/(y*e),R=p*p*E,w=Math.max(C/R,R/d);v<i;++v){if(p+=j=h[v].value,j<d&&(d=j),j>C&&(C=j),R=p*p*E,k=Math.max(C/R,R/d),k>w){p-=j;break}w=k}l.push(m={value:p,dice:u<f,children:h.slice(c,v)}),m.dice?Xe(m,n,r,a,y?r+=f*p/y:s):Qe(m,n,r,y?n+=u*p/y:a,s),y-=p,c=v}return l}const nt=function e(t){function n(r,a,s,l,h){tt(t,r,a,s,l,h)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(et);function it(){var e=nt,t=!1,n=1,r=1,a=[0],s=G,l=G,h=G,m=G,j=G;function c(i){return i.x0=i.y0=0,i.x1=n,i.y1=r,i.eachBefore(v),a=[0],t&&i.eachBefore(Fe),i}function v(i){var u=a[i.depth],f=i.x0+u,y=i.y0+u,p=i.x1-u,d=i.y1-u;p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),i.x0=f,i.y0=y,i.x1=p,i.y1=d,i.children&&(u=a[i.depth+1]=s(i)/2,f+=j(i)-u,y+=l(i)-u,p-=h(i)-u,d-=m(i)-u,p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),e(i,f,y,p,d))}return c.round=function(i){return arguments.length?(t=!!i,c):t},c.size=function(i){return arguments.length?(n=+i[0],r=+i[1],c):[n,r]},c.tile=function(i){return arguments.length?(e=fe(i),c):e},c.padding=function(i){return arguments.length?c.paddingInner(i).paddingOuter(i):c.paddingInner()},c.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:W(+i),c):s},c.paddingOuter=function(i){return arguments.length?c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):c.paddingTop()},c.paddingTop=function(i){return arguments.length?(l=typeof i=="function"?i:W(+i),c):l},c.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:W(+i),c):h},c.paddingBottom=function(i){return arguments.length?(m=typeof i=="function"?i:W(+i),c):m},c.paddingLeft=function(i){return arguments.length?(j=typeof i=="function"?i:W(+i),c):j},c}function rt(e){const{data:t,colors:n,leftMargin:r,width:a,height:s,colorDomain:l,rightMargin:h,topMargin:m,bottomMargin:j,showLabels:c,tooltip:v,onSeriesMouseOver:i,selectedColor:u,showValues:f,suffix:y,prefix:p,highlightedDataPoints:d,onSeriesMouseClick:C,resetSelectionOnDoubleClick:k,detailsOnClick:w,language:E,styles:R,classNames:$,animate:B,dimmedOpacity:H,precision:J}=e,X=O.useRef(null),V=we.useInView(X,{once:B.once,amount:B.amount}),[L,S]=O.useState(void 0),[D,I]=O.useState(void 0),[_,A]=O.useState(void 0),[Y,z]=O.useState(void 0),M={top:m,bottom:j,left:r,right:h},q=a-M.left-M.right,K=s-M.top-M.bottom,Q=[{id:"root",parent:void 0,value:void 0,data:void 0},...t.map(o=>({id:o.label,value:o.size,parent:"root",data:o}))],U=Ze().id(o=>o.id).parentId(o=>o.parent)(Q);U.sum(o=>o.value);const T=it().size([q,K]).padding(2)(U);return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(Z.motion.svg,{width:`${a}px`,height:`${s}px`,viewBox:`0 0 ${a} ${s}`,direction:"ltr",ref:X,children:g.jsxRuntimeExports.jsx("g",{transform:`translate(${M.left},${M.top})`,children:g.jsxRuntimeExports.jsx(je.AnimatePresence,{children:T.children?.map(o=>g.jsxRuntimeExports.jsxs(Z.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:o.x0,y:o.y0},whileInView:{opacity:u?o.data.data.color&&n[l.indexOf(o.data.data.color)]===u?1:H:d.length!==0?d.indexOf(o.data.id)!==-1?.85:H:.85,x:o.x0,y:o.y0,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},onMouseEnter:b=>{S(o.data.data),z(b.clientY),A(b.clientX),i?.(o.data.data)},onClick:()=>{(C||w)&&(D===o.data.id&&k?(I(void 0),C?.(void 0)):(I(o.data.id),C?.(o.data.data)))},onMouseMove:b=>{S(o.data.data),z(b.clientY),A(b.clientX)},onMouseLeave:()=>{S(void 0),A(void 0),z(void 0),i?.(void 0)},children:[g.jsxRuntimeExports.jsx(Z.motion.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:B.duration}},variants:{initial:{width:0,height:0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray},whileInView:{width:o.x1-o.x0,height:o.y1-o.y0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial"}),o.x1-o.x0>50&&o.y1-o.y0>25&&(c||f)?g.jsxRuntimeExports.jsx(Z.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:g.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:o.x1-o.x0,height:o.y1-o.y0,children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray)},children:[c?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full treemap-label",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{WebkitLineClamp:o.y1-o.y0>50?o.y1-o.y0>100?o.y1-o.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:o.data.id}):null,f?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full font-bold treemap-value",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:ve.numberFormattingFunction(o.data.value,"NA",J,p,y)}):null]})})}):null]},o.data.id))})})}),L&&v&&_&&Y?g.jsxRuntimeExports.jsx(xe.Tooltip,{data:L,body:v,xPos:_,yPos:Y,backgroundStyle:R?.tooltip,className:$?.tooltip}):null,w&&D!==void 0?g.jsxRuntimeExports.jsx(me.X,{open:D!==void 0,onClose:()=>{I(void 0)},children:g.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:ye.string2HTML(w,D)}:void 0,children:typeof w=="function"?w(D):null})}):null]})}function ot(e){const{data:t,graphTitle:n,colors:r,suffix:a="",sources:s,prefix:l="",graphDescription:h,leftMargin:m=0,rightMargin:j=0,topMargin:c=0,bottomMargin:v=0,height:i,width:u,footNote:f,colorDomain:y,colorLegendTitle:p,padding:d,backgroundColor:C=!1,showLabels:k=!0,relativeHeight:w,tooltip:E,onSeriesMouseOver:R,showColorScale:$=!0,showValues:B=!0,graphID:H,highlightedDataPoints:J=[],onSeriesMouseClick:X,graphDownload:V=!1,dataDownload:L=!1,language:S="en",showNAColor:D=!0,minHeight:I=0,theme:_="light",ariaLabel:A,resetSelectionOnDoubleClick:Y=!0,detailsOnClick:z,styles:M,classNames:q,animate:K=!1,dimmedOpacity:Q=.3,precision:U=2}=e,[T,o]=O.useState(0),[b,re]=O.useState(0),[pe,ge]=O.useState(void 0),P=O.useRef(null),oe=O.useRef(null);return O.useEffect(()=>{const x=new ResizeObserver(ae=>{o(u||ae[0].target.clientWidth||620),re(i||ae[0].target.clientHeight||480)});return P.current&&(re(P.current.clientHeight||480),o(P.current.clientWidth||620),u||x.observe(P.current)),()=>x.disconnect()},[u,i]),g.jsxRuntimeExports.jsx("div",{className:`${_||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:S==="he"||S==="ar"?"rtl":void 0,children:g.jsxRuntimeExports.jsx("div",{className:g.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${S||"en"}`,q?.graphContainer),style:{...M?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:H,ref:oe,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${h?` ${h}`:""}`,children:g.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?d||"1rem":d||0},children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||h||V||L?g.jsxRuntimeExports.jsx(Ee.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:q?.title,description:q?.description},graphTitle:n,graphDescription:h,width:u,graphDownload:V?oe.current:void 0,dataDownload:L?t.map(x=>x.data).filter(x=>x!==void 0).length>0?t.map(x=>x.data).filter(x=>x!==void 0):t.filter(x=>x!==void 0):null}):null,g.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.length===0?g.jsxRuntimeExports.jsx(Re.EmptyState,{}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[$&&t.filter(x=>x.color).length!==0?g.jsxRuntimeExports.jsx(Me.ColorLegendWithMouseOver,{width:u,colorLegendTitle:p,colors:r||N.Colors[_].categoricalColors.colors,colorDomain:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),setSelectedColor:ge,showNAColor:D}):null,g.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:P,"aria-label":"Graph area",children:(u||T)&&(i||b)?g.jsxRuntimeExports.jsx(rt,{data:t.filter(x=>!Ce.checkIfNullOrUndefined(x.size)),colors:t.filter(x=>x.color).length===0?r?[r]:[N.Colors.primaryColors["blue-600"]]:r||N.Colors[_].categoricalColors.colors,colorDomain:t.filter(x=>x.color).length===0?[]:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),width:u||T,height:Math.max(I,i||(w?I?(u||T)*w>I?(u||T)*w:I:(u||T)*w:b)),leftMargin:m,rightMargin:j,topMargin:c,bottomMargin:v,showLabels:k,showValues:B,suffix:a,prefix:l,selectedColor:pe,tooltip:E,onSeriesMouseOver:R,onSeriesMouseClick:X,highlightedDataPoints:J,resetSelectionOnDoubleClick:Y,detailsOnClick:z,styles:M,classNames:q,language:S,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},dimmedOpacity:Q,precision:U}):null})]})}),s||f?g.jsxRuntimeExports.jsx(be.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:q?.footnote,source:q?.source},sources:s,footNote:f,width:u}):null]})})})})}exports.TreeMapGraph=ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CHPV5EwG-DDoeWRVt.cjs"),le=require("./index-CZbIGs8q.cjs"),O=require("react"),se=require("./Typography-k-kOjICQ.cjs"),me=require("./Modal-tXZlLE5s.cjs"),xe=require("./Tooltip-n8z5bfav.cjs"),ve=require("./numberFormattingFunction-02t-wJta.cjs"),ee=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),N=require("./Colors.cjs"),ye=require("./string2HTML-D2Avudmb.cjs"),we=require("./use-in-view-sQJZ_xDO.cjs"),Z=require("./proxy-BHRoeZgd.cjs"),je=require("./index-BW8iNx7E.cjs"),Ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./GraphFooter.cjs"),Ee=require("./GraphHeader.cjs"),Me=require("./ColorLegendWithMouseOver.cjs"),Re=require("./EmptyState-d8_8SxeW.cjs");function Oe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function ke(){return this.eachAfter(Oe)}function Be(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Se(e,t){for(var n=this,r=[n],a,s,l=-1;n=r.pop();)if(e.call(t,n,++l,this),a=n.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function Ie(e,t){for(var n=this,r=[n],a=[],s,l,h,m=-1;n=r.pop();)if(a.push(n),s=n.children)for(l=0,h=s.length;l<h;++l)r.push(s[l]);for(;n=a.pop();)e.call(t,n,++m,this);return this}function qe(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Ne(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function De(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Te(e){for(var t=this,n=Ve(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function Ve(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function _e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $e(){return Array.from(this)}function He(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Le(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ae(){var e=this,t,n=[e],r,a,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a<s;++a)n.push(r[a]);while(n.length)}function he(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ge)):t===void 0&&(t=Pe);for(var n=new F(e),r,a=[n],s,l,h,m;r=a.pop();)if((l=t(r.data))&&(m=(l=Array.from(l)).length))for(r.children=l,h=m-1;h>=0;--h)a.push(s=l[h]=new F(l[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(de)}function ze(){return he(this).eachBefore(We)}function Pe(e){return e.children}function Ge(e){return Array.isArray(e)?e[1]:null}function We(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function de(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}F.prototype=he.prototype={constructor:F,count:ke,each:Be,eachAfter:Ie,eachBefore:Se,find:qe,sum:Ne,sort:De,path:Te,ancestors:_e,descendants:$e,leaves:He,links:Le,copy:ze,[Symbol.iterator]:Ae};function te(e){return e==null?null:fe(e)}function fe(e){if(typeof e!="function")throw new Error;return e}function G(){return 0}function W(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Xe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(r-t)/e.value;++h<m;)l=s[h],l.y0=n,l.y1=a,l.x0=t,l.x1=t+=l.value*j}var Ye={depth:-1},ue={},ne={};function Ke(e){return e.id}function Ue(e){return e.parentId}function Ze(){var e=Ke,t=Ue,n;function r(a){var s=Array.from(a),l=e,h=t,m,j,c,v,i,u,f,y,p=new Map;if(n!=null){const d=s.map((w,E)=>Je(n(w,E,a))),C=d.map(ce),k=new Set(d).add("");for(const w of C)k.has(w)||(k.add(w),d.push(w),C.push(ce(w)),s.push(ne));l=(w,E)=>d[E],h=(w,E)=>C[E]}for(c=0,m=s.length;c<m;++c)j=s[c],u=s[c]=new F(j),(f=l(j,c,a))!=null&&(f+="")&&(y=u.id=f,p.set(y,p.has(y)?ue:u)),(f=h(j,c,a))!=null&&(f+="")&&(u.parent=f);for(c=0;c<m;++c)if(u=s[c],f=u.parent){if(i=p.get(f),!i)throw new Error("missing: "+f);if(i===ue)throw new Error("ambiguous: "+f);i.children?i.children.push(u):i.children=[u],u.parent=i}else{if(v)throw new Error("multiple roots");v=u}if(!v)throw new Error("no root");if(n!=null){for(;v.data===ne&&v.children.length===1;)v=v.children[0],--m;for(let d=s.length-1;d>=0&&(u=s[d],u.data===ne);--d)u.data=null}if(v.parent=Ye,v.eachBefore(function(d){d.depth=d.parent.depth+1,--m}).eachBefore(de),v.parent=null,m>0)throw new Error("cycle");return v}return r.id=function(a){return arguments.length?(e=te(a),r):e},r.parentId=function(a){return arguments.length?(t=te(a),r):t},r.path=function(a){return arguments.length?(n=te(a),r):n},r}function Je(e){e=`${e}`;let t=e.length;return ie(e,t-1)&&!ie(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ce(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ie(e,t););return e.slice(0,t)}function ie(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,j=e.value&&(a-n)/e.value;++h<m;)l=s[h],l.x0=t,l.x1=r,l.y0=n,l.y1=n+=l.value*j}var et=(1+Math.sqrt(5))/2;function tt(e,t,n,r,a,s){for(var l=[],h=t.children,m,j,c=0,v=0,i=h.length,u,f,y=t.value,p,d,C,k,w,E,R;c<i;){u=a-n,f=s-r;do p=h[v++].value;while(!p&&v<i);for(d=C=p,E=Math.max(f/u,u/f)/(y*e),R=p*p*E,w=Math.max(C/R,R/d);v<i;++v){if(p+=j=h[v].value,j<d&&(d=j),j>C&&(C=j),R=p*p*E,k=Math.max(C/R,R/d),k>w){p-=j;break}w=k}l.push(m={value:p,dice:u<f,children:h.slice(c,v)}),m.dice?Xe(m,n,r,a,y?r+=f*p/y:s):Qe(m,n,r,y?n+=u*p/y:a,s),y-=p,c=v}return l}const nt=function e(t){function n(r,a,s,l,h){tt(t,r,a,s,l,h)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(et);function it(){var e=nt,t=!1,n=1,r=1,a=[0],s=G,l=G,h=G,m=G,j=G;function c(i){return i.x0=i.y0=0,i.x1=n,i.y1=r,i.eachBefore(v),a=[0],t&&i.eachBefore(Fe),i}function v(i){var u=a[i.depth],f=i.x0+u,y=i.y0+u,p=i.x1-u,d=i.y1-u;p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),i.x0=f,i.y0=y,i.x1=p,i.y1=d,i.children&&(u=a[i.depth+1]=s(i)/2,f+=j(i)-u,y+=l(i)-u,p-=h(i)-u,d-=m(i)-u,p<f&&(f=p=(f+p)/2),d<y&&(y=d=(y+d)/2),e(i,f,y,p,d))}return c.round=function(i){return arguments.length?(t=!!i,c):t},c.size=function(i){return arguments.length?(n=+i[0],r=+i[1],c):[n,r]},c.tile=function(i){return arguments.length?(e=fe(i),c):e},c.padding=function(i){return arguments.length?c.paddingInner(i).paddingOuter(i):c.paddingInner()},c.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:W(+i),c):s},c.paddingOuter=function(i){return arguments.length?c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):c.paddingTop()},c.paddingTop=function(i){return arguments.length?(l=typeof i=="function"?i:W(+i),c):l},c.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:W(+i),c):h},c.paddingBottom=function(i){return arguments.length?(m=typeof i=="function"?i:W(+i),c):m},c.paddingLeft=function(i){return arguments.length?(j=typeof i=="function"?i:W(+i),c):j},c}function rt(e){const{data:t,colors:n,leftMargin:r,width:a,height:s,colorDomain:l,rightMargin:h,topMargin:m,bottomMargin:j,showLabels:c,tooltip:v,onSeriesMouseOver:i,selectedColor:u,showValues:f,suffix:y,prefix:p,highlightedDataPoints:d,onSeriesMouseClick:C,resetSelectionOnDoubleClick:k,detailsOnClick:w,language:E,styles:R,classNames:$,animate:B,dimmedOpacity:H,precision:J}=e,X=O.useRef(null),V=we.useInView(X,{once:B.once,amount:B.amount}),[L,S]=O.useState(void 0),[D,I]=O.useState(void 0),[_,A]=O.useState(void 0),[Y,z]=O.useState(void 0),M={top:m,bottom:j,left:r,right:h},q=a-M.left-M.right,K=s-M.top-M.bottom,Q=[{id:"root",parent:void 0,value:void 0,data:void 0},...t.map(o=>({id:o.label,value:o.size,parent:"root",data:o}))],U=Ze().id(o=>o.id).parentId(o=>o.parent)(Q);U.sum(o=>o.value);const T=it().size([q,K]).padding(2)(U);return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(Z.motion.svg,{width:`${a}px`,height:`${s}px`,viewBox:`0 0 ${a} ${s}`,direction:"ltr",ref:X,children:g.jsxRuntimeExports.jsx("g",{transform:`translate(${M.left},${M.top})`,children:g.jsxRuntimeExports.jsx(je.AnimatePresence,{children:T.children?.map(o=>g.jsxRuntimeExports.jsxs(Z.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:o.x0,y:o.y0},whileInView:{opacity:u?o.data.data.color&&n[l.indexOf(o.data.data.color)]===u?1:H:d.length!==0?d.indexOf(o.data.id)!==-1?.85:H:.85,x:o.x0,y:o.y0,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},onMouseEnter:b=>{S(o.data.data),z(b.clientY),A(b.clientX),i?.(o.data.data)},onClick:()=>{(C||w)&&(D===o.data.id&&k?(I(void 0),C?.(void 0)):(I(o.data.id),C?.(o.data.data)))},onMouseMove:b=>{S(o.data.data),z(b.clientY),A(b.clientX)},onMouseLeave:()=>{S(void 0),A(void 0),z(void 0),i?.(void 0)},children:[g.jsxRuntimeExports.jsx(Z.motion.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:B.duration}},variants:{initial:{width:0,height:0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray},whileInView:{width:o.x1-o.x0,height:o.y1-o.y0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial"}),o.x1-o.x0>50&&o.y1-o.y0>25&&(c||f)?g.jsxRuntimeExports.jsx(Z.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:B.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:B.duration}},children:g.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:o.x1-o.x0,height:o.y1-o.y0,children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray)},children:[c?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full treemap-label",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{WebkitLineClamp:o.y1-o.y0>50?o.y1-o.y0>100?o.y1-o.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:o.data.id}):null,f?g.jsxRuntimeExports.jsx(se.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full font-bold treemap-value",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:ve.numberFormattingFunction(o.data.value,"NA",J,p,y)}):null]})})}):null]},o.data.id))})})}),L&&v&&_&&Y?g.jsxRuntimeExports.jsx(xe.Tooltip,{data:L,body:v,xPos:_,yPos:Y,backgroundStyle:R?.tooltip,className:$?.tooltip}):null,w&&D!==void 0?g.jsxRuntimeExports.jsx(me.X,{open:D!==void 0,onClose:()=>{I(void 0)},children:g.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:ye.string2HTML(w,D)}:void 0,children:typeof w=="function"?w(D):null})}):null]})}function ot(e){const{data:t,graphTitle:n,colors:r,suffix:a="",sources:s,prefix:l="",graphDescription:h,leftMargin:m=0,rightMargin:j=0,topMargin:c=0,bottomMargin:v=0,height:i,width:u,footNote:f,colorDomain:y,colorLegendTitle:p,padding:d,backgroundColor:C=!1,showLabels:k=!0,relativeHeight:w,tooltip:E,onSeriesMouseOver:R,showColorScale:$=!0,showValues:B=!0,graphID:H,highlightedDataPoints:J=[],onSeriesMouseClick:X,graphDownload:V=!1,dataDownload:L=!1,language:S="en",showNAColor:D=!0,minHeight:I=0,theme:_="light",ariaLabel:A,resetSelectionOnDoubleClick:Y=!0,detailsOnClick:z,styles:M,classNames:q,animate:K=!1,dimmedOpacity:Q=.3,precision:U=2}=e,[T,o]=O.useState(0),[b,re]=O.useState(0),[pe,ge]=O.useState(void 0),P=O.useRef(null),oe=O.useRef(null);return O.useEffect(()=>{const x=new ResizeObserver(ae=>{o(u||ae[0].target.clientWidth||620),re(i||ae[0].target.clientHeight||480)});return P.current&&(re(P.current.clientHeight||480),o(P.current.clientWidth||620),u||x.observe(P.current)),()=>x.disconnect()},[u,i]),g.jsxRuntimeExports.jsx("div",{className:`${_||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:S==="he"||S==="ar"?"rtl":void 0,children:g.jsxRuntimeExports.jsx("div",{className:g.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${S||"en"}`,q?.graphContainer),style:{...M?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:H,ref:oe,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${h?` ${h}`:""}`,children:g.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?d||"1rem":d||0},children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||h||V||L?g.jsxRuntimeExports.jsx(Ee.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:q?.title,description:q?.description},graphTitle:n,graphDescription:h,width:u,graphDownload:V?oe.current:void 0,dataDownload:L?t.map(x=>x.data).filter(x=>x!==void 0).length>0?t.map(x=>x.data).filter(x=>x!==void 0):t.filter(x=>x!==void 0):null}):null,g.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.length===0?g.jsxRuntimeExports.jsx(Re.EmptyState,{}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[$&&t.filter(x=>x.color).length!==0?g.jsxRuntimeExports.jsx(Me.ColorLegendWithMouseOver,{width:u,colorLegendTitle:p,colors:r||N.Colors[_].categoricalColors.colors,colorDomain:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),setSelectedColor:ge,showNAColor:D}):null,g.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:P,"aria-label":"Graph area",children:(u||T)&&(i||b)?g.jsxRuntimeExports.jsx(rt,{data:t.filter(x=>!Ce.checkIfNullOrUndefined(x.size)),colors:t.filter(x=>x.color).length===0?r?[r]:[N.Colors.primaryColors["blue-600"]]:r||N.Colors[_].categoricalColors.colors,colorDomain:t.filter(x=>x.color).length===0?[]:y||le.uniqBy(t.filter(x=>x.color),"color").map(x=>x.color),width:u||T,height:Math.max(I,i||(w?I?(u||T)*w>I?(u||T)*w:I:(u||T)*w:b)),leftMargin:m,rightMargin:j,topMargin:c,bottomMargin:v,showLabels:k,showValues:B,suffix:a,prefix:l,selectedColor:pe,tooltip:E,onSeriesMouseOver:R,onSeriesMouseClick:X,highlightedDataPoints:J,resetSelectionOnDoubleClick:Y,detailsOnClick:z,styles:M,classNames:q,language:S,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},dimmedOpacity:Q,precision:U}):null})]})}),s||f?g.jsxRuntimeExports.jsx(be.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:q?.footnote,source:q?.source},sources:s,footNote:f,width:u}):null]})})})})}exports.TreeMapGraph=ot;
2
2
  //# sourceMappingURL=TreeMapGraph.cjs.map
@@ -2,15 +2,15 @@ import { j as v, m as ie } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { u as ce } from "./index-CaAIPGZo.js";
3
3
  import { useRef as re, useState as A, useEffect as ye } from "react";
4
4
  import { u as ue } from "./Typography-Ctgfl1J5.js";
5
- import { X as we } from "./Modal-CUU6ZK3U.js";
5
+ import { X as we } from "./Modal-DVVwpKhP.js";
6
6
  import { T as xe } from "./Tooltip-DyM5snqx.js";
7
7
  import { n as be } from "./numberFormattingFunction-14YCbkN2.js";
8
8
  import { g as ee } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
9
9
  import { Colors as V } from "./Colors.js";
10
10
  import { s as je } from "./string2HTML-CWHGfz_d.js";
11
- import { u as Me } from "./use-in-view-BAHrBy6b.js";
12
- import { m as Z } from "./proxy-DJxJg1kD.js";
13
- import { A as Oe } from "./index-BxAUvrua.js";
11
+ import { u as Me } from "./use-in-view-yS6jzJAp.js";
12
+ import { m as Z } from "./proxy-CkpFesk1.js";
13
+ import { A as Oe } from "./index-CNvov0eg.js";
14
14
  import { c as Ce } from "./checkIfNullOrUndefined-DmfiKkNw.js";
15
15
  import { GraphFooter as ke } from "./GraphFooter.js";
16
16
  import { GraphHeader as De } from "./GraphHeader.js";
package/dist/Types.d.ts CHANGED
@@ -619,7 +619,7 @@ export declare interface GraphSettingsDataType {
619
619
  labelsToBeHidden?: (string | number)[];
620
620
  autoRotate?: boolean;
621
621
  enableZoom?: boolean;
622
- globeMaterial?: MaterialDataType;
622
+ globeMaterial?: any;
623
623
  categorical?: boolean;
624
624
  atmosphereColor?: string;
625
625
  lineAxisTitle?: string;
@@ -627,6 +627,9 @@ export declare interface GraphSettingsDataType {
627
627
  naLabel?: string;
628
628
  globeOffset?: [number, number];
629
629
  polygonAltitude?: number;
630
+ atmosphereAltitude?: number;
631
+ globeCurvatureResolution?: number;
632
+ lightColor?: string;
630
633
  }
631
634
 
632
635
  export declare type GraphType = GraphTypeForGriddedGraph;
@@ -711,12 +714,6 @@ export declare interface MarginDataType {
711
714
  right: number;
712
715
  }
713
716
 
714
- export declare interface MaterialDataType {
715
- color: string;
716
- opacity: number;
717
- transparent: boolean;
718
- }
719
-
720
717
  export declare interface MultiLineAltChartDataType {
721
718
  label: number | string;
722
719
  y: number | null;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),F=require("react"),O=require("./index-C21TvELx.cjs"),M=require("./Typography-k-kOjICQ.cjs"),U=require("./GraphFooter.cjs"),J=require("./GraphHeader.cjs"),K=require("./Colors.cjs"),Q=require("./numberFormattingFunction-02t-wJta.cjs"),X=require("./use-in-view-BCmzDU2O.cjs"),Y=require("./index-DVOJ7vxH.cjs"),Z=require("./proxy-PQd2AItT.cjs");function _(z){const{data:n,size:g=200,graphTitle:x,sources:R,colors:E=K.Colors.light.categoricalColors.colors,graphDescription:d,totalNoOfDots:f=100,unitPadding:G=3,gridSize:c=10,footNote:b,padding:N,backgroundColor:l=!1,graphID:H,graphDownload:k=!1,language:j="en",showColorScale:I=!0,showStrokeForWhiteDots:m=!0,note:C,dataDownload:S=!1,theme:P="light",width:r,height:h,minHeight:s=0,relativeHeight:a,ariaLabel:T,styles:u,classNames:w,animate:$=!1,precision:L=2}=z,q=F.useRef(null),y=$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},W=X.useInView(q,{once:y.once,amount:y.amount}),B=O.sum(n.map(e=>e.value)),D=F.useRef(null),o=g/c,p=(o-G*2)/2;if(p<=0)return console.error("The size of single unit is less than or equal to zero. Check values for ((dimension / gridSize) - (padding * 2)) / 2 is not less than or equal to 0."),null;const v=[];return n.forEach((e,i)=>{const A=Math.round(e.value/B*f);for(let V=0;V<A;V+=1)v.push({color:E[i]})}),t.jsxRuntimeExports.jsx("div",{className:`${P||"light"} flex ${r?"w-fit grow-0":"w-full grow"}`,dir:j==="he"||j==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${j||"en"}`,w?.graphContainer),style:{...u?.graphContainer||{},minHeight:"inherit",...l&&l!==!0?{backgroundColor:l}:{}},id:H,ref:D,"aria-label":T||`${x?`The graph shows ${x}. `:""}${d?` ${d}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?N||"1rem":N||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 w-full grow",children:[x||d||k?t.jsxRuntimeExports.jsx(J.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:w?.title,description:w?.description},graphTitle:x,graphDescription:d,width:r,graphDownload:k?D.current:void 0,dataDownload:S?n.map(e=>e.data).filter(e=>e!==void 0).length>0?n.map(e=>e.data).filter(e=>e!==void 0):n.filter(e=>e!==void 0):null}):null,C?t.jsxRuntimeExports.jsx(M.f,{marginBottom:"2xs",className:"text-primary-gray-700 dark:text-primary-gray-100 font-bold",style:{width:r?`${r}px`:"100%"},children:C}):null,t.jsxRuntimeExports.jsxs("div",{className:"flex grow flex-col gap-4 justify-between",children:[t.jsxRuntimeExports.jsxs("div",{children:[I?t.jsxRuntimeExports.jsx("div",{className:"mb-4 leading-0",style:{width:r?`${r}px`:"100%"},"aria-label":"Color legend",children:t.jsxRuntimeExports.jsx("div",{className:"flex mb-0 flex-wrap gap-x-4 gap-y-1",children:n.map((e,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:E[i]}}),t.jsxRuntimeExports.jsxs(M.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[e.label,":"," ",t.jsxRuntimeExports.jsx("span",{className:"font-bold",children:Q.numberFormattingFunction(e.value,"NA",L)})]})]},i))})}):null,t.jsxRuntimeExports.jsx("div",{"aria-label":"Graph area",children:t.jsxRuntimeExports.jsx("svg",{width:`${r||g}px`,height:`${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}px`,ref:q,direction:"ltr",viewBox:`0 0 ${r||g} ${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}`,children:t.jsxRuntimeExports.jsx(Y.AnimatePresence,{children:t.jsxRuntimeExports.jsx("g",{children:v.map((e,i)=>t.jsxRuntimeExports.jsx(Z.motion.circle,{cx:i%c*o+o/2,cy:Math.floor(i/c)*o+o/2,style:{...m?{}:{stroke:e.color},strokeWidth:1},variants:{initial:{fill:"#fff",opacity:0,...m?{}:{stroke:e.color},strokeWidth:1},whileInView:{fill:e.color,opacity:1,...m?{}:{stroke:e.color},strokeWidth:1,transition:{duration:0,delay:y.duration/v.length*i}}},initial:"initial",animate:W?"whileInView":"initial",className:(e.color.toLowerCase()==="#fff"||e.color.toLowerCase()==="#ffffff"||e.color.toLowerCase()==="white")&&m?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"",r:p},i))})})})})]}),R||b?t.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},sources:R,footNote:b,width:r}):null]})]})})})})}exports.UnitChart=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),F=require("react"),O=require("./index-C21TvELx.cjs"),M=require("./Typography-k-kOjICQ.cjs"),U=require("./GraphFooter.cjs"),J=require("./GraphHeader.cjs"),K=require("./Colors.cjs"),Q=require("./numberFormattingFunction-02t-wJta.cjs"),X=require("./use-in-view-sQJZ_xDO.cjs"),Y=require("./index-BW8iNx7E.cjs"),Z=require("./proxy-BHRoeZgd.cjs");function _(z){const{data:n,size:g=200,graphTitle:x,sources:R,colors:E=K.Colors.light.categoricalColors.colors,graphDescription:d,totalNoOfDots:f=100,unitPadding:G=3,gridSize:c=10,footNote:b,padding:N,backgroundColor:l=!1,graphID:H,graphDownload:k=!1,language:j="en",showColorScale:I=!0,showStrokeForWhiteDots:m=!0,note:C,dataDownload:S=!1,theme:P="light",width:r,height:h,minHeight:s=0,relativeHeight:a,ariaLabel:T,styles:u,classNames:w,animate:$=!1,precision:L=2}=z,q=F.useRef(null),y=$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},W=X.useInView(q,{once:y.once,amount:y.amount}),B=O.sum(n.map(e=>e.value)),D=F.useRef(null),o=g/c,p=(o-G*2)/2;if(p<=0)return console.error("The size of single unit is less than or equal to zero. Check values for ((dimension / gridSize) - (padding * 2)) / 2 is not less than or equal to 0."),null;const v=[];return n.forEach((e,i)=>{const A=Math.round(e.value/B*f);for(let V=0;V<A;V+=1)v.push({color:E[i]})}),t.jsxRuntimeExports.jsx("div",{className:`${P||"light"} flex ${r?"w-fit grow-0":"w-full grow"}`,dir:j==="he"||j==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${j||"en"}`,w?.graphContainer),style:{...u?.graphContainer||{},minHeight:"inherit",...l&&l!==!0?{backgroundColor:l}:{}},id:H,ref:D,"aria-label":T||`${x?`The graph shows ${x}. `:""}${d?` ${d}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?N||"1rem":N||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 w-full grow",children:[x||d||k?t.jsxRuntimeExports.jsx(J.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:w?.title,description:w?.description},graphTitle:x,graphDescription:d,width:r,graphDownload:k?D.current:void 0,dataDownload:S?n.map(e=>e.data).filter(e=>e!==void 0).length>0?n.map(e=>e.data).filter(e=>e!==void 0):n.filter(e=>e!==void 0):null}):null,C?t.jsxRuntimeExports.jsx(M.f,{marginBottom:"2xs",className:"text-primary-gray-700 dark:text-primary-gray-100 font-bold",style:{width:r?`${r}px`:"100%"},children:C}):null,t.jsxRuntimeExports.jsxs("div",{className:"flex grow flex-col gap-4 justify-between",children:[t.jsxRuntimeExports.jsxs("div",{children:[I?t.jsxRuntimeExports.jsx("div",{className:"mb-4 leading-0",style:{width:r?`${r}px`:"100%"},"aria-label":"Color legend",children:t.jsxRuntimeExports.jsx("div",{className:"flex mb-0 flex-wrap gap-x-4 gap-y-1",children:n.map((e,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:E[i]}}),t.jsxRuntimeExports.jsxs(M.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[e.label,":"," ",t.jsxRuntimeExports.jsx("span",{className:"font-bold",children:Q.numberFormattingFunction(e.value,"NA",L)})]})]},i))})}):null,t.jsxRuntimeExports.jsx("div",{"aria-label":"Graph area",children:t.jsxRuntimeExports.jsx("svg",{width:`${r||g}px`,height:`${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}px`,ref:q,direction:"ltr",viewBox:`0 0 ${r||g} ${Math.max(s,h?a&&r?s?r*a>s?r*a:s:r*a:h:Math.floor((f-1)/c)*o+o/2+p+5)}`,children:t.jsxRuntimeExports.jsx(Y.AnimatePresence,{children:t.jsxRuntimeExports.jsx("g",{children:v.map((e,i)=>t.jsxRuntimeExports.jsx(Z.motion.circle,{cx:i%c*o+o/2,cy:Math.floor(i/c)*o+o/2,style:{...m?{}:{stroke:e.color},strokeWidth:1},variants:{initial:{fill:"#fff",opacity:0,...m?{}:{stroke:e.color},strokeWidth:1},whileInView:{fill:e.color,opacity:1,...m?{}:{stroke:e.color},strokeWidth:1,transition:{duration:0,delay:y.duration/v.length*i}}},initial:"initial",animate:W?"whileInView":"initial",className:(e.color.toLowerCase()==="#fff"||e.color.toLowerCase()==="#ffffff"||e.color.toLowerCase()==="white")&&m?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"",r:p},i))})})})})]}),R||b?t.jsxRuntimeExports.jsx(U.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},sources:R,footNote:b,width:r}):null]})]})})})})}exports.UnitChart=_;
2
2
  //# sourceMappingURL=UnitChart.cjs.map
package/dist/UnitChart.js CHANGED
@@ -6,9 +6,9 @@ import { GraphFooter as K } from "./GraphFooter.js";
6
6
  import { GraphHeader as Q } from "./GraphHeader.js";
7
7
  import { Colors as X } from "./Colors.js";
8
8
  import { n as Y } from "./numberFormattingFunction-14YCbkN2.js";
9
- import { u as Z } from "./use-in-view-BAHrBy6b.js";
10
- import { A as _ } from "./index-BxAUvrua.js";
11
- import { m as ee } from "./proxy-DJxJg1kD.js";
9
+ import { u as Z } from "./use-in-view-yS6jzJAp.js";
10
+ import { A as _ } from "./index-CNvov0eg.js";
11
+ import { m as ee } from "./proxy-CkpFesk1.js";
12
12
  function he(H) {
13
13
  const {
14
14
  data: s,
@@ -1,5 +1,5 @@
1
1
  import { j as i, m as d } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { m as p } from "./proxy-DJxJg1kD.js";
2
+ import { m as p } from "./proxy-CkpFesk1.js";
3
3
  function u(a) {
4
4
  const {
5
5
  value: n,
@@ -54,4 +54,4 @@ function u(a) {
54
54
  export {
55
55
  u as X
56
56
  };
57
- //# sourceMappingURL=XAxesLabels-DQFo_z2R.js.map
57
+ //# sourceMappingURL=XAxesLabels-CaV2q-6H.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"XAxesLabels-DQFo_z2R.js","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAL;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAC;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUM,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,wCACTH,MAAc,QAAQ,kBAAkB,aAC1C;AAAA,UAEA,UAAAG,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWE;AAAAA,gBACT;AAAA,gBACAR;AAAA,cAAA;AAAA,cAEF,OAAAD;AAAA,cAEC,UAAAH;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"XAxesLabels-CaV2q-6H.js","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAL;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAC;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUM,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,wCACTH,MAAc,QAAQ,kBAAkB,aAC1C;AAAA,UAEA,UAAAG,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWE;AAAAA,gBACT;AAAA,gBACAR;AAAA,cAAA;AAAA,cAEF,OAAAD;AAAA,cAEC,UAAAH;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-PQd2AItT.cjs");function d(n){const{value:a,y:s,x:t,style:r,className:l,width:o,height:x,alignment:c="top",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,y:s,variants:{initial:{x:t},whileInView:{x:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:`flex flex-col items-center h-inherit ${c==="top"?"justify-start":"justify-end"}`,children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",l),style:r,children:a})})})}exports.XAxesLabels=d;
2
- //# sourceMappingURL=XAxesLabels-CJMQbfVy.cjs.map
1
+ "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-BHRoeZgd.cjs");function d(n){const{value:a,y:s,x:t,style:r,className:l,width:o,height:x,alignment:c="top",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,y:s,variants:{initial:{x:t},whileInView:{x:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:`flex flex-col items-center h-inherit ${c==="top"?"justify-start":"justify-end"}`,children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",l),style:r,children:a})})})}exports.XAxesLabels=d;
2
+ //# sourceMappingURL=XAxesLabels-OjBNl_lS.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"XAxesLabels-CJMQbfVy.cjs","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,MACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAL,EACA,SAAU,CACR,QAAS,CACP,EAAAC,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUM,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAW,wCACTH,IAAc,MAAQ,gBAAkB,aAC1C,GAEA,SAAAG,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,oGACAR,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CAAA,CACF,CAAA,CAGN"}
1
+ {"version":3,"file":"XAxesLabels-OjBNl_lS.cjs","sources":["../src/Components/Elements/Axes/XAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'top' | 'bottom';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function XAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'top',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n y={y}\r\n variants={{\r\n initial: {\r\n x,\r\n },\r\n whileInView: {\r\n x,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div\r\n className={`flex flex-col items-center h-inherit ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n >\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none',\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,MACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAL,EACA,SAAU,CACR,QAAS,CACP,EAAAC,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUM,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAW,wCACTH,IAAc,MAAQ,gBAAkB,aAC1C,GAEA,SAAAG,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,oGACAR,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CAAA,CACF,CAAA,CAGN"}
@@ -1,5 +1,5 @@
1
1
  import { j as i, m as d } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { m as h } from "./proxy-DJxJg1kD.js";
2
+ import { m as h } from "./proxy-CkpFesk1.js";
3
3
  function u(n) {
4
4
  const {
5
5
  value: e,
@@ -49,4 +49,4 @@ function u(n) {
49
49
  export {
50
50
  u as Y
51
51
  };
52
- //# sourceMappingURL=YAxesLabels-H5-002X5.js.map
52
+ //# sourceMappingURL=YAxesLabels-CPGZjmZJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"YAxesLabels-H5-002X5.js","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAJ;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAD;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUO,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,0CACb,UAAAA,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWE;AAAAA,YACT;AAAA,YACA,QAAQL,CAAS;AAAA,YACjBH;AAAA,UAAA;AAAA,UAEF,OAAAD;AAAA,UAEC,UAAAH;AAAA,QAAA;AAAA,MAAA,EACH,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"YAxesLabels-CPGZjmZJ.js","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":";;AAkBO,SAASA,EAAYC,GAAc;AACxC,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,SAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,IACEV;AACJ,SACEW,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MACC,OAAAN;AAAA,MACA,QAAAC;AAAA,MACA,GAAAJ;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,UACP,GAAAD;AAAA,QAAA;AAAA,QAEF,aAAa;AAAA,UACX,GAAAA;AAAA,UACA,YAAY,EAAE,UAAUO,EAAQ,SAAA;AAAA,QAAS;AAAA,MAC3C;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MACpC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUD,EAAQ,WAAS;AAAA,MAE7D,UAAAE,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,0CACb,UAAAA,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWE;AAAAA,YACT;AAAA,YACA,QAAQL,CAAS;AAAA,YACjBH;AAAA,UAAA;AAAA,UAEF,OAAAD;AAAA,UAEC,UAAAH;AAAA,QAAA;AAAA,MAAA,EACH,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-PQd2AItT.cjs");function d(n){const{value:a,y:t,x:r,style:s,className:l,width:o,height:x,alignment:c="right",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,x:r,variants:{initial:{y:t},whileInView:{y:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center h-inherit",children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none",`text-${c}`,l),style:s,children:a})})})}exports.YAxesLabels=d;
2
- //# sourceMappingURL=YAxesLabels-BXLTX7AI.cjs.map
1
+ "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("./proxy-BHRoeZgd.cjs");function d(n){const{value:a,y:t,x:r,style:s,className:l,width:o,height:x,alignment:c="right",animate:e,isInView:m}=n;return i.jsxRuntimeExports.jsx(u.motion.foreignObject,{width:o,height:x,x:r,variants:{initial:{y:t},whileInView:{y:t,transition:{duration:e.duration}}},initial:"initial",animate:m?"whileInView":"initial",exit:{opacity:0,transition:{duration:e.duration}},children:i.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center h-inherit",children:i.jsxRuntimeExports.jsx("p",{className:i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none",`text-${c}`,l),style:s,children:a})})})}exports.YAxesLabels=d;
2
+ //# sourceMappingURL=YAxesLabels-D8IydyZj.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"YAxesLabels-BXLTX7AI.cjs","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,QACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAJ,EACA,SAAU,CACR,QAAS,CACP,EAAAD,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUO,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,yCACb,SAAAA,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,wFACA,QAAQL,CAAS,GACjBH,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CACF,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"YAxesLabels-D8IydyZj.cjs","sources":["../src/Components/Elements/Axes/YAxesLabels.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface Props {\r\n value: number | string;\r\n y: number;\r\n x: number;\r\n width: number;\r\n height: number;\r\n style?: React.CSSProperties;\r\n className?: string;\r\n alignment?: 'left' | 'right' | 'center';\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function YAxesLabels(props: Props) {\r\n const {\r\n value,\r\n y,\r\n x,\r\n style,\r\n className,\r\n width,\r\n height,\r\n alignment = 'right',\r\n animate,\r\n isInView,\r\n } = props;\r\n return (\r\n <motion.foreignObject\r\n width={width}\r\n height={height}\r\n x={x}\r\n variants={{\r\n initial: {\r\n y,\r\n },\r\n whileInView: {\r\n y,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n >\r\n <div className='flex flex-col justify-center h-inherit'>\r\n <p\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={style}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </motion.foreignObject>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","value","y","x","style","className","width","height","alignment","animate","isInView","jsx","motion","cn"],"mappings":"gGAkBO,SAASA,EAAYC,EAAc,CACxC,KAAM,CACJ,MAAAC,EACA,EAAAC,EACA,EAAAC,EACA,MAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EAAY,QACZ,QAAAC,EACA,SAAAC,CAAA,EACEV,EACJ,OACEW,EAAAA,kBAAAA,IAACC,EAAAA,OAAO,cAAP,CACC,MAAAN,EACA,OAAAC,EACA,EAAAJ,EACA,SAAU,CACR,QAAS,CACP,EAAAD,CAAA,EAEF,YAAa,CACX,EAAAA,EACA,WAAY,CAAE,SAAUO,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UACpC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUD,EAAQ,SAAS,EAE7D,SAAAE,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,yCACb,SAAAA,EAAAA,kBAAAA,IAAC,IAAA,CACC,UAAWE,EAAAA,GACT,wFACA,QAAQL,CAAS,GACjBH,CAAA,EAEF,MAAAD,EAEC,SAAAH,CAAA,CAAA,CACH,CACF,CAAA,CAAA,CAGN"}