@undp/data-viz 2.0.0 → 2.0.2

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 (140) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +959 -959
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BasicStatCard.cjs +1 -1
  6. package/dist/BasicStatCard.cjs.map +1 -1
  7. package/dist/BasicStatCard.js +45 -47
  8. package/dist/BasicStatCard.js.map +1 -1
  9. package/dist/BeeSwarmChart.cjs +1 -1
  10. package/dist/BeeSwarmChart.cjs.map +1 -1
  11. package/dist/BeeSwarmChart.js +76 -56
  12. package/dist/BeeSwarmChart.js.map +1 -1
  13. package/dist/BiVariateChoroplethMap.cjs +1 -1
  14. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  15. package/dist/BiVariateChoroplethMap.js +157 -157
  16. package/dist/BiVariateChoroplethMap.js.map +1 -1
  17. package/dist/BulletChart.cjs +1 -1
  18. package/dist/BulletChart.js +2 -2
  19. package/dist/ButterflyChart.cjs +1 -1
  20. package/dist/ButterflyChart.js +1 -1
  21. package/dist/ChoroplethMap.cjs +1 -1
  22. package/dist/ChoroplethMap.cjs.map +1 -1
  23. package/dist/ChoroplethMap.js +185 -185
  24. package/dist/ChoroplethMap.js.map +1 -1
  25. package/dist/CirclePackingGraph.cjs +1 -1
  26. package/dist/CirclePackingGraph.js +2 -4
  27. package/dist/CirclePackingGraph.js.map +1 -1
  28. package/dist/Data/barChart.json +70 -0
  29. package/dist/Data/basic.csv +20 -0
  30. package/dist/DifferenceLineChart.cjs +1 -1
  31. package/dist/DifferenceLineChart.cjs.map +1 -1
  32. package/dist/DifferenceLineChart.js +224 -223
  33. package/dist/DifferenceLineChart.js.map +1 -1
  34. package/dist/DonutChart.cjs +1 -1
  35. package/dist/DonutChart.cjs.map +1 -1
  36. package/dist/DonutChart.js +32 -24
  37. package/dist/DonutChart.js.map +1 -1
  38. package/dist/DotDensityMap.cjs +1 -1
  39. package/dist/DotDensityMap.cjs.map +1 -1
  40. package/dist/DotDensityMap.js +156 -156
  41. package/dist/DotDensityMap.js.map +1 -1
  42. package/dist/DualAxisLineChart.cjs +1 -1
  43. package/dist/DualAxisLineChart.cjs.map +1 -1
  44. package/dist/DualAxisLineChart.js +326 -325
  45. package/dist/DualAxisLineChart.js.map +1 -1
  46. package/dist/DumbbellChart.cjs +1 -1
  47. package/dist/DumbbellChart.js +2 -2
  48. package/dist/GeoHubCompareMaps.cjs +1 -1
  49. package/dist/GeoHubCompareMaps.cjs.map +1 -1
  50. package/dist/GeoHubCompareMaps.js +183 -183
  51. package/dist/GeoHubCompareMaps.js.map +1 -1
  52. package/dist/{GraphEl-DzRon4cb.js → GraphEl-BZne2JIx.js} +3 -3
  53. package/dist/{GraphEl-DzRon4cb.js.map → GraphEl-BZne2JIx.js.map} +1 -1
  54. package/dist/{GraphEl-BkyLYXG5.cjs → GraphEl-D5MUfp45.cjs} +2 -2
  55. package/dist/{GraphEl-BkyLYXG5.cjs.map → GraphEl-D5MUfp45.cjs.map} +1 -1
  56. package/dist/GriddedGraphs.cjs +1 -1
  57. package/dist/GriddedGraphs.js +1 -1
  58. package/dist/HeatMap.cjs +1 -1
  59. package/dist/HeatMap.js +2 -2
  60. package/dist/Histogram.cjs +1 -1
  61. package/dist/Histogram.js +1 -1
  62. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  63. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  64. package/dist/LineChartWithConfidenceInterval.js +133 -132
  65. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  66. package/dist/MultiGraphDashboard.cjs +1 -1
  67. package/dist/MultiGraphDashboard.cjs.map +1 -1
  68. package/dist/MultiGraphDashboard.js +52 -50
  69. package/dist/MultiGraphDashboard.js.map +1 -1
  70. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  71. package/dist/MultiGraphDashboardWideToLongFormat.cjs.map +1 -1
  72. package/dist/MultiGraphDashboardWideToLongFormat.js +11 -9
  73. package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -1
  74. package/dist/MultiLineAltChart.cjs +1 -1
  75. package/dist/MultiLineAltChart.cjs.map +1 -1
  76. package/dist/MultiLineAltChart.js +149 -148
  77. package/dist/MultiLineAltChart.js.map +1 -1
  78. package/dist/MultiLineChart.cjs +1 -1
  79. package/dist/MultiLineChart.cjs.map +1 -1
  80. package/dist/MultiLineChart.js +182 -181
  81. package/dist/MultiLineChart.js.map +1 -1
  82. package/dist/ParetoChart.cjs +1 -1
  83. package/dist/ParetoChart.js +1 -1
  84. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  85. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -1
  86. package/dist/PerformanceIntensiveMultiGraphDashboard.js +14 -12
  87. package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -1
  88. package/dist/SimpleLineChart.cjs +1 -1
  89. package/dist/SimpleLineChart.cjs.map +1 -1
  90. package/dist/SimpleLineChart.js +123 -122
  91. package/dist/SimpleLineChart.js.map +1 -1
  92. package/dist/SingleGraphDashboard.cjs +1 -1
  93. package/dist/SingleGraphDashboard.cjs.map +1 -1
  94. package/dist/SingleGraphDashboard.js +83 -79
  95. package/dist/SingleGraphDashboard.js.map +1 -1
  96. package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
  97. package/dist/SingleGraphDashboardGeoHubMaps.cjs.map +1 -1
  98. package/dist/SingleGraphDashboardGeoHubMaps.js +49 -45
  99. package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -1
  100. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  101. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  102. package/dist/SingleGraphDashboardThreeDGraphs.js +56 -52
  103. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  104. package/dist/StatCardFromData.cjs +1 -1
  105. package/dist/StatCardFromData.cjs.map +1 -1
  106. package/dist/StatCardFromData.js +44 -46
  107. package/dist/StatCardFromData.js.map +1 -1
  108. package/dist/ThreeDGlobe.cjs +1 -1
  109. package/dist/ThreeDGlobe.cjs.map +1 -1
  110. package/dist/ThreeDGlobe.js +134 -134
  111. package/dist/ThreeDGlobe.js.map +1 -1
  112. package/dist/{XAxesLabels-D5X8jngD.cjs → XAxesLabels-C1XSXoWG.cjs} +2 -2
  113. package/dist/XAxesLabels-C1XSXoWG.cjs.map +1 -0
  114. package/dist/{XAxesLabels-DNO0KmjL.js → XAxesLabels-Dmbk50u4.js} +18 -16
  115. package/dist/XAxesLabels-Dmbk50u4.js.map +1 -0
  116. package/dist/YAxesLabels-1XTb-D0_.js +72 -0
  117. package/dist/YAxesLabels-1XTb-D0_.js.map +1 -0
  118. package/dist/YAxesLabels-pjdsVwIM.cjs +2 -0
  119. package/dist/YAxesLabels-pjdsVwIM.cjs.map +1 -0
  120. package/dist/getNoOfTicks-C_1CFXv_.cjs +2 -0
  121. package/dist/getNoOfTicks-C_1CFXv_.cjs.map +1 -0
  122. package/dist/getNoOfTicks-CpmRjcRF.js +7 -0
  123. package/dist/getNoOfTicks-CpmRjcRF.js.map +1 -0
  124. package/dist/index-C6LorfZ-.cjs +2 -0
  125. package/dist/index-C6LorfZ-.cjs.map +1 -0
  126. package/dist/index-Ceppbd8C.js +342 -0
  127. package/dist/index-Ceppbd8C.js.map +1 -0
  128. package/dist/index.cjs +1 -1
  129. package/dist/index.js +1 -1
  130. package/package.json +1 -1
  131. package/dist/XAxesLabels-D5X8jngD.cjs.map +0 -1
  132. package/dist/XAxesLabels-DNO0KmjL.js.map +0 -1
  133. package/dist/YAxesLabels-DcS85Beo.cjs +0 -2
  134. package/dist/YAxesLabels-DcS85Beo.cjs.map +0 -1
  135. package/dist/YAxesLabels-Dnnng49-.js +0 -70
  136. package/dist/YAxesLabels-Dnnng49-.js.map +0 -1
  137. package/dist/index-DoY3Ga3W.cjs +0 -2
  138. package/dist/index-DoY3Ga3W.cjs.map +0 -1
  139. package/dist/index-leTnKT2q.js +0 -329
  140. package/dist/index-leTnKT2q.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 { useCallback, 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\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n FogDataType,\r\n LightConfig,\r\n StyleObject,\r\n} 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\nimport { getCentroidCoordinates } from '@/Utils/getCentroidCoordinates';\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 lights: LightConfig[];\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 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 fogSettings?: FogDataType;\r\n highlightedAltitude: number;\r\n selectedId?: string;\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nfunction createLightFromConfig(config: LightConfig): THREE.Light {\r\n let light: THREE.Light;\r\n\r\n switch (config.type) {\r\n case 'ambient':\r\n light = new THREE.AmbientLight(config.color, config.intensity);\r\n break;\r\n case 'directional':\r\n light = new THREE.DirectionalLight(config.color, config.intensity);\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z === undefined ? -1 : config.target.z,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.DirectionalLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.DirectionalLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.DirectionalLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.DirectionalLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.DirectionalLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n case 'point':\r\n light = new THREE.PointLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n break;\r\n case 'spot':\r\n light = new THREE.SpotLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.angle || Math.PI / 3,\r\n config.penumbra || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z || 0,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.SpotLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.SpotLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.SpotLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.SpotLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.SpotLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n default:\r\n throw new Error('Unknown light type');\r\n }\r\n\r\n return light;\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 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 fogSettings,\r\n lights,\r\n highlightedAltitude,\r\n selectedId,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [globeReady, setGlobeReady] = useState(false);\r\n const globeEl = useRef<GlobeMethods | undefined>(undefined);\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\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().enableZoom = enableZoom;\r\n }\r\n }, [enableZoom]);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n if (mouseOverData || selectedId) {\r\n globeEl.current.controls().autoRotate = false;\r\n } else {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n globeEl.current.controls().autoRotateSpeed = autoRotate;\r\n }\r\n }\r\n }, [mouseOverData, selectedId, autoRotate]);\r\n useEffect(() => {\r\n if (globeEl.current && selectedId) {\r\n const selectedPolygon = polygonData.find(\r\n (d: any) => d.properties[mapProperty] === selectedId,\r\n );\r\n const [lng, lat] = getCentroidCoordinates(selectedPolygon);\r\n globeEl.current.pointOfView({ lat, lng, altitude: scale }, 1000);\r\n }\r\n }, [selectedId, scale, polygonData, mapProperty]);\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.MeshBasicMaterial({\r\n color: '#FFF',\r\n });\r\n const setupCustomLighting = useCallback(() => {\r\n if (!globeEl.current) return;\r\n\r\n const scene = globeEl.current.scene();\r\n const camera = globeEl.current.camera();\r\n\r\n let lightsAndObjToRemove: THREE.Object3D[] = [];\r\n scene.traverse(obj => {\r\n if (obj instanceof THREE.Light) {\r\n lightsAndObjToRemove.push(obj);\r\n }\r\n });\r\n lightsAndObjToRemove = [...lightsAndObjToRemove, ...camera.children];\r\n lightsAndObjToRemove.forEach(light => light.parent?.remove(light));\r\n\r\n const lightConfig = lights.map(config => createLightFromConfig(config));\r\n lightConfig.forEach((light, i) => {\r\n if (lights[i].type !== 'ambient' && lights[i].position === 'camera') {\r\n camera.add(light);\r\n if (lights[i].type !== 'point') {\r\n camera.add((light as THREE.DirectionalLight | THREE.SpotLight).target);\r\n }\r\n } else {\r\n scene.add(light);\r\n }\r\n });\r\n\r\n if (fogSettings) {\r\n scene.fog = new THREE.Fog(fogSettings.color, fogSettings.near, fogSettings.far);\r\n }\r\n }, [lights, fogSettings]);\r\n\r\n const handleGlobeReady = () => {\r\n setGlobeReady(true);\r\n setupCustomLighting();\r\n };\r\n useEffect(() => {\r\n if (globeReady) {\r\n setupCustomLighting();\r\n }\r\n }, [globeReady, setupCustomLighting]);\r\n return (\r\n <div className='relative'>\r\n <Globe\r\n ref={globeEl}\r\n height={height}\r\n width={width}\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 polygon?.properties?.[mapProperty] === selectedId\r\n ? highlightedAltitude * (polygon?.properties?.[mapProperty] === selectedId ? 2 : 1)\r\n : polygon?.properties?.[mapProperty] === mouseOverData?.id ||\r\n polygon?.properties?.[mapProperty] === mouseClickData?.id\r\n ? highlightedAltitude\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 polygon?.properties?.[mapProperty] === selectedId\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 onGlobeClick={() => {\r\n setMouseClickData(undefined);\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 }}\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: centerLat,\r\n lng: centerLng,\r\n });\r\n const scene = globeEl.current.scene();\r\n setTimeout(() => {\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 camera = globeEl.current.camera();\r\n scene.add(camera);\r\n handleGlobeReady();\r\n }\r\n }}\r\n />\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\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='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\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, useEffectEvent, useRef, useState } from 'react';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport * as THREE from 'three';\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 FogDataType,\r\n Languages,\r\n LightConfig,\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\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\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.Material;\r\n /** Defines the lights for the 3D scene */\r\n lights?: LightConfig[];\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 /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: 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 fog settings for the scene. */\r\n fogSettings?: FogDataType;\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 selectedId?: string;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the altitude of the highlighted countries or the countries on mouseover. */\r\n highlightedAltitude?: number;\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 highlightedAltitude = 0.1,\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 fogSettings,\r\n lights = [\r\n {\r\n type: 'ambient',\r\n color: 0x404040,\r\n intensity: 0.4,\r\n },\r\n {\r\n type: 'directional',\r\n color: 0xffffff,\r\n intensity: 1,\r\n position: { x: 5, y: 10, z: 5 },\r\n },\r\n ],\r\n selectedId,\r\n collapseColorScaleByDefault,\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 const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\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 onUpdateShape(features);\r\n } else onUpdateShape(d.features);\r\n });\r\n } else {\r\n onUpdateShape(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 <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\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 <GraphArea ref={graphDiv}>\r\n {svgWidth && 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 colorLegendTitle={colorLegendTitle}\r\n showColorScale={showColorScale}\r\n hoverStrokeColor={\r\n theme === 'light' ? Colors.light.grays['gray-700'] : 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 fogSettings={fogSettings}\r\n lights={lights}\r\n highlightedAltitude={highlightedAltitude}\r\n selectedId={selectedId}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\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 </GraphArea>\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 </GraphContainer>\r\n );\r\n}\r\n"],"names":["createLightFromConfig","config","light","type","THREE","AmbientLight","color","intensity","DirectionalLight","position","set","x","y","z","target","undefined","castShadow","shadow","mapSize","width","height","camera","near","far","PointLight","distance","decay","SpotLight","angle","Math","PI","penumbra","Error","Graph","props","autoRotate","data","enableZoom","categorical","colorDomain","colors","globeMaterial","polygonData","mapProperty","mapBorderColor","atmosphereColor","tooltip","styles","classNames","mapNoDataColor","colorLegendTitle","showColorScale","hoverStrokeColor","detailsOnClick","onSeriesMouseClick","onSeriesMouseOver","resetSelectionOnDoubleClick","highlightedIds","scale","globeOffset","polygonAltitude","centerLng","centerLat","atmosphereAltitude","globeCurvatureResolution","fogSettings","lights","highlightedAltitude","selectedId","collapseColorScaleByDefault","globeReady","setGlobeReady","useState","globeEl","useRef","mouseClickData","setMouseClickData","showLegend","setShowLegend","mousePos","setMousePos","mouseOverData","setMouseOverData","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","current","controls","autoRotateSpeed","selectedPolygon","find","d","properties","lng","lat","getCentroidCoordinates","pointOfView","altitude","canvas","renderer","domElement","handleMouseMove","e","clientX","clientY","addEventListener","removeEventListener","materials","MeshBasicMaterial","setupCustomLighting","useCallback","scene","lightsAndObjToRemove","traverse","obj","Light","push","children","forEach","parent","remove","map","i","add","fog","Fog","handleGlobeReady","jsxs","jsx","Globe","polygon","includes","id","val","el","clickedData","isEqual","hoverData","setTimeout","polygons","line","renderOrder","cn","colorLegend","Fragment","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","length","fill","stroke","textAnchor","numberFormattingFunction","Tooltip","Modal","__html","string2HTML","ThreeDGlobe","$","_c","mapData","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","padding","t3","t4","t5","relativeHeight","graphID","t6","dataDownload","t7","language","t8","minHeight","t9","theme","t10","ariaLabel","t11","t12","centerPoint","t13","t14","t15","t16","t17","t18","t19","t20","t21","t22","t23","t24","Colors","graphNoData","grays","t25","t26","t27","t28","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","t29","t30","Symbol","for","resizeObserver","ResizeObserver","entries","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","features","_temp","t33","t34","getUniqValue","getJenks","_temp2","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp3","filter","_temp4","_temp5","_temp6","_temp7","t38","GraphArea","max","sequentialColors","Spinner","t39","footnote","source","GraphFooter","t40","GraphContainer","d_3","d_2","d_1","d_5","d_4","d_0","geometry","reversed","coordinates","reverse","coord","c","reversed_0","geometry_0"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+DA,SAASA,GAAsBC,GAAkC;AAC/D,MAAIC;AAEJ,UAAQD,EAAOE,MAAAA;AAAAA,IACb,KAAK;AACHD,MAAAA,IAAQ,IAAIE,EAAMC,aAAaJ,EAAOK,OAAOL,EAAOM,SAAS;AAC7D;A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AqIiB;AArQd,SAAAV,GAAAY,GAAA;AAAA,SAiK4BhL,MAAM/E;AAAS;AAjK3C,SAAAkP,GAAAc,GAAA;AAAA,SAgK6CjL,MAAM/E;AAAS;AAhK5D,SAAAiP,GAAAgB,GAAA;AAAA,SAgKyBlL,EAAC1D;AAAK;AAhK/B,SAAA2N,GAAAkB,GAAA;AAAA,SA+J2CnL,MAAM/E;AAAS;AA/J1D,SAAA8O,GAAAqB,GAAA;AAAA,SA+JuBpL,EAAC1D;AAAK;AA/J7B,SAAAiN,GAAA8B,GAAA;AAAA,SA4HiBrL,EAACnF;AAA+B;AA5HjD,SAAAqO,GAAAvG,GAAA;AAgGK,MAAIA,EAAE2I,SAASjR,SAAU,WAAS;AAChC,UAAAkR,IAAiB,CAAA,GAAI5I,EAAE2I,SAASE,YAAY,CAAA,CAAG,EAACC,QAAAA,GAChDH,IAAiB;AAAA,MAAA,GAAK3I,EAAE2I;AAAAA,MAASE,aAAe,CAACD,CAAQ;AAAA,IAAA;AAAI,WACtD;AAAA,MAAA,GAAK5I;AAAAA,MAAE2I,UAAAA;AAAAA,IAAAA;AAAAA,EAAY;AAG5B,QAAAI,IAAmB,CAAA;AAEnB/I,EAAAA,EAAE2I,SAASE,YAAY7J,QAASgK,CAAAA,MAAA;AAC9B,UAAAC,IAAiB,CAAA,GAAID,IAAI,EAACF,QAAAA;AAC1BC,IAAAA,EAAKjK,KAAM,CAAC8J,CAAQ,CAAC;AAAA,EAAC,CACvB;AACD,QAAAM,IAAiB;AAAA,IAAA,GAAKlJ,EAAE2I;AAAAA,IAASE,aAAeE;AAAAA,EAAAA;AAAQ,SACjD;AAAA,IAAA,GAAK/I;AAAAA,IAAE2I,UAAEA;AAAAA,EAAAA;AAAU;"}
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 { useCallback, 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\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n FogDataType,\r\n LightConfig,\r\n StyleObject,\r\n} 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\nimport { getCentroidCoordinates } from '@/Utils/getCentroidCoordinates';\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 lights: LightConfig[];\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 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 fogSettings?: FogDataType;\r\n highlightedAltitude: number;\r\n selectedId?: string;\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nfunction createLightFromConfig(config: LightConfig): THREE.Light {\r\n let light: THREE.Light;\r\n\r\n switch (config.type) {\r\n case 'ambient':\r\n light = new THREE.AmbientLight(config.color, config.intensity);\r\n break;\r\n case 'directional':\r\n light = new THREE.DirectionalLight(config.color, config.intensity);\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z === undefined ? -1 : config.target.z,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.DirectionalLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.DirectionalLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.DirectionalLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.DirectionalLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.DirectionalLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n case 'point':\r\n light = new THREE.PointLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n break;\r\n case 'spot':\r\n light = new THREE.SpotLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.angle || Math.PI / 3,\r\n config.penumbra || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z || 0,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.SpotLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.SpotLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.SpotLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.SpotLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.SpotLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n default:\r\n throw new Error('Unknown light type');\r\n }\r\n\r\n return light;\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 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 fogSettings,\r\n lights,\r\n highlightedAltitude,\r\n selectedId,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [globeReady, setGlobeReady] = useState(false);\r\n const globeEl = useRef<GlobeMethods | undefined>(undefined);\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\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().enableZoom = enableZoom;\r\n }\r\n }, [enableZoom]);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n if (mouseOverData || selectedId) {\r\n globeEl.current.controls().autoRotate = false;\r\n } else {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n globeEl.current.controls().autoRotateSpeed = autoRotate;\r\n }\r\n }\r\n }, [mouseOverData, selectedId, autoRotate]);\r\n useEffect(() => {\r\n if (globeEl.current && selectedId) {\r\n const selectedPolygon = polygonData.find(\r\n (d: any) => d.properties[mapProperty] === selectedId,\r\n );\r\n const [lng, lat] = getCentroidCoordinates(selectedPolygon);\r\n globeEl.current.pointOfView({ lat, lng, altitude: scale }, 1000);\r\n }\r\n }, [selectedId, scale, polygonData, mapProperty]);\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.MeshBasicMaterial({\r\n color: '#FFF',\r\n });\r\n const setupCustomLighting = useCallback(() => {\r\n if (!globeEl.current) return;\r\n\r\n const scene = globeEl.current.scene();\r\n const camera = globeEl.current.camera();\r\n\r\n let lightsAndObjToRemove: THREE.Object3D[] = [];\r\n scene.traverse(obj => {\r\n if (obj instanceof THREE.Light) {\r\n lightsAndObjToRemove.push(obj);\r\n }\r\n });\r\n lightsAndObjToRemove = [...lightsAndObjToRemove, ...camera.children];\r\n lightsAndObjToRemove.forEach(light => light.parent?.remove(light));\r\n\r\n const lightConfig = lights.map(config => createLightFromConfig(config));\r\n lightConfig.forEach((light, i) => {\r\n if (lights[i].type !== 'ambient' && lights[i].position === 'camera') {\r\n camera.add(light);\r\n if (lights[i].type !== 'point') {\r\n camera.add((light as THREE.DirectionalLight | THREE.SpotLight).target);\r\n }\r\n } else {\r\n scene.add(light);\r\n }\r\n });\r\n\r\n if (fogSettings) {\r\n scene.fog = new THREE.Fog(fogSettings.color, fogSettings.near, fogSettings.far);\r\n }\r\n }, [lights, fogSettings]);\r\n\r\n const handleGlobeReady = () => {\r\n setGlobeReady(true);\r\n setupCustomLighting();\r\n };\r\n useEffect(() => {\r\n if (globeReady) {\r\n setupCustomLighting();\r\n }\r\n }, [globeReady, setupCustomLighting]);\r\n return (\r\n <div className='relative'>\r\n <Globe\r\n ref={globeEl}\r\n height={height}\r\n width={width}\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 polygon?.properties?.[mapProperty] === selectedId\r\n ? highlightedAltitude * (polygon?.properties?.[mapProperty] === selectedId ? 2 : 1)\r\n : polygon?.properties?.[mapProperty] === mouseOverData?.id ||\r\n polygon?.properties?.[mapProperty] === mouseClickData?.id\r\n ? highlightedAltitude\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 polygon?.properties?.[mapProperty] === selectedId\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 onGlobeClick={() => {\r\n setMouseClickData(undefined);\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 }}\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: centerLat,\r\n lng: centerLng,\r\n });\r\n const scene = globeEl.current.scene();\r\n setTimeout(() => {\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 camera = globeEl.current.camera();\r\n scene.add(camera);\r\n handleGlobeReady();\r\n }\r\n }}\r\n />\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\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='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\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, useEffectEvent, useRef, useState } from 'react';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport * as THREE from 'three';\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 FogDataType,\r\n Languages,\r\n LightConfig,\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\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\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.Material;\r\n /** Defines the lights for the 3D scene */\r\n lights?: LightConfig[];\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 /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: 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 fog settings for the scene. */\r\n fogSettings?: FogDataType;\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 selectedId?: string;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the altitude of the highlighted countries or the countries on mouseover. */\r\n highlightedAltitude?: number;\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 highlightedAltitude = 0.1,\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 fogSettings,\r\n lights = [\r\n {\r\n type: 'ambient',\r\n color: 0x404040,\r\n intensity: 0.4,\r\n },\r\n {\r\n type: 'directional',\r\n color: 0xffffff,\r\n intensity: 1,\r\n position: { x: 5, y: 10, z: 5 },\r\n },\r\n ],\r\n selectedId,\r\n collapseColorScaleByDefault,\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 const graphParentDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\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 onUpdateShape(features);\r\n } else onUpdateShape(d.features);\r\n });\r\n } else {\r\n onUpdateShape(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 <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\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 <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data}\r\n globeOffset={globeOffset}\r\n polygonData={mapShape}\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\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 colorLegendTitle={colorLegendTitle}\r\n showColorScale={showColorScale}\r\n hoverStrokeColor={\r\n theme === 'light' ? Colors.light.grays['gray-700'] : 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 fogSettings={fogSettings}\r\n lights={lights}\r\n highlightedAltitude={highlightedAltitude}\r\n selectedId={selectedId}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\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 </GraphArea>\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 </GraphContainer>\r\n );\r\n}\r\n"],"names":["createLightFromConfig","config","light","type","THREE","AmbientLight","color","intensity","DirectionalLight","position","set","x","y","z","target","undefined","castShadow","shadow","mapSize","width","height","camera","near","far","PointLight","distance","decay","SpotLight","angle","Math","PI","penumbra","Error","Graph","props","autoRotate","data","enableZoom","categorical","colorDomain","colors","globeMaterial","polygonData","mapProperty","mapBorderColor","atmosphereColor","tooltip","styles","classNames","mapNoDataColor","colorLegendTitle","showColorScale","hoverStrokeColor","detailsOnClick","onSeriesMouseClick","onSeriesMouseOver","resetSelectionOnDoubleClick","highlightedIds","scale","globeOffset","polygonAltitude","centerLng","centerLat","atmosphereAltitude","globeCurvatureResolution","fogSettings","lights","highlightedAltitude","selectedId","collapseColorScaleByDefault","globeReady","setGlobeReady","useState","globeEl","useRef","mouseClickData","setMouseClickData","showLegend","setShowLegend","mousePos","setMousePos","mouseOverData","setMouseOverData","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","current","controls","autoRotateSpeed","selectedPolygon","find","d","properties","lng","lat","getCentroidCoordinates","pointOfView","altitude","canvas","renderer","domElement","handleMouseMove","e","clientX","clientY","addEventListener","removeEventListener","materials","MeshBasicMaterial","setupCustomLighting","useCallback","scene","lightsAndObjToRemove","traverse","obj","Light","push","children","forEach","parent","remove","map","i","add","fog","Fog","handleGlobeReady","jsxs","jsx","Globe","polygon","includes","id","val","el","clickedData","isEqual","hoverData","setTimeout","polygons","line","renderOrder","cn","colorLegend","Fragment","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","length","fill","stroke","textAnchor","numberFormattingFunction","Tooltip","Modal","__html","string2HTML","ThreeDGlobe","$","_c","mapData","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","padding","t3","t4","t5","relativeHeight","graphID","t6","dataDownload","t7","language","t8","minHeight","t9","theme","t10","ariaLabel","t11","t12","centerPoint","t13","t14","t15","t16","t17","t18","t19","t20","t21","t22","t23","t24","Colors","graphNoData","grays","t25","t26","t27","t28","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","t29","t30","Symbol","for","resizeObserver","ResizeObserver","entries","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","features","_temp","t33","t34","getUniqValue","getJenks","_temp2","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp3","filter","_temp4","_temp5","_temp6","_temp7","t38","GraphArea","sequentialColors","max","Spinner","t39","footnote","source","GraphFooter","t40","GraphContainer","d_3","d_2","d_1","d_5","d_4","d_0","geometry","reversed","coordinates","reverse","coord","c","reversed_0","geometry_0"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA+DA,SAASA,GAAsBC,GAAkC;AAC/D,MAAIC;AAEJ,UAAQD,EAAOE,MAAAA;AAAAA,IACb,KAAK;AACHD,MAAAA,IAAQ,IAAIE,EAAMC,aAAaJ,EAAOK,OAAOL,EAAOM,SAAS;AAC7D;AAAA,IACF,KAAK;AACHL,MAAAA,IAAQ,IAAIE,EAAMI,iBAAiBP,EAAOK,OAAOL,EAAOM,SAAS,GAC7DN,EAAOQ,aACLR,EAAOQ,aAAa,WAAUP,EAAMO,SAASC,IAAI,GAAG,GAAG,CAAC,IACvDR,EAAMO,SAASC,IAAIT,EAAOQ,SAASE,GAAGV,EAAOQ,SAASG,GAAGX,EAAOQ,SAASI,CAAC,KAE7EZ,EAAOa,UAAUb,EAAOQ,aAAa,aACtCP,EAA0BY,OAAOL,SAASC,IACzCT,EAAOa,QAAQH,KAAK,GACpBV,EAAOa,QAAQF,KAAK,GACpBX,EAAOa,QAAQD,MAAME,SAAY,KAAKd,EAAOa,OAAOD,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AAE2I;AAAAA,MAASE,aAAe,CAACD,CAAQ;AAAA,IAAA;AAAI,WACtD;AAAA,MAAA,GAAK5I;AAAAA,MAAE2I,UAAAA;AAAAA,IAAAA;AAAAA,EAAY;AAG5B,QAAAI,IAAmB,CAAA;AAEnB/I,EAAAA,EAAE2I,SAASE,YAAY7J,QAASgK,CAAAA,MAAA;AAC9B,UAAAC,IAAiB,CAAA,GAAID,IAAI,EAACF,QAAAA;AAC1BC,IAAAA,EAAKjK,KAAM,CAAC8J,CAAQ,CAAC;AAAA,EAAC,CACvB;AACD,QAAAM,IAAiB;AAAA,IAAA,GAAKlJ,EAAE2I;AAAAA,IAASE,aAAeE;AAAAA,EAAAA;AAAQ,SACjD;AAAA,IAAA,GAAK/I;AAAAA,IAAE2I,UAAEA;AAAAA,EAAAA;AAAU;"}
@@ -1,2 +1,2 @@
1
- "use strict";const p=require("./index-CHPV5EwG-CTPQjnHt.cjs"),q=require("./proxy-BxvUI_9l.cjs");function C(A){const t=p.compilerRuntimeExports.c(38),{value:g,y:e,x:i,style:h,className:j,width:w,height:E,alignment:V,animate:n,isInView:N}=A,b=V===void 0?"top":V;let l;t[0]!==i||t[1]!==e?(l={x:i,y:e},t[0]=i,t[1]=e,t[2]=l):l=t[2];let s;t[3]!==n.duration?(s={duration:n.duration},t[3]=n.duration,t[4]=s):s=t[4];let r;t[5]!==s||t[6]!==i||t[7]!==e?(r={x:i,y:e,transition:s},t[5]=s,t[6]=i,t[7]=e,t[8]=r):r=t[8];let a;t[9]!==l||t[10]!==r?(a={initial:l,whileInView:r},t[9]=l,t[10]=r,t[11]=a):a=t[11];const R=N?"whileInView":"initial";let o;t[12]!==n.duration?(o={opacity:0,transition:{duration:n.duration}},t[12]=n.duration,t[13]=o):o=t[13];const v=`flex flex-col items-center h-full ${b==="top"?"justify-start":"justify-end"}`,I=b==="top"?"flex-start":"flex-end";let x;t[14]!==I?(x={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:I,height:"100%"},t[14]=I,t[15]=x):x=t[15];let c;t[16]!==j?(c=p.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",j),t[16]=j,t[17]=c):c=t[17];let f;t[18]!==h?(f={textAlign:"center",padding:"0 6px",...h},t[18]=h,t[19]=f):f=t[19];let u;t[20]!==c||t[21]!==f||t[22]!==g?(u=p.jsxRuntimeExports.jsx("p",{className:c,style:f,children:g}),t[20]=c,t[21]=f,t[22]=g,t[23]=u):u=t[23];let d;t[24]!==u||t[25]!==v||t[26]!==x?(d=p.jsxRuntimeExports.jsx("div",{className:v,style:x,children:u}),t[24]=u,t[25]=v,t[26]=x,t[27]=d):d=t[27];let m;t[28]!==E||t[29]!==d||t[30]!==w?(m=p.jsxRuntimeExports.jsx("foreignObject",{width:w,height:E,y:0,x:0,children:d}),t[28]=E,t[29]=d,t[30]=w,t[31]=m):m=t[31];let y;return t[32]!==m||t[33]!==a||t[34]!==R||t[35]!==o||t[36]!==e?(y=p.jsxRuntimeExports.jsx(q.motion.g,{variants:a,initial:"initial",animate:R,exit:o,children:m},e),t[32]=m,t[33]=a,t[34]=R,t[35]=o,t[36]=e,t[37]=y):y=t[37],y}exports.XAxesLabels=C;
2
- //# sourceMappingURL=XAxesLabels-D5X8jngD.cjs.map
1
+ "use strict";const p=require("./index-CHPV5EwG-CTPQjnHt.cjs"),q=require("./proxy-BxvUI_9l.cjs");function C(A){const t=p.compilerRuntimeExports.c(38),{value:g,y:e,x:i,style:h,className:j,width:w,height:E,alignment:V,animate:n,isInView:N}=A,b=V===void 0?"top":V;let l;t[0]!==i||t[1]!==e?(l={x:i,y:e},t[0]=i,t[1]=e,t[2]=l):l=t[2];let s;t[3]!==n.duration?(s={duration:n.duration},t[3]=n.duration,t[4]=s):s=t[4];let r;t[5]!==s||t[6]!==i||t[7]!==e?(r={x:i,y:e,transition:s},t[5]=s,t[6]=i,t[7]=e,t[8]=r):r=t[8];let a;t[9]!==l||t[10]!==r?(a={initial:l,whileInView:r},t[9]=l,t[10]=r,t[11]=a):a=t[11];const R=N?"whileInView":"initial";let o;t[12]!==n.duration?(o={opacity:0,transition:{duration:n.duration}},t[12]=n.duration,t[13]=o):o=t[13];const v=`flex flex-col items-center h-full ${b==="top"?"justify-start":"justify-end"}`,I=b==="top"?"flex-start":"flex-end";let x;t[14]!==I?(x={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:I,height:"100%"},t[14]=I,t[15]=x):x=t[15];let c;t[16]!==j?(c=p.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none",j),t[16]=j,t[17]=c):c=t[17];let f;t[18]!==h?(f={textAlign:"center",padding:"0 6px",fontSize:"12px",lineHeight:1,...h},t[18]=h,t[19]=f):f=t[19];let u;t[20]!==c||t[21]!==f||t[22]!==g?(u=p.jsxRuntimeExports.jsx("p",{className:c,style:f,children:g}),t[20]=c,t[21]=f,t[22]=g,t[23]=u):u=t[23];let d;t[24]!==u||t[25]!==v||t[26]!==x?(d=p.jsxRuntimeExports.jsx("div",{className:v,style:x,children:u}),t[24]=u,t[25]=v,t[26]=x,t[27]=d):d=t[27];let m;t[28]!==E||t[29]!==d||t[30]!==w?(m=p.jsxRuntimeExports.jsx("foreignObject",{width:w,height:E,y:0,x:0,children:d}),t[28]=E,t[29]=d,t[30]=w,t[31]=m):m=t[31];let y;return t[32]!==m||t[33]!==a||t[34]!==R||t[35]!==o||t[36]!==e?(y=p.jsxRuntimeExports.jsx(q.motion.g,{variants:a,initial:"initial",animate:R,exit:o,children:m},e),t[32]=m,t[33]=a,t[34]=R,t[35]=o,t[36]=e,t[37]=y):y=t[37],y}exports.XAxesLabels=C;
2
+ //# sourceMappingURL=XAxesLabels-C1XSXoWG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XAxesLabels-C1XSXoWG.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.g\r\n key={y}\r\n variants={{\r\n initial: {\r\n x,\r\n y,\r\n },\r\n whileInView: {\r\n x,\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 <foreignObject width={width} height={height} y={0} x={0}>\r\n <div\r\n className={`flex flex-col items-center h-full ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n style={{\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n justifyContent: alignment === 'top' ? 'flex-start' : 'flex-end',\r\n height: '100%',\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={{\r\n textAlign: 'center',\r\n padding: '0 6px',\r\n fontSize: '12px',\r\n lineHeight: 1,\r\n ...style,\r\n }}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </foreignObject>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","$","_c","value","y","x","style","className","width","height","alignment","t0","animate","isInView","undefined","t1","t2","duration","t3","transition","t4","initial","whileInView","t5","t6","opacity","t7","t8","t9","display","flexDirection","alignItems","justifyContent","t10","cn","t11","textAlign","padding","fontSize","lineHeight","t12","t13","t14","jsx","t15","motion"],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eC,OAAAA,EAAW,EAAA,EAAM,EAAA,EACpDgC,SAAAA,CAAAA,CA4BF,EAAgBxC,MAAAQ,EAAAR,MAAAwC,EAAAxC,MAAAO,EAAAP,MAAAyC,GAAAA,EAAAzC,EAAA,EAAA,EAAA,IAAA2C,EAAA,OAAA3C,EAAA,EAAA,IAAAyC,GAAAzC,EAAA,EAAA,IAAAmB,GAAAnB,EAAA,EAAA,IAAAsB,GAAAtB,EAAA,EAAA,IAAAuB,GAAAvB,QAAAG,GA9ClBwC,EAAAD,EAAAA,kBAAAA,IAAAE,EAAAA,OAAA,EAAA,CAEY,SAAAzB,EAWF,QAAA,UACC,QAAAG,EACH,KAAAC,EAENkB,YAhBKtC,CA8CP,EAAWH,MAAAyC,EAAAzC,MAAAmB,EAAAnB,MAAAsB,EAAAtB,MAAAuB,EAAAvB,MAAAG,EAAAH,MAAA2C,GAAAA,EAAA3C,EAAA,EAAA,EA/CX2C,CA+CW"}
@@ -1,6 +1,6 @@
1
1
  import { c as X, m as $, j as y } from "./index-CHPV5EwG-Curnpaqc.js";
2
2
  import { m as k } from "./proxy-BxkFHwUw.js";
3
- function L(E) {
3
+ function D(E) {
4
4
  const t = X.c(38), {
5
5
  value: g,
6
6
  y: e,
@@ -28,19 +28,19 @@ function L(E) {
28
28
  y: e,
29
29
  transition: s
30
30
  }, t[5] = s, t[6] = i, t[7] = e, t[8] = a) : a = t[8];
31
- let r;
32
- t[9] !== n || t[10] !== a ? (r = {
31
+ let o;
32
+ t[9] !== n || t[10] !== a ? (o = {
33
33
  initial: n,
34
34
  whileInView: a
35
- }, t[9] = n, t[10] = a, t[11] = r) : r = t[11];
35
+ }, t[9] = n, t[10] = a, t[11] = o) : o = t[11];
36
36
  const I = R ? "whileInView" : "initial";
37
- let o;
38
- t[12] !== l.duration ? (o = {
37
+ let r;
38
+ t[12] !== l.duration ? (r = {
39
39
  opacity: 0,
40
40
  transition: {
41
41
  duration: l.duration
42
42
  }
43
- }, t[12] = l.duration, t[13] = o) : o = t[13];
43
+ }, t[12] = l.duration, t[13] = r) : r = t[13];
44
44
  const N = `flex flex-col items-center h-full ${A === "top" ? "justify-start" : "justify-end"}`, V = A === "top" ? "flex-start" : "flex-end";
45
45
  let f;
46
46
  t[14] !== V ? (f = {
@@ -52,22 +52,24 @@ function L(E) {
52
52
  }, t[14] = V, t[15] = f) : f = t[15];
53
53
  let c;
54
54
  t[16] !== j ? (c = $("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 text-center leading-none", j), t[16] = j, t[17] = c) : c = t[17];
55
- let m;
56
- t[18] !== h ? (m = {
55
+ let x;
56
+ t[18] !== h ? (x = {
57
57
  textAlign: "center",
58
58
  padding: "0 6px",
59
+ fontSize: "12px",
60
+ lineHeight: 1,
59
61
  ...h
60
- }, t[18] = h, t[19] = m) : m = t[19];
61
- let x;
62
- t[20] !== c || t[21] !== m || t[22] !== g ? (x = /* @__PURE__ */ y.jsx("p", { className: c, style: m, children: g }), t[20] = c, t[21] = m, t[22] = g, t[23] = x) : x = t[23];
62
+ }, t[18] = h, t[19] = x) : x = t[19];
63
+ let m;
64
+ t[20] !== c || t[21] !== x || t[22] !== g ? (m = /* @__PURE__ */ y.jsx("p", { className: c, style: x, children: g }), t[20] = c, t[21] = x, t[22] = g, t[23] = m) : m = t[23];
63
65
  let d;
64
- t[24] !== x || t[25] !== N || t[26] !== f ? (d = /* @__PURE__ */ y.jsx("div", { className: N, style: f, children: x }), t[24] = x, t[25] = N, t[26] = f, t[27] = d) : d = t[27];
66
+ t[24] !== m || t[25] !== N || t[26] !== f ? (d = /* @__PURE__ */ y.jsx("div", { className: N, style: f, children: m }), t[24] = m, t[25] = N, t[26] = f, t[27] = d) : d = t[27];
65
67
  let p;
66
68
  t[28] !== v || t[29] !== d || t[30] !== w ? (p = /* @__PURE__ */ y.jsx("foreignObject", { width: w, height: v, y: 0, x: 0, children: d }), t[28] = v, t[29] = d, t[30] = w, t[31] = p) : p = t[31];
67
69
  let u;
68
- return t[32] !== p || t[33] !== r || t[34] !== I || t[35] !== o || t[36] !== e ? (u = /* @__PURE__ */ y.jsx(k.g, { variants: r, initial: "initial", animate: I, exit: o, children: p }, e), t[32] = p, t[33] = r, t[34] = I, t[35] = o, t[36] = e, t[37] = u) : u = t[37], u;
70
+ return t[32] !== p || t[33] !== o || t[34] !== I || t[35] !== r || t[36] !== e ? (u = /* @__PURE__ */ y.jsx(k.g, { variants: o, initial: "initial", animate: I, exit: r, children: p }, e), t[32] = p, t[33] = o, t[34] = I, t[35] = r, t[36] = e, t[37] = u) : u = t[37], u;
69
71
  }
70
72
  export {
71
- L as X
73
+ D as X
72
74
  };
73
- //# sourceMappingURL=XAxesLabels-DNO0KmjL.js.map
75
+ //# sourceMappingURL=XAxesLabels-Dmbk50u4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XAxesLabels-Dmbk50u4.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.g\r\n key={y}\r\n variants={{\r\n initial: {\r\n x,\r\n y,\r\n },\r\n whileInView: {\r\n x,\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 <foreignObject width={width} height={height} y={0} x={0}>\r\n <div\r\n className={`flex flex-col items-center h-full ${\r\n alignment === 'top' ? 'justify-start' : 'justify-end'\r\n }`}\r\n style={{\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n justifyContent: alignment === 'top' ? 'flex-start' : 'flex-end',\r\n height: '100%',\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={{\r\n textAlign: 'center',\r\n padding: '0 6px',\r\n fontSize: '12px',\r\n lineHeight: 1,\r\n ...style,\r\n }}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </foreignObject>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["XAxesLabels","props","$","_c","value","y","x","style","className","width","height","alignment","t0","animate","isInView","undefined","t1","t2","duration","t3","transition","t4","initial","whileInView","t5","t6","opacity","t7","t8","t9","display","flexDirection","alignItems","justifyContent","t10","cn","t11","textAlign","padding","fontSize","lineHeight","t12","t13","t14","jsx","t15","motion"],"mappings":";;AAkBO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,EAAA,GACL;AAAA,IAAAC,OAAAA;AAAAA,IAAAC,GAAAA;AAAAA,IAAAC,GAAAA;AAAAA,IAAAC,OAAAA;AAAAA,IAAAC,WAAAA;AAAAA,IAAAC,OAAAA;AAAAA,IAAAC,QAAAA;AAAAA,IAAAC,WAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,UAAAA;AAAAA,EAAAA,IAWIb,GAHFU,IAAAC,MAAAG,SAAA,QAAAH;AAAiB,MAAAI;AAAA,EAAAd,EAAA,CAAA,MAAAI,KAAAJ,SAAAG,KAQJW,IAAA;AAAA,IAAAV,GAAAA;AAAAA,IAAAD,GAAAA;AAAAA,EAAAA,GAGRH,OAAAI,GAAAJ,OAAAG,GAAAH,OAAAc,KAAAA,IAAAd,EAAA,CAAA;AAAA,MAAAe;AAAA,EAAAf,EAAA,CAAA,M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AA,EAAA,MAAAuB,KAAAvB,UAAAG,KA9ClBwC,IAAAD,gBAAAA,EAAAA,IAAAE,EAAA,GAAA,EAEY,UAAAzB,GAWF,SAAA,WACC,SAAAG,GACH,MAAAC,GAENkB,eAhBKtC,CA8CP,GAAWH,QAAAyC,GAAAzC,QAAAmB,GAAAnB,QAAAsB,GAAAtB,QAAAuB,GAAAvB,QAAAG,GAAAH,QAAA2C,KAAAA,IAAA3C,EAAA,EAAA,GA/CX2C;AA+CW;"}
@@ -0,0 +1,72 @@
1
+ import { c as E, m as R, j as h } from "./index-CHPV5EwG-Curnpaqc.js";
2
+ import { m as S } from "./proxy-BxkFHwUw.js";
3
+ function $(V) {
4
+ const e = E.c(35), {
5
+ value: y,
6
+ y: i,
7
+ x: t,
8
+ style: g,
9
+ className: j,
10
+ width: w,
11
+ height: v,
12
+ alignment: N,
13
+ animate: l,
14
+ isInView: A
15
+ } = V, d = N === void 0 ? "right" : N;
16
+ let n;
17
+ e[0] !== t || e[1] !== i ? (n = {
18
+ y: i,
19
+ x: t
20
+ }, e[0] = t, e[1] = i, e[2] = n) : n = e[2];
21
+ let s;
22
+ e[3] !== l.duration ? (s = {
23
+ duration: l.duration
24
+ }, e[3] = l.duration, e[4] = s) : s = e[4];
25
+ let a;
26
+ e[5] !== s || e[6] !== t || e[7] !== i ? (a = {
27
+ y: i,
28
+ x: t,
29
+ transition: s
30
+ }, e[5] = s, e[6] = t, e[7] = i, e[8] = a) : a = e[8];
31
+ let o;
32
+ e[9] !== n || e[10] !== a ? (o = {
33
+ initial: n,
34
+ whileInView: a
35
+ }, e[9] = n, e[10] = a, e[11] = o) : o = e[11];
36
+ const b = A ? "whileInView" : "initial";
37
+ let r;
38
+ e[12] !== l.duration ? (r = {
39
+ opacity: 0,
40
+ transition: {
41
+ duration: l.duration
42
+ }
43
+ }, e[12] = l.duration, e[13] = r) : r = e[13];
44
+ let u;
45
+ e[14] === Symbol.for("react.memo_cache_sentinel") ? (u = {
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ justifyContent: "center",
49
+ height: "100%"
50
+ }, e[14] = u) : u = e[14];
51
+ const I = `text-${d}`;
52
+ let c;
53
+ e[15] !== j || e[16] !== I ? (c = R("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none", I, j), e[15] = j, e[16] = I, e[17] = c) : c = e[17];
54
+ let f;
55
+ e[18] !== d || e[19] !== g ? (f = {
56
+ textAlign: d,
57
+ padding: "6px 0",
58
+ fontSize: "12px",
59
+ lineHeight: 1,
60
+ ...g
61
+ }, e[18] = d, e[19] = g, e[20] = f) : f = e[20];
62
+ let m;
63
+ e[21] !== f || e[22] !== c || e[23] !== y ? (m = /* @__PURE__ */ h.jsx("div", { className: "flex flex-col justify-center h-full", style: u, children: /* @__PURE__ */ h.jsx("p", { className: c, style: f, children: y }) }), e[21] = f, e[22] = c, e[23] = y, e[24] = m) : m = e[24];
64
+ let x;
65
+ e[25] !== v || e[26] !== m || e[27] !== w ? (x = /* @__PURE__ */ h.jsx("foreignObject", { y: 0, x: 0, width: w, height: v, children: m }), e[25] = v, e[26] = m, e[27] = w, e[28] = x) : x = e[28];
66
+ let p;
67
+ return e[29] !== x || e[30] !== o || e[31] !== b || e[32] !== r || e[33] !== t ? (p = /* @__PURE__ */ h.jsx(S.g, { variants: o, initial: "initial", animate: b, exit: r, children: x }, t), e[29] = x, e[30] = o, e[31] = b, e[32] = r, e[33] = t, e[34] = p) : p = e[34], p;
68
+ }
69
+ export {
70
+ $ as Y
71
+ };
72
+ //# sourceMappingURL=YAxesLabels-1XTb-D0_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YAxesLabels-1XTb-D0_.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.g\r\n key={x}\r\n variants={{\r\n initial: {\r\n y,\r\n x,\r\n },\r\n whileInView: {\r\n y,\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 <foreignObject y={0} x={0} width={width} height={height}>\r\n <div\r\n className='flex flex-col justify-center h-full'\r\n style={{\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n height: '100%',\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 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={{\r\n textAlign: alignment,\r\n padding: '6px 0',\r\n fontSize: '12px',\r\n lineHeight: 1,\r\n ...style,\r\n }}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </foreignObject>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","$","_c","value","y","x","style","className","width","height","alignment","t0","animate","isInView","undefined","t1","t2","duration","t3","transition","t4","initial","whileInView","t5","t6","opacity","t7","Symbol","for","display","flexDirection","justifyContent","t8","t9","cn","t10","textAlign","padding","fontSize","lineHeight","t11","jsx","t12","t13","motion"],"mappings":";;AAkBO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,EAAA,GACL;AAAA,IAAAC,OAAAA;AAAAA,IAAAC,GAAAA;AAAAA,IAAAC,GAAAA;AAAAA,IAAAC,OAAAA;AAAA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,EAAAA,IAAA,mBAAkB,GAAA,GAAM,GAAA,GAAUjC,OAAAA,GAAeC,QAAAA,GAC/C+B,UAAAA,EAAAA,CA0BF,GAAgBvC,QAAAQ,GAAAR,QAAAuC,GAAAvC,QAAAO,GAAAP,QAAAyC,KAAAA,IAAAzC,EAAA,EAAA;AAAA,MAAA0C;AAAA,SAAA1C,EAAA,EAAA,MAAAyC,KAAAzC,EAAA,EAAA,MAAAmB,KAAAnB,EAAA,EAAA,MAAAsB,KAAAtB,EAAA,EAAA,MAAAuB,KAAAvB,UAAAI,KA5ClBsC,IAAAF,gBAAAA,EAAAA,IAAAG,EAAA,GAAA,EAEY,UAAAxB,GAWF,SAAA,WACC,SAAAG,GACH,MAAAC,GAENkB,eAhBKrC,CA4CP,GAAWJ,QAAAyC,GAAAzC,QAAAmB,GAAAnB,QAAAsB,GAAAtB,QAAAuB,GAAAvB,QAAAI,GAAAJ,QAAA0C,KAAAA,IAAA1C,EAAA,EAAA,GA7CX0C;AA6CW;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const m=require("./index-CHPV5EwG-CTPQjnHt.cjs"),I=require("./proxy-BxvUI_9l.cjs");function N(V){const e=m.compilerRuntimeExports.c(35),{value:h,y:i,x:t,style:g,className:j,width:w,height:E,alignment:v,animate:n,isInView:A}=V,d=v===void 0?"right":v;let l;e[0]!==t||e[1]!==i?(l={y:i,x:t},e[0]=t,e[1]=i,e[2]=l):l=e[2];let s;e[3]!==n.duration?(s={duration:n.duration},e[3]=n.duration,e[4]=s):s=e[4];let r;e[5]!==s||e[6]!==t||e[7]!==i?(r={y:i,x:t,transition:s},e[5]=s,e[6]=t,e[7]=i,e[8]=r):r=e[8];let a;e[9]!==l||e[10]!==r?(a={initial:l,whileInView:r},e[9]=l,e[10]=r,e[11]=a):a=e[11];const R=A?"whileInView":"initial";let o;e[12]!==n.duration?(o={opacity:0,transition:{duration:n.duration}},e[12]=n.duration,e[13]=o):o=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p={display:"flex",flexDirection:"column",justifyContent:"center",height:"100%"},e[14]=p):p=e[14];const b=`text-${d}`;let x;e[15]!==j||e[16]!==b?(x=m.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs m-0 py-0 px-1.5 leading-none",b,j),e[15]=j,e[16]=b,e[17]=x):x=e[17];let c;e[18]!==d||e[19]!==g?(c={textAlign:d,padding:"6px 0",fontSize:"12px",lineHeight:1,...g},e[18]=d,e[19]=g,e[20]=c):c=e[20];let f;e[21]!==c||e[22]!==x||e[23]!==h?(f=m.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center h-full",style:p,children:m.jsxRuntimeExports.jsx("p",{className:x,style:c,children:h})}),e[21]=c,e[22]=x,e[23]=h,e[24]=f):f=e[24];let u;e[25]!==E||e[26]!==f||e[27]!==w?(u=m.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:w,height:E,children:f}),e[25]=E,e[26]=f,e[27]=w,e[28]=u):u=e[28];let y;return e[29]!==u||e[30]!==a||e[31]!==R||e[32]!==o||e[33]!==t?(y=m.jsxRuntimeExports.jsx(I.motion.g,{variants:a,initial:"initial",animate:R,exit:o,children:u},t),e[29]=u,e[30]=a,e[31]=R,e[32]=o,e[33]=t,e[34]=y):y=e[34],y}exports.YAxesLabels=N;
2
+ //# sourceMappingURL=YAxesLabels-pjdsVwIM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YAxesLabels-pjdsVwIM.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.g\r\n key={x}\r\n variants={{\r\n initial: {\r\n y,\r\n x,\r\n },\r\n whileInView: {\r\n y,\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 <foreignObject y={0} x={0} width={width} height={height}>\r\n <div\r\n className='flex flex-col justify-center h-full'\r\n style={{\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n height: '100%',\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 leading-none',\r\n `text-${alignment}`,\r\n className,\r\n )}\r\n style={{\r\n textAlign: alignment,\r\n padding: '6px 0',\r\n fontSize: '12px',\r\n lineHeight: 1,\r\n ...style,\r\n }}\r\n >\r\n {value}\r\n </p>\r\n </div>\r\n </foreignObject>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["YAxesLabels","props","$","_c","value","y","x","style","className","width","height","alignment","t0","animate","isInView","undefined","t1","t2","duration","t3","transition","t4","initial","whileInView","t5","t6","opacity","t7","Symbol","for","display","flexDirection","justifyContent","t8","t9","cn","t10","textAlign","padding","fontSize","lineHeight","t11","jsx","t12","t13","motion"],"mappings":"gGAkBO,SAAAA,EAAAC,EAAA,CAAA,MAAAC,EAAAC,EAAAA,uBAAAA,EAAA,EAAA,EACL,CAAAC,MAAAA,EAAAC,EAAAA,EAAAC,EAAAA,EAAAC,MAAAA,EAAAC,UAAAA,EAAAC,MAAAA,EAAAC,OAAAA,EAAAC,UAAAC,EAAAC,QAAAA,EAAAC,SAAAA,CAAAA,EAWIb,EAHFU,EAAAC,IAAAG,OAAA,QAAAH,EAAmB,IAAAI,EAAAd,EAAA,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H,KAAAC,EAENkB,YAhBKrC,CA4CP,EAAWJ,MAAAyC,EAAAzC,MAAAmB,EAAAnB,MAAAsB,EAAAtB,MAAAuB,EAAAvB,MAAAI,EAAAJ,MAAA0C,GAAAA,EAAA1C,EAAA,EAAA,EA7CX0C,CA6CW"}
@@ -0,0 +1,2 @@
1
+ "use strict";function t(r){return r<360?2:r<520?5:10}exports.getNoOfTicks=t;
2
+ //# sourceMappingURL=getNoOfTicks-C_1CFXv_.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNoOfTicks-C_1CFXv_.cjs","sources":["../src/Utils/getNoOfTicks.ts"],"sourcesContent":["export function getNoOfTicks(width: number) {\r\n if (width < 360) return 2;\r\n if (width < 520) return 5;\r\n return 10;\r\n}\r\n"],"names":["getNoOfTicks","width"],"mappings":"aAAO,SAASA,EAAaC,EAAe,CAC1C,OAAIA,EAAQ,IAAY,EACpBA,EAAQ,IAAY,EACjB,EACT"}
@@ -0,0 +1,7 @@
1
+ function e(r) {
2
+ return r < 360 ? 2 : r < 520 ? 5 : 10;
3
+ }
4
+ export {
5
+ e as g
6
+ };
7
+ //# sourceMappingURL=getNoOfTicks-CpmRjcRF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNoOfTicks-CpmRjcRF.js","sources":["../src/Utils/getNoOfTicks.ts"],"sourcesContent":["export function getNoOfTicks(width: number) {\r\n if (width < 360) return 2;\r\n if (width < 520) return 5;\r\n return 10;\r\n}\r\n"],"names":["getNoOfTicks","width"],"mappings":"AAAO,SAASA,EAAaC,GAAe;AAC1C,SAAIA,IAAQ,MAAY,IACpBA,IAAQ,MAAY,IACjB;AACT;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const n=require("./index-CHPV5EwG-CTPQjnHt.cjs"),y=require("react"),He=require("./index-Cno4Q0YE.cjs"),Le=require("./Modal-JW_IExO3.cjs"),Be=require("./Spinner-DRMBUsX7.cjs"),Pe=require("./Tooltip-4dJo4_AF.cjs"),Ge=require("./numberFormattingFunction-02t-wJta.cjs"),ze=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),ke=require("./Colors.cjs"),qe=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Te=require("./string2HTML-CPGr_I5E.cjs"),Fe=require("./pow-DgrUorRi.cjs"),we=require("./y-QcCbqrzx.cjs"),We=require("./GraphFooter.cjs"),Ie=require("./GraphHeader.cjs"),Ae=require("./ColorLegendWithMouseOver.cjs"),Xe=require("./EmptyState-sAEZ_5rU.cjs"),Ne=require("./uniqBy-O05lp2S5.cjs"),Ve=require("./GraphContainer-d8A46BK2.cjs");function Se(t,e){let o,r;if(e===void 0)for(const l of t)l!=null&&(o===void 0?l>=l&&(o=r=l):(o>l&&(o=l),r<l&&(r=l)));else{let l=-1;for(let d of t)(d=e(d,++l,t))!=null&&(o===void 0?d>=d&&(o=r=d):(o>d&&(o=d),r<d&&(r=d)))}return[o,r]}const Ye=t=>{const e=n.compilerRuntimeExports.c(104),{data:o,colors:r,leftMargin:l,width:d,height:R,colorDomain:D,selectedColor:k,rightMargin:x,topMargin:te,bottomMargin:xe,showLabels:p,tooltip:F,onSeriesMouseOver:q,showValues:$,suffix:W,prefix:oe,highlightedDataPoints:ve,onSeriesMouseClick:ie,maxRadiusValue:H,radius:c,resetSelectionOnDoubleClick:je,detailsOnClick:C,styles:z,classNames:M,dimmedOpacity:I,precision:L}=t,Oe=y.useRef(null),[be,Ce]=y.useState(void 0),[w,A]=y.useState(void 0),[S,De]=y.useState(void 0),[ne,se]=y.useState(void 0),[re,ye]=y.useState(void 0),[le,m]=y.useState(null);let a;e[0]!==xe||e[1]!==l||e[2]!==x||e[3]!==te?(a={top:te,bottom:xe,left:l,right:x},e[0]=xe,e[1]=l,e[2]=x,e[3]=te,e[4]=a):a=e[4];const X=a,Y=d-X.left-X.right,B=R-X.top-X.bottom;let ce;e[5]!==o?(ce=o.filter(Ue).length===0?o:He.orderBy(o.filter(Je),"radius","asc"),e[5]=o,e[6]=ce):ce=e[6];const P=ce;let ae;e[7]!==o||e[8]!==H||e[9]!==c?(ae=o.filter(Ke).length!==o.length?Fe.sqrt().domain([0,qe.checkIfNullOrUndefined(H)?Math.max(...o.map(Qe).filter(Ze)):H]).range([.25,c]).nice():void 0,e[7]=o,e[8]=H,e[9]=c,e[10]=ae):ae=e[10];const s=ae;let ue;e[11]!==P||e[12]!==B||e[13]!==Y||e[14]!==c||e[15]!==s?(ue=()=>{(()=>{const u=P.map(_e);we.forceSimulation(u).force("y",we.forceY(v=>B/2).strength(1)).force("x",we.forceX(v=>Y/2).strength(1)).force("collide",we.forceCollide(v=>s?s(v.size||0)+1:c+1)).force("charge",we.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{m(u)}).on("end",()=>{m(u);const v=Se(u,f=>f.x-(s?s(f.size||0)+1:c+1))[0]||0,g=Se(u,f=>f.y-(s?s(f.size||0)+1:c+1))[0]||0,N=Se(u,f=>f.x+(s?s(f.size||0)+1:c+1))[1]||0,O=Se(u,f=>f.y+(s?s(f.size||0)+1:c+1))[1]||0;De([v,g,v<0?N-v:N,g<0?O-g:O])})})()},e[11]=P,e[12]=B,e[13]=Y,e[14]=c,e[15]=s,e[16]=ue):ue=e[16];let fe;e[17]!==o||e[18]!==P||e[19]!==B||e[20]!==Y||e[21]!==H||e[22]!==c||e[23]!==s?(fe=[o,c,B,Y,H,P,s],e[17]=o,e[18]=P,e[19]=B,e[20]=Y,e[21]=H,e[22]=c,e[23]=s,e[24]=fe):fe=e[24],y.useEffect(ue,fe);let de;e[25]!==q?(de=(i,u)=>{Ce(u),ye(i.clientY),se(i.clientX),q?.(u)},e[25]=q,e[26]=de):de=e[26];const U=de;let J;e[27]===Symbol.for("react.memo_cache_sentinel")?(J=(i,u)=>{Ce(u),ye(i.clientY),se(i.clientX)},e[27]=J):J=e[27];const Re=J;let K;e[28]!==C||e[29]!==w||e[30]!==ie||e[31]!==je?(K=i=>{(ie||C)&&(w===i.label&&je?(A(void 0),ie?.(void 0)):(A(i.label),ie?.(i)))},e[28]=C,e[29]=w,e[30]=ie,e[31]=je,e[32]=K):K=e[32];const G=K;let he;e[33]!==q?(he=()=>{Ce(void 0),se(void 0),ye(void 0),q?.(void 0)},e[33]=q,e[34]=he):he=e[34];const Q=he;let E;e[35]!==D||e[36]!==r||e[37]!==o?(E=i=>o.filter(et).length===0?r[0]:i.color?r[D.indexOf(i.color)]:ke.Colors.gray,e[35]=D,e[36]=r,e[37]=o,e[38]=E):E=e[38];const Z=E;let pe;e[39]!==D||e[40]!==r||e[41]!==I||e[42]!==ve||e[43]!==k?(pe=i=>k?i.color&&r[D.indexOf(i.color)]===k?1:I:ve.length!==0?ve.indexOf(i.label)!==-1?.85:I:.85,e[39]=D,e[40]=r,e[41]=I,e[42]=ve,e[43]=k,e[44]=pe):pe=e[44];const _=pe;if(!le){const i=`${d}px`,u=`${R}px`;let b;e[45]!==i||e[46]!==u?(b={width:i,height:u},e[45]=i,e[46]=u,e[47]=b):b=e[47];let v;e[48]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:n.jsxRuntimeExports.jsx(Be.w,{})}),e[48]=v):v=e[48];let g;return e[49]!==b?(g=n.jsxRuntimeExports.jsx("div",{style:b,children:v}),e[49]=b,e[50]=g):g=e[50],g}if(S){const i=`${d}px`,u=`${R}px`,b=`${S[0]>0?0:S[0]} ${S[1]>0?0:S[1]} ${d<S[2]?S[2]:d} ${R<S[3]?S[3]:R}`,v=`translate(${X.left},${X.top})`;let g;if(e[51]!==M?.graphObjectValues||e[52]!==le||e[53]!==Z||e[54]!==_||e[55]!==G||e[56]!==U||e[57]!==Q||e[58]!==L||e[59]!==oe||e[60]!==c||e[61]!==s||e[62]!==p||e[63]!==$||e[64]!==z?.graphObjectValues||e[65]!==W){let me;e[67]!==M?.graphObjectValues||e[68]!==Z||e[69]!==_||e[70]!==G||e[71]!==U||e[72]!==Q||e[73]!==L||e[74]!==oe||e[75]!==c||e[76]!==s||e[77]!==p||e[78]!==$||e[79]!==z?.graphObjectValues||e[80]!==W?(me=j=>{const T=Z(j),ge=_(j),h=s?s(j.size||0):c,Me=h>20&&(p||$);return n.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",opacity:ge,transform:`translate(${j.x},${j.y})`,onMouseEnter:Ee=>U(Ee,j),onMouseMove:Ee=>Re(Ee,j),onClick:()=>G(j),onMouseLeave:Q,children:[n.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:h,fill:T}),(Me||$)&&j.size!==void 0&&j.size!==null&&h>=15&&n.jsxRuntimeExports.jsx("g",{children:n.jsxRuntimeExports.jsx("foreignObject",{y:0-h,x:0-h,width:2*h,height:2*h,children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col justify-center items-center h-full py-0 px-3",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",padding:"0 0.75rem"},children:[p&&n.jsxRuntimeExports.jsx("p",{className:n.mo("text-center leading-[1.25] overflow-hidden m-0 circle-packing-label",M?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round(h/4),12),Math.max(Math.round(h*12/`${j.label}`.length),12),14)}px`,textAlign:"center",margin:0,lineHeight:1.25,WebkitLineClamp:h*2<60?1:h*2<75?2:h*2<100?3:void 0,display:"-webkit-box",WebkitBoxOrient:"vertical",color:ze.getTextColorBasedOnBgColor(T),hyphens:"auto",...z?.graphObjectValues||{}},children:j.label}),$&&n.jsxRuntimeExports.jsx("p",{className:"text-center font-bold leading-[1.25] w-full m-0 circle-packing-value",style:{fontSize:`${Math.min(Math.max(Math.round(h/4),14),14)}px`,textAlign:"center",margin:0,lineHeight:1.25,width:"100%",fontWeight:"bold",color:ze.getTextColorBasedOnBgColor(T)},children:Ge.numberFormattingFunction(j.size,"NA",L,oe,W)})]})})})]},j.label)},e[67]=M?.graphObjectValues,e[68]=Z,e[69]=_,e[70]=G,e[71]=U,e[72]=Q,e[73]=L,e[74]=oe,e[75]=c,e[76]=s,e[77]=p,e[78]=$,e[79]=z?.graphObjectValues,e[80]=W,e[81]=me):me=e[81],g=le.map(me),e[51]=M?.graphObjectValues,e[52]=le,e[53]=Z,e[54]=_,e[55]=G,e[56]=U,e[57]=Q,e[58]=L,e[59]=oe,e[60]=c,e[61]=s,e[62]=p,e[63]=$,e[64]=z?.graphObjectValues,e[65]=W,e[66]=g}else g=e[66];let N;e[82]!==v||e[83]!==g?(N=n.jsxRuntimeExports.jsx("g",{transform:v,children:g}),e[82]=v,e[83]=g,e[84]=N):N=e[84];let O;e[85]!==i||e[86]!==u||e[87]!==b||e[88]!==N?(O=n.jsxRuntimeExports.jsx("svg",{width:i,height:u,viewBox:b,direction:"ltr",ref:Oe,children:N}),e[85]=i,e[86]=u,e[87]=b,e[88]=N,e[89]=O):O=e[89];let f;e[90]!==M?.tooltip||e[91]!==ne||e[92]!==re||e[93]!==be||e[94]!==z?.tooltip||e[95]!==F?(f=be&&F&&ne&&re&&n.jsxRuntimeExports.jsx(Pe.Tooltip,{data:be,body:F,xPos:ne,yPos:re,backgroundStyle:z?.tooltip,className:M?.tooltip}),e[90]=M?.tooltip,e[91]=ne,e[92]=re,e[93]=be,e[94]=z?.tooltip,e[95]=F,e[96]=f):f=e[96];let V;e[97]!==C||e[98]!==w?(V=C&&w!==void 0?n.jsxRuntimeExports.jsx(Le.le,{open:w!==void 0,onClose:()=>{A(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof C=="string"?{__html:Te.string2HTML(C,w)}:void 0,children:typeof C=="function"?C(w):null})}):null,e[97]=C,e[98]=w,e[99]=V):V=e[99];let ee;return e[100]!==O||e[101]!==f||e[102]!==V?(ee=n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[O,f,V]}),e[100]=O,e[101]=f,e[102]=V,e[103]=ee):ee=e[103],ee}return null};function Ue(t){return!qe.checkIfNullOrUndefined(t.size)}function Je(t){return!qe.checkIfNullOrUndefined(t.size)}function Ke(t){return t.size===void 0||t.size===null}function Qe(t){return t.size}function Ze(t){return t!=null}function _e(t){return{...t,...t.data&&{data:{...t.data}}}}function et(t){return t.color}function tt(t,e,o){const r=t.filter(x=>x!=null),l=Math.min(e,o)/2,d=r.reduce((x,te)=>x+te,0),R=Math.max(...r),D=x=>x<=5?.9:x<=10?.85:x<=20?.8:.7,k=x=>x<=200?.85:x<=250?.95:1;return l*Math.sqrt(R/d)*k(l)*D(r.length)}function ot(t){const e=n.compilerRuntimeExports.c(71),{data:o,graphTitle:r,colors:l,suffix:d,sources:R,prefix:D,graphDescription:k,leftMargin:x,rightMargin:te,height:xe,width:p,footNote:F,colorDomain:q,colorLegendTitle:$,padding:W,backgroundColor:oe,topMargin:ve,bottomMargin:ie,showLabels:H,relativeHeight:c,tooltip:je,onSeriesMouseOver:C,showColorScale:z,showValues:M,graphID:I,highlightedDataPoints:L,onSeriesMouseClick:Oe,graphDownload:be,dataDownload:Ce,language:w,showNAColor:A,minHeight:S,theme:De,ariaLabel:ne,radius:se,maxRadiusValue:re,resetSelectionOnDoubleClick:ye,detailsOnClick:le,styles:m,classNames:a,dimmedOpacity:X,precision:Y}=t,B=d===void 0?"":d,ce=D===void 0?"":D,P=x===void 0?0:x,ae=te===void 0?0:te,s=oe===void 0?!1:oe,ue=ve===void 0?0:ve,fe=ie===void 0?0:ie,de=H===void 0?!0:H,U=z===void 0?!0:z;let J;e[0]!==L?(J=L===void 0?[]:L,e[0]=L,e[1]=J):J=e[1];const Re=J,K=be===void 0?!1:be,G=Ce===void 0?!1:Ce,he=w===void 0?"en":w,Q=S===void 0?0:S,E=De===void 0?"light":De,Z=ye===void 0?!0:ye,pe=X===void 0?.3:X,_=Y===void 0?2:Y,[i,u]=y.useState(0),[b,v]=y.useState(0),[g,N]=y.useState(void 0),O=y.useRef(null),f=y.useRef(null);let V,ee;e[2]===Symbol.for("react.memo_cache_sentinel")?(V=()=>{const Ee=new ResizeObserver($e=>{u($e[0].target.clientWidth||620),v($e[0].target.clientHeight||480)});return O.current&&Ee.observe(O.current),()=>Ee.disconnect()},ee=[],e[2]=V,e[3]=ee):(V=e[2],ee=e[3]),y.useEffect(V,ee);const me=a?.graphContainer,j=m?.graphContainer;let T;e[4]!==a?.description||e[5]!==a?.title||e[6]!==o||e[7]!==G||e[8]!==k||e[9]!==K||e[10]!==r||e[11]!==m?.description||e[12]!==m?.title||e[13]!==p?(T=r||k||K||G?n.jsxRuntimeExports.jsx(Ie.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:a?.title,description:a?.description},graphTitle:r,graphDescription:k,width:p,graphDownload:K?f:void 0,dataDownload:G?o.map(dt).filter(ft).length>0?o.map(ut).filter(at):o.filter(ct):null}):null,e[4]=a?.description,e[5]=a?.title,e[6]=o,e[7]=G,e[8]=k,e[9]=K,e[10]=r,e[11]=m?.description,e[12]=m?.title,e[13]=p,e[14]=T):T=e[14];let ge;e[15]!==fe||e[16]!==a||e[17]!==q||e[18]!==$||e[19]!==l||e[20]!==o||e[21]!==le||e[22]!==pe||e[23]!==Re||e[24]!==P||e[25]!==re||e[26]!==Oe||e[27]!==C||e[28]!==_||e[29]!==ce||e[30]!==se||e[31]!==Z||e[32]!==ae||e[33]!==g||e[34]!==U||e[35]!==de||e[36]!==A||e[37]!==M||e[38]!==m||e[39]!==B||e[40]!==b||e[41]!==i||e[42]!==E||e[43]!==je||e[44]!==ue||e[45]!==p?(ge=o.length===0?n.jsxRuntimeExports.jsx(Xe.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[U&&o.filter(lt).length!==0?n.jsxRuntimeExports.jsx(Ae.ColorLegendWithMouseOver,{width:p,colorLegendTitle:$,colors:l||ke.Colors[E].categoricalColors.colors,colorDomain:q||Ne.uniqBy(o,"color",!0),setSelectedColor:N,showNAColor:A??!0,isCenter:!0,className:a?.colorLegend}):null,n.jsxRuntimeExports.jsx(Ve.GraphArea,{ref:O,children:i&&b?n.jsxRuntimeExports.jsx(Ye,{data:o,colors:o.filter(rt).length===0?l?[l]:[ke.Colors.primaryColors["blue-600"]]:l||ke.Colors[E].categoricalColors.colors,colorDomain:o.filter(st).length===0?[]:q||Ne.uniqBy(o,"color",!0),width:i,height:b,leftMargin:P,rightMargin:ae,topMargin:ue,bottomMargin:fe,showLabels:de,showValues:M!==!1?o.filter(nt).length!==0:M,selectedColor:g,suffix:B,prefix:ce,tooltip:je,onSeriesMouseOver:C,highlightedDataPoints:Re,onSeriesMouseClick:Oe,theme:E,radius:se||tt(o.map(it),i,b),maxRadiusValue:re,resetSelectionOnDoubleClick:Z,detailsOnClick:le,styles:m,classNames:a,dimmedOpacity:pe,precision:_}):null})]}),e[15]=fe,e[16]=a,e[17]=q,e[18]=$,e[19]=l,e[20]=o,e[21]=le,e[22]=pe,e[23]=Re,e[24]=P,e[25]=re,e[26]=Oe,e[27]=C,e[28]=_,e[29]=ce,e[30]=se,e[31]=Z,e[32]=ae,e[33]=g,e[34]=U,e[35]=de,e[36]=A,e[37]=M,e[38]=m,e[39]=B,e[40]=b,e[41]=i,e[42]=E,e[43]=je,e[44]=ue,e[45]=p,e[46]=ge):ge=e[46];let h;e[47]!==a?.footnote||e[48]!==a?.source||e[49]!==F||e[50]!==R||e[51]!==m?.footnote||e[52]!==m?.source||e[53]!==p?(h=R||F?n.jsxRuntimeExports.jsx(We.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:a?.footnote,source:a?.source},sources:R,footNote:F,width:p}):null,e[47]=a?.footnote,e[48]=a?.source,e[49]=F,e[50]=R,e[51]=m?.footnote,e[52]=m?.source,e[53]=p,e[54]=h):h=e[54];let Me;return e[55]!==ne||e[56]!==s||e[57]!==I||e[58]!==xe||e[59]!==he||e[60]!==Q||e[61]!==W||e[62]!==c||e[63]!==me||e[64]!==j||e[65]!==T||e[66]!==ge||e[67]!==h||e[68]!==E||e[69]!==p?(Me=n.jsxRuntimeExports.jsxs(Ve.GraphContainer,{className:me,style:j,id:I,ref:f,"aria-label":ne,backgroundColor:s,theme:E,language:he,minHeight:Q,width:p,height:xe,relativeHeight:c,padding:W,children:[T,ge,h]}),e[55]=ne,e[56]=s,e[57]=I,e[58]=xe,e[59]=he,e[60]=Q,e[61]=W,e[62]=c,e[63]=me,e[64]=j,e[65]=T,e[66]=ge,e[67]=h,e[68]=E,e[69]=p,e[70]=Me):Me=e[70],Me}function it(t){return t.size}function nt(t){return t.size}function st(t){return t.color}function rt(t){return t.color}function lt(t){return t.color}function ct(t){return t!==void 0}function at(t){return t!==void 0}function ut(t){return t.data}function ft(t){return t!==void 0}function dt(t){return t.data}exports.CirclePackingGraph=ot;exports.extent=Se;
2
+ //# sourceMappingURL=index-C6LorfZ-.cjs.map