@undp/data-viz 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +195 -195
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +1 -1
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +1 -1
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +2 -2
- package/dist/HybridMap.js.map +1 -1
- 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 { 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 { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\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}\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 } = 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 [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];\r\n const latDiff = bounds[3] - bounds[1];\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 }}\r\n />\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 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.length !== 0\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 }}\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 ...(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='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 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 </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\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} 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\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 } = 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [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 || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === 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(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\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 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 />\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","formattedMapData","useMemo","rewind","reverse","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","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","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","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","light","graphNoData","grays","t28","t29","t30","t31","enabled","autoplay","showOnlyActiveDate","t32","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t33","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t34","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t35","shape","onUpdateShape","useEffectEvent","t36","fetchAndParseJSON","then","d_1","t37","t38","t39","speed","interval","setInterval","clearInterval","t40","t41","getSliderMarks","markObj","t42","graphContainer","t43","t44","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t45","Pause","Play","SliderUI","nextValue","nextValue_0","t46","GraphArea","d_7","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t47","footnote","source","GraphFooter","t48","GraphContainer","d_9","d_8","el_1","el_0","properties","NAME","d_4","d_3","d_2","d_6","d_5","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8EO,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,EAAAA,IACElC,GACEmC,IAAmBC,GAAQ,MAC1BF,KAEEG,GAAOlC,GAAS;AAAA,IAAEmC,SAAS;AAAA,EAAA,CAAM,IAFAnC,GAGvC,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AAA0S,GAAAgB,GAAA;AAAA,SAuNyB1L,EAAED;AAAM;AAvNjC,SAAAyK,GAAAmB,GAAA;AAAA,SA8MyB3L,EAAED;AAAM;AA9MjC,SAAAwK,GAAAvK,GAAA;AAAA,SAyM4BA,EAAE4L,WAAWC,SAAU;AAAY;AAzM/D,SAAAjC,GAAAkC,GAAA;AAAA,SAwJ4BrQ,MAAMrB;AAAS;AAxJ3C,SAAAuP,GAAAoC,GAAA;AAAA,SAuJ6CtQ,MAAMrB;AAAS;AAvJ5D,SAAAsP,GAAAsC,GAAA;AAAA,SAuJyBvQ,EAAC9D;AAAK;AAvJ/B,SAAA8R,GAAAwC,GAAA;AAAA,SAsJ2CxQ,MAAMrB;AAAS;AAtJ1D,SAAAoP,GAAA0C,GAAA;AAAA,SAsJuBzQ,EAAC9D;AAAK;AAtJ7B,SAAAgP,GAAAwF,GAAAC,GAAA;AAAA,SAkEkBD,IAAIC;AAAC;AAlEvB,SAAA3F,GAAAhL,GAAA;AAAA,SA8DgBA,EAAC4K;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 { 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 { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\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}\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 } = 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 [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];\r\n const latDiff = bounds[3] - bounds[1];\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 }}\r\n />\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.length !== 0\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 }}\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 ...(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='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 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 </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\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} 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\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 } = 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [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 || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === 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(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\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 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 />\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","formattedMapData","useMemo","rewind","reverse","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","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","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","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","light","graphNoData","grays","t28","t29","t30","t31","enabled","autoplay","showOnlyActiveDate","t32","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t33","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t34","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t35","shape","onUpdateShape","useEffectEvent","t36","fetchAndParseJSON","then","d_1","t37","t38","t39","speed","interval","setInterval","clearInterval","t40","t41","getSliderMarks","markObj","t42","graphContainer","t43","t44","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t45","Pause","Play","SliderUI","nextValue","nextValue_0","t46","GraphArea","d_7","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t47","footnote","source","GraphFooter","t48","GraphContainer","d_9","d_8","el_1","el_0","properties","NAME","d_4","d_3","d_2","d_6","d_5","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8EO,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,EAAAA,IACElC,GACEmC,IAAmBC,GAAQ,MAC1BF,KAEEG,GAAOlC,GAA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,GAAAU,GAAA;AAAA,SA2PqChQ,EAACzD;AAAO;AA3P7C,SAAA0S,GAAAgB,GAAA;AAAA,SAuNyB1L,EAAED;AAAM;AAvNjC,SAAAyK,GAAAmB,GAAA;AAAA,SA8MyB3L,EAAED;AAAM;AA9MjC,SAAAwK,GAAAvK,GAAA;AAAA,SAyM4BA,EAAE4L,WAAWC,SAAU;AAAY;AAzM/D,SAAAjC,GAAAkC,GAAA;AAAA,SAwJ4BrQ,MAAMrB;AAAS;AAxJ3C,SAAAuP,GAAAoC,GAAA;AAAA,SAuJ6CtQ,MAAMrB;AAAS;AAvJ5D,SAAAsP,GAAAsC,GAAA;AAAA,SAuJyBvQ,EAAC9D;AAAK;AAvJ/B,SAAA8R,GAAAwC,GAAA;AAAA,SAsJ2CxQ,MAAMrB;AAAS;AAtJ1D,SAAAoP,GAAA0C,GAAA;AAAA,SAsJuBzQ,EAAC9D;AAAK;AAtJ7B,SAAAgP,GAAAwF,GAAAC,GAAA;AAAA,SAkEkBD,IAAIC;AAAC;AAlEvB,SAAA3F,GAAAhL,GAAA;AAAA,SA8DgBA,EAAC4K;AAAK;"}
|
package/dist/HybridMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),d=require("react"),qt=require("./parse-xYI9yrvL.cjs"),It=require("./getSliderMarks-CIuSoedo.cjs"),Ut=require("./Spinner-jTMOLuw_.cjs"),Pt=require("./index-DQA8q5sC.cjs"),U=require("./index-DLFt97gy.cjs"),St=require("./Typography-sa1UE0oF.cjs"),Gt=require("./index-C5K--w8d.cjs"),zt=require("./Source-B5AoSlsi.cjs"),Ht=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Xt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./index-C6er0ety.cjs"),Yt=require("./DetailsModal-DHttOA80.cjs"),Jt=require("./pow-BnyPO-NX.cjs"),Kt=require("./ordinal-CrsysVE-.cjs"),Zt=require("./threshold-DNsSUf8Q.cjs"),Nt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-C4-uo6nS.cjs"),dt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Qt=require("./numberFormattingFunction-02t-wJta.cjs"),eo=require("./use-in-view-C3o_ntMv.cjs"),to=require("./index-CoobIWNj.cjs"),oo=require("./GraphFooter.cjs"),ro=require("./GraphHeader.cjs"),we=require("./Colors.cjs"),io=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./GraphContainer-B1EDxJ0S.cjs"),ao=require("./getUniqValue-NX8DgwND.cjs"),no=require("./getJenks-BzJvhy_H.cjs");function so(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const lo=so(d);var co="Separator",Vt="horizontal",uo=["horizontal","vertical"],_t=lo.forwardRef((i,e)=>{const{decorative:t,orientation:g=Vt,...f}=i,n=mo(g)?g:Vt,y=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ht.w.div,{"data-orientation":n,...y,...f,ref:e})});_t.displayName=co;function mo(i){return uo.includes(i)}var $t=_t;const Bt=d.forwardRef((i,e)=>{const t=r._.c(14);let g,f,n,y;t[0]!==i?({className:g,variant:n,orientation:y,...f}=i,t[0]=i,t[1]=g,t[2]=f,t[3]=n,t[4]=y):(g=t[1],f=t[2],n=t[3],y=t[4]);const v=n===void 0?"dark":n,s=y===void 0?"horizontal":y,x=s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",k=v==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let E;t[5]!==g||t[6]!==x||t[7]!==k?(E=r.mo(x,k,g),t[5]=g,t[6]=x,t[7]=k,t[8]=E):E=t[8];let S;return t[9]!==s||t[10]!==f||t[11]!==e||t[12]!==E?(S=r.ae.jsx($t,{...f,ref:e,orientation:s,className:E}),t[9]=s,t[10]=f,t[11]=e,t[12]=E,t[13]=S):S=t[13],S});Bt.displayName=$t.displayName;function po(i){const{data:e,colors:t,mapData:g,mapColorLegendTitle:f,colorDomain:n,radius:y,height:v,width:s,scale:x,centerPoint:k,tooltip:E,showLabels:S,mapBorderWidth:ke,mapBorderColor:Re,mapNoDataColor:Ce,onSeriesMouseOver:G,showColorScale:De,zoomScaleExtend:We,zoomTranslateExtend:Ue,highlightedDataPoints:Se,onSeriesMouseClick:I,resetSelectionOnDoubleClick:Ne,detailsOnClick:H,styles:R,classNames:X,mapProjection:ee,zoomInteraction:Y,animate:j,dimmedOpacity:P,customLayers:ce,maxRadiusValue:de,categorical:te,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:oe,mapProperty:ue,dotLegendTitle:me,dotBorderColor:Me,labelColor:qe,projectionRotate:K,rewindCoordinatesInMapData:pe}=i,u=d.useMemo(()=>pe?U.index_default(g,{reverse:!0}):g,[g,pe]),[l,z]=d.useState(void 0),[Ge,Ie]=d.useState(Oe===void 0?!(s<680):!Oe),xe=d.useRef(null),[L,N]=d.useState(void 0),[re,O]=d.useState(void 0),[Pe,C]=d.useState(void 0),[ze,M]=d.useState(void 0),V=d.useRef(null),Z=eo.useInView(V,{once:j.once,amount:j.amount}),ie=d.useRef(null),_=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?Jt.sqrt().domain([0,de]).range([.25,y]).nice():void 0,q=te?Kt.ordinal().domain(n).range(t):Zt.threshold().domain(n).range(t);d.useEffect(()=>{const o=Nt.select(ie.current),a=Nt.select(V.current),b=m=>{if(Y==="noZoom")return!1;if(Y==="button")return!m.type.includes("wheel");const ge=m.type==="wheel",fe=m.type.startsWith("touch"),Be=m.type==="mousedown"||m.type==="mousemove";return fe?!0:ge?Y==="scroll"?!0:m.ctrlKey:Be&&!m.button&&!m.ctrlKey},D=U.zoom().scaleExtent(We).translateExtent(Ue||[[-20,-20],[s+20,v+20]]).filter(b).on("zoom",({transform:m})=>{o.attr("transform",m)});a.call(D),xe.current=D},[v,s,Y]);const $=U.index_default$1(u),w=Gt.index_default(u),Le=$[2]-$[0],Ve=$[3]-$[1],_e=s*190/960*360/Le,$e=v*190/678*180/Ve,B=x*Math.min(_e,$e),Q=ee==="mercator"?U.geoMercator().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="equalEarth"?U.geoEqualEarth().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="naturalEarth"?U.geoNaturalEarth1().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="orthographic"?U.geoOrthographic().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):U.geoAlbersUsa().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B),he=U.geoPath().projection(Q),ae=o=>{if(!V.current||!xe.current)return;Nt.select(V.current).call(xe.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:`${s}px`,height:`${v}px`,viewBox:`0 0 ${s} ${v}`,ref:V,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ie,children:[ce.filter(o=>o.position==="before").map(o=>o.layer),u.features.map((o,a)=>{if(!o.properties?.[ue])return null;const b=he(o);return b?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:l?P:oe.length!==0?oe.indexOf(o.properties[ue])!==-1?1:P:1,children:r.jsxRuntimeExports.jsx("path",{d:b,style:{stroke:Re,strokeWidth:ke,fill:Ce}})},a):null}),r.jsxRuntimeExports.jsxs(to.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const a=u.features.findIndex(m=>o.id===m.properties[ue]);if(a===-1)return null;const b=he(u.features[a]);if(!b)return null;const D=dt.checkIfNullOrUndefined(o.x)?Ce:q(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:l?l===D?1:P:oe.length!==0?oe.indexOf(o.id)!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:m=>{O(o),M(m.clientY),C(m.clientX),G?.(o)},onMouseMove:m=>{O(o),M(m.clientY),C(m.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:b,variants:{initial:{fill:D,opacity:0},whileInView:{fill:D,opacity:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},style:{stroke:Re,strokeWidth:ke}},`${o.id}`)},o.id)}),e.filter(o=>!dt.checkIfNullOrUndefined(o.lat)&&!dt.checkIfNullOrUndefined(o.long)).map(o=>{const a=Q([o.long,o.lat])[0]>.6*s?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:Se.length!==0?Se.indexOf(o.label||"")!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:b=>{O(o),M(b.clientY),C(b.clientX),G?.(o)},onMouseMove:b=>{O(o),M(b.clientY),C(b.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},transform:`translate(${Q([o.long,o.lat])[0]},${Q([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:Me||J},whileInView:{r:_?_(o.radius||0):y,fill:J,stroke:Me||J,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),S&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:a*(_?_(o.radius||0):y)},whileInView:{opacity:1,x:a*(_?_(o.radius||0):y),transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:r.mo("text-sm",X?.graphObjectValues),style:{textAnchor:a===-1?"end":"start",fill:qe||"#000",...R?.graphObjectValues||{}},dx:a*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ce.filter(o=>o.position==="after").map(o=>o.layer)]})}),De===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:Ge?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:()=>{Ie(!1)},children:r.jsxRuntimeExports.jsx(Ot.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:te?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:J}}),r.jsxRuntimeExports.jsx(St.j,{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(zt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Bt,{}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"})]}):null,f&&f!==""?r.jsxRuntimeExports.jsx(St.j,{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:f}):null,te?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,a)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[a%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[a%t.length]}}),r.jsxRuntimeExports.jsx(St.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,a)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[a])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:a*320/t.length+1,y:1,width:320/t.length-2,height:8,className:l===t[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[a],...l===t[a]?{}:{stroke:t[a]}}}),r.jsxRuntimeExports.jsx("text",{x:(a+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Qt.numberFormattingFunction(o,"NA")})]},a)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${l===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...l===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Ie(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Y==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>ae("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:()=>ae("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:"–"})]})]}),H&&L!==void 0?r.jsxRuntimeExports.jsx(Yt.DetailsModal,{body:H,data:L,setData:N,className:X?.modal}):null,re&&E&&Pe&&ze?r.jsxRuntimeExports.jsx(Xt.Tooltip,{data:re,body:E,xPos:Pe,yPos:ze,backgroundStyle:R?.tooltip,className:X?.tooltip}):null]})}function xo(i){const e=r.compilerRuntimeExports.c(135),{data:t,mapData:g,graphTitle:f,colors:n,sources:y,graphDescription:v,height:s,width:x,footNote:k,mapColorLegendTitle:E,colorDomain:S,choroplethScaleType:ke,radius:Re,scale:Ce,centerPoint:G,padding:De,mapBorderWidth:We,mapNoDataColor:Ue,backgroundColor:Se,showLabels:I,mapBorderColor:Ne,tooltip:H,relativeHeight:R,onSeriesMouseOver:X,isWorldMap:ee,showColorScale:Y,zoomScaleExtend:j,zoomTranslateExtend:P,graphID:ce,highlightedDataPoints:de,onSeriesMouseClick:te,graphDownload:J,dataDownload:Oe,showAntarctica:oe,language:ue,minHeight:me,theme:Me,ariaLabel:qe,resetSelectionOnDoubleClick:K,detailsOnClick:pe,styles:u,classNames:l,mapProjection:z,zoomInteraction:Ge,animate:Ie,dimmedOpacity:xe,customLayers:L,maxRadiusValue:N,timeline:re,collapseColorScaleByDefault:O,dotColor:Pe,highlightedIds:C,mapProperty:ze,dotLegendTitle:M,dotBorderColor:V,labelColor:Z,projectionRotate:ie,rewindCoordinatesInMapData:_}=i,q=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,$=k===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.":k,w=ke===void 0?"threshold":ke,Le=Re===void 0?5:Re,Ve=Ce===void 0?.95:Ce,_e=We===void 0?.5:We,$e=Ue===void 0?we.Colors.light.graphNoData:Ue,B=Se===void 0?!1:Se,Q=I===void 0?!1:I,he=Ne===void 0?we.Colors.light.grays["gray-500"]:Ne,ae=ee===void 0?!0:ee,o=Y===void 0?!0:Y;let a;e[0]!==j?(a=j===void 0?[.8,6]:j,e[0]=j,e[1]=a):a=e[1];const b=a;let D;e[2]!==de?(D=de===void 0?[]:de,e[2]=de,e[3]=D):D=e[3];const m=D,ge=J===void 0?!1:J,fe=Oe===void 0?!1:Oe,Be=oe===void 0?!1:oe,ut=ue===void 0?"en":ue,F=me===void 0?0:me,ne=Me===void 0?"light":Me,mt=K===void 0?!0:K,pt=z===void 0?"naturalEarth":z,xt=Ge===void 0?"button":Ge,He=Ie===void 0?!1:Ie,ht=xe===void 0?.3:xe;let Xe;e[4]!==L?(Xe=L===void 0?[]:L,e[4]=L,e[5]=Xe):Xe=e[5];const gt=Xe;let Ye;e[6]!==re?(Ye=re===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:re,e[6]=re,e[7]=Ye):Ye=e[7];const c=Ye,ft=Pe===void 0?we.Colors.primaryColors["blue-600"]:Pe;let Je;e[8]!==C?(Je=C===void 0?[]:C,e[8]=C,e[9]=Je):Je=e[9];const yt=Je,vt=ze===void 0?"ISO3":ze,jt=Z===void 0?we.Colors.primaryColors["blue-600"]:Z;let Ke;e[10]!==ie?(Ke=ie===void 0?[0,0]:ie,e[10]=ie,e[11]=Ke):Ke=e[11];const bt=Ke,Et=_===void 0?!0:_,[se,Ft]=d.useState(0),[Fe,Tt]=d.useState(0),[T,At]=d.useState(c.autoplay);let Te;if(e[12]!==t||e[13]!==c.dateFormat){let h;e[15]!==c.dateFormat?(h=W=>qt.parse(`${W.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[15]=c.dateFormat,e[16]=h):h=e[16],Te=[...new Set(t.filter(Ro).map(h))],Te.sort(ko),e[12]=t,e[13]=c.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[A,wt]=d.useState(c.autoplay?0:p.length-1),[ye,Wt]=d.useState(void 0),kt=d.useRef(null),Mt=d.useRef(null);let Ze;e[17]!==w||e[18]!==S||e[19]!==n?.length||e[20]!==t?(Ze=S||(w==="categorical"?ao.getUniqValue(t,"x"):no.getJenks(t.map(wo),n?.length||4)),e[17]=w,e[18]=S,e[19]=n?.length,e[20]=t,e[21]=Ze):Ze=e[21];const Ae=Ze;let Qe,et;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{const h=new ResizeObserver(W=>{Ft(W[0].target.clientWidth||620),Tt(W[0].target.clientHeight||480)});return kt.current&&h.observe(kt.current),()=>h.disconnect()},et=[],e[22]=Qe,e[23]=et):(Qe=e[22],et=e[23]),d.useEffect(Qe,et);let tt;e[24]===Symbol.for("react.memo_cache_sentinel")?(tt=h=>{Wt(h)},e[24]=tt):tt=e[24];const ot=d.useEffectEvent(tt);let rt;e[25]!==q||e[26]!==ot?(rt=()=>{typeof q=="string"?io.fetchAndParseJSON(q).then(W=>{ot(W)}):ot(q)},e[25]=q,e[26]=ot,e[27]=rt):rt=e[27];let it;e[28]!==q?(it=[q],e[28]=q,e[29]=it):it=e[29],d.useEffect(rt,it);let at,nt;e[30]!==T||e[31]!==c.speed||e[32]!==p?(at=()=>{const h=setInterval(()=>{wt(W=>W<p.length-1?W+1:0)},(c.speed||2)*1e3);return T||clearInterval(h),()=>clearInterval(h)},nt=[p,T,c.speed],e[30]=T,e[31]=c.speed,e[32]=p,e[33]=at,e[34]=nt):(at=e[33],nt=e[34]),d.useEffect(at,nt);const Rt=c.dateFormat||"yyyy";let st;e[35]!==A||e[36]!==Rt||e[37]!==c.showOnlyActiveDate||e[38]!==p?(st=It.getSliderMarks(p,A,c.showOnlyActiveDate,Rt),e[35]=A,e[36]=Rt,e[37]=c.showOnlyActiveDate,e[38]=p,e[39]=st):st=e[39];const lt=st,Ct=l?.graphContainer,Dt=u?.graphContainer;let ve;e[40]!==l?.description||e[41]!==l?.title||e[42]!==t||e[43]!==fe||e[44]!==v||e[45]!==ge||e[46]!==f||e[47]!==u?.description||e[48]!==u?.title||e[49]!==x?(ve=f||v||ge||fe?r.jsxRuntimeExports.jsx(ro.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:l?.title,description:l?.description},graphTitle:f,graphDescription:v,width:x,graphDownload:ge?Mt:void 0,dataDownload:fe?t.map(Eo).filter(bo).length>0?t.map(jo).filter(vo):t.filter(yo):null}):null,e[40]=l?.description,e[41]=l?.title,e[42]=t,e[43]=fe,e[44]=v,e[45]=ge,e[46]=f,e[47]=u?.description,e[48]=u?.title,e[49]=x,e[50]=ve):ve=e[50];let je;e[51]!==A||e[52]!==lt||e[53]!==T||e[54]!==c.enabled||e[55]!==p?(je=c.enabled&&p.length>0&<?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{At(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?r.jsxRuntimeExports.jsx(Ot.Pause,{}):r.jsxRuntimeExports.jsx(Ot.Play,{})}),r.jsxRuntimeExports.jsx(It.Nr,{min:p[0],max:p[p.length-1],marks:lt,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:h=>{wt(p.indexOf(h))},onChange:h=>{wt(p.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[51]=A,e[52]=lt,e[53]=T,e[54]=c.enabled,e[55]=p,e[56]=je):je=e[56];let be;e[57]!==He||e[58]!==G||e[59]!==w||e[60]!==l||e[61]!==O||e[62]!==n||e[63]!==gt||e[64]!==t||e[65]!==pe||e[66]!==ht||e[67]!==Ae||e[68]!==V||e[69]!==ft||e[70]!==M||e[71]!==s||e[72]!==m||e[73]!==yt||e[74]!==A||e[75]!==ae||e[76]!==jt||e[77]!==he||e[78]!==_e||e[79]!==E||e[80]!==$e||e[81]!==pt||e[82]!==vt||e[83]!==ye||e[84]!==N||e[85]!==F||e[86]!==te||e[87]!==X||e[88]!==bt||e[89]!==Le||e[90]!==R||e[91]!==mt||e[92]!==Et||e[93]!==Ve||e[94]!==Be||e[95]!==o||e[96]!==Q||e[97]!==u||e[98]!==Fe||e[99]!==se||e[100]!==ne||e[101]!==c.dateFormat||e[102]!==c.enabled||e[103]!==H||e[104]!==p||e[105]!==x||e[106]!==xt||e[107]!==b||e[108]!==P?(be=r.jsxRuntimeExports.jsx(Lt.GraphArea,{ref:kt,children:se&&Fe&&ye?r.jsxRuntimeExports.jsx(po,{dotColor:ft,data:t.filter(h=>c.enabled?h.date===qt.format(new Date(p[A]),c.dateFormat||"yyyy"):h),mapData:Be?ye:{...ye,features:ye.features.filter(fo)},colorDomain:Ae,width:se,height:Fe,scale:Ve,centerPoint:G,colors:n||(w==="categorical"?we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length}`]:we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:E,radius:Le,categorical:w==="categorical",mapBorderWidth:_e,mapNoDataColor:$e,mapBorderColor:he,tooltip:H,onSeriesMouseOver:X,showLabels:Q,isWorldMap:ae,showColorScale:o,zoomScaleExtend:b,zoomTranslateExtend:P,onSeriesMouseClick:te,highlightedDataPoints:m,resetSelectionOnDoubleClick:mt,styles:u,classNames:l,zoomInteraction:xt,detailsOnClick:pe,mapProjection:pt||(ae?"naturalEarth":"mercator"),animate:He===!0?{duration:.5,once:!0,amount:.5}:He||{duration:0,once:!0,amount:0},dimmedOpacity:ht,customLayers:gt,maxRadiusValue:dt.checkIfNullOrUndefined(N)?Math.max(...t.map(go).filter(ho)):N,collapseColorScaleByDefault:O,highlightedIds:yt,mapProperty:vt,dotLegendTitle:M,dotBorderColor:V,labelColor:jt,projectionRotate:bt,rewindCoordinatesInMapData:Et}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,s||(R?F?(x||se)*R>F?(x||se)*R:F:(x||se)*R:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Ut.w,{"aria-label":"Loading graph"})})}),e[57]=He,e[58]=G,e[59]=w,e[60]=l,e[61]=O,e[62]=n,e[63]=gt,e[64]=t,e[65]=pe,e[66]=ht,e[67]=Ae,e[68]=V,e[69]=ft,e[70]=M,e[71]=s,e[72]=m,e[73]=yt,e[74]=A,e[75]=ae,e[76]=jt,e[77]=he,e[78]=_e,e[79]=E,e[80]=$e,e[81]=pt,e[82]=vt,e[83]=ye,e[84]=N,e[85]=F,e[86]=te,e[87]=X,e[88]=bt,e[89]=Le,e[90]=R,e[91]=mt,e[92]=Et,e[93]=Ve,e[94]=Be,e[95]=o,e[96]=Q,e[97]=u,e[98]=Fe,e[99]=se,e[100]=ne,e[101]=c.dateFormat,e[102]=c.enabled,e[103]=H,e[104]=p,e[105]=x,e[106]=xt,e[107]=b,e[108]=P,e[109]=be):be=e[109];let Ee;e[110]!==l?.footnote||e[111]!==l?.source||e[112]!==$||e[113]!==y||e[114]!==u?.footnote||e[115]!==u?.source||e[116]!==x?(Ee=y||$?r.jsxRuntimeExports.jsx(oo.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:y,footNote:$,width:x}):null,e[110]=l?.footnote,e[111]=l?.source,e[112]=$,e[113]=y,e[114]=u?.footnote,e[115]=u?.source,e[116]=x,e[117]=Ee):Ee=e[117];let ct;return e[118]!==qe||e[119]!==B||e[120]!==ce||e[121]!==s||e[122]!==ut||e[123]!==F||e[124]!==De||e[125]!==R||e[126]!==Ct||e[127]!==Dt||e[128]!==ve||e[129]!==je||e[130]!==be||e[131]!==Ee||e[132]!==ne||e[133]!==x?(ct=r.jsxRuntimeExports.jsxs(Lt.GraphContainer,{className:Ct,style:Dt,id:ce,ref:Mt,"aria-label":qe,backgroundColor:B,theme:ne,language:ut,minHeight:F,width:x,height:s,relativeHeight:R,padding:De,children:[ve,je,be,Ee]}),e[118]=qe,e[119]=B,e[120]=ce,e[121]=s,e[122]=ut,e[123]=F,e[124]=De,e[125]=R,e[126]=Ct,e[127]=Dt,e[128]=ve,e[129]=je,e[130]=be,e[131]=Ee,e[132]=ne,e[133]=x,e[134]=ct):ct=e[134],ct}function ho(i){return i!=null}function go(i){return i.radius}function fo(i){return i.properties.NAME!=="Antarctica"}function yo(i){return i!==void 0}function vo(i){return i!==void 0}function jo(i){return i.data}function bo(i){return i!==void 0}function Eo(i){return i.data}function wo(i){return i.x}function ko(i,e){return i-e}function Ro(i){return i.date}exports.HybridMap=xo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-6v2a2njQ.cjs"),d=require("react"),qt=require("./parse-xYI9yrvL.cjs"),It=require("./getSliderMarks-CIuSoedo.cjs"),Ut=require("./Spinner-jTMOLuw_.cjs"),Pt=require("./index-DQA8q5sC.cjs"),U=require("./index-DLFt97gy.cjs"),St=require("./Typography-sa1UE0oF.cjs"),Gt=require("./index-C5K--w8d.cjs"),zt=require("./Source-B5AoSlsi.cjs"),Ht=require("./index-Dzc_aaI9-C3DbPpy3.cjs"),Xt=require("./Tooltip-BLa2EfMs.cjs"),Ot=require("./index-C6er0ety.cjs"),Yt=require("./DetailsModal-DHttOA80.cjs"),Jt=require("./pow-BnyPO-NX.cjs"),Kt=require("./ordinal-CrsysVE-.cjs"),Zt=require("./threshold-DNsSUf8Q.cjs"),Nt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-C4-uo6nS.cjs"),dt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Qt=require("./numberFormattingFunction-02t-wJta.cjs"),eo=require("./use-in-view-C3o_ntMv.cjs"),to=require("./index-CoobIWNj.cjs"),oo=require("./GraphFooter.cjs"),ro=require("./GraphHeader.cjs"),we=require("./Colors.cjs"),ao=require("./fetchAndParseData-QTF6tjij.cjs"),Lt=require("./GraphContainer-B1EDxJ0S.cjs"),io=require("./getUniqValue-NX8DgwND.cjs"),no=require("./getJenks-BzJvhy_H.cjs");function so(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 lo=so(d);var co="Separator",Vt="horizontal",uo=["horizontal","vertical"],_t=lo.forwardRef((a,e)=>{const{decorative:t,orientation:g=Vt,...f}=a,n=mo(g)?g:Vt,y=t?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return r.ae.jsx(Ht.w.div,{"data-orientation":n,...y,...f,ref:e})});_t.displayName=co;function mo(a){return uo.includes(a)}var $t=_t;const Bt=d.forwardRef((a,e)=>{const t=r._.c(14);let g,f,n,y;t[0]!==a?({className:g,variant:n,orientation:y,...f}=a,t[0]=a,t[1]=g,t[2]=f,t[3]=n,t[4]=y):(g=t[1],f=t[2],n=t[3],y=t[4]);const v=n===void 0?"dark":n,s=y===void 0?"horizontal":y,x=s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",k=v==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let E;t[5]!==g||t[6]!==x||t[7]!==k?(E=r.mo(x,k,g),t[5]=g,t[6]=x,t[7]=k,t[8]=E):E=t[8];let S;return t[9]!==s||t[10]!==f||t[11]!==e||t[12]!==E?(S=r.ae.jsx($t,{...f,ref:e,orientation:s,className:E}),t[9]=s,t[10]=f,t[11]=e,t[12]=E,t[13]=S):S=t[13],S});Bt.displayName=$t.displayName;function po(a){const{data:e,colors:t,mapData:g,mapColorLegendTitle:f,colorDomain:n,radius:y,height:v,width:s,scale:x,centerPoint:k,tooltip:E,showLabels:S,mapBorderWidth:ke,mapBorderColor:Re,mapNoDataColor:Ce,onSeriesMouseOver:G,showColorScale:De,zoomScaleExtend:We,zoomTranslateExtend:Ue,highlightedDataPoints:Se,onSeriesMouseClick:I,resetSelectionOnDoubleClick:Ne,detailsOnClick:H,styles:R,classNames:X,mapProjection:ee,zoomInteraction:Y,animate:j,dimmedOpacity:P,customLayers:ce,maxRadiusValue:de,categorical:te,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:oe,mapProperty:ue,dotLegendTitle:me,dotBorderColor:Me,labelColor:qe,projectionRotate:K,rewindCoordinatesInMapData:pe}=a,u=d.useMemo(()=>pe?U.index_default(g,{reverse:!0}):g,[g,pe]),[l,z]=d.useState(void 0),[Ge,Ie]=d.useState(Oe===void 0?!(s<680):!Oe),xe=d.useRef(null),[L,N]=d.useState(void 0),[re,O]=d.useState(void 0),[Pe,C]=d.useState(void 0),[ze,M]=d.useState(void 0),V=d.useRef(null),Z=eo.useInView(V,{once:j.once,amount:j.amount}),ae=d.useRef(null),_=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?Jt.sqrt().domain([0,de]).range([.25,y]).nice():void 0,q=te?Kt.ordinal().domain(n).range(t):Zt.threshold().domain(n).range(t);d.useEffect(()=>{const o=Nt.select(ae.current),i=Nt.select(V.current),b=m=>{if(Y==="noZoom")return!1;if(Y==="button")return!m.type.includes("wheel");const ge=m.type==="wheel",fe=m.type.startsWith("touch"),Be=m.type==="mousedown"||m.type==="mousemove";return fe?!0:ge?Y==="scroll"?!0:m.ctrlKey:Be&&!m.button&&!m.ctrlKey},D=U.zoom().scaleExtent(We).translateExtent(Ue||[[-20,-20],[s+20,v+20]]).filter(b).on("zoom",({transform:m})=>{o.attr("transform",m)});i.call(D),xe.current=D},[v,s,Y]);const $=U.index_default$1(u),w=Gt.index_default(u),Le=$[2]-$[0],Ve=$[3]-$[1],_e=s*190/960*360/Le,$e=v*190/678*180/Ve,B=x*Math.min(_e,$e),Q=ee==="mercator"?U.geoMercator().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="equalEarth"?U.geoEqualEarth().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="naturalEarth"?U.geoNaturalEarth1().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):ee==="orthographic"?U.geoOrthographic().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B):U.geoAlbersUsa().rotate(K).center(k||w.geometry.coordinates).translate([s/2,v/2]).scale(B),he=U.geoPath().projection(Q),ie=o=>{if(!V.current||!xe.current)return;Nt.select(V.current).call(xe.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:`${s}px`,height:`${v}px`,viewBox:`0 0 ${s} ${v}`,ref:V,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ae,children:[ce.filter(o=>o.position==="before").map(o=>o.layer),u.features.map((o,i)=>{if(!o.properties?.[ue])return null;const b=he(o);return b?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:l?P:oe.length!==0?oe.indexOf(o.properties[ue])!==-1?1:P:1,children:r.jsxRuntimeExports.jsx("path",{d:b,style:{stroke:Re,strokeWidth:ke,fill:Ce}})},i):null}),r.jsxRuntimeExports.jsxs(to.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const i=u.features.findIndex(m=>o.id===m.properties[ue]);if(i===-1)return null;const b=he(u.features[i]);if(!b)return null;const D=dt.checkIfNullOrUndefined(o.x)?Ce:q(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:l?l===D?1:P:oe.length!==0?oe.indexOf(o.id)!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:m=>{O(o),M(m.clientY),C(m.clientX),G?.(o)},onMouseMove:m=>{O(o),M(m.clientY),C(m.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:b,variants:{initial:{fill:D,opacity:0},whileInView:{fill:D,opacity:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},style:{stroke:Re,strokeWidth:ke}},`${o.id}`)},o.id)}),e.filter(o=>!dt.checkIfNullOrUndefined(o.lat)&&!dt.checkIfNullOrUndefined(o.long)).map(o=>{const i=Q([o.long,o.lat])[0]>.6*s?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:Se.length!==0?Se.indexOf(o.label||"")!==-1?1:P:1,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},onMouseEnter:b=>{O(o),M(b.clientY),C(b.clientX),G?.(o)},onMouseMove:b=>{O(o),M(b.clientY),C(b.clientX)},onMouseLeave:()=>{O(void 0),C(void 0),M(void 0),G?.(void 0)},onClick:()=>{(I||H)&&(Pt.isEqual(L,o)&&Ne?(N(void 0),I?.(void 0)):(N(o),I?.(o)))},transform:`translate(${Q([o.long,o.lat])[0]},${Q([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:Me||J},whileInView:{r:_?_(o.radius||0):y,fill:J,stroke:Me||J,transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{r:0,transition:{duration:j.duration}},style:{fillOpacity:.8}}),S&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:i*(_?_(o.radius||0):y)},whileInView:{opacity:1,x:i*(_?_(o.radius||0):y),transition:{duration:j.duration}}},initial:"initial",animate:Z?"whileInView":"initial",exit:{opacity:0,transition:{duration:j.duration}},y:0,className:r.mo("text-sm",X?.graphObjectValues),style:{textAnchor:i===-1?"end":"start",fill:qe||"#000",...R?.graphObjectValues||{}},dx:i*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ce.filter(o=>o.position==="after").map(o=>o.layer)]})}),De===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:Ge?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:()=>{Ie(!1)},children:r.jsxRuntimeExports.jsx(Ot.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:te?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:J}}),r.jsxRuntimeExports.jsx(St.j,{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(zt.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Bt,{}),r.jsxRuntimeExports.jsx(zt.n,{size:"xl"})]}):null,f&&f!==""?r.jsxRuntimeExports.jsx(St.j,{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:f}):null,te?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:n.map((o,i)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(t[i%t.length])},onMouseLeave:()=>{z(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[i%t.length]}}),r.jsxRuntimeExports.jsx(St.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[n.map((o,i)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(t[i])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:i*320/t.length+1,y:1,width:320/t.length-2,height:8,className:l===t[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[i],...l===t[i]?{}:{stroke:t[i]}}}),r.jsxRuntimeExports.jsx("text",{x:(i+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Qt.numberFormattingFunction(o,"NA")})]},i)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(t[n.length])},onMouseLeave:()=>{z(void 0)},x:n.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${l===t[n.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[n.length],...l===t[n.length]?{}:{stroke:t[n.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Ie(!0)},children:r.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),Y==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>ie("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:()=>ie("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:"–"})]})]}),H&&L!==void 0?r.jsxRuntimeExports.jsx(Yt.DetailsModal,{body:H,data:L,setData:N,className:X?.modal}):null,re&&E&&Pe&&ze?r.jsxRuntimeExports.jsx(Xt.Tooltip,{data:re,body:E,xPos:Pe,yPos:ze,backgroundStyle:R?.tooltip,className:X?.tooltip}):null]})}function xo(a){const e=r.compilerRuntimeExports.c(135),{data:t,mapData:g,graphTitle:f,colors:n,sources:y,graphDescription:v,height:s,width:x,footNote:k,mapColorLegendTitle:E,colorDomain:S,choroplethScaleType:ke,radius:Re,scale:Ce,centerPoint:G,padding:De,mapBorderWidth:We,mapNoDataColor:Ue,backgroundColor:Se,showLabels:I,mapBorderColor:Ne,tooltip:H,relativeHeight:R,onSeriesMouseOver:X,isWorldMap:ee,showColorScale:Y,zoomScaleExtend:j,zoomTranslateExtend:P,graphID:ce,highlightedDataPoints:de,onSeriesMouseClick:te,graphDownload:J,dataDownload:Oe,showAntarctica:oe,language:ue,minHeight:me,theme:Me,ariaLabel:qe,resetSelectionOnDoubleClick:K,detailsOnClick:pe,styles:u,classNames:l,mapProjection:z,zoomInteraction:Ge,animate:Ie,dimmedOpacity:xe,customLayers:L,maxRadiusValue:N,timeline:re,collapseColorScaleByDefault:O,dotColor:Pe,highlightedIds:C,mapProperty:ze,dotLegendTitle:M,dotBorderColor:V,labelColor:Z,projectionRotate:ae,rewindCoordinatesInMapData:_}=a,q=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,$=k===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.":k,w=ke===void 0?"threshold":ke,Le=Re===void 0?5:Re,Ve=Ce===void 0?.95:Ce,_e=We===void 0?.5:We,$e=Ue===void 0?we.Colors.light.graphNoData:Ue,B=Se===void 0?!1:Se,Q=I===void 0?!1:I,he=Ne===void 0?we.Colors.light.grays["gray-500"]:Ne,ie=ee===void 0?!0:ee,o=Y===void 0?!0:Y;let i;e[0]!==j?(i=j===void 0?[.8,6]:j,e[0]=j,e[1]=i):i=e[1];const b=i;let D;e[2]!==de?(D=de===void 0?[]:de,e[2]=de,e[3]=D):D=e[3];const m=D,ge=J===void 0?!1:J,fe=Oe===void 0?!1:Oe,Be=oe===void 0?!1:oe,ut=ue===void 0?"en":ue,F=me===void 0?0:me,ne=Me===void 0?"light":Me,mt=K===void 0?!0:K,pt=z===void 0?"naturalEarth":z,xt=Ge===void 0?"button":Ge,He=Ie===void 0?!1:Ie,ht=xe===void 0?.3:xe;let Xe;e[4]!==L?(Xe=L===void 0?[]:L,e[4]=L,e[5]=Xe):Xe=e[5];const gt=Xe;let Ye;e[6]!==re?(Ye=re===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:re,e[6]=re,e[7]=Ye):Ye=e[7];const c=Ye,ft=Pe===void 0?we.Colors.primaryColors["blue-600"]:Pe;let Je;e[8]!==C?(Je=C===void 0?[]:C,e[8]=C,e[9]=Je):Je=e[9];const yt=Je,vt=ze===void 0?"ISO3":ze,jt=Z===void 0?we.Colors.primaryColors["blue-600"]:Z;let Ke;e[10]!==ae?(Ke=ae===void 0?[0,0]:ae,e[10]=ae,e[11]=Ke):Ke=e[11];const bt=Ke,Et=_===void 0?!0:_,[se,Ft]=d.useState(0),[Fe,Tt]=d.useState(0),[T,At]=d.useState(c.autoplay);let Te;if(e[12]!==t||e[13]!==c.dateFormat){let h;e[15]!==c.dateFormat?(h=W=>qt.parse(`${W.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[15]=c.dateFormat,e[16]=h):h=e[16],Te=[...new Set(t.filter(Ro).map(h))],Te.sort(ko),e[12]=t,e[13]=c.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[A,wt]=d.useState(c.autoplay?0:p.length-1),[ye,Wt]=d.useState(void 0),kt=d.useRef(null),Mt=d.useRef(null);let Ze;e[17]!==w||e[18]!==S||e[19]!==n?.length||e[20]!==t?(Ze=S||(w==="categorical"?io.getUniqValue(t,"x"):no.getJenks(t.map(wo),n?.length||4)),e[17]=w,e[18]=S,e[19]=n?.length,e[20]=t,e[21]=Ze):Ze=e[21];const Ae=Ze;let Qe,et;e[22]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{const h=new ResizeObserver(W=>{Ft(W[0].target.clientWidth||620),Tt(W[0].target.clientHeight||480)});return kt.current&&h.observe(kt.current),()=>h.disconnect()},et=[],e[22]=Qe,e[23]=et):(Qe=e[22],et=e[23]),d.useEffect(Qe,et);let tt;e[24]===Symbol.for("react.memo_cache_sentinel")?(tt=h=>{Wt(h)},e[24]=tt):tt=e[24];const ot=d.useEffectEvent(tt);let rt;e[25]!==q||e[26]!==ot?(rt=()=>{typeof q=="string"?ao.fetchAndParseJSON(q).then(W=>{ot(W)}):ot(q)},e[25]=q,e[26]=ot,e[27]=rt):rt=e[27];let at;e[28]!==q?(at=[q],e[28]=q,e[29]=at):at=e[29],d.useEffect(rt,at);let it,nt;e[30]!==T||e[31]!==c.speed||e[32]!==p?(it=()=>{const h=setInterval(()=>{wt(W=>W<p.length-1?W+1:0)},(c.speed||2)*1e3);return T||clearInterval(h),()=>clearInterval(h)},nt=[p,T,c.speed],e[30]=T,e[31]=c.speed,e[32]=p,e[33]=it,e[34]=nt):(it=e[33],nt=e[34]),d.useEffect(it,nt);const Rt=c.dateFormat||"yyyy";let st;e[35]!==A||e[36]!==Rt||e[37]!==c.showOnlyActiveDate||e[38]!==p?(st=It.getSliderMarks(p,A,c.showOnlyActiveDate,Rt),e[35]=A,e[36]=Rt,e[37]=c.showOnlyActiveDate,e[38]=p,e[39]=st):st=e[39];const lt=st,Ct=l?.graphContainer,Dt=u?.graphContainer;let ve;e[40]!==l?.description||e[41]!==l?.title||e[42]!==t||e[43]!==fe||e[44]!==v||e[45]!==ge||e[46]!==f||e[47]!==u?.description||e[48]!==u?.title||e[49]!==x?(ve=f||v||ge||fe?r.jsxRuntimeExports.jsx(ro.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:l?.title,description:l?.description},graphTitle:f,graphDescription:v,width:x,graphDownload:ge?Mt:void 0,dataDownload:fe?t.map(Eo).filter(bo).length>0?t.map(jo).filter(vo):t.filter(yo):null}):null,e[40]=l?.description,e[41]=l?.title,e[42]=t,e[43]=fe,e[44]=v,e[45]=ge,e[46]=f,e[47]=u?.description,e[48]=u?.title,e[49]=x,e[50]=ve):ve=e[50];let je;e[51]!==A||e[52]!==lt||e[53]!==T||e[54]!==c.enabled||e[55]!==p?(je=c.enabled&&p.length>0&<?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{At(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?r.jsxRuntimeExports.jsx(Ot.Pause,{}):r.jsxRuntimeExports.jsx(Ot.Play,{})}),r.jsxRuntimeExports.jsx(It.Nr,{min:p[0],max:p[p.length-1],marks:lt,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:h=>{wt(p.indexOf(h))},onChange:h=>{wt(p.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[51]=A,e[52]=lt,e[53]=T,e[54]=c.enabled,e[55]=p,e[56]=je):je=e[56];let be;e[57]!==He||e[58]!==G||e[59]!==w||e[60]!==l||e[61]!==O||e[62]!==n||e[63]!==gt||e[64]!==t||e[65]!==pe||e[66]!==ht||e[67]!==Ae||e[68]!==V||e[69]!==ft||e[70]!==M||e[71]!==s||e[72]!==m||e[73]!==yt||e[74]!==A||e[75]!==ie||e[76]!==jt||e[77]!==he||e[78]!==_e||e[79]!==E||e[80]!==$e||e[81]!==pt||e[82]!==vt||e[83]!==ye||e[84]!==N||e[85]!==F||e[86]!==te||e[87]!==X||e[88]!==bt||e[89]!==Le||e[90]!==R||e[91]!==mt||e[92]!==Et||e[93]!==Ve||e[94]!==Be||e[95]!==o||e[96]!==Q||e[97]!==u||e[98]!==Fe||e[99]!==se||e[100]!==ne||e[101]!==c.dateFormat||e[102]!==c.enabled||e[103]!==H||e[104]!==p||e[105]!==x||e[106]!==xt||e[107]!==b||e[108]!==P?(be=r.jsxRuntimeExports.jsx(Lt.GraphArea,{ref:kt,children:se&&Fe&&ye?r.jsxRuntimeExports.jsx(po,{dotColor:ft,data:t.filter(h=>c.enabled?h.date===qt.format(new Date(p[A]),c.dateFormat||"yyyy"):h),mapData:Be?ye:{...ye,features:ye.features.filter(fo)},colorDomain:Ae,width:se,height:Fe,scale:Ve,centerPoint:G,colors:n||(w==="categorical"?we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length}`]:we.Colors[ne].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:E,radius:Le,categorical:w==="categorical",mapBorderWidth:_e,mapNoDataColor:$e,mapBorderColor:he,tooltip:H,onSeriesMouseOver:X,showLabels:Q,isWorldMap:ie,showColorScale:o,zoomScaleExtend:b,zoomTranslateExtend:P,onSeriesMouseClick:te,highlightedDataPoints:m,resetSelectionOnDoubleClick:mt,styles:u,classNames:l,zoomInteraction:xt,detailsOnClick:pe,mapProjection:pt||(ie?"naturalEarth":"mercator"),animate:He===!0?{duration:.5,once:!0,amount:.5}:He||{duration:0,once:!0,amount:0},dimmedOpacity:ht,customLayers:gt,maxRadiusValue:dt.checkIfNullOrUndefined(N)?Math.max(...t.map(go).filter(ho)):N,collapseColorScaleByDefault:O,highlightedIds:yt,mapProperty:vt,dotLegendTitle:M,dotBorderColor:V,labelColor:jt,projectionRotate:bt,rewindCoordinatesInMapData:Et}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,s||(R?F?(x||se)*R>F?(x||se)*R:F:(x||se)*R:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(Ut.w,{"aria-label":"Loading graph"})})}),e[57]=He,e[58]=G,e[59]=w,e[60]=l,e[61]=O,e[62]=n,e[63]=gt,e[64]=t,e[65]=pe,e[66]=ht,e[67]=Ae,e[68]=V,e[69]=ft,e[70]=M,e[71]=s,e[72]=m,e[73]=yt,e[74]=A,e[75]=ie,e[76]=jt,e[77]=he,e[78]=_e,e[79]=E,e[80]=$e,e[81]=pt,e[82]=vt,e[83]=ye,e[84]=N,e[85]=F,e[86]=te,e[87]=X,e[88]=bt,e[89]=Le,e[90]=R,e[91]=mt,e[92]=Et,e[93]=Ve,e[94]=Be,e[95]=o,e[96]=Q,e[97]=u,e[98]=Fe,e[99]=se,e[100]=ne,e[101]=c.dateFormat,e[102]=c.enabled,e[103]=H,e[104]=p,e[105]=x,e[106]=xt,e[107]=b,e[108]=P,e[109]=be):be=e[109];let Ee;e[110]!==l?.footnote||e[111]!==l?.source||e[112]!==$||e[113]!==y||e[114]!==u?.footnote||e[115]!==u?.source||e[116]!==x?(Ee=y||$?r.jsxRuntimeExports.jsx(oo.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:l?.footnote,source:l?.source},sources:y,footNote:$,width:x}):null,e[110]=l?.footnote,e[111]=l?.source,e[112]=$,e[113]=y,e[114]=u?.footnote,e[115]=u?.source,e[116]=x,e[117]=Ee):Ee=e[117];let ct;return e[118]!==qe||e[119]!==B||e[120]!==ce||e[121]!==s||e[122]!==ut||e[123]!==F||e[124]!==De||e[125]!==R||e[126]!==Ct||e[127]!==Dt||e[128]!==ve||e[129]!==je||e[130]!==be||e[131]!==Ee||e[132]!==ne||e[133]!==x?(ct=r.jsxRuntimeExports.jsxs(Lt.GraphContainer,{className:Ct,style:Dt,id:ce,ref:Mt,"aria-label":qe,backgroundColor:B,theme:ne,language:ut,minHeight:F,width:x,height:s,relativeHeight:R,padding:De,children:[ve,je,be,Ee]}),e[118]=qe,e[119]=B,e[120]=ce,e[121]=s,e[122]=ut,e[123]=F,e[124]=De,e[125]=R,e[126]=Ct,e[127]=Dt,e[128]=ve,e[129]=je,e[130]=be,e[131]=Ee,e[132]=ne,e[133]=x,e[134]=ct):ct=e[134],ct}function ho(a){return a!=null}function go(a){return a.radius}function fo(a){return a.properties.NAME!=="Antarctica"}function yo(a){return a!==void 0}function vo(a){return a!==void 0}function jo(a){return a.data}function bo(a){return a!==void 0}function Eo(a){return a.data}function wo(a){return a.x}function ko(a,e){return a-e}function Ro(a){return a.date}exports.HybridMap=xo;
|
|
2
2
|
//# sourceMappingURL=HybridMap.cjs.map
|