@undp/data-viz 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/BiVariateChoroplethMap.cjs +1 -1
  2. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  3. package/dist/BiVariateChoroplethMap.js +297 -289
  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 +307 -299
  8. package/dist/ChoroplethMap.js.map +1 -1
  9. package/dist/CopyTextButton.cjs +1 -1
  10. package/dist/CopyTextButton.cjs.map +1 -1
  11. package/dist/CopyTextButton.js +281 -279
  12. package/dist/CopyTextButton.js.map +1 -1
  13. package/dist/CsvDownloadButton.cjs +4 -4
  14. package/dist/CsvDownloadButton.cjs.map +1 -1
  15. package/dist/CsvDownloadButton.js +268 -266
  16. package/dist/CsvDownloadButton.js.map +1 -1
  17. package/dist/DotDensityMap.cjs +1 -1
  18. package/dist/DotDensityMap.cjs.map +1 -1
  19. package/dist/DotDensityMap.js +277 -269
  20. package/dist/DotDensityMap.js.map +1 -1
  21. package/dist/ExcelDownloadButton.cjs +1 -1
  22. package/dist/ExcelDownloadButton.cjs.map +1 -1
  23. package/dist/ExcelDownloadButton.js +21 -19
  24. package/dist/ExcelDownloadButton.js.map +1 -1
  25. package/dist/HybridMap.cjs +1 -1
  26. package/dist/HybridMap.cjs.map +1 -1
  27. package/dist/HybridMap.js +299 -291
  28. package/dist/HybridMap.js.map +1 -1
  29. package/dist/ImageDownloadButton.cjs +1 -1
  30. package/dist/ImageDownloadButton.cjs.map +1 -1
  31. package/dist/ImageDownloadButton.js +19 -17
  32. package/dist/ImageDownloadButton.js.map +1 -1
  33. package/dist/SVGDownloadButton.cjs +1 -1
  34. package/dist/SVGDownloadButton.cjs.map +1 -1
  35. package/dist/SVGDownloadButton.js +20 -18
  36. package/dist/SVGDownloadButton.js.map +1 -1
  37. package/dist/ScatterPlot.cjs +1 -1
  38. package/dist/ScatterPlot.cjs.map +1 -1
  39. package/dist/ScatterPlot.d.ts +1 -1
  40. package/dist/ScatterPlot.js +107 -107
  41. package/dist/ScatterPlot.js.map +1 -1
  42. package/dist/index.d.ts +1 -1
  43. package/package.json +1 -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 { 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;AAAA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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
+ {"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\nimport { CsvDownloadButton } from '@/Components/Actions/CsvDownloadButton';\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n dataDownload: any;\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 dataDownload,\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 || dataDownload) && (\r\n <div className='absolute right-4 top-4 flex flex-col image-download-button gap-2'>\r\n {graphDownload && (\r\n <ImageDownloadButton nodeID={graphDownload} buttonSmall className='p-1' />\r\n )}\r\n {dataDownload && dataDownload.length > 0 && (\r\n <CsvDownloadButton\r\n csvData={dataDownload}\r\n buttonSmall\r\n headers={Object.keys(dataDownload[0]).map(d => ({\r\n label: d,\r\n key: d,\r\n }))}\r\n className='p-1'\r\n />\r\n )}\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 ? (\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 />\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 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 ) : (\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","dataDownload","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","CsvDownloadButton","Object","keys","label","key","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","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","t50","Pause","Play","SliderUI","nextValue","nextValue_0","t51","GraphArea","d_3","format","_temp3","getJenks","_temp4","_temp5","_temp6","_temp7","_temp8","_temp9","_temp0","Spinner","t52","footnote","source","GraphFooter","t53","GraphContainer","d_8","d_7","d_6","d_10","d_9","d_5","d_4","NAME","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FO,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,IACAC,cAAAA;AAAAA,EAAAA,IACE1C,GACE2C,IAAmBC,GAAQ,MAC1BT,IAEEU,GAAO1C,GAAS;AAAA,IAAE2C,SAAS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AZ,SAAAkB,GAAAlB,SAAA8H,IAAA9H,SAAAgI,IAAAhI,SAAAiI,IAAAjI,SAAAqI,IAAArI,SAAA2I,IAAA3I,SAAAyJ,IAAAzJ,SAAAiC,GAAAjC,SAAA/L,GAAA+L,SAAA6J,MAAAA,KAAA7J,EAAA,GAAA,GA7KjB6J;AA6KiB;AA7Td,SAAAN,GAAAQ,GAAA;AAAA,SAwR8BpQ,MAAM9C;AAAS;AAxR7C,SAAAyS,GAAAU,GAAA;AAAA,SAuR+CrQ,MAAM9C;AAAS;AAvR9D,SAAAwS,GAAAY,GAAA;AAAA,SAuR2BtQ,EAAChG;AAAK;AAvRjC,SAAAyV,GAAAc,GAAA;AAAA,SAsR6CvQ,MAAM9C;AAAS;AAtR5D,SAAAsS,GAAAgB,GAAA;AAAA,SAsRyBxQ,EAAChG;AAAK;AAtR/B,SAAAuV,GAAAkB,GAAA;AAAA,SAsOuBzQ,EAAC6D;AAA+B;AAtOvD,SAAAyL,GAAAoB,GAAA;AAAA,SA+NuB1Q,EAAC2D;AAA+B;AA/NvD,SAAAyL,GAAA7L,GAAA;AAAA,SAyNsDA,EAAEpD,YAAiBwQ,SAAK;AAAY;AAzN1F,SAAAxF,GAAAyF,GAAAC,GAAA;AAAA,SAsEkBD,IAAIC;AAAC;AAtEvB,SAAA5F,GAAAjL,GAAA;AAAA,SAkEgBA,EAAC6K;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"),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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-D4pAp7u0.cjs"),n=require("react"),kt=require("./getSliderMarks-BzrpHrHS.cjs"),It=require("./Spinner-WHzzloYQ.cjs"),wt=require("./parse-xYI9yrvL.cjs"),Pt=require("./index-DQA8q5sC.cjs"),N=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("./CsvDownloadButton.cjs"),Tt=require("./ordinal-CrsysVE-.cjs"),Gt=require("./threshold-DNsSUf8Q.cjs"),Et=require("./select-Bnfk0lJx.cjs"),it=require("./proxy-CqH8m8IQ.cjs"),Ht=require("./use-in-view-dnRv_qqF.cjs"),Vt=require("./index-FXfr51ZM.cjs"),Ut=require("./GraphFooter.cjs"),Xt=require("./GraphHeader.cjs"),lt=require("./Colors.cjs"),Rt=require("./fetchAndParseData-QTF6tjij.cjs"),Yt=require("./getUniqValue-NX8DgwND.cjs"),Jt=require("./getJenks-BzJvhy_H.cjs"),St=require("./GraphContainer-Cul9b74X.cjs");function Zt(p){const{data:e,colorDomain:s,colors:i,mapData:F,colorLegendTitle:k,categorical:$,height:v,width:h,scale:f,centerPoint:L,tooltip:te,mapBorderWidth:U,mapBorderColor:oe,mapNoDataColor:be,onSeriesMouseOver:re,showColorScale:Ee,zoomScaleExtend:ze,zoomTranslateExtend:_e,highlightedIds:b,onSeriesMouseClick:ae,mapProperty:y,resetSelectionOnDoubleClick:De,detailsOnClick:X,styles:We,classNames:ne,mapProjection:M,zoomInteraction:O,animate:w,dimmedOpacity:q,customLayers:se,collapseColorScaleByDefault:ke,zoomAndCenterByHighlightedIds:we,projectionRotate:T,rewindCoordinatesInMapData:Y,overlayMapData:J,overlayMapBorderColor:Ae,overlayMapBorderWidth:Fe,numberDisplayOptions:Z,graphDownload:ie,dataDownload:B}=p,a=n.useMemo(()=>Y?N.index_default(F,{reverse:!0}):F,[F,Y]),x=n.useMemo(()=>!Y||!J?J:N.index_default(J,{reverse:!0}),[J,Y]),[C,I]=n.useState(void 0),le=n.useRef(null),[$e,K]=n.useState(ke===void 0?!(h<680):!ke),[G,Q]=n.useState(void 0),[P,ce]=n.useState(void 0),[Ce,g]=n.useState(void 0),[de,E]=n.useState(void 0),R=n.useRef(null),S=Ht.useInView(R,{once:w.once,amount:w.amount}),ue=n.useRef(null),Re=$?Tt.ordinal().domain(s).range(i):Gt.threshold().domain(s).range(i);n.useEffect(()=>{const o=Et.select(ue.current),r=Et.select(R.current),m=d=>{if(O==="noZoom")return!1;if(O==="button")return!d.type.includes("wheel");const Oe=d.type==="wheel",qe=d.type.startsWith("touch"),xe=d.type==="mousedown"||d.type==="mousemove";return qe?!0:Oe?O==="scroll"?!0:d.ctrlKey:xe&&!d.button&&!d.ctrlKey},j=N.zoom().scaleExtent(ze).translateExtent(_e||[[-20,-20],[h+20,v+20]]).filter(m).on("zoom",({transform:d})=>{o.attr("transform",d)});r.call(j),le.current=j},[v,h,O]);const H=N.index_default$1({...a,features:we?a.features.filter(o=>(b||[]).length===0||b?.indexOf(o.properties[y])!==-1):a.features}),z=zt.index_default({...a,features:we?a.features.filter(o=>(b||[]).length===0||b?.indexOf(o.properties[y])!==-1):a.features}),Se=(H[2]-H[0])*1.15,pe=(H[3]-H[1])*1.15,Ne=h*190/960*360/Se,me=v*190/678*180/pe,_=f*Math.min(Ne,me),Me=M==="mercator"?N.geoMercator().rotate(T).center(L||z.geometry.coordinates).translate([h/2,v/2]).scale(_):M==="equalEarth"?N.geoEqualEarth().rotate(T).center(L||z.geometry.coordinates).translate([h/2,v/2]).scale(_):M==="naturalEarth"?N.geoNaturalEarth1().rotate(T).center(L||z.geometry.coordinates).translate([h/2,v/2]).scale(_):M==="orthographic"?N.geoOrthographic().rotate(T).center(L||z.geometry.coordinates).translate([h/2,v/2]).scale(_):N.geoAlbersUsa().rotate(T).center(L||z.geometry.coordinates).translate([h/2,v/2]).scale(_),V=N.geoPath().projection(Me),he=o=>{if(!R.current||!le.current)return;Et.select(R.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:`${h}px`,height:`${v}px`,viewBox:`0 0 ${h} ${v}`,ref:R,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:ue,children:[se.filter(o=>o.position==="before").map(o=>o.layer),a.features.map((o,r)=>{if(!o.properties?.[y])return null;const m=V(o);return m?t.jsxRuntimeExports.jsx(it.motion.g,{opacity:C?q:b?b.indexOf(o.properties[y])!==-1?1:q:1,children:t.jsxRuntimeExports.jsx("path",{d:m,style:{stroke:oe,strokeWidth:U,fill:be,vectorEffect:"non-scaling-stroke"}})},r):null}),t.jsxRuntimeExports.jsx(Vt.AnimatePresence,{children:e.map(o=>{const r=a.features.findIndex(d=>o.id===d.properties[y]);if(r===-1)return null;const m=V(a.features[r]);if(!m)return null;const j=At.checkIfNullOrUndefined(o.x)?be:Re(o.x);return t.jsxRuntimeExports.jsx(it.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:C?C===j&&(!b||b.indexOf(o.id)!==-1)?1:q:b?b.indexOf(o.id)!==-1?1:q:1,transition:{duration:w.duration}}},initial:"initial",animate:S?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},onMouseEnter:d=>{ce(o),E(d.clientY),g(d.clientX),re?.(o)},onMouseMove:d=>{ce(o),E(d.clientY),g(d.clientX)},onMouseLeave:()=>{ce(void 0),g(void 0),E(void 0),re?.(void 0)},onClick:()=>{(ae||X)&&(Pt.isEqual(G,o)&&De?(Q(void 0),ae?.(void 0)):(Q(o),ae?.(o)))},children:t.jsxRuntimeExports.jsx(it.motion.path,{d:m,variants:{initial:{fill:j,opacity:0},whileInView:{fill:j,opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:S?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},style:{stroke:oe,strokeWidth:U,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)})}),P?a.features.filter(o=>o.properties[y]===P.id).map((o,r)=>t.jsxRuntimeExports.jsx("path",{d:V(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,x?.features.map((o,r)=>{const m=V(o);return m?t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:m,style:{stroke:Ae||oe,strokeWidth:Fe||U+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},r):null}),se.filter(o=>o.position==="after").map(o=>o.layer)]})}),Ee===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",ne?.colorLegend),children:$e?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:()=>{K(!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:$?void 0:"340px"},children:[k&&k!==""?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:k}):null,$?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:s.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:[s.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:C===i[r]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:i[r],...C===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",Z?.precision??2,void 0,void 0,Z?.locale||"en",Z?.padZeros||!1)})]},r)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{I(i[s.length])},onMouseLeave:()=>{I(void 0)},x:s.length*320/i.length+1,y:1,width:320/i.length-2,height:8,className:`cursor-pointer ${C===i[s.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:i[s.length],...C===i[s.length]?{}:{stroke:i[s.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:()=>{K(!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:()=>he("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:()=>he("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:"–"})]}),(ie||B)&&t.jsxRuntimeExports.jsxs("div",{className:"absolute right-4 top-4 flex flex-col image-download-button gap-2",children:[ie&&t.jsxRuntimeExports.jsx($t.ImageDownloadButton,{nodeID:ie,buttonSmall:!0,className:"p-1"}),B&&B.length>0&&t.jsxRuntimeExports.jsx(Lt.CsvDownloadButton,{csvData:B,buttonSmall:!0,headers:Object.keys(B[0]).map(o=>({label:o,key:o})),className:"p-1"})]})]}),X&&G!==void 0?t.jsxRuntimeExports.jsx(Ft.DetailsModal,{body:X,data:G,setData:Q,className:ne?.modal}):null,P&&te&&Ce&&de?t.jsxRuntimeExports.jsx(Wt.Tooltip,{data:P,body:te,xPos:Ce,yPos:de,backgroundStyle:We?.tooltip,className:ne?.tooltip}):null]})}function Kt(p){const e=t.compilerRuntimeExports.c(133),{data:s,mapData:i,graphTitle:F,colors:k,sources:$,graphDescription:v,height:h,width:f,footNote:L,colorDomain:te,colorLegendTitle:U,scaleType:oe,scale:be,centerPoint:re,padding:Ee,mapBorderWidth:ze,mapNoDataColor:_e,backgroundColor:b,mapBorderColor:ae,relativeHeight:y,tooltip:De,onSeriesMouseOver:X,isWorldMap:We,showColorScale:ne,zoomScaleExtend:M,zoomTranslateExtend:O,graphID:w,highlightedIds:q,onSeriesMouseClick:se,mapProperty:ke,graphDownload:we,dataDownload:T,showAntarctica:Y,language:J,minHeight:Ae,theme:Fe,ariaLabel:Z,resetSelectionOnDoubleClick:ie,detailsOnClick:B,styles:a,classNames:x,mapProjection:C,zoomInteraction:I,animate:le,dimmedOpacity:$e,customLayers:K,timeline:G,collapseColorScaleByDefault:Q,projectionRotate:P,zoomAndCenterByHighlightedIds:ce,rewindCoordinatesInMapData:Ce,mapOverlay:g,numberDisplayOptions:de}=p,E=i===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":i,R=L===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.":L,S=oe===void 0?"threshold":oe,ue=be===void 0?.95:be,Re=ze===void 0?.5:ze,H=_e===void 0?lt.Colors.light.graphNoData:_e,z=b===void 0?!1:b,Se=ae===void 0?lt.Colors.light.grays["gray-500"]:ae,pe=We===void 0?!0:We,Ne=ne===void 0?!0:ne;let me;e[0]!==M?(me=M===void 0?[.8,6]:M,e[0]=M,e[1]=me):me=e[1];const _=me,Me=ke===void 0?"ISO3":ke,V=we===void 0?!1:we,he=T===void 0?!1:T,o=Y===void 0?!1:Y,r=J===void 0?"en":J,m=Ae===void 0?0:Ae,j=Fe===void 0?"light":Fe,d=ie===void 0?!0:ie,Oe=C===void 0?"naturalEarth":C,qe=I===void 0?"button":I,xe=le===void 0?!1:le,dt=$e===void 0?.3:$e;let Le;e[2]!==K?(Le=K===void 0?[]:K,e[2]=K,e[3]=Le):Le=e[3];const ut=Le;let Te;e[4]!==G?(Te=G===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:G,e[4]=G,e[5]=Te):Te=e[5];const l=Te;let Ge;e[6]!==P?(Ge=P===void 0?[0,0]:P,e[6]=P,e[7]=Ge):Ge=e[7];const pt=Ge,mt=ce===void 0?!1:ce,ht=Ce===void 0?!0:Ce,[ee,Nt]=n.useState(0),[Be,Mt]=n.useState(0),[W,Ot]=n.useState(l.autoplay);let Ie;if(e[8]!==s||e[9]!==l.dateFormat){let c;e[11]!==l.dateFormat?(c=D=>wt.parse(`${D.date}`,l.dateFormat||"yyyy",new Date).getTime(),e[11]=l.dateFormat,e[12]=c):c=e[12],Ie=[...new Set(s.filter(io).map(c))],Ie.sort(so),e[8]=s,e[9]=l.dateFormat,e[10]=Ie}else Ie=e[10];const u=Ie,[A,xt]=n.useState(l.autoplay?0:u.length-1),[ge,qt]=n.useState(void 0),[gt,Bt]=n.useState(void 0),ft=n.useRef(null),Dt=n.useRef(null);let He,Ve;e[13]===Symbol.for("react.memo_cache_sentinel")?(He=()=>{const c=new ResizeObserver(D=>{Nt(D[0].target.clientWidth||620),Mt(D[0].target.clientHeight||480)});return ft.current&&c.observe(ft.current),()=>c.disconnect()},Ve=[],e[13]=He,e[14]=Ve):(He=e[13],Ve=e[14]),n.useEffect(He,Ve);let Ue;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ue=c=>{qt(c)},e[15]=Ue):Ue=e[15];const Xe=n.useEffectEvent(Ue);let Ye;e[16]===Symbol.for("react.memo_cache_sentinel")?(Ye=c=>{Bt(c)},e[16]=Ye):Ye=e[16];const Pe=n.useEffectEvent(Ye);let Je;e[17]!==E||e[18]!==Xe?(Je=()=>{typeof E=="string"?Rt.fetchAndParseJSON(E).then(D=>{Xe(D)}):Xe(E)},e[17]=E,e[18]=Xe,e[19]=Je):Je=e[19];let Ze;e[20]!==E?(Ze=[E],e[20]=E,e[21]=Ze):Ze=e[21],n.useEffect(Je,Ze);let Ke;e[22]!==g?.mapData||e[23]!==Pe?(Ke=()=>{g?.mapData||Pe(void 0),typeof g?.mapData=="string"?Rt.fetchAndParseJSON(g?.mapData).then(D=>{Pe(D)}):Pe(g?.mapData)},e[22]=g?.mapData,e[23]=Pe,e[24]=Ke):Ke=e[24];const yt=g?.mapData;let Qe;e[25]!==yt?(Qe=[yt],e[25]=yt,e[26]=Qe):Qe=e[26],n.useEffect(Ke,Qe);let et;e[27]!==te||e[28]!==k?.length||e[29]!==s||e[30]!==S?(et=te||(S==="categorical"?Yt.getUniqValue(s,"x"):Jt.getJenks(s.map(no),k?.length||4)),e[27]=te,e[28]=k?.length,e[29]=s,e[30]=S,e[31]=et):et=e[31];const tt=et;let ot,rt;e[32]!==W||e[33]!==l.speed||e[34]!==u?(ot=()=>{const c=setInterval(()=>{xt(D=>D<u.length-1?D+1:0)},(l.speed||2)*1e3);return W||clearInterval(c),()=>clearInterval(c)},rt=[u,W,l.speed],e[32]=W,e[33]=l.speed,e[34]=u,e[35]=ot,e[36]=rt):(ot=e[35],rt=e[36]),n.useEffect(ot,rt);const vt=l.dateFormat||"yyyy";let at;e[37]!==A||e[38]!==vt||e[39]!==l.showOnlyActiveDate||e[40]!==u?(at=kt.getSliderMarks(u,A,l.showOnlyActiveDate,vt),e[37]=A,e[38]=vt,e[39]=l.showOnlyActiveDate,e[40]=u,e[41]=at):at=e[41];const nt=at,jt=x?.graphContainer,bt=a?.graphContainer;let fe;e[42]!==x?.description||e[43]!==x?.title||e[44]!==v||e[45]!==F||e[46]!==a?.description||e[47]!==a?.title||e[48]!==f?(fe=F||v?t.jsxRuntimeExports.jsx(Xt.GraphHeader,{styles:{title:a?.title,description:a?.description},classNames:{title:x?.title,description:x?.description},graphTitle:F,graphDescription:v,width:f}):null,e[42]=x?.description,e[43]=x?.title,e[44]=v,e[45]=F,e[46]=a?.description,e[47]=a?.title,e[48]=f,e[49]=fe):fe=e[49];let ye;e[50]!==A||e[51]!==nt||e[52]!==W||e[53]!==l.enabled||e[54]!==u?(ye=l.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(!W)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":W?"Click to pause animation":"Click to play animation",children:W?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[A],onChangeComplete:c=>{xt(u.indexOf(c))},onChange:c=>{xt(u.indexOf(c))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[50]=A,e[51]=nt,e[52]=W,e[53]=l.enabled,e[54]=u,e[55]=ye):ye=e[55];let ve;e[56]!==xe||e[57]!==re||e[58]!==x||e[59]!==Q||e[60]!==U||e[61]!==k||e[62]!==ut||e[63]!==s||e[64]!==he||e[65]!==B||e[66]!==dt||e[67]!==tt||e[68]!==V||e[69]!==h||e[70]!==q||e[71]!==A||e[72]!==pe||e[73]!==Se||e[74]!==Re||e[75]!==H||e[76]!==g?.mapBorderColor||e[77]!==g?.mapBorderWidth||e[78]!==Oe||e[79]!==Me||e[80]!==ge||e[81]!==m||e[82]!==de||e[83]!==se||e[84]!==X||e[85]!==gt||e[86]!==pt||e[87]!==y||e[88]!==d||e[89]!==ht||e[90]!==ue||e[91]!==S||e[92]!==o||e[93]!==Ne||e[94]!==a||e[95]!==Be||e[96]!==ee||e[97]!==j||e[98]!==l.dateFormat||e[99]!==l.enabled||e[100]!==De||e[101]!==u||e[102]!==f||e[103]!==mt||e[104]!==qe||e[105]!==_||e[106]!==O?(ve=t.jsxRuntimeExports.jsx(St.GraphArea,{ref:ft,children:ee&&Be&&ge?t.jsxRuntimeExports.jsx(Zt,{data:s.filter(c=>l.enabled?`${c.date}`===wt.format(new Date(u[A]),l.dateFormat||"yyyy"):c),mapData:o?ge:{...ge,features:ge.features.filter(ao)},colorDomain:tt,width:ee,height:Be,scale:ue,centerPoint:re,colors:k||(S==="categorical"?lt.Colors[j].categoricalColors.colors:lt.Colors[j].sequentialColors[`neutralColorsx0${tt.length+1}`]),colorLegendTitle:U,mapBorderWidth:Re,mapNoDataColor:H,categorical:S==="categorical",mapBorderColor:Se,tooltip:De,onSeriesMouseOver:X,isWorldMap:pe,showColorScale:Ne,zoomScaleExtend:_,zoomTranslateExtend:O,onSeriesMouseClick:se,mapProperty:Me,highlightedIds:q,resetSelectionOnDoubleClick:d,styles:a,overlayMapData:gt,overlayMapBorderColor:g?.mapBorderColor,overlayMapBorderWidth:g?.mapBorderWidth,classNames:x,detailsOnClick:B,mapProjection:Oe||(pe?"naturalEarth":"mercator"),zoomInteraction:qe,dimmedOpacity:dt,animate:xe===!0?{duration:.5,once:!0,amount:.5}:xe||{duration:0,once:!0,amount:0},customLayers:ut,zoomAndCenterByHighlightedIds:mt,collapseColorScaleByDefault:Q,projectionRotate:pt,rewindCoordinatesInMapData:ht,numberDisplayOptions:de,graphDownload:V?Dt:void 0,dataDownload:he?s.map(ro).filter(oo).length>0?s.map(to).filter(eo):s.filter(Qt):null}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(m,h||(y?m?(f||ee)*y>m?(f||ee)*y:m:(f||ee)*y:Be))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(It.w,{"aria-label":"Loading graph"})})}),e[56]=xe,e[57]=re,e[58]=x,e[59]=Q,e[60]=U,e[61]=k,e[62]=ut,e[63]=s,e[64]=he,e[65]=B,e[66]=dt,e[67]=tt,e[68]=V,e[69]=h,e[70]=q,e[71]=A,e[72]=pe,e[73]=Se,e[74]=Re,e[75]=H,e[76]=g?.mapBorderColor,e[77]=g?.mapBorderWidth,e[78]=Oe,e[79]=Me,e[80]=ge,e[81]=m,e[82]=de,e[83]=se,e[84]=X,e[85]=gt,e[86]=pt,e[87]=y,e[88]=d,e[89]=ht,e[90]=ue,e[91]=S,e[92]=o,e[93]=Ne,e[94]=a,e[95]=Be,e[96]=ee,e[97]=j,e[98]=l.dateFormat,e[99]=l.enabled,e[100]=De,e[101]=u,e[102]=f,e[103]=mt,e[104]=qe,e[105]=_,e[106]=O,e[107]=ve):ve=e[107];let je;e[108]!==x?.footnote||e[109]!==x?.source||e[110]!==R||e[111]!==$||e[112]!==a?.footnote||e[113]!==a?.source||e[114]!==f?(je=$||R?t.jsxRuntimeExports.jsx(Ut.GraphFooter,{styles:{footnote:a?.footnote,source:a?.source},classNames:{footnote:x?.footnote,source:x?.source},sources:$,footNote:R,width:f}):null,e[108]=x?.footnote,e[109]=x?.source,e[110]=R,e[111]=$,e[112]=a?.footnote,e[113]=a?.source,e[114]=f,e[115]=je):je=e[115];let st;return e[116]!==Z||e[117]!==z||e[118]!==w||e[119]!==h||e[120]!==r||e[121]!==m||e[122]!==Ee||e[123]!==y||e[124]!==jt||e[125]!==bt||e[126]!==fe||e[127]!==ye||e[128]!==ve||e[129]!==je||e[130]!==j||e[131]!==f?(st=t.jsxRuntimeExports.jsxs(St.GraphContainer,{className:jt,style:bt,id:w,ref:Dt,"aria-label":Z,backgroundColor:z,theme:j,language:r,minHeight:m,width:f,height:h,relativeHeight:y,padding:Ee,children:[fe,ye,ve,je]}),e[116]=Z,e[117]=z,e[118]=w,e[119]=h,e[120]=r,e[121]=m,e[122]=Ee,e[123]=y,e[124]=jt,e[125]=bt,e[126]=fe,e[127]=ye,e[128]=ve,e[129]=je,e[130]=j,e[131]=f,e[132]=st):st=e[132],st}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.properties?.NAME!=="Antarctica"}function no(p){return p.x}function so(p,e){return p-e}function io(p){return p.date}exports.ChoroplethMap=Kt;
2
2
  //# sourceMappingURL=ChoroplethMap.cjs.map