@undp/data-viz 2.0.4 → 2.0.6

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.
@@ -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={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,GAA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A+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":["../node_modules/hex-to-rgba/build/index.js","../src/Components/Graphs/Maps/ThreeDGlobe/Graph.tsx","../src/Components/Graphs/Maps/ThreeDGlobe/index.tsx"],"sourcesContent":["\"use strict\";\n\nvar removeHash = function removeHash(hex) {\n return hex.charAt(0) === '#' ? hex.slice(1) : hex;\n};\n\nvar parseHex = function parseHex(nakedHex) {\n var isShort = nakedHex.length === 3 || nakedHex.length === 4;\n var twoDigitHexR = isShort ? \"\".concat(nakedHex.slice(0, 1)).concat(nakedHex.slice(0, 1)) : nakedHex.slice(0, 2);\n var twoDigitHexG = isShort ? \"\".concat(nakedHex.slice(1, 2)).concat(nakedHex.slice(1, 2)) : nakedHex.slice(2, 4);\n var twoDigitHexB = isShort ? \"\".concat(nakedHex.slice(2, 3)).concat(nakedHex.slice(2, 3)) : nakedHex.slice(4, 6);\n var twoDigitHexA = (isShort ? \"\".concat(nakedHex.slice(3, 4)).concat(nakedHex.slice(3, 4)) : nakedHex.slice(6, 8)) || 'ff'; // const numericA = +((parseInt(a, 16) / 255).toFixed(2));\n\n return {\n r: twoDigitHexR,\n g: twoDigitHexG,\n b: twoDigitHexB,\n a: twoDigitHexA\n };\n};\n\nvar hexToDecimal = function hexToDecimal(hex) {\n return parseInt(hex, 16);\n};\n\nvar hexesToDecimals = function hexesToDecimals(_ref) {\n var r = _ref.r,\n g = _ref.g,\n b = _ref.b,\n a = _ref.a;\n return {\n r: hexToDecimal(r),\n g: hexToDecimal(g),\n b: hexToDecimal(b),\n a: +(hexToDecimal(a) / 255).toFixed(2)\n };\n};\n\nvar isNumeric = function isNumeric(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}; // eslint-disable-line no-restricted-globals, max-len\n\n\nvar formatRgb = function formatRgb(decimalObject, parameterA) {\n var r = decimalObject.r,\n g = decimalObject.g,\n b = decimalObject.b,\n parsedA = decimalObject.a;\n var a = isNumeric(parameterA) ? parameterA : parsedA;\n return \"rgba(\".concat(r, \", \").concat(g, \", \").concat(b, \", \").concat(a, \")\");\n};\n/**\n * Turns an old-fashioned css hex color value into a rgb color value.\n *\n * If you specify an alpha value, you'll get a rgba() value instead.\n *\n * @param The hex value to convert. ('123456'. '#123456', ''123', '#123')\n * @param An alpha value to apply. (optional) ('0.5', '0.25')\n * @return An rgb or rgba value. ('rgb(11, 22, 33)'. 'rgba(11, 22, 33, 0.5)')\n */\n\n\nvar hexToRgba = function hexToRgba(hex, a) {\n var hashlessHex = removeHash(hex);\n var hexObject = parseHex(hashlessHex);\n var decimalObject = hexesToDecimals(hexObject);\n return formatRgb(decimalObject, a);\n};\n\nmodule.exports = hexToRgba;","/* 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\nimport hexToRgba from 'hex-to-rgba';\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 dimmedOpacity: number;\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 dimmedOpacity,\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\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 opacity = selectedId\r\n ? polygon?.properties?.[mapProperty] === selectedId\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.includes(polygon?.properties?.[mapProperty])\r\n ? 1\r\n : dimmedOpacity\r\n : 1;\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 hexToRgba(color, `${opacity}`);\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 opacity = selectedId\r\n ? polygon?.properties?.[mapProperty] === selectedId\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.includes(polygon?.properties?.[mapProperty])\r\n ? 1\r\n : dimmedOpacity\r\n : 1;\r\n const color = val !== undefined && val !== null ? colorScale(val as any) : mapNoDataColor;\r\n return hexToRgba(color, `${opacity}`);\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. Make sure the the colors are in hex code, any other format can cause issues. */\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 /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: 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 dimmedOpacity = 0.3,\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 dimmedOpacity={dimmedOpacity}\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":["removeHash","hex","parseHex","nakedHex","isShort","twoDigitHexR","twoDigitHexG","twoDigitHexB","twoDigitHexA","hexToDecimal","hexesToDecimals","_ref","r","g","b","a","isNumeric","n","formatRgb","decimalObject","parameterA","parsedA","hexToRgba","hashlessHex","hexObject","build","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","dimmedOpacity","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","opacity","length","val","el","clickedData","isEqual","hoverData","setTimeout","polygons","line","renderOrder","cn","colorLegend","Fragment","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","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","t25","Colors","graphNoData","grays","t26","t27","t28","t29","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","t30","t31","Symbol","for","resizeObserver","ResizeObserver","entries","clientWidth","clientHeight","observe","disconnect","t32","shape","onUpdateShape","useEffectEvent","t33","fetchAndParseJSON","then","features","_temp","t34","t35","getUniqValue","getJenks","_temp2","t36","graphContainer","t37","t38","description","title","GraphHeader","_temp3","filter","_temp4","_temp5","_temp6","_temp7","t39","GraphArea","sequentialColors","max","Spinner","t40","footnote","source","GraphFooter","t41","GraphContainer","d_3","d_2","d_1","d_5","d_4","d_0","geometry","reversed","coordinates","reverse","coord","c","reversed_0","geometry_0"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA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AAK;AAjK/B,SAAA8N,GAAAkB,GAAA;AAAA,SAgK2CrL,MAAMhF;AAAS;AAhK1D,SAAAiP,GAAAqB,GAAA;AAAA,SAgKuBtL,EAAC3D;AAAK;AAhK7B,SAAAoN,GAAA8B,GAAA;AAAA,SA6HiBvL,EAACpF;AAA+B;AA7HjD,SAAAwO,GAAAvG,GAAA;AAiGK,MAAIA,EAAE2I,SAASpR,SAAU,WAAS;AAChC,UAAAqR,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,YAAY/J,QAASkK,CAAAA,MAAA;AAC9B,UAAAC,IAAiB,CAAA,GAAID,IAAI,EAACF,QAAAA;AAC1BC,IAAAA,EAAKnK,KAAM,CAACgK,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;","x_google_ignoreList":[0]}
package/dist/index.d.ts CHANGED
@@ -5372,7 +5372,7 @@ declare interface Props_16 {
5372
5372
  sources?: SourcesDataType[];
5373
5373
  /** Accessibility label */
5374
5374
  ariaLabel?: string;
5375
- /** Colors for the choropleth map */
5375
+ /** Colors for the choropleth map. Make sure the the colors are in hex code, any other format can cause issues. */
5376
5376
  colors?: string[];
5377
5377
  /** Domain of colors for the graph */
5378
5378
  colorDomain?: number[] | string[];
@@ -5438,6 +5438,8 @@ declare interface Props_16 {
5438
5438
  highlightedIds?: string[];
5439
5439
  /** Defines the altitude of the highlighted countries or the countries on mouseover. */
5440
5440
  highlightedAltitude?: number;
5441
+ /** Defines the opacity of the non-highlighted data */
5442
+ dimmedOpacity?: number;
5441
5443
  /** Enable data download option as a csv */
5442
5444
  dataDownload?: boolean;
5443
5445
  /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */
@@ -5985,6 +5987,8 @@ declare interface Props_22 {
5985
5987
  targetStyle?: 'background' | 'line';
5986
5988
  /** Defines the color of the target bar */
5987
5989
  targetColor?: string;
5990
+ /** Defines the thickness if the target is of style line */
5991
+ targetLineThickness?: number;
5988
5992
  /** Defines the width of the measure bar in relation with available width */
5989
5993
  measureBarWidthFactor?: number;
5990
5994
  /** Custom order for labels */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@undp/data-viz",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "browser": "./dist/index.umd.js",
@@ -450,6 +450,7 @@
450
450
  "d3-zoom": "^3.0.0",
451
451
  "date-fns": "^4.1.0",
452
452
  "fast-deep-equal": "^3.1.3",
453
+ "hex-to-rgba": "^2.0.1",
453
454
  "lodash.flattendeep": "^4.4.0",
454
455
  "lodash.intersection": "^4.4.0",
455
456
  "lodash.orderby": "^4.6.0",