@undp/data-viz 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/BiVariateChoroplethMap.cjs +1 -1
  2. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  3. package/dist/BiVariateChoroplethMap.js +275 -272
  4. package/dist/BiVariateChoroplethMap.js.map +1 -1
  5. package/dist/ChoroplethMap.cjs +1 -1
  6. package/dist/ChoroplethMap.cjs.map +1 -1
  7. package/dist/ChoroplethMap.js +321 -318
  8. package/dist/ChoroplethMap.js.map +1 -1
  9. package/dist/DotDensityMap.cjs +1 -1
  10. package/dist/DotDensityMap.cjs.map +1 -1
  11. package/dist/DotDensityMap.js +268 -265
  12. package/dist/DotDensityMap.js.map +1 -1
  13. package/dist/{GraphEl-B7x5ku_y.cjs → GraphEl-BgkDbq50.cjs} +2 -2
  14. package/dist/GraphEl-BgkDbq50.cjs.map +1 -0
  15. package/dist/{GraphEl-B8tGXqWk.js → GraphEl-Ch0uAeZw.js} +2 -1
  16. package/dist/GraphEl-Ch0uAeZw.js.map +1 -0
  17. package/dist/GriddedGraphs.cjs +1 -1
  18. package/dist/GriddedGraphs.d.ts +1 -0
  19. package/dist/GriddedGraphs.js +1 -1
  20. package/dist/GriddedGraphsFromConfig.d.ts +1 -0
  21. package/dist/HybridMap.cjs +1 -1
  22. package/dist/HybridMap.cjs.map +1 -1
  23. package/dist/HybridMap.js +304 -301
  24. package/dist/HybridMap.js.map +1 -1
  25. package/dist/ImageDownloadButton.cjs +1 -1
  26. package/dist/ImageDownloadButton.js +1 -1
  27. package/dist/MultiGraphDashboard.d.ts +1 -0
  28. package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
  29. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
  30. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
  31. package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
  32. package/dist/ScatterPlot.cjs +1 -1
  33. package/dist/ScatterPlot.cjs.map +1 -1
  34. package/dist/ScatterPlot.d.ts +2 -0
  35. package/dist/ScatterPlot.js +451 -449
  36. package/dist/ScatterPlot.js.map +1 -1
  37. package/dist/ScrollStory.d.ts +1 -0
  38. package/dist/SingleGraphDashboard.cjs +1 -1
  39. package/dist/SingleGraphDashboard.d.ts +1 -0
  40. package/dist/SingleGraphDashboard.js +1 -1
  41. package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
  42. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
  43. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
  44. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
  45. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
  46. package/dist/Types.d.ts +1 -0
  47. package/dist/{imageDownload-Diofs_vY.js → imageDownload-BYsNEtMS.js} +11 -11
  48. package/dist/{imageDownload-Diofs_vY.js.map → imageDownload-BYsNEtMS.js.map} +1 -1
  49. package/dist/{imageDownload-61q6jyJW.cjs → imageDownload-CkMwA7Cw.cjs} +4 -4
  50. package/dist/{imageDownload-61q6jyJW.cjs.map → imageDownload-CkMwA7Cw.cjs.map} +1 -1
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.ts +3 -0
  53. package/dist/index.js +1 -1
  54. package/dist/style.css +1 -1
  55. package/dist/utils.cjs +1 -1
  56. package/dist/utils.js +1 -1
  57. package/package.json +1 -1
  58. package/dist/GraphEl-B7x5ku_y.cjs.map +0 -1
  59. package/dist/GraphEl-B8tGXqWk.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n NumberFormatOptions,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n mapData: FeatureCollection;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds?: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n xNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n yNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n xNumberDisplayOptions,\r\n yNumberDisplayOptions,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const pathGenerator = geoPath().projection(projection);\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? !highlightedIds || highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\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 onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\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 className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\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={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n xNumberDisplayOptions?.precision ?? 2,\r\n undefined,\r\n undefined,\r\n xNumberDisplayOptions?.locale || 'en',\r\n xNumberDisplayOptions?.padZeros || false,\r\n )}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n yNumberDisplayOptions?.precision ?? 2,\r\n undefined,\r\n undefined,\r\n yNumberDisplayOptions?.locale || 'en',\r\n yNumberDisplayOptions?.padZeros || false,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n NumberFormatOptions,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\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: BivariateMapDataType[];\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. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\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 mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\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 /** 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 /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Configuration options for controlling number formatting, localization, precision, and zero padding. */\r\n xNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n /** Configuration options for controlling number formatting, localization, precision, and zero padding. */\r\n yNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\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\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\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 xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n xNumberDisplayOptions,\r\n yNumberDisplayOptions,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\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\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(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 onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\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 || graphDownload || 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={graphDownload ? graphParentDiv : 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 {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n xNumberDisplayOptions={xNumberDisplayOptions}\r\n yNumberDisplayOptions={yNumberDisplayOptions}\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":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","xNumberDisplayOptions","yNumberDisplayOptions","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","j","cursor","numberFormattingFunction","precision","locale","padZeros","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","ExpandIcon","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","graphDownload","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","mapOverlay","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","shape_0","onUpdateOverlayMapShape","t38","fetchAndParseJSON","then","d_1","t39","t40","d_2","t41","t42","t43","t44","speed","interval","setInterval","clearInterval","t45","t46","getSliderMarks","markObj","console","error","t47","graphContainer","t48","t49","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t50","Pause","Play","SliderUI","nextValue","nextValue_0","t51","GraphArea","d_8","format","_temp8","getJenks","_temp9","_temp0","Spinner","t52","footnote","source","GraphFooter","t53","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,+BAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,4BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,uBAAAA;AAA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GA7KjB+J;AA6KiB;AA7Td,SAAAN,GAAAQ,GAAA;AAAA,SA8OuBhQ,EAAC6D;AAA+B;AA9OvD,SAAA0L,GAAAU,GAAA;AAAA,SAuOuBjQ,EAAC2D;AAA+B;AAvOvD,SAAA0L,GAAA9L,GAAA;AAAA,SAiOsDA,EAAEpD,YAAiB+P,SAAK;AAAY;AAjO1F,SAAAxB,GAAAyB,GAAA;AAAA,SAiL4BnQ,MAAM9C;AAAS;AAjL3C,SAAAuR,GAAA2B,GAAA;AAAA,SAgL6CpQ,MAAM9C;AAAS;AAhL5D,SAAAsR,GAAA6B,GAAA;AAAA,SAgLyBrQ,EAAC9F;AAAK;AAhL/B,SAAAqU,GAAA+B,GAAA;AAAA,SA+K2CtQ,MAAM9C;AAAS;AA/K1D,SAAAoR,GAAAiC,GAAA;AAAA,SA+KuBvQ,EAAC9F;AAAK;AA/K7B,SAAA6Q,GAAAyF,GAAAC,GAAA;AAAA,SAsEkBD,IAAIC;AAAC;AAtEvB,SAAA5F,GAAA7K,GAAA;AAAA,SAkEgBA,EAACyK;AAAK;"}
1
+ {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { RefObject, useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n NumberFormatOptions,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { ImageDownloadButton } from '@/Components/Actions/ImageDownloadButton';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n mapData: FeatureCollection;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds?: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n xNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n yNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n graphDownload?: RefObject<HTMLDivElement | null>;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n xNumberDisplayOptions,\r\n yNumberDisplayOptions,\r\n graphDownload,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...formattedMapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? formattedMapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds?.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : formattedMapData.features,\r\n });\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const pathGenerator = geoPath().projection(projection);\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = formattedMapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n className='undp-map-shapes'\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? !highlightedIds || highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedIds\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\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 onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\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 className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? formattedMapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n .map((d, i) => (\r\n <path\r\n key={i}\r\n d={pathGenerator(d) || ''}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n ))\r\n : null}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\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={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n xNumberDisplayOptions?.precision ?? 2,\r\n undefined,\r\n undefined,\r\n xNumberDisplayOptions?.locale || 'en',\r\n xNumberDisplayOptions?.padZeros || false,\r\n )}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(\r\n el,\r\n undefined,\r\n yNumberDisplayOptions?.precision ?? 2,\r\n undefined,\r\n undefined,\r\n yNumberDisplayOptions?.locale || 'en',\r\n yNumberDisplayOptions?.padZeros || false,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col undp-viz-zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n {graphDownload && (\r\n <div className='absolute right-4 top-4 flex flex-col image-download-button'>\r\n <ImageDownloadButton nodeID={graphDownload} buttonSmall />\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n NumberFormatOptions,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\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: BivariateMapDataType[];\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. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\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 mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\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 /** 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 /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Configuration options for controlling number formatting, localization, precision, and zero padding. */\r\n xNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n /** Configuration options for controlling number formatting, localization, precision, and zero padding. */\r\n yNumberDisplayOptions?: Omit<NumberFormatOptions, 'suffix' | 'prefix'>;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\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\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\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 xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n xNumberDisplayOptions,\r\n yNumberDisplayOptions,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\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\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(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 onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\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 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 {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n xNumberDisplayOptions={xNumberDisplayOptions}\r\n yNumberDisplayOptions={yNumberDisplayOptions}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\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":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","xNumberDisplayOptions","yNumberDisplayOptions","graphDownload","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","path","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","index","findIndex","el","id","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","pointerEvents","cn","colorLegend","X","j","cursor","numberFormattingFunction","precision","locale","padZeros","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","ExpandIcon","ImageDownloadButton","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","mapOverlay","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t30","t31","t32","enabled","autoplay","showOnlyActiveDate","t33","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t34","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t35","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t36","shape","onUpdateShape","useEffectEvent","t37","shape_0","onUpdateOverlayMapShape","t38","fetchAndParseJSON","then","d_1","t39","t40","d_2","t41","t42","t43","t44","speed","interval","setInterval","clearInterval","t45","t46","getSliderMarks","markObj","console","error","t47","graphContainer","t48","t49","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t50","Pause","Play","SliderUI","nextValue","nextValue_0","t51","GraphArea","d_8","format","_temp8","getJenks","_temp9","_temp0","Spinner","t52","footnote","source","GraphFooter","t53","GraphContainer","d_10","d_9","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,+BAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,4BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,eAAAA;AAAAA,EAAAA,IACEzC,GACE0C,IAAmBC,GAAQ,MAC1BR,IAEES,GAAOz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AzL,GAAAyL,SAAA8J,MAAAA,KAAA9J,EAAA,GAAA,GA7KjB8J;AA6KiB;AA7Td,SAAAN,GAAAQ,GAAA;AAAA,SA6OuBhQ,EAAC6D;AAA+B;AA7OvD,SAAA0L,GAAAU,GAAA;AAAA,SAsOuBjQ,EAAC2D;AAA+B;AAtOvD,SAAA0L,GAAA9L,GAAA;AAAA,SAgOsDA,EAAEpD,YAAiB+P,SAAK;AAAY;AAhO1F,SAAAxB,GAAAyB,GAAA;AAAA,SAgL4BnQ,MAAM9C;AAAS;AAhL3C,SAAAuR,GAAA2B,GAAA;AAAA,SA+K6CpQ,MAAM9C;AAAS;AA/K5D,SAAAsR,GAAA6B,GAAA;AAAA,SA+KyBrQ,EAAC/F;AAAK;AA/K/B,SAAAsU,GAAA+B,GAAA;AAAA,SA8K2CtQ,MAAM9C;AAAS;AA9K1D,SAAAoR,GAAAiC,GAAA;AAAA,SA8KuBvQ,EAAC/F;AAAK;AA9K7B,SAAA8Q,GAAAyF,GAAAC,GAAA;AAAA,SAsEkBD,IAAIC;AAAC;AAtEvB,SAAA5F,GAAA7K,GAAA;AAAA,SAkEgBA,EAACyK;AAAK;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-D4pAp7u0.cjs"),s=require("react"),Dt=require("./getSliderMarks-BzrpHrHS.cjs"),It=require("./Spinner-WHzzloYQ.cjs"),Ct=require("./parse-xYI9yrvL.cjs"),Pt=require("./index-DQA8q5sC.cjs"),w=require("./index-DLFt97gy.cjs"),Rt=require("./Typography-BqmyF1gP.cjs"),zt=require("./index-C5K--w8d.cjs"),_t=require("./numberFormattingFunction-u2iNHL_c.cjs"),Wt=require("./Tooltip-C9F3uYG0.cjs"),At=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),lt=require("./index-BhI7mBJx.cjs"),Ft=require("./DetailsModal-Du8Fr1QD.cjs"),$t=require("./ordinal-CrsysVE-.cjs"),Lt=require("./threshold-DNsSUf8Q.cjs"),Et=require("./select-Bnfk0lJx.cjs"),st=require("./proxy-CqH8m8IQ.cjs"),Tt=require("./use-in-view-dnRv_qqF.cjs"),Gt=require("./index-FXfr51ZM.cjs"),Ht=require("./GraphFooter.cjs"),Vt=require("./GraphHeader.cjs"),it=require("./Colors.cjs"),wt=require("./fetchAndParseData-QTF6tjij.cjs"),Ut=require("./getUniqValue-NX8DgwND.cjs"),Xt=require("./getJenks-BzJvhy_H.cjs"),St=require("./GraphContainer-Cul9b74X.cjs");function Yt(m){const{data:e,colorDomain:n,colors:i,mapData:A,colorLegendTitle:D,categorical:F,height:y,width:h,scale:f,centerPoint:$,tooltip:te,mapBorderWidth:V,mapBorderColor:oe,mapNoDataColor:ye,onSeriesMouseOver:re,showColorScale:ve,zoomScaleExtend:Ie,zoomTranslateExtend:Pe,highlightedIds:j,onSeriesMouseClick:ae,mapProperty:g,resetSelectionOnDoubleClick:je,detailsOnClick:U,styles:ze,classNames:ne,mapProjection:S,zoomInteraction:M,animate:C,dimmedOpacity:N,customLayers:se,collapseColorScaleByDefault:be,zoomAndCenterByHighlightedIds:Ee,projectionRotate:L,rewindCoordinatesInMapData:X,overlayMapData:Y,overlayMapBorderColor:_e,overlayMapBorderWidth:We,numberDisplayOptions:J}=m,b=s.useMemo(()=>X?w.index_default(A,{reverse:!0}):A,[A,X]),ke=s.useMemo(()=>!X||!Y?Y:w.index_default(Y,{reverse:!0}),[Y,X]),[l,d]=s.useState(void 0),ie=s.useRef(null),[Ae,De]=s.useState(be===void 0?!(h<680):!be),[le,T]=s.useState(void 0),[O,Z]=s.useState(void 0),[K,ce]=s.useState(void 0),[Ce,x]=s.useState(void 0),q=s.useRef(null),E=Tt.useInView(q,{once:C.once,amount:C.amount}),Q=s.useRef(null),B=F?$t.ordinal().domain(n).range(i):Lt.threshold().domain(n).range(i);s.useEffect(()=>{const o=Et.select(Q.current),r=Et.select(q.current),v=a=>{if(M==="noZoom")return!1;if(M==="button")return!a.type.includes("wheel");const z=a.type==="wheel",Me=a.type.startsWith("touch"),Ne=a.type==="mousedown"||a.type==="mousemove";return Me?!0:z?M==="scroll"?!0:a.ctrlKey:Ne&&!a.button&&!a.ctrlKey},R=w.zoom().scaleExtent(Ie).translateExtent(Pe||[[-20,-20],[h+20,y+20]]).filter(v).on("zoom",({transform:a})=>{o.attr("transform",a)});r.call(R),ie.current=R},[y,h,M]);const G=w.index_default$1({...b,features:Ee?b.features.filter(o=>(j||[]).length===0||j?.indexOf(o.properties[g])!==-1):b.features}),I=zt.index_default({...b,features:Ee?b.features.filter(o=>(j||[]).length===0||j?.indexOf(o.properties[g])!==-1):b.features}),Re=(G[2]-G[0])*1.15,we=(G[3]-G[1])*1.15,Se=h*190/960*360/Re,de=y*190/678*180/we,P=f*Math.min(Se,de),ue=S==="mercator"?w.geoMercator().rotate(L).center($||I.geometry.coordinates).translate([h/2,y/2]).scale(P):S==="equalEarth"?w.geoEqualEarth().rotate(L).center($||I.geometry.coordinates).translate([h/2,y/2]).scale(P):S==="naturalEarth"?w.geoNaturalEarth1().rotate(L).center($||I.geometry.coordinates).translate([h/2,y/2]).scale(P):S==="orthographic"?w.geoOrthographic().rotate(L).center($||I.geometry.coordinates).translate([h/2,y/2]).scale(P):w.geoAlbersUsa().rotate(L).center($||I.geometry.coordinates).translate([h/2,y/2]).scale(P),H=w.geoPath().projection(ue),pe=o=>{if(!q.current||!ie.current)return;Et.select(q.current).call(ie.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(st.motion.svg,{width:`${h}px`,height:`${y}px`,viewBox:`0 0 ${h} ${y}`,ref:q,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:Q,children:[se.filter(o=>o.position==="before").map(o=>o.layer),b.features.map((o,r)=>{if(!o.properties?.[g])return null;const v=H(o);return v?t.jsxRuntimeExports.jsx(st.motion.g,{opacity:l?N:j?j.indexOf(o.properties[g])!==-1?1:N:1,children:t.jsxRuntimeExports.jsx("path",{d:v,style:{stroke:oe,strokeWidth:V,fill:ye,vectorEffect:"non-scaling-stroke"}})},r):null}),t.jsxRuntimeExports.jsx(Gt.AnimatePresence,{children:e.map(o=>{const r=b.features.findIndex(a=>o.id===a.properties[g]);if(r===-1)return null;const v=H(b.features[r]);if(!v)return null;const R=At.checkIfNullOrUndefined(o.x)?ye:B(o.x);return t.jsxRuntimeExports.jsx(st.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:l?l===R&&(!j||j.indexOf(o.id)!==-1)?1:N:j?j.indexOf(o.id)!==-1?1:N:1,transition:{duration:C.duration}}},initial:"initial",animate:E?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},onMouseEnter:a=>{Z(o),x(a.clientY),ce(a.clientX),re?.(o)},onMouseMove:a=>{Z(o),x(a.clientY),ce(a.clientX)},onMouseLeave:()=>{Z(void 0),ce(void 0),x(void 0),re?.(void 0)},onClick:()=>{(ae||U)&&(Pt.isEqual(le,o)&&je?(T(void 0),ae?.(void 0)):(T(o),ae?.(o)))},children:t.jsxRuntimeExports.jsx(st.motion.path,{d:v,variants:{initial:{fill:R,opacity:0},whileInView:{fill:R,opacity:1,transition:{duration:C.duration}}},initial:"initial",animate:E?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},style:{stroke:oe,strokeWidth:V,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)})}),O?b.features.filter(o=>o.properties[g]===O.id).map((o,r)=>t.jsxRuntimeExports.jsx("path",{d:H(o)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}},r)):null,ke?.features.map((o,r)=>{const v=H(o);return v?t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:v,style:{stroke:_e||oe,strokeWidth:We||V+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},r):null}),se.filter(o=>o.position==="after").map(o=>o.layer)]})}),ve===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",ne?.colorLegend),children:Ae?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{De(!1)},children:t.jsxRuntimeExports.jsx(lt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:F?void 0:"340px"},children:[D&&D!==""?t.jsxRuntimeExports.jsx(Rt._,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:D}):null,F?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,r)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{d(i[r%i.length])},onMouseLeave:()=>{d(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i[r%i.length]}}),t.jsxRuntimeExports.jsx(Rt._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},r))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[n.map((o,r)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{d(i[r])},onMouseLeave:()=>{d(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:r*320/i.length+1,y:1,width:320/i.length-2,height:8,className:l===i[r]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:i[r],...l===i[r]?{}:{stroke:i[r]}}}),t.jsxRuntimeExports.jsx("text",{x:(r+1)*320/i.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:_t.numberFormattingFunction(o,"NA",J?.precision??2,void 0,void 0,J?.locale||"en",J?.padZeros||!1)})]},r)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{d(i[n.length])},onMouseLeave:()=>{d(void 0)},x:n.length*320/i.length+1,y:1,width:320/i.length-2,height:8,className:`cursor-pointer ${l===i[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:i[n.length],...l===i[n.length]?{}:{stroke:i[n.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button",onClick:()=>{De(!0)},children:t.jsxRuntimeExports.jsx(lt.ExpandIcon,{})})}),M==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>pe("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>pe("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),U&&le!==void 0?t.jsxRuntimeExports.jsx(Ft.DetailsModal,{body:U,data:le,setData:T,className:ne?.modal}):null,O&&te&&K&&Ce?t.jsxRuntimeExports.jsx(Wt.Tooltip,{data:O,body:te,xPos:K,yPos:Ce,backgroundStyle:ze?.tooltip,className:ne?.tooltip}):null]})}function Jt(m){const e=t.compilerRuntimeExports.c(134),{data:n,mapData:i,graphTitle:A,colors:D,sources:F,graphDescription:y,height:h,width:f,footNote:$,colorDomain:te,colorLegendTitle:V,scaleType:oe,scale:ye,centerPoint:re,padding:ve,mapBorderWidth:Ie,mapNoDataColor:Pe,backgroundColor:j,mapBorderColor:ae,relativeHeight:g,tooltip:je,onSeriesMouseOver:U,isWorldMap:ze,showColorScale:ne,zoomScaleExtend:S,zoomTranslateExtend:M,graphID:C,highlightedIds:N,onSeriesMouseClick:se,mapProperty:be,graphDownload:Ee,dataDownload:L,showAntarctica:X,language:Y,minHeight:_e,theme:We,ariaLabel:J,resetSelectionOnDoubleClick:b,detailsOnClick:ke,styles:l,classNames:d,mapProjection:ie,zoomInteraction:Ae,animate:De,dimmedOpacity:le,customLayers:T,timeline:O,collapseColorScaleByDefault:Z,projectionRotate:K,zoomAndCenterByHighlightedIds:ce,rewindCoordinatesInMapData:Ce,mapOverlay:x,numberDisplayOptions:q}=m,E=i===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":i,Q=$===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":$,B=oe===void 0?"threshold":oe,G=ye===void 0?.95:ye,I=Ie===void 0?.5:Ie,Re=Pe===void 0?it.Colors.light.graphNoData:Pe,we=j===void 0?!1:j,Se=ae===void 0?it.Colors.light.grays["gray-500"]:ae,de=ze===void 0?!0:ze,P=ne===void 0?!0:ne;let ue;e[0]!==S?(ue=S===void 0?[.8,6]:S,e[0]=S,e[1]=ue):ue=e[1];const H=ue,pe=be===void 0?"ISO3":be,o=Ee===void 0?!1:Ee,r=L===void 0?!1:L,v=X===void 0?!1:X,R=Y===void 0?"en":Y,a=_e===void 0?0:_e,z=We===void 0?"light":We,Me=b===void 0?!0:b,Ne=ie===void 0?"naturalEarth":ie,ct=Ae===void 0?"button":Ae,Fe=De===void 0?!1:De,dt=le===void 0?.3:le;let $e;e[2]!==T?($e=T===void 0?[]:T,e[2]=T,e[3]=$e):$e=e[3];const ut=$e;let Le;e[4]!==O?(Le=O===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:O,e[4]=O,e[5]=Le):Le=e[5];const c=Le;let Te;e[6]!==K?(Te=K===void 0?[0,0]:K,e[6]=K,e[7]=Te):Te=e[7];const pt=Te,mt=ce===void 0?!1:ce,ht=Ce===void 0?!0:Ce,[ee,Mt]=s.useState(0),[Oe,Nt]=s.useState(0),[_,Ot]=s.useState(c.autoplay);let qe;if(e[8]!==n||e[9]!==c.dateFormat){let u;e[11]!==c.dateFormat?(u=k=>Ct.parse(`${k.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[11]=c.dateFormat,e[12]=u):u=e[12],qe=[...new Set(n.filter(no).map(u))],qe.sort(ao),e[8]=n,e[9]=c.dateFormat,e[10]=qe}else qe=e[10];const p=qe,[W,xt]=s.useState(c.autoplay?0:p.length-1),[me,qt]=s.useState(void 0),[ft,Bt]=s.useState(void 0),gt=s.useRef(null),kt=s.useRef(null);let Ge,He;e[13]===Symbol.for("react.memo_cache_sentinel")?(Ge=()=>{const u=new ResizeObserver(k=>{Mt(k[0].target.clientWidth||620),Nt(k[0].target.clientHeight||480)});return gt.current&&u.observe(gt.current),()=>u.disconnect()},He=[],e[13]=Ge,e[14]=He):(Ge=e[13],He=e[14]),s.useEffect(Ge,He);let Ve;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ve=u=>{qt(u)},e[15]=Ve):Ve=e[15];const Ue=s.useEffectEvent(Ve);let Xe;e[16]===Symbol.for("react.memo_cache_sentinel")?(Xe=u=>{Bt(u)},e[16]=Xe):Xe=e[16];const Be=s.useEffectEvent(Xe);let Ye;e[17]!==E||e[18]!==Ue?(Ye=()=>{typeof E=="string"?wt.fetchAndParseJSON(E).then(k=>{Ue(k)}):Ue(E)},e[17]=E,e[18]=Ue,e[19]=Ye):Ye=e[19];let Je;e[20]!==E?(Je=[E],e[20]=E,e[21]=Je):Je=e[21],s.useEffect(Ye,Je);let Ze;e[22]!==x?.mapData||e[23]!==Be?(Ze=()=>{x?.mapData||Be(void 0),typeof x?.mapData=="string"?wt.fetchAndParseJSON(x?.mapData).then(k=>{Be(k)}):Be(x?.mapData)},e[22]=x?.mapData,e[23]=Be,e[24]=Ze):Ze=e[24];const yt=x?.mapData;let Ke;e[25]!==yt?(Ke=[yt],e[25]=yt,e[26]=Ke):Ke=e[26],s.useEffect(Ze,Ke);let Qe;e[27]!==te||e[28]!==D?.length||e[29]!==n||e[30]!==B?(Qe=te||(B==="categorical"?Ut.getUniqValue(n,"x"):Xt.getJenks(n.map(ro),D?.length||4)),e[27]=te,e[28]=D?.length,e[29]=n,e[30]=B,e[31]=Qe):Qe=e[31];const et=Qe;let tt,ot;e[32]!==_||e[33]!==c.speed||e[34]!==p?(tt=()=>{const u=setInterval(()=>{xt(k=>k<p.length-1?k+1:0)},(c.speed||2)*1e3);return _||clearInterval(u),()=>clearInterval(u)},ot=[p,_,c.speed],e[32]=_,e[33]=c.speed,e[34]=p,e[35]=tt,e[36]=ot):(tt=e[35],ot=e[36]),s.useEffect(tt,ot);const vt=c.dateFormat||"yyyy";let rt;e[37]!==W||e[38]!==vt||e[39]!==c.showOnlyActiveDate||e[40]!==p?(rt=Dt.getSliderMarks(p,W,c.showOnlyActiveDate,vt),e[37]=W,e[38]=vt,e[39]=c.showOnlyActiveDate,e[40]=p,e[41]=rt):rt=e[41];const at=rt,jt=d?.graphContainer,bt=l?.graphContainer;let he;e[42]!==d?.description||e[43]!==d?.title||e[44]!==n||e[45]!==r||e[46]!==y||e[47]!==o||e[48]!==A||e[49]!==l?.description||e[50]!==l?.title||e[51]!==f?(he=A||y||o||r?t.jsxRuntimeExports.jsx(Vt.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:d?.title,description:d?.description},graphTitle:A,graphDescription:y,width:f,graphDownload:o?kt:void 0,dataDownload:r?n.map(oo).filter(to).length>0?n.map(eo).filter(Qt):n.filter(Kt):null}):null,e[42]=d?.description,e[43]=d?.title,e[44]=n,e[45]=r,e[46]=y,e[47]=o,e[48]=A,e[49]=l?.description,e[50]=l?.title,e[51]=f,e[52]=he):he=e[52];let xe;e[53]!==W||e[54]!==at||e[55]!==_||e[56]!==c.enabled||e[57]!==p?(xe=c.enabled&&p.length>0&&at?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ot(!_)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":_?"Click to pause animation":"Click to play animation",children:_?t.jsxRuntimeExports.jsx(lt.Pause,{}):t.jsxRuntimeExports.jsx(lt.Play,{})}),t.jsxRuntimeExports.jsx(Dt.Nr,{min:p[0],max:p[p.length-1],marks:at,step:null,defaultValue:p[p.length-1],value:p[W],onChangeComplete:u=>{xt(p.indexOf(u))},onChange:u=>{xt(p.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[53]=W,e[54]=at,e[55]=_,e[56]=c.enabled,e[57]=p,e[58]=xe):xe=e[58];let fe;e[59]!==Fe||e[60]!==re||e[61]!==d||e[62]!==Z||e[63]!==V||e[64]!==D||e[65]!==ut||e[66]!==n||e[67]!==ke||e[68]!==dt||e[69]!==et||e[70]!==h||e[71]!==N||e[72]!==W||e[73]!==de||e[74]!==Se||e[75]!==I||e[76]!==Re||e[77]!==x?.mapBorderColor||e[78]!==x?.mapBorderWidth||e[79]!==Ne||e[80]!==pe||e[81]!==me||e[82]!==a||e[83]!==q||e[84]!==se||e[85]!==U||e[86]!==ft||e[87]!==pt||e[88]!==g||e[89]!==Me||e[90]!==ht||e[91]!==G||e[92]!==B||e[93]!==v||e[94]!==P||e[95]!==l||e[96]!==Oe||e[97]!==ee||e[98]!==z||e[99]!==c.dateFormat||e[100]!==c.enabled||e[101]!==je||e[102]!==p||e[103]!==f||e[104]!==mt||e[105]!==ct||e[106]!==H||e[107]!==M?(fe=t.jsxRuntimeExports.jsx(St.GraphArea,{ref:gt,children:ee&&Oe&&me?t.jsxRuntimeExports.jsx(Yt,{data:n.filter(u=>c.enabled?`${u.date}`===Ct.format(new Date(p[W]),c.dateFormat||"yyyy"):u),mapData:v?me:{...me,features:me.features.filter(Zt)},colorDomain:et,width:ee,height:Oe,scale:G,centerPoint:re,colors:D||(B==="categorical"?it.Colors[z].categoricalColors.colors:it.Colors[z].sequentialColors[`neutralColorsx0${et.length+1}`]),colorLegendTitle:V,mapBorderWidth:I,mapNoDataColor:Re,categorical:B==="categorical",mapBorderColor:Se,tooltip:je,onSeriesMouseOver:U,isWorldMap:de,showColorScale:P,zoomScaleExtend:H,zoomTranslateExtend:M,onSeriesMouseClick:se,mapProperty:pe,highlightedIds:N,resetSelectionOnDoubleClick:Me,styles:l,overlayMapData:ft,overlayMapBorderColor:x?.mapBorderColor,overlayMapBorderWidth:x?.mapBorderWidth,classNames:d,detailsOnClick:ke,mapProjection:Ne||(de?"naturalEarth":"mercator"),zoomInteraction:ct,dimmedOpacity:dt,animate:Fe===!0?{duration:.5,once:!0,amount:.5}:Fe||{duration:0,once:!0,amount:0},customLayers:ut,zoomAndCenterByHighlightedIds:mt,collapseColorScaleByDefault:Z,projectionRotate:pt,rewindCoordinatesInMapData:ht,numberDisplayOptions:q}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(a,h||(g?a?(f||ee)*g>a?(f||ee)*g:a:(f||ee)*g:Oe))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(It.w,{"aria-label":"Loading graph"})})}),e[59]=Fe,e[60]=re,e[61]=d,e[62]=Z,e[63]=V,e[64]=D,e[65]=ut,e[66]=n,e[67]=ke,e[68]=dt,e[69]=et,e[70]=h,e[71]=N,e[72]=W,e[73]=de,e[74]=Se,e[75]=I,e[76]=Re,e[77]=x?.mapBorderColor,e[78]=x?.mapBorderWidth,e[79]=Ne,e[80]=pe,e[81]=me,e[82]=a,e[83]=q,e[84]=se,e[85]=U,e[86]=ft,e[87]=pt,e[88]=g,e[89]=Me,e[90]=ht,e[91]=G,e[92]=B,e[93]=v,e[94]=P,e[95]=l,e[96]=Oe,e[97]=ee,e[98]=z,e[99]=c.dateFormat,e[100]=c.enabled,e[101]=je,e[102]=p,e[103]=f,e[104]=mt,e[105]=ct,e[106]=H,e[107]=M,e[108]=fe):fe=e[108];let ge;e[109]!==d?.footnote||e[110]!==d?.source||e[111]!==Q||e[112]!==F||e[113]!==l?.footnote||e[114]!==l?.source||e[115]!==f?(ge=F||Q?t.jsxRuntimeExports.jsx(Ht.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:F,footNote:Q,width:f}):null,e[109]=d?.footnote,e[110]=d?.source,e[111]=Q,e[112]=F,e[113]=l?.footnote,e[114]=l?.source,e[115]=f,e[116]=ge):ge=e[116];let nt;return e[117]!==J||e[118]!==we||e[119]!==C||e[120]!==h||e[121]!==R||e[122]!==a||e[123]!==ve||e[124]!==g||e[125]!==jt||e[126]!==bt||e[127]!==he||e[128]!==xe||e[129]!==fe||e[130]!==ge||e[131]!==z||e[132]!==f?(nt=t.jsxRuntimeExports.jsxs(St.GraphContainer,{className:jt,style:bt,id:C,ref:kt,"aria-label":J,backgroundColor:we,theme:z,language:R,minHeight:a,width:f,height:h,relativeHeight:g,padding:ve,children:[he,xe,fe,ge]}),e[117]=J,e[118]=we,e[119]=C,e[120]=h,e[121]=R,e[122]=a,e[123]=ve,e[124]=g,e[125]=jt,e[126]=bt,e[127]=he,e[128]=xe,e[129]=fe,e[130]=ge,e[131]=z,e[132]=f,e[133]=nt):nt=e[133],nt}function Zt(m){return m.properties?.NAME!=="Antarctica"}function Kt(m){return m!==void 0}function Qt(m){return m!==void 0}function eo(m){return m.data}function to(m){return m!==void 0}function oo(m){return m.data}function ro(m){return m.x}function ao(m,e){return m-e}function no(m){return m.date}exports.ChoroplethMap=Jt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-D4pAp7u0.cjs"),s=require("react"),kt=require("./getSliderMarks-BzrpHrHS.cjs"),Bt=require("./Spinner-WHzzloYQ.cjs"),wt=require("./parse-xYI9yrvL.cjs"),Pt=require("./index-DQA8q5sC.cjs"),M=require("./index-DLFt97gy.cjs"),Ct=require("./Typography-BqmyF1gP.cjs"),zt=require("./index-C5K--w8d.cjs"),_t=require("./numberFormattingFunction-u2iNHL_c.cjs"),Wt=require("./Tooltip-C9F3uYG0.cjs"),At=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ct=require("./index-BhI7mBJx.cjs"),Ft=require("./DetailsModal-Du8Fr1QD.cjs"),$t=require("./ImageDownloadButton.cjs"),Lt=require("./ordinal-CrsysVE-.cjs"),Tt=require("./threshold-DNsSUf8Q.cjs"),Dt=require("./select-Bnfk0lJx.cjs"),it=require("./proxy-CqH8m8IQ.cjs"),Gt=require("./use-in-view-dnRv_qqF.cjs"),Ht=require("./index-FXfr51ZM.cjs"),Vt=require("./GraphFooter.cjs"),Ut=require("./GraphHeader.cjs"),lt=require("./Colors.cjs"),Rt=require("./fetchAndParseData-QTF6tjij.cjs"),Xt=require("./getUniqValue-NX8DgwND.cjs"),Yt=require("./getJenks-BzJvhy_H.cjs"),St=require("./GraphContainer-Cul9b74X.cjs");function Jt(p){const{data:e,colorDomain:a,colors:i,mapData:W,colorLegendTitle:w,categorical:A,height:v,width:m,scale:x,centerPoint:F,tooltip:oe,mapBorderWidth:X,mapBorderColor:re,mapNoDataColor:ge,onSeriesMouseOver:ae,showColorScale:fe,zoomScaleExtend:Pe,zoomTranslateExtend:ze,highlightedIds:D,onSeriesMouseClick:ne,mapProperty:g,resetSelectionOnDoubleClick:ye,detailsOnClick:Y,styles:_e,classNames:se,mapProjection:N,zoomInteraction:O,animate:C,dimmedOpacity:q,customLayers:ie,collapseColorScaleByDefault:ve,zoomAndCenterByHighlightedIds:je,projectionRotate:$,rewindCoordinatesInMapData:J,overlayMapData:Z,overlayMapBorderColor:We,overlayMapBorderWidth:Ae,numberDisplayOptions:K,graphDownload:be}=p,j=s.useMemo(()=>J?M.index_default(W,{reverse:!0}):W,[W,J]),h=s.useMemo(()=>!J||!Z?Z:M.index_default(Z,{reverse:!0}),[Z,J]),[l,I]=s.useState(void 0),le=s.useRef(null),[Fe,Ee]=s.useState(ve===void 0?!(m<680):!ve),[L,T]=s.useState(void 0),[G,H]=s.useState(void 0),[De,ce]=s.useState(void 0),[f,Q]=s.useState(void 0),b=s.useRef(null),ee=Gt.useInView(b,{once:C.once,amount:C.amount}),R=s.useRef(null),ke=A?Lt.ordinal().domain(a).range(i):Tt.threshold().domain(a).range(i);s.useEffect(()=>{const o=Dt.select(R.current),r=Dt.select(b.current),E=n=>{if(O==="noZoom")return!1;if(O==="button")return!n.type.includes("wheel");const Me=n.type==="wheel",Ne=n.type.startsWith("touch"),Oe=n.type==="mousedown"||n.type==="mousemove";return Ne?!0:Me?O==="scroll"?!0:n.ctrlKey:Oe&&!n.button&&!n.ctrlKey},y=M.zoom().scaleExtent(Pe).translateExtent(ze||[[-20,-20],[m+20,v+20]]).filter(E).on("zoom",({transform:n})=>{o.attr("transform",n)});r.call(y),le.current=y},[v,m,O]);const V=M.index_default$1({...j,features:je?j.features.filter(o=>(D||[]).length===0||D?.indexOf(o.properties[g])!==-1):j.features}),B=zt.index_default({...j,features:je?j.features.filter(o=>(D||[]).length===0||D?.indexOf(o.properties[g])!==-1):j.features}),we=(V[2]-V[0])*1.15,Ce=(V[3]-V[1])*1.15,de=m*190/960*360/we,Re=v*190/678*180/Ce,S=x*Math.min(de,Re),Se=N==="mercator"?M.geoMercator().rotate($).center(F||B.geometry.coordinates).translate([m/2,v/2]).scale(S):N==="equalEarth"?M.geoEqualEarth().rotate($).center(F||B.geometry.coordinates).translate([m/2,v/2]).scale(S):N==="naturalEarth"?M.geoNaturalEarth1().rotate($).center(F||B.geometry.coordinates).translate([m/2,v/2]).scale(S):N==="orthographic"?M.geoOrthographic().rotate($).center(F||B.geometry.coordinates).translate([m/2,v/2]).scale(S):M.geoAlbersUsa().rotate($).center(F||B.geometry.coordinates).translate([m/2,v/2]).scale(S),U=M.geoPath().projection(Se),P=o=>{if(!b.current||!le.current)return;Dt.select(b.current).call(le.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(it.motion.svg,{width:`${m}px`,height:`${v}px`,viewBox:`0 0 ${m} ${v}`,ref:b,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:R,children:[ie.filter(o=>o.position==="before").map(o=>o.layer),j.features.map((o,r)=>{if(!o.properties?.[g])return null;const E=U(o);return E?t.jsxRuntimeExports.jsx(it.motion.g,{opacity:l?q:D?D.indexOf(o.properties[g])!==-1?1:q:1,children:t.jsxRuntimeExports.jsx("path",{d:E,style:{stroke:re,strokeWidth:X,fill:ge,vectorEffect:"non-scaling-stroke"}})},r):null}),t.jsxRuntimeExports.jsx(Ht.AnimatePresence,{children:e.map(o=>{const r=j.features.findIndex(n=>o.id===n.properties[g]);if(r===-1)return null;const E=U(j.features[r]);if(!E)return null;const y=At.checkIfNullOrUndefined(o.x)?ge:ke(o.x);return t.jsxRuntimeExports.jsx(it.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:l?l===y&&(!D||D.indexOf(o.id)!==-1)?1:q:D?D.indexOf(o.id)!==-1?1:q:1,transition:{duration:C.duration}}},initial:"initial",animate:ee?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},onMouseEnter:n=>{H(o),Q(n.clientY),ce(n.clientX),ae?.(o)},onMouseMove:n=>{H(o),Q(n.clientY),ce(n.clientX)},onMouseLeave:()=>{H(void 0),ce(void 0),Q(void 0),ae?.(void 0)},onClick:()=>{(ne||Y)&&(Pt.isEqual(L,o)&&ye?(T(void 0),ne?.(void 0)):(T(o),ne?.(o)))},children:t.jsxRuntimeExports.jsx(it.motion.path,{d:E,variants:{initial:{fill:y,opacity:0},whileInView:{fill:y,opacity:1,transition:{duration:C.duration}}},initial:"initial",animate:ee?"whileInView":"initial",exit:{opacity:0,transition:{duration:C.duration}},style:{stroke:re,strokeWidth:X,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)})}),G?j.features.filter(o=>o.properties[g]===G.id).map((o,r)=>t.jsxRuntimeExports.jsx("path",{d:U(o)||"",className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5",vectorEffect:"non-scaling-stroke"}},r)):null,h?.features.map((o,r)=>{const E=U(o);return E?t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:E,style:{stroke:We||re,strokeWidth:Ae||X+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},r):null}),ie.filter(o=>o.position==="after").map(o=>o.layer)]})}),fe===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",se?.colorLegend),children:Fe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Ee(!1)},children:t.jsxRuntimeExports.jsx(ct.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:A?void 0:"340px"},children:[w&&w!==""?t.jsxRuntimeExports.jsx(Ct._,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:w}):null,A?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:a.map((o,r)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{I(i[r%i.length])},onMouseLeave:()=>{I(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i[r%i.length]}}),t.jsxRuntimeExports.jsx(Ct._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},r))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[a.map((o,r)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{I(i[r])},onMouseLeave:()=>{I(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:r*320/i.length+1,y:1,width:320/i.length-2,height:8,className:l===i[r]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:i[r],...l===i[r]?{}:{stroke:i[r]}}}),t.jsxRuntimeExports.jsx("text",{x:(r+1)*320/i.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:_t.numberFormattingFunction(o,"NA",K?.precision??2,void 0,void 0,K?.locale||"en",K?.padZeros||!1)})]},r)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{I(i[a.length])},onMouseLeave:()=>{I(void 0)},x:a.length*320/i.length+1,y:1,width:320/i.length-2,height:8,className:`cursor-pointer ${l===i[a.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:i[a.length],...l===i[a.length]?{}:{stroke:i[a.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button",onClick:()=>{Ee(!0)},children:t.jsxRuntimeExports.jsx(ct.ExpandIcon,{})})}),O==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col undp-viz-zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>P("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>P("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]}),be&&t.jsxRuntimeExports.jsx("div",{className:"absolute right-4 top-4 flex flex-col image-download-button",children:t.jsxRuntimeExports.jsx($t.ImageDownloadButton,{nodeID:be,buttonSmall:!0})})]}),Y&&L!==void 0?t.jsxRuntimeExports.jsx(Ft.DetailsModal,{body:Y,data:L,setData:T,className:se?.modal}):null,G&&oe&&De&&f?t.jsxRuntimeExports.jsx(Wt.Tooltip,{data:G,body:oe,xPos:De,yPos:f,backgroundStyle:_e?.tooltip,className:se?.tooltip}):null]})}function Zt(p){const e=t.compilerRuntimeExports.c(135),{data:a,mapData:i,graphTitle:W,colors:w,sources:A,graphDescription:v,height:m,width:x,footNote:F,colorDomain:oe,colorLegendTitle:X,scaleType:re,scale:ge,centerPoint:ae,padding:fe,mapBorderWidth:Pe,mapNoDataColor:ze,backgroundColor:D,mapBorderColor:ne,relativeHeight:g,tooltip:ye,onSeriesMouseOver:Y,isWorldMap:_e,showColorScale:se,zoomScaleExtend:N,zoomTranslateExtend:O,graphID:C,highlightedIds:q,onSeriesMouseClick:ie,mapProperty:ve,graphDownload:je,dataDownload:$,showAntarctica:J,language:Z,minHeight:We,theme:Ae,ariaLabel:K,resetSelectionOnDoubleClick:be,detailsOnClick:j,styles:h,classNames:l,mapProjection:I,zoomInteraction:le,animate:Fe,dimmedOpacity:Ee,customLayers:L,timeline:T,collapseColorScaleByDefault:G,projectionRotate:H,zoomAndCenterByHighlightedIds:De,rewindCoordinatesInMapData:ce,mapOverlay:f,numberDisplayOptions:Q}=p,b=i===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":i,ee=F===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":F,R=re===void 0?"threshold":re,ke=ge===void 0?.95:ge,V=Pe===void 0?.5:Pe,B=ze===void 0?lt.Colors.light.graphNoData:ze,we=D===void 0?!1:D,Ce=ne===void 0?lt.Colors.light.grays["gray-500"]:ne,de=_e===void 0?!0:_e,Re=se===void 0?!0:se;let S;e[0]!==N?(S=N===void 0?[.8,6]:N,e[0]=N,e[1]=S):S=e[1];const Se=S,U=ve===void 0?"ISO3":ve,P=je===void 0?!1:je,o=$===void 0?!1:$,r=J===void 0?!1:J,E=Z===void 0?"en":Z,y=We===void 0?0:We,n=Ae===void 0?"light":Ae,Me=be===void 0?!0:be,Ne=I===void 0?"naturalEarth":I,Oe=le===void 0?"button":le,$e=Fe===void 0?!1:Fe,dt=Ee===void 0?.3:Ee;let Le;e[2]!==L?(Le=L===void 0?[]:L,e[2]=L,e[3]=Le):Le=e[3];const ut=Le;let Te;e[4]!==T?(Te=T===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:T,e[4]=T,e[5]=Te):Te=e[5];const c=Te;let Ge;e[6]!==H?(Ge=H===void 0?[0,0]:H,e[6]=H,e[7]=Ge):Ge=e[7];const pt=Ge,mt=De===void 0?!1:De,ht=ce===void 0?!0:ce,[te,Mt]=s.useState(0),[qe,Nt]=s.useState(0),[z,Ot]=s.useState(c.autoplay);let Ie;if(e[8]!==a||e[9]!==c.dateFormat){let d;e[11]!==c.dateFormat?(d=k=>wt.parse(`${k.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[11]=c.dateFormat,e[12]=d):d=e[12],Ie=[...new Set(a.filter(so).map(d))],Ie.sort(no),e[8]=a,e[9]=c.dateFormat,e[10]=Ie}else Ie=e[10];const u=Ie,[_,xt]=s.useState(c.autoplay?0:u.length-1),[ue,qt]=s.useState(void 0),[gt,It]=s.useState(void 0),ft=s.useRef(null),yt=s.useRef(null);let He,Ve;e[13]===Symbol.for("react.memo_cache_sentinel")?(He=()=>{const d=new ResizeObserver(k=>{Mt(k[0].target.clientWidth||620),Nt(k[0].target.clientHeight||480)});return ft.current&&d.observe(ft.current),()=>d.disconnect()},Ve=[],e[13]=He,e[14]=Ve):(He=e[13],Ve=e[14]),s.useEffect(He,Ve);let Ue;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ue=d=>{qt(d)},e[15]=Ue):Ue=e[15];const Xe=s.useEffectEvent(Ue);let Ye;e[16]===Symbol.for("react.memo_cache_sentinel")?(Ye=d=>{It(d)},e[16]=Ye):Ye=e[16];const Be=s.useEffectEvent(Ye);let Je;e[17]!==b||e[18]!==Xe?(Je=()=>{typeof b=="string"?Rt.fetchAndParseJSON(b).then(k=>{Xe(k)}):Xe(b)},e[17]=b,e[18]=Xe,e[19]=Je):Je=e[19];let Ze;e[20]!==b?(Ze=[b],e[20]=b,e[21]=Ze):Ze=e[21],s.useEffect(Je,Ze);let Ke;e[22]!==f?.mapData||e[23]!==Be?(Ke=()=>{f?.mapData||Be(void 0),typeof f?.mapData=="string"?Rt.fetchAndParseJSON(f?.mapData).then(k=>{Be(k)}):Be(f?.mapData)},e[22]=f?.mapData,e[23]=Be,e[24]=Ke):Ke=e[24];const vt=f?.mapData;let Qe;e[25]!==vt?(Qe=[vt],e[25]=vt,e[26]=Qe):Qe=e[26],s.useEffect(Ke,Qe);let et;e[27]!==oe||e[28]!==w?.length||e[29]!==a||e[30]!==R?(et=oe||(R==="categorical"?Xt.getUniqValue(a,"x"):Yt.getJenks(a.map(ao),w?.length||4)),e[27]=oe,e[28]=w?.length,e[29]=a,e[30]=R,e[31]=et):et=e[31];const tt=et;let ot,rt;e[32]!==z||e[33]!==c.speed||e[34]!==u?(ot=()=>{const d=setInterval(()=>{xt(k=>k<u.length-1?k+1:0)},(c.speed||2)*1e3);return z||clearInterval(d),()=>clearInterval(d)},rt=[u,z,c.speed],e[32]=z,e[33]=c.speed,e[34]=u,e[35]=ot,e[36]=rt):(ot=e[35],rt=e[36]),s.useEffect(ot,rt);const jt=c.dateFormat||"yyyy";let at;e[37]!==_||e[38]!==jt||e[39]!==c.showOnlyActiveDate||e[40]!==u?(at=kt.getSliderMarks(u,_,c.showOnlyActiveDate,jt),e[37]=_,e[38]=jt,e[39]=c.showOnlyActiveDate,e[40]=u,e[41]=at):at=e[41];const nt=at,bt=l?.graphContainer,Et=h?.graphContainer;let pe;e[42]!==l?.description||e[43]!==l?.title||e[44]!==a||e[45]!==o||e[46]!==v||e[47]!==P||e[48]!==W||e[49]!==h?.description||e[50]!==h?.title||e[51]!==x?(pe=W||v||o?t.jsxRuntimeExports.jsx(Ut.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:l?.title,description:l?.description},graphTitle:W,graphDescription:v,width:x,graphDownload:P?yt:void 0,dataDownload:o?a.map(ro).filter(oo).length>0?a.map(to).filter(eo):a.filter(Qt):null}):null,e[42]=l?.description,e[43]=l?.title,e[44]=a,e[45]=o,e[46]=v,e[47]=P,e[48]=W,e[49]=h?.description,e[50]=h?.title,e[51]=x,e[52]=pe):pe=e[52];let me;e[53]!==_||e[54]!==nt||e[55]!==z||e[56]!==c.enabled||e[57]!==u?(me=c.enabled&&u.length>0&&nt?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ot(!z)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":z?"Click to pause animation":"Click to play animation",children:z?t.jsxRuntimeExports.jsx(ct.Pause,{}):t.jsxRuntimeExports.jsx(ct.Play,{})}),t.jsxRuntimeExports.jsx(kt.Nr,{min:u[0],max:u[u.length-1],marks:nt,step:null,defaultValue:u[u.length-1],value:u[_],onChangeComplete:d=>{xt(u.indexOf(d))},onChange:d=>{xt(u.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[53]=_,e[54]=nt,e[55]=z,e[56]=c.enabled,e[57]=u,e[58]=me):me=e[58];let he;e[59]!==$e||e[60]!==ae||e[61]!==l||e[62]!==G||e[63]!==X||e[64]!==w||e[65]!==ut||e[66]!==a||e[67]!==j||e[68]!==dt||e[69]!==tt||e[70]!==P||e[71]!==m||e[72]!==q||e[73]!==_||e[74]!==de||e[75]!==Ce||e[76]!==V||e[77]!==B||e[78]!==f?.mapBorderColor||e[79]!==f?.mapBorderWidth||e[80]!==Ne||e[81]!==U||e[82]!==ue||e[83]!==y||e[84]!==Q||e[85]!==ie||e[86]!==Y||e[87]!==gt||e[88]!==pt||e[89]!==g||e[90]!==Me||e[91]!==ht||e[92]!==ke||e[93]!==R||e[94]!==r||e[95]!==Re||e[96]!==h||e[97]!==qe||e[98]!==te||e[99]!==n||e[100]!==c.dateFormat||e[101]!==c.enabled||e[102]!==ye||e[103]!==u||e[104]!==x||e[105]!==mt||e[106]!==Oe||e[107]!==Se||e[108]!==O?(he=t.jsxRuntimeExports.jsx(St.GraphArea,{ref:ft,children:te&&qe&&ue?t.jsxRuntimeExports.jsx(Jt,{data:a.filter(d=>c.enabled?`${d.date}`===wt.format(new Date(u[_]),c.dateFormat||"yyyy"):d),mapData:r?ue:{...ue,features:ue.features.filter(Kt)},colorDomain:tt,width:te,height:qe,scale:ke,centerPoint:ae,colors:w||(R==="categorical"?lt.Colors[n].categoricalColors.colors:lt.Colors[n].sequentialColors[`neutralColorsx0${tt.length+1}`]),colorLegendTitle:X,mapBorderWidth:V,mapNoDataColor:B,categorical:R==="categorical",mapBorderColor:Ce,tooltip:ye,onSeriesMouseOver:Y,isWorldMap:de,showColorScale:Re,zoomScaleExtend:Se,zoomTranslateExtend:O,onSeriesMouseClick:ie,mapProperty:U,highlightedIds:q,resetSelectionOnDoubleClick:Me,styles:h,overlayMapData:gt,overlayMapBorderColor:f?.mapBorderColor,overlayMapBorderWidth:f?.mapBorderWidth,classNames:l,detailsOnClick:j,mapProjection:Ne||(de?"naturalEarth":"mercator"),zoomInteraction:Oe,dimmedOpacity:dt,animate:$e===!0?{duration:.5,once:!0,amount:.5}:$e||{duration:0,once:!0,amount:0},customLayers:ut,zoomAndCenterByHighlightedIds:mt,collapseColorScaleByDefault:G,projectionRotate:pt,rewindCoordinatesInMapData:ht,numberDisplayOptions:Q,graphDownload:P?yt:void 0}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(y,m||(g?y?(x||te)*g>y?(x||te)*g:y:(x||te)*g:qe))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Bt.w,{"aria-label":"Loading graph"})})}),e[59]=$e,e[60]=ae,e[61]=l,e[62]=G,e[63]=X,e[64]=w,e[65]=ut,e[66]=a,e[67]=j,e[68]=dt,e[69]=tt,e[70]=P,e[71]=m,e[72]=q,e[73]=_,e[74]=de,e[75]=Ce,e[76]=V,e[77]=B,e[78]=f?.mapBorderColor,e[79]=f?.mapBorderWidth,e[80]=Ne,e[81]=U,e[82]=ue,e[83]=y,e[84]=Q,e[85]=ie,e[86]=Y,e[87]=gt,e[88]=pt,e[89]=g,e[90]=Me,e[91]=ht,e[92]=ke,e[93]=R,e[94]=r,e[95]=Re,e[96]=h,e[97]=qe,e[98]=te,e[99]=n,e[100]=c.dateFormat,e[101]=c.enabled,e[102]=ye,e[103]=u,e[104]=x,e[105]=mt,e[106]=Oe,e[107]=Se,e[108]=O,e[109]=he):he=e[109];let xe;e[110]!==l?.footnote||e[111]!==l?.source||e[112]!==ee||e[113]!==A||e[114]!==h?.footnote||e[115]!==h?.source||e[116]!==x?(xe=A||ee?t.jsxRuntimeExports.jsx(Vt.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:A,footNote:ee,width:x}):null,e[110]=l?.footnote,e[111]=l?.source,e[112]=ee,e[113]=A,e[114]=h?.footnote,e[115]=h?.source,e[116]=x,e[117]=xe):xe=e[117];let st;return e[118]!==K||e[119]!==we||e[120]!==C||e[121]!==m||e[122]!==E||e[123]!==y||e[124]!==fe||e[125]!==g||e[126]!==bt||e[127]!==Et||e[128]!==pe||e[129]!==me||e[130]!==he||e[131]!==xe||e[132]!==n||e[133]!==x?(st=t.jsxRuntimeExports.jsxs(St.GraphContainer,{className:bt,style:Et,id:C,ref:yt,"aria-label":K,backgroundColor:we,theme:n,language:E,minHeight:y,width:x,height:m,relativeHeight:g,padding:fe,children:[pe,me,he,xe]}),e[118]=K,e[119]=we,e[120]=C,e[121]=m,e[122]=E,e[123]=y,e[124]=fe,e[125]=g,e[126]=bt,e[127]=Et,e[128]=pe,e[129]=me,e[130]=he,e[131]=xe,e[132]=n,e[133]=x,e[134]=st):st=e[134],st}function Kt(p){return p.properties?.NAME!=="Antarctica"}function Qt(p){return p!==void 0}function eo(p){return p!==void 0}function to(p){return p.data}function oo(p){return p!==void 0}function ro(p){return p.data}function ao(p){return p.x}function no(p,e){return p-e}function so(p){return p.date}exports.ChoroplethMap=Zt;
2
2
  //# sourceMappingURL=ChoroplethMap.cjs.map