@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":"DotDensityMap.js","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\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 { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\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: DotDensityMapDataType[];\r\n\r\n mapData: FeatureCollection;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints?: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: 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 graphDownload?: RefObject<HTMLDivElement | null>;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\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 [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\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 radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\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(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\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 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 width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\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 const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <path\r\n d={path}\r\n key={i}\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 );\r\n })}\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 <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -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 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 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 transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\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 y={0}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || 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 className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </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 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'\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 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'\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 {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 {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 </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\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: DotDensityMapDataType[];\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 /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\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 /** 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 /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\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 /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\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 /** 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 DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\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 showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\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 maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\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 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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\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 maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\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","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","graphDownload","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","path","stroke","strokeWidth","fill","vectorEffect","pointerEvents","AnimatePresence","color","el","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","ExpandIcon","ImageDownloadButton","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","dataDownload","t13","showAntarctica","t14","language","t15","minHeight","t16","theme","t17","ariaLabel","t18","t19","t20","t21","t22","t23","timeline","t24","t25","t26","mapOverlay","light","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","t30","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","shape_0","onUpdateOverlayMapShape","t35","fetchAndParseJSON","then","d_1","t36","t37","d_2","t38","t39","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","d_10","d_9","el_1","el_0","properties","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,6BAAAA;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,gBAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,4BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,eAAAA;AAAAA,EAAAA,IACEtC,GACEuC,KAAmBC,GAAQ,MAC1BN,IAEEO,GAAOtC,GAAS;AAAA,IAAEuC,SAAS;AAAA,EAAA,CAAM,IAFAvC,GAGvC,CAACA,GAAS+B,CAA0B,CAAC,GAClCS,KAA0BH,GAAQ,MAClC,CAACN,KAA8B,CAACC,IAAuBA,I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,IAAAW,SAAAqB,GAAArB,SAAAzK,GAAAyK,SAAA2B,GAAA3B,SAAA6B,GAAA7B,SAAAU,GAAAV,SAAAgB,GAAAhB,SAAAuH,IAAAvH,SAAAyH,IAAAzH,SAAA0H,IAAA1H,SAAAmI,IAAAnI,SAAAyI,IAAAzI,SAAAwJ,IAAAxJ,SAAA+B,GAAA/B,SAAAxK,GAAAwK,SAAA4J,MAAAA,KAAA5J,EAAA,GAAA,GA5KjB4J;AA4KiB;AAnTd,SAAAN,GAAAQ,GAAA;AAAA,SA2Q8E1Q,KAAM;AAAI;AA3QxF,SAAAiQ,GAAAU,GAAA;AAAA,SA2QqC3Q,EAAC9D;AAAO;AA3Q7C,SAAA0T,GAAAgB,GAAA;AAAA,SAoOyBnM,EAAED;AAAM;AApOjC,SAAAkL,GAAAmB,GAAA;AAAA,SA2NyBpM,EAAED;AAAM;AA3NjC,SAAAiL,GAAAhL,GAAA;AAAA,SAuNsDA,EAAEqM,YAAiBC,SAAK;AAAY;AAvN1F,SAAAjC,GAAAkC,GAAA;AAAA,SAuK4BhR,MAAMrB;AAAS;AAvK3C,SAAAkQ,GAAAoC,GAAA;AAAA,SAsK6CjR,MAAMrB;AAAS;AAtK5D,SAAAiQ,GAAAsC,GAAA;AAAA,SAsKyBlR,EAACnE;AAAK;AAtK/B,SAAA8S,GAAAwC,GAAA;AAAA,SAqK2CnR,MAAMrB;AAAS;AArK1D,SAAA+P,GAAA0C,GAAA;AAAA,SAqKuBpR,EAACnE;AAAK;AArK7B,SAAAuP,GAAAiG,GAAAC,GAAA;AAAA,SAmEkBD,IAAIC;AAAC;AAnEvB,SAAApG,GAAAlL,GAAA;AAAA,SA+DgBA,EAAC8K;AAAK;"}
1
+ {"version":3,"file":"DotDensityMap.js","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\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 { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\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: DotDensityMapDataType[];\r\n\r\n mapData: FeatureCollection;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints?: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: 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 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 colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\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 [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\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 radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\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(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\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 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 width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\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 const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <path\r\n d={path}\r\n key={i}\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 );\r\n })}\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 <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -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 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 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 transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\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 y={0}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || 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 className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </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 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'\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 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'\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 {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 {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 </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\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: DotDensityMapDataType[];\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 /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\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 /** 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 /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\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 /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\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 /** 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 DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\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 showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\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 maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\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 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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\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 maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\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","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","graphDownload","dataDownload","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","path","stroke","strokeWidth","fill","vectorEffect","pointerEvents","AnimatePresence","color","el","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","ExpandIcon","ImageDownloadButton","CsvDownloadButton","Object","keys","key","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","t13","showAntarctica","t14","language","t15","minHeight","t16","theme","t17","ariaLabel","t18","t19","t20","t21","t22","t23","timeline","t24","t25","t26","mapOverlay","light","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","t30","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","shape_0","onUpdateOverlayMapShape","t35","fetchAndParseJSON","then","d_1","t36","t37","d_2","t38","t39","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_3","format","_temp3","_temp4","uniqBy","_temp5","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp6","_temp7","_temp8","_temp9","_temp0","_temp1","_temp10","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","d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2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./index-CHPV5EwG-D4pAp7u0.cjs"),b=require("./index-BhI7mBJx.cjs"),y=require("./excelDownload-BQpsCa62.cjs");function D(f){const e=x.compilerRuntimeExports.c(13),{buttonContent:n,buttonType:m,csvData:s,fileName:p,headers:a,xlsxHeader:i,wscols:c,buttonSmall:v,className:w}=f,r=m===void 0?"tertiary":m,d=p===void 0?"data":p,u=`${v?"p-2":"py-4 px-6"} ${w===void 0?"":w}`;let t;e[0]!==s||e[1]!==d||e[2]!==a||e[3]!==c||e[4]!==i?(t=()=>y.excelDownload(s,d,a,i,c),e[0]=s,e[1]=d,e[2]=a,e[3]=c,e[4]=i,e[5]=t):t=e[5];let o;e[6]!==n?(o=n||x.jsxRuntimeExports.jsx(b.FileDown,{}),e[6]=n,e[7]=o):o=e[7];let l;return e[8]!==r||e[9]!==u||e[10]!==t||e[11]!==o?(l=x.jsxRuntimeExports.jsx(b.u,{variant:r,className:u,onClick:t,"aria-label":"Click to download the data as xlsx",children:o}),e[8]=r,e[9]=u,e[10]=t,e[11]=o,e[12]=l):l=e[12],l}exports.ExcelDownloadButton=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-D4pAp7u0.cjs"),v=require("./index-BhI7mBJx.cjs"),E=require("./excelDownload-BQpsCa62.cjs");function j(y){const e=s.compilerRuntimeExports.c(16),{buttonContent:a,buttonType:f,csvData:i,fileName:w,headers:c,xlsxHeader:r,wscols:d,buttonSmall:D,className:b}=y,u=f===void 0?"tertiary":f,x=w===void 0?"data":w,m=b===void 0?"":b,p=D?"p-2":"py-4 px-6";let t;e[0]!==m||e[1]!==p?(t=s.mo(p,m),e[0]=m,e[1]=p,e[2]=t):t=e[2];let o;e[3]!==i||e[4]!==x||e[5]!==c||e[6]!==d||e[7]!==r?(o=()=>E.excelDownload(i,x,c,r,d),e[3]=i,e[4]=x,e[5]=c,e[6]=d,e[7]=r,e[8]=o):o=e[8];let l;e[9]!==a?(l=a||s.jsxRuntimeExports.jsx(v.FileDown,{}),e[9]=a,e[10]=l):l=e[10];let n;return e[11]!==u||e[12]!==t||e[13]!==o||e[14]!==l?(n=s.jsxRuntimeExports.jsx(v.u,{variant:u,className:t,onClick:o,"aria-label":"Click to download the data as xlsx",children:l}),e[11]=u,e[12]=t,e[13]=o,e[14]=l,e[15]=n):n=e[15],n}exports.ExcelDownloadButton=j;
2
2
  //# sourceMappingURL=ExcelDownloadButton.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExcelDownloadButton.cjs","sources":["../src/Components/Actions/ExcelDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\n\r\nimport { excelDownload } from '@/Utils/excelDownload';\r\nimport { FileDown } from '@/Components/Icons';\r\n\r\ninterface WsColInterface {\r\n wch: number;\r\n}\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n csvData: any;\r\n fileName?: string;\r\n headers: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n xlsxHeader: any;\r\n wscols: WsColInterface[];\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ExcelDownloadButton(props: Props) {\r\n const {\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n csvData,\r\n fileName = 'data',\r\n headers,\r\n xlsxHeader,\r\n wscols,\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={`${buttonSmall ? 'p-2' : 'py-4 px-6'} ${className}`}\r\n onClick={() => excelDownload(csvData, fileName, headers, xlsxHeader, wscols)}\r\n aria-label='Click to download the data as xlsx'\r\n >\r\n {buttonContent || <FileDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ExcelDownloadButton","props","$","_c","buttonContent","buttonType","t0","csvData","fileName","t1","headers","xlsxHeader","wscols","buttonSmall","className","t2","undefined","t3","t4","excelDownload","t5","FileDown","t6","jsx","Button"],"mappings":"6MA6BO,SAAAA,EAAAC,EAAA,CAAA,MAAAC,EAAAC,EAAAA,uBAAAA,EAAA,EAAA,EACL,CAAAC,cAAAA,EAAAC,WAAAC,EAAAC,QAAAA,EAAAC,SAAAC,EAAAC,QAAAA,EAAAC,WAAAA,EAAAC,OAAAA,EAAAC,YAAAA,EAAAC,UAAAC,CAAAA,EAUId,EARFI,EAAAC,IAAAU,OAAA,WAAAV,EAEAE,EAAAC,IAAAO,OAAA,OAAAP,EAUaQ,KAAGJ,EAAA,MAAA,WAAiC,IALjDE,IAAAC,OAAA,GAAAD,CAK8D,GAAE,IAAAG,EAAAhB,EAAA,CAAA,IAAAK,GAAAL,EAAA,CAAA,IAAAM,GAAAN,EAAA,CAAA,IAAAQ,GAAAR,EAAA,CAAA,IAAAU,GAAAV,OAAAS,GACrDO,EAAAA,IAAMC,EAAAA,cAAcZ,EAASC,EAAUE,EAASC,EAAYC,CAAM,EAACV,KAAAK,EAAAL,KAAAM,EAAAN,KAAAQ,EAAAR,KAAAU,EAAAV,KAAAS,EAAAT,KAAAgB,GAAAA,EAAAhB,EAAA,CAAA,EAAA,IAAAkB,EAAAlB,OAAAE,GAG3EgB,EAAAhB,2BAAkBiB,EAAAA,SAAA,CAAA,CAAQ,EAAGnB,KAAAE,EAAAF,KAAAkB,GAAAA,EAAAlB,EAAA,CAAA,EAAA,IAAAoB,EAAA,OAAApB,EAAA,CAAA,IAAAG,GAAAH,EAAA,CAAA,IAAAe,GAAAf,EAAA,EAAA,IAAAgB,GAAAhB,QAAAkB,GANhCE,EAAAC,EAAAA,kBAAAA,IAACC,EAAAA,EAAA,CACUnB,QAAAA,EACE,UAAAY,EACF,QAAAC,EACE,aAAA,qCAEVE,SAAAA,CAAAA,CACH,EAASlB,KAAAG,EAAAH,KAAAe,EAAAf,MAAAgB,EAAAhB,MAAAkB,EAAAlB,MAAAoB,GAAAA,EAAApB,EAAA,EAAA,EAPToB,CAOS"}
1
+ {"version":3,"file":"ExcelDownloadButton.cjs","sources":["../src/Components/Actions/ExcelDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { excelDownload } from '@/Utils/excelDownload';\r\nimport { FileDown } from '@/Components/Icons';\r\n\r\ninterface WsColInterface {\r\n wch: number;\r\n}\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n csvData: any;\r\n fileName?: string;\r\n headers: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n xlsxHeader: any;\r\n wscols: WsColInterface[];\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ExcelDownloadButton(props: Props) {\r\n const {\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n csvData,\r\n fileName = 'data',\r\n headers,\r\n xlsxHeader,\r\n wscols,\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={cn(buttonSmall ? 'p-2' : 'py-4 px-6', className)}\r\n onClick={() => excelDownload(csvData, fileName, headers, xlsxHeader, wscols)}\r\n aria-label='Click to download the data as xlsx'\r\n >\r\n {buttonContent || <FileDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ExcelDownloadButton","props","$","_c","buttonContent","buttonType","t0","csvData","fileName","t1","headers","xlsxHeader","wscols","buttonSmall","className","t2","undefined","t3","t4","cn","t5","excelDownload","t6","FileDown","t7","jsx","Button"],"mappings":"6MA8BO,SAAAA,E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,MAAAG,EAAAH,MAAAgB,EAAAhB,MAAAkB,EAAAlB,MAAAoB,EAAApB,MAAAsB,GAAAA,EAAAtB,EAAA,EAAA,EAPTsB,CAOS"}
@@ -1,26 +1,28 @@
1
- import { c as v, j as f } from "./index-CHPV5EwG-BzibaIRc.js";
2
- import { d as w, u as j } from "./index-ApTBN0kp.js";
3
- import { e as y } from "./excelDownload-BEC1AyQW.js";
4
- function $(N) {
5
- const t = v.c(13), {
6
- buttonContent: s,
7
- buttonType: x,
8
- csvData: l,
9
- fileName: p,
10
- headers: n,
11
- xlsxHeader: i,
12
- wscols: c,
13
- buttonSmall: b,
14
- className: u
15
- } = N, r = x === void 0 ? "tertiary" : x, m = p === void 0 ? "data" : p, d = `${b ? "p-2" : "py-4 px-6"} ${u === void 0 ? "" : u}`;
1
+ import { c as j, m as y, j as v } from "./index-CHPV5EwG-BzibaIRc.js";
2
+ import { d as D, u as h } from "./index-ApTBN0kp.js";
3
+ import { e as C } from "./excelDownload-BEC1AyQW.js";
4
+ function T(w) {
5
+ const t = j.c(16), {
6
+ buttonContent: l,
7
+ buttonType: f,
8
+ csvData: n,
9
+ fileName: u,
10
+ headers: i,
11
+ xlsxHeader: c,
12
+ wscols: r,
13
+ buttonSmall: N,
14
+ className: b
15
+ } = w, m = f === void 0 ? "tertiary" : f, d = u === void 0 ? "data" : u, x = b === void 0 ? "" : b, p = N ? "p-2" : "py-4 px-6";
16
16
  let e;
17
- t[0] !== l || t[1] !== m || t[2] !== n || t[3] !== c || t[4] !== i ? (e = () => y(l, m, n, i, c), t[0] = l, t[1] = m, t[2] = n, t[3] = c, t[4] = i, t[5] = e) : e = t[5];
17
+ t[0] !== x || t[1] !== p ? (e = y(p, x), t[0] = x, t[1] = p, t[2] = e) : e = t[2];
18
18
  let o;
19
- t[6] !== s ? (o = s || /* @__PURE__ */ f.jsx(w, {}), t[6] = s, t[7] = o) : o = t[7];
19
+ t[3] !== n || t[4] !== d || t[5] !== i || t[6] !== r || t[7] !== c ? (o = () => C(n, d, i, c, r), t[3] = n, t[4] = d, t[5] = i, t[6] = r, t[7] = c, t[8] = o) : o = t[8];
20
+ let s;
21
+ t[9] !== l ? (s = l || /* @__PURE__ */ v.jsx(D, {}), t[9] = l, t[10] = s) : s = t[10];
20
22
  let a;
21
- return t[8] !== r || t[9] !== d || t[10] !== e || t[11] !== o ? (a = /* @__PURE__ */ f.jsx(j, { variant: r, className: d, onClick: e, "aria-label": "Click to download the data as xlsx", children: o }), t[8] = r, t[9] = d, t[10] = e, t[11] = o, t[12] = a) : a = t[12], a;
23
+ return t[11] !== m || t[12] !== e || t[13] !== o || t[14] !== s ? (a = /* @__PURE__ */ v.jsx(h, { variant: m, className: e, onClick: o, "aria-label": "Click to download the data as xlsx", children: s }), t[11] = m, t[12] = e, t[13] = o, t[14] = s, t[15] = a) : a = t[15], a;
22
24
  }
23
25
  export {
24
- $ as ExcelDownloadButton
26
+ T as ExcelDownloadButton
25
27
  };
26
28
  //# sourceMappingURL=ExcelDownloadButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExcelDownloadButton.js","sources":["../src/Components/Actions/ExcelDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\n\r\nimport { excelDownload } from '@/Utils/excelDownload';\r\nimport { FileDown } from '@/Components/Icons';\r\n\r\ninterface WsColInterface {\r\n wch: number;\r\n}\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n csvData: any;\r\n fileName?: string;\r\n headers: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n xlsxHeader: any;\r\n wscols: WsColInterface[];\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ExcelDownloadButton(props: Props) {\r\n const {\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n csvData,\r\n fileName = 'data',\r\n headers,\r\n xlsxHeader,\r\n wscols,\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={`${buttonSmall ? 'p-2' : 'py-4 px-6'} ${className}`}\r\n onClick={() => excelDownload(csvData, fileName, headers, xlsxHeader, wscols)}\r\n aria-label='Click to download the data as xlsx'\r\n >\r\n {buttonContent || <FileDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ExcelDownloadButton","props","$","_c","buttonContent","buttonType","t0","csvData","fileName","t1","headers","xlsxHeader","wscols","buttonSmall","className","t2","undefined","t3","t4","excelDownload","t5","FileDown","t6","jsx","Button"],"mappings":";;;AA6BO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,EAAA,GACL;AAAA,IAAAC,eAAAA;AAAAA,IAAAC,YAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,UAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,YAAAA;AAAAA,IAAAC,QAAAA;AAAAA,IAAAC,aAAAA;AAAAA,IAAAC,WAAAC;AAAAA,EAAAA,IAUId,GARFI,IAAAC,MAAAU,SAAA,aAAAV,GAEAE,IAAAC,MAAAO,SAAA,SAAAP,GAUaQ,OAAGJ,IAAA,QAAA,WAAiC,IALjDE,MAAAC,SAAA,KAAAD,CAK8D;AAAE,MAAAG;AAAA,EAAAhB,EAAA,CAAA,MAAAK,KAAAL,EAAA,CAAA,MAAAM,KAAAN,EAAA,CAAA,MAAAQ,KAAAR,EAAA,CAAA,MAAAU,KAAAV,SAAAS,KACrDO,IAAAA,MAAMC,EAAcZ,GAASC,GAAUE,GAASC,GAAYC,CAAM,GAACV,OAAAK,GAAAL,OAAAM,GAAAN,OAAAQ,GAAAR,OAAAU,GAAAV,OAAAS,GAAAT,OAAAgB,KAAAA,IAAAhB,EAAA,CAAA;AAAA,MAAAkB;AAAA,EAAAlB,SAAAE,KAG3EgB,IAAAhB,2BAAkBiB,GAAA,CAAA,CAAQ,GAAGnB,OAAAE,GAAAF,OAAAkB,KAAAA,IAAAlB,EAAA,CAAA;AAAA,MAAAoB;AAAA,SAAApB,EAAA,CAAA,MAAAG,KAAAH,EAAA,CAAA,MAAAe,KAAAf,EAAA,EAAA,MAAAgB,KAAAhB,UAAAkB,KANhCE,IAAAC,gBAAAA,EAAAA,IAACC,GAAA,EACUnB,SAAAA,GACE,WAAAY,GACF,SAAAC,GACE,cAAA,sCAEVE,UAAAA,EAAAA,CACH,GAASlB,OAAAG,GAAAH,OAAAe,GAAAf,QAAAgB,GAAAhB,QAAAkB,GAAAlB,QAAAoB,KAAAA,IAAApB,EAAA,EAAA,GAPToB;AAOS;"}
1
+ {"version":3,"file":"ExcelDownloadButton.js","sources":["../src/Components/Actions/ExcelDownloadButton.tsx"],"sourcesContent":["import { Button } from '@undp/design-system-react/Button';\r\nimport { JSX } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { excelDownload } from '@/Utils/excelDownload';\r\nimport { FileDown } from '@/Components/Icons';\r\n\r\ninterface WsColInterface {\r\n wch: number;\r\n}\r\n\r\ninterface Props {\r\n buttonContent?: string | JSX.Element;\r\n buttonType?:\r\n | 'primary'\r\n | 'primary-without-icon'\r\n | 'secondary'\r\n | 'secondary-without-icon'\r\n | 'tertiary';\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n csvData: any;\r\n fileName?: string;\r\n headers: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n xlsxHeader: any;\r\n wscols: WsColInterface[];\r\n buttonSmall?: boolean;\r\n className?: string;\r\n}\r\n\r\nexport function ExcelDownloadButton(props: Props) {\r\n const {\r\n buttonContent,\r\n buttonType = 'tertiary',\r\n csvData,\r\n fileName = 'data',\r\n headers,\r\n xlsxHeader,\r\n wscols,\r\n buttonSmall,\r\n className = '',\r\n } = props;\r\n return (\r\n <Button\r\n variant={buttonType}\r\n className={cn(buttonSmall ? 'p-2' : 'py-4 px-6', className)}\r\n onClick={() => excelDownload(csvData, fileName, headers, xlsxHeader, wscols)}\r\n aria-label='Click to download the data as xlsx'\r\n >\r\n {buttonContent || <FileDown />}\r\n </Button>\r\n );\r\n}\r\n"],"names":["ExcelDownloadButton","props","$","_c","buttonContent","buttonType","t0","csvData","fileName","t1","headers","xlsxHeader","wscols","buttonSmall","className","t2","undefined","t3","t4","cn","t5","excelDownload","t6","FileDown","t7","jsx","Button"],"mappings":";;;AA8BO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,EAAA,GACL;AAAA,IAAAC,eAAAA;AAAAA,IAAAC,YAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,UAAAC;AAAAA,IAAAC,SAAAA;AAAAA,IAAAC,YAAAA;AAAAA,IAAAC,QAAAA;AAAAA,IAAAC,aAAAA;AAAAA,IAAAC,WAAAC;AAAAA,EAAAA,IAUId,GARFI,IAAAC,MAAAU,SAAA,aAAAV,GAEAE,IAAAC,MAAAO,SAAA,SAAAP,GAKAK,IAAAC,MAAAC,SAAA,KAAAD,GAKgBE,IAAAJ,IAAA,QAAA;AAAiC,MAAAK;AAAA,EAAAhB,EAAA,CAAA,MAAAY,KAAAZ,SAAAe,KAApCC,IAAAC,EAAGF,GAAmCH,CAAS,GAACZ,OAAAY,GAAAZ,OAAAe,GAAAf,OAAAgB,KAAAA,IAAAhB,EAAA,CAAA;AAAA,MAAAkB;AAAA,EAAAlB,EAAA,CAAA,MAAAK,KAAAL,EAAA,CAAA,MAAAM,KAAAN,EAAA,CAAA,MAAAQ,KAAAR,EAAA,CAAA,MAAAU,KAAAV,SAAAS,KAClDS,IAAAA,MAAMC,EAAcd,GAASC,GAAUE,GAASC,GAAYC,CAAM,GAACV,OAAAK,GAAAL,OAAAM,GAAAN,OAAAQ,GAAAR,OAAAU,GAAAV,OAAAS,GAAAT,OAAAkB,KAAAA,IAAAlB,EAAA,CAAA;AAAA,MAAAoB;AAAA,EAAApB,SAAAE,KAG3EkB,IAAAlB,2BAAkBmB,GAAA,CAAA,CAAQ,GAAGrB,OAAAE,GAAAF,QAAAoB,KAAAA,IAAApB,EAAA,EAAA;AAAA,MAAAsB;AAAA,SAAAtB,EAAA,EAAA,MAAAG,KAAAH,EAAA,EAAA,MAAAgB,KAAAhB,EAAA,EAAA,MAAAkB,KAAAlB,UAAAoB,KANhCE,IAAAC,gBAAAA,EAAAA,IAACC,GAAA,EACUrB,SAAAA,GACE,WAAAa,GACF,SAAAE,GACE,cAAA,sCAEVE,UAAAA,EAAAA,CACH,GAASpB,QAAAG,GAAAH,QAAAgB,GAAAhB,QAAAkB,GAAAlB,QAAAoB,GAAApB,QAAAsB,KAAAA,IAAAtB,EAAA,EAAA,GAPTsB;AAOS;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-D4pAp7u0.cjs"),i=require("react"),zt=require("./parse-xYI9yrvL.cjs"),_t=require("./getSliderMarks-BzrpHrHS.cjs"),Zt=require("./Spinner-WHzzloYQ.cjs"),Vt=require("./index-DQA8q5sC.cjs"),z=require("./index-DLFt97gy.cjs"),It=require("./Typography-BqmyF1gP.cjs"),Kt=require("./index-C5K--w8d.cjs"),Wt=require("./Source-PKuwZOn3.cjs"),Qt=require("./index-w64Zl8io-DrMm5QSb.cjs"),eo=require("./Tooltip-C9F3uYG0.cjs"),yt=require("./index-BhI7mBJx.cjs"),to=require("./DetailsModal-Du8Fr1QD.cjs"),oo=require("./ImageDownloadButton.cjs"),ro=require("./pow-BnyPO-NX.cjs"),ao=require("./ordinal-CrsysVE-.cjs"),no=require("./threshold-DNsSUf8Q.cjs"),Bt=require("./select-Bnfk0lJx.cjs"),ce=require("./proxy-CqH8m8IQ.cjs"),ft=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),io=require("./numberFormattingFunction-u2iNHL_c.cjs"),so=require("./use-in-view-dnRv_qqF.cjs"),lo=require("./index-FXfr51ZM.cjs"),co=require("./GraphFooter.cjs"),uo=require("./GraphHeader.cjs"),Ce=require("./Colors.cjs"),Lt=require("./fetchAndParseData-QTF6tjij.cjs"),$t=require("./GraphContainer-Cul9b74X.cjs"),po=require("./getUniqValue-NX8DgwND.cjs"),mo=require("./getJenks-BzJvhy_H.cjs");function xo(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const f=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,f.get?f:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const ho=xo(i);var go="Separator",Ft="horizontal",fo=["horizontal","vertical"],Tt=ho.forwardRef((a,e)=>{const{decorative:t,orientation:f=Ft,...v}=a,s=yo(f)?f:Ft,j=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return r.ae.jsx(Qt.w.div,{"data-orientation":s,...j,...v,ref:e})});Tt.displayName=go;function yo(a){return fo.includes(a)}var At=Tt;const Ut=i.forwardRef((a,e)=>{const t=r._.c(14);let f,v,s,j;t[0]!==a?({className:f,variant:s,orientation:j,...v}=a,t[0]=a,t[1]=f,t[2]=v,t[3]=s,t[4]=j):(f=t[1],v=t[2],s=t[3],j=t[4]);const b=s===void 0?"dark":s,c=j===void 0?"horizontal":j,x=c==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",C=b==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let R;t[5]!==f||t[6]!==x||t[7]!==C?(R=r.mo(x,C,f),t[5]=f,t[6]=x,t[7]=C,t[8]=R):R=t[8];let O;return t[9]!==c||t[10]!==v||t[11]!==e||t[12]!==R?(O=r.ae.jsx(At,{...v,ref:e,orientation:c,className:R}),t[9]=c,t[10]=v,t[11]=e,t[12]=R,t[13]=O):O=t[13],O});Ut.displayName=At.displayName;function vo(a){const{data:e,colors:t,mapData:f,mapColorLegendTitle:v,colorDomain:s,radius:j,height:b,width:c,scale:x,centerPoint:C,tooltip:R,showLabels:O,mapBorderWidth:de,mapBorderColor:ue,mapNoDataColor:De,onSeriesMouseOver:H,showColorScale:Se,zoomScaleExtend:Ye,zoomTranslateExtend:Je,highlightedDataPoints:Ne,onSeriesMouseClick:_,resetSelectionOnDoubleClick:Me,detailsOnClick:X,styles:D,classNames:Y,mapProjection:oe,zoomInteraction:J,animate:E,dimmedOpacity:q,customLayers:pe,maxRadiusValue:Oe,categorical:re,dotColor:Z,collapseColorScaleByDefault:qe,highlightedIds:V,mapProperty:me,dotLegendTitle:xe,dotBorderColor:Ie,labelColor:Be,projectionRotate:K,rewindCoordinatesInMapData:Q,overlayMapData:m,overlayMapBorderColor:y,overlayMapBorderWidth:Ze,numberDisplayOptions:he,graphDownload:Pe}=a,ee=i.useMemo(()=>Q?z.index_default(f,{reverse:!0}):f,[f,Q]),ge=i.useMemo(()=>!Q||!m?m:z.index_default(m,{reverse:!0}),[m,Q]),[S,N]=i.useState(void 0),[ze,_e]=i.useState(qe===void 0?!(c<680):!qe),ae=i.useRef(null),[ne,W]=i.useState(void 0),[fe,L]=i.useState(void 0),[ie,$]=i.useState(void 0),[ye,h]=i.useState(void 0),k=i.useRef(null),I=so.useInView(k,{once:E.once,amount:E.amount}),B=i.useRef(null),P=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?ro.sqrt().domain([0,Oe]).range([.25,j]).nice():void 0,Ve=re?ao.ordinal().domain(s).range(t):no.threshold().domain(s).range(t);i.useEffect(()=>{const o=Bt.select(B.current),n=Bt.select(k.current),g=l=>{if(J==="noZoom")return!1;if(J==="button")return!l.type.includes("wheel");const Fe=l.type==="wheel",Te=l.type.startsWith("touch"),Ae=l.type==="mousedown"||l.type==="mousemove";return Te?!0:Fe?J==="scroll"?!0:l.ctrlKey:Ae&&!l.button&&!l.ctrlKey},w=z.zoom().scaleExtent(Ye).translateExtent(Je||[[-20,-20],[c+20,b+20]]).filter(g).on("zoom",({transform:l})=>{o.attr("transform",l)});n.call(w),ae.current=w},[b,c,J]);const te=z.index_default$1(ee),F=Kt.index_default(ee),We=(te[2]-te[0])*1.15,Le=(te[3]-te[1])*1.15,$e=c*190/960*360/We,ve=b*190/678*180/Le,T=x*Math.min($e,ve),A=oe==="mercator"?z.geoMercator().rotate(K).center(C||F.geometry.coordinates).translate([c/2,b/2]).scale(T):oe==="equalEarth"?z.geoEqualEarth().rotate(K).center(C||F.geometry.coordinates).translate([c/2,b/2]).scale(T):oe==="naturalEarth"?z.geoNaturalEarth1().rotate(K).center(C||F.geometry.coordinates).translate([c/2,b/2]).scale(T):oe==="orthographic"?z.geoOrthographic().rotate(K).center(C||F.geometry.coordinates).translate([c/2,b/2]).scale(T):z.geoAlbersUsa().rotate(K).center(C||F.geometry.coordinates).translate([c/2,b/2]).scale(T),se=z.geoPath().projection(A),je=o=>{if(!k.current||!ae.current)return;Bt.select(k.current).call(ae.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(ce.motion.svg,{width:`${c}px`,height:`${b}px`,viewBox:`0 0 ${c} ${b}`,ref:k,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:B,children:[pe.filter(o=>o.position==="before").map(o=>o.layer),ee.features.map((o,n)=>{if(!o.properties?.[me])return null;const g=se(o);return g?r.jsxRuntimeExports.jsx(ce.motion.g,{opacity:S?q:V?V.indexOf(o.properties[me])!==-1?1:q:1,children:r.jsxRuntimeExports.jsx("path",{d:g,style:{stroke:ue,strokeWidth:de,fill:De,vectorEffect:"non-scaling-stroke"}})},n):null}),r.jsxRuntimeExports.jsxs(lo.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const n=ee.features.findIndex(l=>o.id===l.properties[me]);if(n===-1)return null;const g=se(ee.features[n]);if(!g)return null;const w=ft.checkIfNullOrUndefined(o.x)?De:Ve(o.x);return r.jsxRuntimeExports.jsx(ce.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:S?S===w&&(!V||V.indexOf(o.id)!==-1)?1:q:V?V.indexOf(o.id)!==-1?1:q:1,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:l=>{L(o),h(l.clientY),$(l.clientX),H?.(o)},onMouseMove:l=>{L(o),h(l.clientY),$(l.clientX)},onMouseLeave:()=>{L(void 0),$(void 0),h(void 0),H?.(void 0)},onClick:()=>{(_||X)&&(Vt.isEqual(ne,o)&&Me?(W(void 0),_?.(void 0)):(W(o),_?.(o)))},children:r.jsxRuntimeExports.jsx(ce.motion.path,{d:g,variants:{initial:{fill:w,opacity:0},whileInView:{fill:w,opacity:1,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},style:{stroke:ue,strokeWidth:de,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)}),ge?.features.map((o,n)=>{const g=se(o);return g?r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("path",{d:g,style:{stroke:y||ue,strokeWidth:Ze||de+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},n):null}),e.filter(o=>!ft.checkIfNullOrUndefined(o.lat)&&!ft.checkIfNullOrUndefined(o.long)).map(o=>{const n=A([o.long,o.lat])[0]>.8*c?-1:1;return r.jsxRuntimeExports.jsxs(ce.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:Ne?Ne.indexOf(o.label||"")!==-1?1:q:1,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:g=>{L(o),h(g.clientY),$(g.clientX),H?.(o)},onMouseMove:g=>{L(o),h(g.clientY),$(g.clientX)},onMouseLeave:()=>{L(void 0),$(void 0),h(void 0),H?.(void 0)},onClick:()=>{(_||X)&&(Vt.isEqual(ne,o)&&Me?(W(void 0),_?.(void 0)):(W(o),_?.(o)))},transform:`translate(${A([o.long,o.lat])[0]},${A([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(ce.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:Z,stroke:Ie||Z},whileInView:{r:P?P(o.radius||0):j,fill:Z,stroke:Ie||Z,transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8,vectorEffect:"non-scaling-stroke"}}),O&&o.label?r.jsxRuntimeExports.jsx(ce.motion.text,{variants:{initial:{opacity:0,x:n*(P?P(o.radius||0):j)},whileInView:{opacity:1,x:n*(P?P(o.radius||0):j),transition:{duration:E.duration}}},initial:"initial",animate:I?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:r.mo("text-sm",Y?.graphObjectValues),style:{textAnchor:n===-1?"end":"start",fill:Be||"#000",vectorEffect:"non-scaling-stroke",...D?.graphObjectValues||{}},dx:n*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),pe.filter(o=>o.position==="after").map(o=>o.layer)]})}),Se===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",Y?.colorLegend),children:ze?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.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:()=>{_e(!1)},children:r.jsxRuntimeExports.jsx(yt.X,{})}),r.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:re?void 0:"340px"},children:[xe&&xe!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Z}}),r.jsxRuntimeExports.jsx(It._,{size:"xs",marginBottom:"none",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:xe})]}),r.jsxRuntimeExports.jsx(Wt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Ut,{}),r.jsxRuntimeExports.jsx(Wt.n,{size:"xl"})]}):null,v&&v!==""?r.jsxRuntimeExports.jsx(It._,{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:v}):null,re?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:s.map((o,n)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{N(t[n%t.length])},onMouseLeave:()=>{N(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[n%t.length]}}),r.jsxRuntimeExports.jsx(It._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},n))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[s.map((o,n)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{N(t[n])},onMouseLeave:()=>{N(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:n*320/t.length+1,y:1,width:320/t.length-2,height:8,className:S===t[n]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[n],...S===t[n]?{}:{stroke:t[n]}}}),r.jsxRuntimeExports.jsx("text",{x:(n+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:io.numberFormattingFunction(o,void 0,he?.precision??2,void 0,void 0,he?.locale||"en",he?.padZeros||!1)})]},n)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{N(t[s.length])},onMouseLeave:()=>{N(void 0)},x:s.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${S===t[s.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[s.length],...S===t[s.length]?{}:{stroke:t[s.length]}}})})]})})]})]}):r.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:()=>{_e(!0)},children:r.jsxRuntimeExports.jsx(yt.ExpandIcon,{})})}),J==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col undp-viz-zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>je("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:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>je("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:"–"})]}),Pe&&r.jsxRuntimeExports.jsx("div",{className:"absolute right-4 top-4 flex flex-col image-download-button",children:r.jsxRuntimeExports.jsx(oo.ImageDownloadButton,{nodeID:Pe,buttonSmall:!0})})]}),X&&ne!==void 0?r.jsxRuntimeExports.jsx(to.DetailsModal,{body:X,data:ne,setData:W,className:Y?.modal}):null,fe&&R&&ie&&ye?r.jsxRuntimeExports.jsx(eo.Tooltip,{data:fe,body:R,xPos:ie,yPos:ye,backgroundStyle:D?.tooltip,className:Y?.tooltip}):null]})}function jo(a){const e=r.compilerRuntimeExports.c(141),{data:t,mapData:f,graphTitle:v,colors:s,sources:j,graphDescription:b,height:c,width:x,footNote:C,mapColorLegendTitle:R,colorDomain:O,choroplethScaleType:de,radius:ue,scale:De,centerPoint:H,padding:Se,mapBorderWidth:Ye,mapNoDataColor:Je,backgroundColor:Ne,showLabels:_,mapBorderColor:Me,tooltip:X,relativeHeight:D,onSeriesMouseOver:Y,isWorldMap:oe,showColorScale:J,zoomScaleExtend:E,zoomTranslateExtend:q,graphID:pe,highlightedDataPoints:Oe,onSeriesMouseClick:re,graphDownload:Z,dataDownload:qe,showAntarctica:V,language:me,minHeight:xe,theme:Ie,ariaLabel:Be,resetSelectionOnDoubleClick:K,detailsOnClick:Q,styles:m,classNames:y,mapProjection:Ze,zoomInteraction:he,animate:Pe,dimmedOpacity:ee,customLayers:ge,maxRadiusValue:S,timeline:N,collapseColorScaleByDefault:ze,dotColor:_e,highlightedIds:ae,mapProperty:ne,dotLegendTitle:W,dotBorderColor:fe,labelColor:L,projectionRotate:ie,rewindCoordinatesInMapData:$,numberDisplayOptions:ye,mapOverlay:h}=a,k=f===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":f,I=C===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.":C,B=de===void 0?"threshold":de,P=ue===void 0?5:ue,Ve=De===void 0?.95:De,te=Ye===void 0?.5:Ye,F=Je===void 0?Ce.Colors.light.graphNoData:Je,We=Ne===void 0?!1:Ne,Le=_===void 0?!1:_,$e=Me===void 0?Ce.Colors.light.grays["gray-500"]:Me,ve=oe===void 0?!0:oe,T=J===void 0?!0:J;let A;e[0]!==E?(A=E===void 0?[.8,6]:E,e[0]=E,e[1]=A):A=e[1];const se=A,je=Z===void 0?!1:Z,o=qe===void 0?!1:qe,n=V===void 0?!1:V,g=me===void 0?"en":me,w=xe===void 0?0:xe,l=Ie===void 0?"light":Ie,Fe=K===void 0?!0:K,Te=Ze===void 0?"naturalEarth":Ze,Ae=he===void 0?"button":he,Ke=Pe===void 0?!1:Pe,vt=ee===void 0?.3:ee;let Qe;e[2]!==ge?(Qe=ge===void 0?[]:ge,e[2]=ge,e[3]=Qe):Qe=e[3];const jt=Qe;let et;e[4]!==N?(et=N===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:N,e[4]=N,e[5]=et):et=e[5];const d=et,bt=_e===void 0?Ce.Colors.primaryColors["blue-600"]:_e,Et=ne===void 0?"ISO3":ne,wt=L===void 0?Ce.Colors.primaryColors["blue-600"]:L;let tt;e[6]!==ie?(tt=ie===void 0?[0,0]:ie,e[6]=ie,e[7]=tt):tt=e[7];const kt=tt,Rt=$===void 0?!0:$,[le,Gt]=i.useState(0),[Ue,Ht]=i.useState(0),[U,Xt]=i.useState(d.autoplay);let Ge;if(e[8]!==t||e[9]!==d.dateFormat){let u;e[11]!==d.dateFormat?(u=M=>zt.parse(`${M.date}`,d.dateFormat||"yyyy",new Date).getTime(),e[11]=d.dateFormat,e[12]=u):u=e[12],Ge=[...new Set(t.filter(Oo).map(u))],Ge.sort(Mo),e[8]=t,e[9]=d.dateFormat,e[10]=Ge}else Ge=e[10];const p=Ge,[G,Ct]=i.useState(d.autoplay?0:p.length-1),[be,Yt]=i.useState(void 0),[Dt,Jt]=i.useState(void 0),St=i.useRef(null),Pt=i.useRef(null);let ot;e[13]!==B||e[14]!==O||e[15]!==s?.length||e[16]!==t?(ot=O||(B==="categorical"?po.getUniqValue(t,"x"):mo.getJenks(t.map(No),s?.length||4)),e[13]=B,e[14]=O,e[15]=s?.length,e[16]=t,e[17]=ot):ot=e[17];const He=ot;let rt,at;e[18]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{const u=new ResizeObserver(M=>{Gt(M[0].target.clientWidth||620),Ht(M[0].target.clientHeight||480)});return St.current&&u.observe(St.current),()=>u.disconnect()},at=[],e[18]=rt,e[19]=at):(rt=e[18],at=e[19]),i.useEffect(rt,at);let nt;e[20]===Symbol.for("react.memo_cache_sentinel")?(nt=u=>{Yt(u)},e[20]=nt):nt=e[20];const it=i.useEffectEvent(nt);let st;e[21]===Symbol.for("react.memo_cache_sentinel")?(st=u=>{Jt(u)},e[21]=st):st=e[21];const Xe=i.useEffectEvent(st);let lt;e[22]!==k||e[23]!==it?(lt=()=>{typeof k=="string"?Lt.fetchAndParseJSON(k).then(M=>{it(M)}):it(k)},e[22]=k,e[23]=it,e[24]=lt):lt=e[24];let ct;e[25]!==k?(ct=[k],e[25]=k,e[26]=ct):ct=e[26],i.useEffect(lt,ct);let dt;e[27]!==h?.mapData||e[28]!==Xe?(dt=()=>{h?.mapData||Xe(void 0),typeof h?.mapData=="string"?Lt.fetchAndParseJSON(h?.mapData).then(M=>{Xe(M)}):Xe(h?.mapData)},e[27]=h?.mapData,e[28]=Xe,e[29]=dt):dt=e[29];const Nt=h?.mapData;let ut;e[30]!==Nt?(ut=[Nt],e[30]=Nt,e[31]=ut):ut=e[31],i.useEffect(dt,ut);let pt,mt;e[32]!==U||e[33]!==d.speed||e[34]!==p?(pt=()=>{const u=setInterval(()=>{Ct(M=>M<p.length-1?M+1:0)},(d.speed||2)*1e3);return U||clearInterval(u),()=>clearInterval(u)},mt=[p,U,d.speed],e[32]=U,e[33]=d.speed,e[34]=p,e[35]=pt,e[36]=mt):(pt=e[35],mt=e[36]),i.useEffect(pt,mt);const Mt=d.dateFormat||"yyyy";let xt;e[37]!==G||e[38]!==Mt||e[39]!==d.showOnlyActiveDate||e[40]!==p?(xt=_t.getSliderMarks(p,G,d.showOnlyActiveDate,Mt),e[37]=G,e[38]=Mt,e[39]=d.showOnlyActiveDate,e[40]=p,e[41]=xt):xt=e[41];const ht=xt,Ot=y?.graphContainer,qt=m?.graphContainer;let Ee;e[42]!==y?.description||e[43]!==y?.title||e[44]!==t||e[45]!==o||e[46]!==b||e[47]!==v||e[48]!==m?.description||e[49]!==m?.title||e[50]!==x?(Ee=v||b||o?r.jsxRuntimeExports.jsx(uo.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:y?.title,description:y?.description},graphTitle:v,graphDescription:b,width:x,dataDownload:o?t.map(So).filter(Do).length>0?t.map(Co).filter(Ro):t.filter(ko):null}):null,e[42]=y?.description,e[43]=y?.title,e[44]=t,e[45]=o,e[46]=b,e[47]=v,e[48]=m?.description,e[49]=m?.title,e[50]=x,e[51]=Ee):Ee=e[51];let we;e[52]!==G||e[53]!==ht||e[54]!==U||e[55]!==d.enabled||e[56]!==p?(we=d.enabled&&p.length>0&&ht?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Xt(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?r.jsxRuntimeExports.jsx(yt.Pause,{}):r.jsxRuntimeExports.jsx(yt.Play,{})}),r.jsxRuntimeExports.jsx(_t.Nr,{min:p[0],max:p[p.length-1],marks:ht,step:null,defaultValue:p[p.length-1],value:p[G],onChangeComplete:u=>{Ct(p.indexOf(u))},onChange:u=>{Ct(p.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[52]=G,e[53]=ht,e[54]=U,e[55]=d.enabled,e[56]=p,e[57]=we):we=e[57];let ke;e[58]!==Ke||e[59]!==H||e[60]!==B||e[61]!==y||e[62]!==ze||e[63]!==s||e[64]!==jt||e[65]!==t||e[66]!==Q||e[67]!==vt||e[68]!==He||e[69]!==fe||e[70]!==bt||e[71]!==W||e[72]!==je||e[73]!==c||e[74]!==Oe||e[75]!==ae||e[76]!==G||e[77]!==ve||e[78]!==wt||e[79]!==$e||e[80]!==te||e[81]!==R||e[82]!==F||e[83]!==h?.mapBorderColor||e[84]!==h?.mapBorderWidth||e[85]!==Te||e[86]!==Et||e[87]!==be||e[88]!==S||e[89]!==w||e[90]!==ye||e[91]!==re||e[92]!==Y||e[93]!==Dt||e[94]!==kt||e[95]!==P||e[96]!==D||e[97]!==Fe||e[98]!==Rt||e[99]!==Ve||e[100]!==n||e[101]!==T||e[102]!==Le||e[103]!==m||e[104]!==Ue||e[105]!==le||e[106]!==l||e[107]!==d.dateFormat||e[108]!==d.enabled||e[109]!==X||e[110]!==p||e[111]!==x||e[112]!==Ae||e[113]!==se||e[114]!==q?(ke=r.jsxRuntimeExports.jsx($t.GraphArea,{ref:St,children:le&&Ue&&be?r.jsxRuntimeExports.jsx(vo,{dotColor:bt,data:t.filter(u=>d.enabled?`${u.date}`===zt.format(new Date(p[G]),d.dateFormat||"yyyy"):u),mapData:n?be:{...be,features:be.features.filter(wo)},overlayMapData:Dt,overlayMapBorderColor:h?.mapBorderColor,overlayMapBorderWidth:h?.mapBorderWidth,colorDomain:He,width:le,height:Ue,scale:Ve,centerPoint:H,colors:s||(B==="categorical"?Ce.Colors[l].sequentialColors[`neutralColorsx0${He.length}`]:Ce.Colors[l].sequentialColors[`neutralColorsx0${He.length+1}`]),mapColorLegendTitle:R,radius:P,categorical:B==="categorical",mapBorderWidth:te,mapNoDataColor:F,mapBorderColor:$e,tooltip:X,onSeriesMouseOver:Y,showLabels:Le,isWorldMap:ve,showColorScale:T,zoomScaleExtend:se,zoomTranslateExtend:q,onSeriesMouseClick:re,highlightedDataPoints:Oe,resetSelectionOnDoubleClick:Fe,styles:m,classNames:y,zoomInteraction:Ae,detailsOnClick:Q,mapProjection:Te||(ve?"naturalEarth":"mercator"),animate:Ke===!0?{duration:.5,once:!0,amount:.5}:Ke||{duration:0,once:!0,amount:0},dimmedOpacity:vt,customLayers:jt,maxRadiusValue:ft.checkIfNullOrUndefined(S)?Math.max(...t.map(Eo).filter(bo)):S,collapseColorScaleByDefault:ze,highlightedIds:ae,mapProperty:Et,dotLegendTitle:W,dotBorderColor:fe,labelColor:wt,projectionRotate:kt,rewindCoordinatesInMapData:Rt,numberDisplayOptions:ye,graphDownload:je?Pt:void 0}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(w,c||(D?w?(x||le)*D>w?(x||le)*D:w:(x||le)*D:Ue))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Zt.w,{"aria-label":"Loading graph"})})}),e[58]=Ke,e[59]=H,e[60]=B,e[61]=y,e[62]=ze,e[63]=s,e[64]=jt,e[65]=t,e[66]=Q,e[67]=vt,e[68]=He,e[69]=fe,e[70]=bt,e[71]=W,e[72]=je,e[73]=c,e[74]=Oe,e[75]=ae,e[76]=G,e[77]=ve,e[78]=wt,e[79]=$e,e[80]=te,e[81]=R,e[82]=F,e[83]=h?.mapBorderColor,e[84]=h?.mapBorderWidth,e[85]=Te,e[86]=Et,e[87]=be,e[88]=S,e[89]=w,e[90]=ye,e[91]=re,e[92]=Y,e[93]=Dt,e[94]=kt,e[95]=P,e[96]=D,e[97]=Fe,e[98]=Rt,e[99]=Ve,e[100]=n,e[101]=T,e[102]=Le,e[103]=m,e[104]=Ue,e[105]=le,e[106]=l,e[107]=d.dateFormat,e[108]=d.enabled,e[109]=X,e[110]=p,e[111]=x,e[112]=Ae,e[113]=se,e[114]=q,e[115]=ke):ke=e[115];let Re;e[116]!==y?.footnote||e[117]!==y?.source||e[118]!==I||e[119]!==j||e[120]!==m?.footnote||e[121]!==m?.source||e[122]!==x?(Re=j||I?r.jsxRuntimeExports.jsx(co.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:y?.footnote,source:y?.source},sources:j,footNote:I,width:x}):null,e[116]=y?.footnote,e[117]=y?.source,e[118]=I,e[119]=j,e[120]=m?.footnote,e[121]=m?.source,e[122]=x,e[123]=Re):Re=e[123];let gt;return e[124]!==Be||e[125]!==We||e[126]!==pe||e[127]!==c||e[128]!==g||e[129]!==w||e[130]!==Se||e[131]!==D||e[132]!==Ot||e[133]!==qt||e[134]!==Ee||e[135]!==we||e[136]!==ke||e[137]!==Re||e[138]!==l||e[139]!==x?(gt=r.jsxRuntimeExports.jsxs($t.GraphContainer,{className:Ot,style:qt,id:pe,ref:Pt,"aria-label":Be,backgroundColor:We,theme:l,language:g,minHeight:w,width:x,height:c,relativeHeight:D,padding:Se,children:[Ee,we,ke,Re]}),e[124]=Be,e[125]=We,e[126]=pe,e[127]=c,e[128]=g,e[129]=w,e[130]=Se,e[131]=D,e[132]=Ot,e[133]=qt,e[134]=Ee,e[135]=we,e[136]=ke,e[137]=Re,e[138]=l,e[139]=x,e[140]=gt):gt=e[140],gt}function bo(a){return a!=null}function Eo(a){return a.radius}function wo(a){return a.properties?.NAME!=="Antarctica"}function ko(a){return a!==void 0}function Ro(a){return a!==void 0}function Co(a){return a.data}function Do(a){return a!==void 0}function So(a){return a.data}function No(a){return a.x}function Mo(a,e){return a-e}function Oo(a){return a.date}exports.HybridMap=jo;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-D4pAp7u0.cjs"),i=require("react"),zt=require("./parse-xYI9yrvL.cjs"),_t=require("./getSliderMarks-BzrpHrHS.cjs"),Zt=require("./Spinner-WHzzloYQ.cjs"),Vt=require("./index-DQA8q5sC.cjs"),L=require("./index-DLFt97gy.cjs"),It=require("./Typography-BqmyF1gP.cjs"),Kt=require("./index-C5K--w8d.cjs"),Wt=require("./Source-PKuwZOn3.cjs"),Qt=require("./index-w64Zl8io-DrMm5QSb.cjs"),eo=require("./Tooltip-C9F3uYG0.cjs"),yt=require("./index-BhI7mBJx.cjs"),to=require("./DetailsModal-Du8Fr1QD.cjs"),oo=require("./ImageDownloadButton.cjs"),ro=require("./CsvDownloadButton.cjs"),ao=require("./pow-BnyPO-NX.cjs"),no=require("./ordinal-CrsysVE-.cjs"),io=require("./threshold-DNsSUf8Q.cjs"),Bt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-CqH8m8IQ.cjs"),ft=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),so=require("./numberFormattingFunction-u2iNHL_c.cjs"),lo=require("./use-in-view-dnRv_qqF.cjs"),co=require("./index-FXfr51ZM.cjs"),uo=require("./GraphFooter.cjs"),po=require("./GraphHeader.cjs"),Se=require("./Colors.cjs"),Lt=require("./fetchAndParseData-QTF6tjij.cjs"),$t=require("./GraphContainer-Cul9b74X.cjs"),mo=require("./getUniqValue-NX8DgwND.cjs"),xo=require("./getJenks-BzJvhy_H.cjs");function ho(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const go=ho(i);var fo="Separator",Ft="horizontal",yo=["horizontal","vertical"],Tt=go.forwardRef((a,e)=>{const{decorative:t,orientation:g=Ft,...y}=a,s=vo(g)?g:Ft,v=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return r.ae.jsx(Qt.w.div,{"data-orientation":s,...v,...y,ref:e})});Tt.displayName=fo;function vo(a){return yo.includes(a)}var At=Tt;const Ut=i.forwardRef((a,e)=>{const t=r._.c(14);let g,y,s,v;t[0]!==a?({className:g,variant:s,orientation:v,...y}=a,t[0]=a,t[1]=g,t[2]=y,t[3]=s,t[4]=v):(g=t[1],y=t[2],s=t[3],v=t[4]);const j=s===void 0?"dark":s,c=v===void 0?"horizontal":v,h=c==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",C=j==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let D;t[5]!==g||t[6]!==h||t[7]!==C?(D=r.mo(h,C,g),t[5]=g,t[6]=h,t[7]=C,t[8]=D):D=t[8];let q;return t[9]!==c||t[10]!==y||t[11]!==e||t[12]!==D?(q=r.ae.jsx(At,{...y,ref:e,orientation:c,className:D}),t[9]=c,t[10]=y,t[11]=e,t[12]=D,t[13]=q):q=t[13],q});Ut.displayName=At.displayName;function jo(a){const{data:e,colors:t,mapData:g,mapColorLegendTitle:y,colorDomain:s,radius:v,height:j,width:c,scale:h,centerPoint:C,tooltip:D,showLabels:q,mapBorderWidth:ce,mapBorderColor:de,mapNoDataColor:Ne,onSeriesMouseOver:H,showColorScale:Oe,zoomScaleExtend:Ye,zoomTranslateExtend:Je,highlightedDataPoints:Me,onSeriesMouseClick:$,resetSelectionOnDoubleClick:qe,detailsOnClick:X,styles:S,classNames:Y,mapProjection:ae,zoomInteraction:J,animate:b,dimmedOpacity:I,customLayers:ue,maxRadiusValue:Ie,categorical:ne,dotColor:Z,collapseColorScaleByDefault:Be,highlightedIds:F,mapProperty:pe,dotLegendTitle:me,dotBorderColor:Pe,labelColor:ze,projectionRotate:K,rewindCoordinatesInMapData:Q,overlayMapData:x,overlayMapBorderColor:f,overlayMapBorderWidth:Ze,numberDisplayOptions:xe,graphDownload:he,dataDownload:ee}=a,B=i.useMemo(()=>Q?L.index_default(g,{reverse:!0}):g,[g,Q]),ge=i.useMemo(()=>!Q||!x?x:L.index_default(x,{reverse:!0}),[x,Q]),[N,P]=i.useState(void 0),[Ke,fe]=i.useState(Be===void 0?!(c<680):!Be),ye=i.useRef(null),[te,T]=i.useState(void 0),[_e,O]=i.useState(void 0),[Ve,z]=i.useState(void 0),[E,w]=i.useState(void 0),_=i.useRef(null),R=lo.useInView(_,{once:b.once,amount:b.amount}),ve=i.useRef(null),V=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?ao.sqrt().domain([0,Ie]).range([.25,v]).nice():void 0,We=ne?no.ordinal().domain(s).range(t):io.threshold().domain(s).range(t);i.useEffect(()=>{const o=Bt.select(ve.current),n=Bt.select(_.current),l=p=>{if(J==="noZoom")return!1;if(J==="button")return!p.type.includes("wheel");const Te=p.type==="wheel",Ae=p.type.startsWith("touch"),Ee=p.type==="mousedown"||p.type==="mousemove";return Ae?!0:Te?J==="scroll"?!0:p.ctrlKey:Ee&&!p.button&&!p.ctrlKey},k=L.zoom().scaleExtent(Ye).translateExtent(Je||[[-20,-20],[c+20,j+20]]).filter(l).on("zoom",({transform:p})=>{o.attr("transform",p)});n.call(k),ye.current=k},[j,c,J]);const oe=L.index_default$1(B),A=Kt.index_default(B),Le=(oe[2]-oe[0])*1.15,$e=(oe[3]-oe[1])*1.15,je=c*190/960*360/Le,Fe=j*190/678*180/$e,W=h*Math.min(je,Fe),re=ae==="mercator"?L.geoMercator().rotate(K).center(C||A.geometry.coordinates).translate([c/2,j/2]).scale(W):ae==="equalEarth"?L.geoEqualEarth().rotate(K).center(C||A.geometry.coordinates).translate([c/2,j/2]).scale(W):ae==="naturalEarth"?L.geoNaturalEarth1().rotate(K).center(C||A.geometry.coordinates).translate([c/2,j/2]).scale(W):ae==="orthographic"?L.geoOrthographic().rotate(K).center(C||A.geometry.coordinates).translate([c/2,j/2]).scale(W):L.geoAlbersUsa().rotate(K).center(C||A.geometry.coordinates).translate([c/2,j/2]).scale(W),ie=L.geoPath().projection(re),be=o=>{if(!_.current||!ye.current)return;Bt.select(_.current).call(ye.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(le.motion.svg,{width:`${c}px`,height:`${j}px`,viewBox:`0 0 ${c} ${j}`,ref:_,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ve,children:[ue.filter(o=>o.position==="before").map(o=>o.layer),B.features.map((o,n)=>{if(!o.properties?.[pe])return null;const l=ie(o);return l?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:N?I:F?F.indexOf(o.properties[pe])!==-1?1:I:1,children:r.jsxRuntimeExports.jsx("path",{d:l,style:{stroke:de,strokeWidth:ce,fill:Ne,vectorEffect:"non-scaling-stroke"}})},n):null}),r.jsxRuntimeExports.jsxs(co.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const n=B.features.findIndex(p=>o.id===p.properties[pe]);if(n===-1)return null;const l=ie(B.features[n]);if(!l)return null;const k=ft.checkIfNullOrUndefined(o.x)?Ne:We(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:N?N===k&&(!F||F.indexOf(o.id)!==-1)?1:I:F?F.indexOf(o.id)!==-1?1:I:1,transition:{duration:b.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:p=>{O(o),w(p.clientY),z(p.clientX),H?.(o)},onMouseMove:p=>{O(o),w(p.clientY),z(p.clientX)},onMouseLeave:()=>{O(void 0),z(void 0),w(void 0),H?.(void 0)},onClick:()=>{($||X)&&(Vt.isEqual(te,o)&&qe?(T(void 0),$?.(void 0)):(T(o),$?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:l,variants:{initial:{fill:k,opacity:0},whileInView:{fill:k,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:de,strokeWidth:ce,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)}),ge?.features.map((o,n)=>{const l=ie(o);return l?r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("path",{d:l,style:{stroke:f||de,strokeWidth:Ze||ce+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},n):null}),e.filter(o=>!ft.checkIfNullOrUndefined(o.lat)&&!ft.checkIfNullOrUndefined(o.long)).map(o=>{const n=re([o.long,o.lat])[0]>.8*c?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:Me?Me.indexOf(o.label||"")!==-1?1:I:1,transition:{duration:b.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:l=>{O(o),w(l.clientY),z(l.clientX),H?.(o)},onMouseMove:l=>{O(o),w(l.clientY),z(l.clientX)},onMouseLeave:()=>{O(void 0),z(void 0),w(void 0),H?.(void 0)},onClick:()=>{($||X)&&(Vt.isEqual(te,o)&&qe?(T(void 0),$?.(void 0)):(T(o),$?.(o)))},transform:`translate(${re([o.long,o.lat])[0]},${re([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:Z,stroke:Pe||Z},whileInView:{r:V?V(o.radius||0):v,fill:Z,stroke:Pe||Z,transition:{duration:b.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{r:0,transition:{duration:b.duration}},style:{fillOpacity:.8,vectorEffect:"non-scaling-stroke"}}),q&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:n*(V?V(o.radius||0):v)},whileInView:{opacity:1,x:n*(V?V(o.radius||0):v),transition:{duration:b.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},y:0,className:r.mo("text-sm",Y?.graphObjectValues),style:{textAnchor:n===-1?"end":"start",fill:ze||"#000",vectorEffect:"non-scaling-stroke",...S?.graphObjectValues||{}},dx:n*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ue.filter(o=>o.position==="after").map(o=>o.layer)]})}),Oe===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",Y?.colorLegend),children:Ke?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.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:()=>{fe(!1)},children:r.jsxRuntimeExports.jsx(yt.X,{})}),r.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:ne?void 0:"340px"},children:[me&&me!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Z}}),r.jsxRuntimeExports.jsx(It._,{size:"xs",marginBottom:"none",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:me})]}),r.jsxRuntimeExports.jsx(Wt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Ut,{}),r.jsxRuntimeExports.jsx(Wt.n,{size:"xl"})]}):null,y&&y!==""?r.jsxRuntimeExports.jsx(It._,{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:y}):null,ne?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:s.map((o,n)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{P(t[n%t.length])},onMouseLeave:()=>{P(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[n%t.length]}}),r.jsxRuntimeExports.jsx(It._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},n))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[s.map((o,n)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{P(t[n])},onMouseLeave:()=>{P(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:n*320/t.length+1,y:1,width:320/t.length-2,height:8,className:N===t[n]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[n],...N===t[n]?{}:{stroke:t[n]}}}),r.jsxRuntimeExports.jsx("text",{x:(n+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:so.numberFormattingFunction(o,void 0,xe?.precision??2,void 0,void 0,xe?.locale||"en",xe?.padZeros||!1)})]},n)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{P(t[s.length])},onMouseLeave:()=>{P(void 0)},x:s.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${N===t[s.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[s.length],...N===t[s.length]?{}:{stroke:t[s.length]}}})})]})})]})]}):r.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:()=>{fe(!0)},children:r.jsxRuntimeExports.jsx(yt.ExpandIcon,{})})}),J==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col undp-viz-zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>be("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:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>be("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:"–"})]}),(he||ee)&&r.jsxRuntimeExports.jsxs("div",{className:"absolute right-4 top-4 flex flex-col image-download-button gap-2",children:[he&&r.jsxRuntimeExports.jsx(oo.ImageDownloadButton,{nodeID:he,buttonSmall:!0,className:"p-1"}),ee&&ee.length>0&&r.jsxRuntimeExports.jsx(ro.CsvDownloadButton,{csvData:ee,buttonSmall:!0,headers:Object.keys(ee[0]).map(o=>({label:o,key:o})),className:"p-1"})]})]}),X&&te!==void 0?r.jsxRuntimeExports.jsx(to.DetailsModal,{body:X,data:te,setData:T,className:Y?.modal}):null,_e&&D&&Ve&&E?r.jsxRuntimeExports.jsx(eo.Tooltip,{data:_e,body:D,xPos:Ve,yPos:E,backgroundStyle:S?.tooltip,className:Y?.tooltip}):null]})}function bo(a){const e=r.compilerRuntimeExports.c(140),{data:t,mapData:g,graphTitle:y,colors:s,sources:v,graphDescription:j,height:c,width:h,footNote:C,mapColorLegendTitle:D,colorDomain:q,choroplethScaleType:ce,radius:de,scale:Ne,centerPoint:H,padding:Oe,mapBorderWidth:Ye,mapNoDataColor:Je,backgroundColor:Me,showLabels:$,mapBorderColor:qe,tooltip:X,relativeHeight:S,onSeriesMouseOver:Y,isWorldMap:ae,showColorScale:J,zoomScaleExtend:b,zoomTranslateExtend:I,graphID:ue,highlightedDataPoints:Ie,onSeriesMouseClick:ne,graphDownload:Z,dataDownload:Be,showAntarctica:F,language:pe,minHeight:me,theme:Pe,ariaLabel:ze,resetSelectionOnDoubleClick:K,detailsOnClick:Q,styles:x,classNames:f,mapProjection:Ze,zoomInteraction:xe,animate:he,dimmedOpacity:ee,customLayers:B,maxRadiusValue:ge,timeline:N,collapseColorScaleByDefault:P,dotColor:Ke,highlightedIds:fe,mapProperty:ye,dotLegendTitle:te,dotBorderColor:T,labelColor:_e,projectionRotate:O,rewindCoordinatesInMapData:Ve,numberDisplayOptions:z,mapOverlay:E}=a,w=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,_=C===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.":C,R=ce===void 0?"threshold":ce,ve=de===void 0?5:de,V=Ne===void 0?.95:Ne,We=Ye===void 0?.5:Ye,oe=Je===void 0?Se.Colors.light.graphNoData:Je,A=Me===void 0?!1:Me,Le=$===void 0?!1:$,$e=qe===void 0?Se.Colors.light.grays["gray-500"]:qe,je=ae===void 0?!0:ae,Fe=J===void 0?!0:J;let W;e[0]!==b?(W=b===void 0?[.8,6]:b,e[0]=b,e[1]=W):W=e[1];const re=W,ie=Z===void 0?!1:Z,be=Be===void 0?!1:Be,o=F===void 0?!1:F,n=pe===void 0?"en":pe,l=me===void 0?0:me,k=Pe===void 0?"light":Pe,p=K===void 0?!0:K,Te=Ze===void 0?"naturalEarth":Ze,Ae=xe===void 0?"button":xe,Ee=he===void 0?!1:he,vt=ee===void 0?.3:ee;let Qe;e[2]!==B?(Qe=B===void 0?[]:B,e[2]=B,e[3]=Qe):Qe=e[3];const jt=Qe;let et;e[4]!==N?(et=N===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:N,e[4]=N,e[5]=et):et=e[5];const d=et,bt=Ke===void 0?Se.Colors.primaryColors["blue-600"]:Ke,Et=ye===void 0?"ISO3":ye,wt=_e===void 0?Se.Colors.primaryColors["blue-600"]:_e;let tt;e[6]!==O?(tt=O===void 0?[0,0]:O,e[6]=O,e[7]=tt):tt=e[7];const kt=tt,Dt=Ve===void 0?!0:Ve,[se,Gt]=i.useState(0),[Ue,Ht]=i.useState(0),[U,Xt]=i.useState(d.autoplay);let Ge;if(e[8]!==t||e[9]!==d.dateFormat){let u;e[11]!==d.dateFormat?(u=M=>zt.parse(`${M.date}`,d.dateFormat||"yyyy",new Date).getTime(),e[11]=d.dateFormat,e[12]=u):u=e[12],Ge=[...new Set(t.filter(qo).map(u))],Ge.sort(Mo),e[8]=t,e[9]=d.dateFormat,e[10]=Ge}else Ge=e[10];const m=Ge,[G,Rt]=i.useState(d.autoplay?0:m.length-1),[we,Yt]=i.useState(void 0),[Ct,Jt]=i.useState(void 0),St=i.useRef(null),Pt=i.useRef(null);let ot;e[13]!==R||e[14]!==q||e[15]!==s?.length||e[16]!==t?(ot=q||(R==="categorical"?mo.getUniqValue(t,"x"):xo.getJenks(t.map(Oo),s?.length||4)),e[13]=R,e[14]=q,e[15]=s?.length,e[16]=t,e[17]=ot):ot=e[17];const He=ot;let rt,at;e[18]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{const u=new ResizeObserver(M=>{Gt(M[0].target.clientWidth||620),Ht(M[0].target.clientHeight||480)});return St.current&&u.observe(St.current),()=>u.disconnect()},at=[],e[18]=rt,e[19]=at):(rt=e[18],at=e[19]),i.useEffect(rt,at);let nt;e[20]===Symbol.for("react.memo_cache_sentinel")?(nt=u=>{Yt(u)},e[20]=nt):nt=e[20];const it=i.useEffectEvent(nt);let st;e[21]===Symbol.for("react.memo_cache_sentinel")?(st=u=>{Jt(u)},e[21]=st):st=e[21];const Xe=i.useEffectEvent(st);let lt;e[22]!==w||e[23]!==it?(lt=()=>{typeof w=="string"?Lt.fetchAndParseJSON(w).then(M=>{it(M)}):it(w)},e[22]=w,e[23]=it,e[24]=lt):lt=e[24];let ct;e[25]!==w?(ct=[w],e[25]=w,e[26]=ct):ct=e[26],i.useEffect(lt,ct);let dt;e[27]!==E?.mapData||e[28]!==Xe?(dt=()=>{E?.mapData||Xe(void 0),typeof E?.mapData=="string"?Lt.fetchAndParseJSON(E?.mapData).then(M=>{Xe(M)}):Xe(E?.mapData)},e[27]=E?.mapData,e[28]=Xe,e[29]=dt):dt=e[29];const Nt=E?.mapData;let ut;e[30]!==Nt?(ut=[Nt],e[30]=Nt,e[31]=ut):ut=e[31],i.useEffect(dt,ut);let pt,mt;e[32]!==U||e[33]!==d.speed||e[34]!==m?(pt=()=>{const u=setInterval(()=>{Rt(M=>M<m.length-1?M+1:0)},(d.speed||2)*1e3);return U||clearInterval(u),()=>clearInterval(u)},mt=[m,U,d.speed],e[32]=U,e[33]=d.speed,e[34]=m,e[35]=pt,e[36]=mt):(pt=e[35],mt=e[36]),i.useEffect(pt,mt);const Ot=d.dateFormat||"yyyy";let xt;e[37]!==G||e[38]!==Ot||e[39]!==d.showOnlyActiveDate||e[40]!==m?(xt=_t.getSliderMarks(m,G,d.showOnlyActiveDate,Ot),e[37]=G,e[38]=Ot,e[39]=d.showOnlyActiveDate,e[40]=m,e[41]=xt):xt=e[41];const ht=xt,Mt=f?.graphContainer,qt=x?.graphContainer;let ke;e[42]!==f?.description||e[43]!==f?.title||e[44]!==j||e[45]!==y||e[46]!==x?.description||e[47]!==x?.title||e[48]!==h?(ke=y||j?r.jsxRuntimeExports.jsx(po.GraphHeader,{styles:{title:x?.title,description:x?.description},classNames:{title:f?.title,description:f?.description},graphTitle:y,graphDescription:j,width:h}):null,e[42]=f?.description,e[43]=f?.title,e[44]=j,e[45]=y,e[46]=x?.description,e[47]=x?.title,e[48]=h,e[49]=ke):ke=e[49];let De;e[50]!==G||e[51]!==ht||e[52]!==U||e[53]!==d.enabled||e[54]!==m?(De=d.enabled&&m.length>0&&ht?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Xt(!U)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":U?"Click to pause animation":"Click to play animation",children:U?r.jsxRuntimeExports.jsx(yt.Pause,{}):r.jsxRuntimeExports.jsx(yt.Play,{})}),r.jsxRuntimeExports.jsx(_t.Nr,{min:m[0],max:m[m.length-1],marks:ht,step:null,defaultValue:m[m.length-1],value:m[G],onChangeComplete:u=>{Rt(m.indexOf(u))},onChange:u=>{Rt(m.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[50]=G,e[51]=ht,e[52]=U,e[53]=d.enabled,e[54]=m,e[55]=De):De=e[55];let Re;e[56]!==Ee||e[57]!==H||e[58]!==R||e[59]!==f||e[60]!==P||e[61]!==s||e[62]!==jt||e[63]!==t||e[64]!==be||e[65]!==Q||e[66]!==vt||e[67]!==He||e[68]!==T||e[69]!==bt||e[70]!==te||e[71]!==ie||e[72]!==c||e[73]!==Ie||e[74]!==fe||e[75]!==G||e[76]!==je||e[77]!==wt||e[78]!==$e||e[79]!==We||e[80]!==D||e[81]!==oe||e[82]!==E?.mapBorderColor||e[83]!==E?.mapBorderWidth||e[84]!==Te||e[85]!==Et||e[86]!==we||e[87]!==ge||e[88]!==l||e[89]!==z||e[90]!==ne||e[91]!==Y||e[92]!==Ct||e[93]!==kt||e[94]!==ve||e[95]!==S||e[96]!==p||e[97]!==Dt||e[98]!==V||e[99]!==o||e[100]!==Fe||e[101]!==Le||e[102]!==x||e[103]!==Ue||e[104]!==se||e[105]!==k||e[106]!==d.dateFormat||e[107]!==d.enabled||e[108]!==X||e[109]!==m||e[110]!==h||e[111]!==Ae||e[112]!==re||e[113]!==I?(Re=r.jsxRuntimeExports.jsx($t.GraphArea,{ref:St,children:se&&Ue&&we?r.jsxRuntimeExports.jsx(jo,{dotColor:bt,data:t.filter(u=>d.enabled?`${u.date}`===zt.format(new Date(m[G]),d.dateFormat||"yyyy"):u),mapData:o?we:{...we,features:we.features.filter(No)},overlayMapData:Ct,overlayMapBorderColor:E?.mapBorderColor,overlayMapBorderWidth:E?.mapBorderWidth,colorDomain:He,width:se,height:Ue,scale:V,centerPoint:H,colors:s||(R==="categorical"?Se.Colors[k].sequentialColors[`neutralColorsx0${He.length}`]:Se.Colors[k].sequentialColors[`neutralColorsx0${He.length+1}`]),mapColorLegendTitle:D,radius:ve,categorical:R==="categorical",mapBorderWidth:We,mapNoDataColor:oe,mapBorderColor:$e,tooltip:X,onSeriesMouseOver:Y,showLabels:Le,isWorldMap:je,showColorScale:Fe,zoomScaleExtend:re,zoomTranslateExtend:I,onSeriesMouseClick:ne,highlightedDataPoints:Ie,resetSelectionOnDoubleClick:p,styles:x,classNames:f,zoomInteraction:Ae,detailsOnClick:Q,mapProjection:Te||(je?"naturalEarth":"mercator"),animate:Ee===!0?{duration:.5,once:!0,amount:.5}:Ee||{duration:0,once:!0,amount:0},dimmedOpacity:vt,customLayers:jt,maxRadiusValue:ft.checkIfNullOrUndefined(ge)?Math.max(...t.map(So).filter(Co)):ge,collapseColorScaleByDefault:P,highlightedIds:fe,mapProperty:Et,dotLegendTitle:te,dotBorderColor:T,labelColor:wt,projectionRotate:kt,rewindCoordinatesInMapData:Dt,numberDisplayOptions:z,graphDownload:ie?Pt:void 0,dataDownload:be?t.map(Ro).filter(Do).length>0?t.map(ko).filter(wo):t.filter(Eo):null}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(l,c||(S?l?(h||se)*S>l?(h||se)*S:l:(h||se)*S:Ue))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Zt.w,{"aria-label":"Loading graph"})})}),e[56]=Ee,e[57]=H,e[58]=R,e[59]=f,e[60]=P,e[61]=s,e[62]=jt,e[63]=t,e[64]=be,e[65]=Q,e[66]=vt,e[67]=He,e[68]=T,e[69]=bt,e[70]=te,e[71]=ie,e[72]=c,e[73]=Ie,e[74]=fe,e[75]=G,e[76]=je,e[77]=wt,e[78]=$e,e[79]=We,e[80]=D,e[81]=oe,e[82]=E?.mapBorderColor,e[83]=E?.mapBorderWidth,e[84]=Te,e[85]=Et,e[86]=we,e[87]=ge,e[88]=l,e[89]=z,e[90]=ne,e[91]=Y,e[92]=Ct,e[93]=kt,e[94]=ve,e[95]=S,e[96]=p,e[97]=Dt,e[98]=V,e[99]=o,e[100]=Fe,e[101]=Le,e[102]=x,e[103]=Ue,e[104]=se,e[105]=k,e[106]=d.dateFormat,e[107]=d.enabled,e[108]=X,e[109]=m,e[110]=h,e[111]=Ae,e[112]=re,e[113]=I,e[114]=Re):Re=e[114];let Ce;e[115]!==f?.footnote||e[116]!==f?.source||e[117]!==_||e[118]!==v||e[119]!==x?.footnote||e[120]!==x?.source||e[121]!==h?(Ce=v||_?r.jsxRuntimeExports.jsx(uo.GraphFooter,{styles:{footnote:x?.footnote,source:x?.source},classNames:{footnote:f?.footnote,source:f?.source},sources:v,footNote:_,width:h}):null,e[115]=f?.footnote,e[116]=f?.source,e[117]=_,e[118]=v,e[119]=x?.footnote,e[120]=x?.source,e[121]=h,e[122]=Ce):Ce=e[122];let gt;return e[123]!==ze||e[124]!==A||e[125]!==ue||e[126]!==c||e[127]!==n||e[128]!==l||e[129]!==Oe||e[130]!==S||e[131]!==Mt||e[132]!==qt||e[133]!==ke||e[134]!==De||e[135]!==Re||e[136]!==Ce||e[137]!==k||e[138]!==h?(gt=r.jsxRuntimeExports.jsxs($t.GraphContainer,{className:Mt,style:qt,id:ue,ref:Pt,"aria-label":ze,backgroundColor:A,theme:k,language:n,minHeight:l,width:h,height:c,relativeHeight:S,padding:Oe,children:[ke,De,Re,Ce]}),e[123]=ze,e[124]=A,e[125]=ue,e[126]=c,e[127]=n,e[128]=l,e[129]=Oe,e[130]=S,e[131]=Mt,e[132]=qt,e[133]=ke,e[134]=De,e[135]=Re,e[136]=Ce,e[137]=k,e[138]=h,e[139]=gt):gt=e[139],gt}function Eo(a){return a!==void 0}function wo(a){return a!==void 0}function ko(a){return a.data}function Do(a){return a!==void 0}function Ro(a){return a.data}function Co(a){return a!=null}function So(a){return a.radius}function No(a){return a.properties?.NAME!=="Antarctica"}function Oo(a){return a.x}function Mo(a,e){return a-e}function qo(a){return a.date}exports.HybridMap=bo;
2
2
  //# sourceMappingURL=HybridMap.cjs.map