@undp/data-viz 2.2.1 → 2.2.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.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +264 -250
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +272 -258
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/GraphEl-CAjJLOGk.cjs +2 -0
- package/dist/GraphEl-CAjJLOGk.cjs.map +1 -0
- package/dist/{GraphEl-DKrjuQNB.js → GraphEl-DcNr5JzH.js} +9 -7
- package/dist/GraphEl-DcNr5JzH.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/Types.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
- package/dist/GraphEl-CBZdcvb7.cjs +0 -2
- package/dist/GraphEl-CBZdcvb7.cjs.map +0 -1
- package/dist/GraphEl-DKrjuQNB.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\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 xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\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 : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\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 </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\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 : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='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 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\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 /** 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 /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = 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\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === 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 xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","t30","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","fetchAndParseJSON","then","d_1","t35","t36","t37","speed","interval","setInterval","clearInterval","t38","t39","getSliderMarks","markObj","console","error","t40","graphContainer","t41","t42","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t43","Pause","Play","SliderUI","nextValue","nextValue_0","t44","GraphArea","d_7","format","_temp8","getJenks","_temp9","_temp0","Spinner","t45","footnote","source","GraphFooter","t46","GraphContainer","d_9","d_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S;AAAAA,IA6BDM;AAAAA,IAwFCS;AAAAA,EAAAA,GAYH,GAAiB9I,QAAAsC,GAAAtC,SAAAe,IAAAf,SAAAsB,GAAAtB,SAAAvK,GAAAuK,SAAAgC,GAAAhC,SAAAkC,GAAAlC,SAAAY,IAAAZ,SAAAkB,GAAAlB,SAAAmH,IAAAnH,SAAAqH,IAAArH,SAAAsH,IAAAtH,SAAA+H,IAAA/H,SAAAqI,IAAArI,SAAA8I,IAAA9I,SAAAoC,IAAApC,SAAAxK,GAAAwK,SAAAkJ,MAAAA,KAAAlJ,EAAA,GAAA,GAvKjBkJ;AAuKiB;AAlSd,SAAAN,GAAAQ,GAAA;AAAA,SA2NuB3M,EAAC2B;AAA+B;AA3NvD,SAAAuK,GAAAU,GAAA;AAAA,SAoNuB5M,EAACyB;AAA+B;AApNvD,SAAAuK,GAAA1L,GAAA;AAAA,SA6M4BA,EAAEE,WAAWqM,SAAU;AAAY;AA7M/D,SAAAxB,GAAAyB,GAAA;AAAA,SA4J4B9M,MAAMpF;AAAS;AA5J3C,SAAAwQ,GAAA2B,GAAA;AAAA,SA2J6C/M,MAAMpF;AAAS;AA3J5D,SAAAuQ,GAAA6B,GAAA;AAAA,SA2JyBhN,EAACvH;AAAK;AA3J/B,SAAAyS,GAAA+B,GAAA;AAAA,SA0J2CjN,MAAMpF;AAAS;AA1J1D,SAAAqQ,GAAAiC,GAAA;AAAA,SA0JuBlN,EAACvH;AAAK;AA1J7B,SAAA0P,GAAAgF,GAAAC,GAAA;AAAA,SAgEkBD,IAAIC;AAAC;AAhEvB,SAAAnF,GAAAjI,GAAA;AAAA,SA4DgBA,EAAC6H;AAAK;"}
|
|
1
|
+
{"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n zoomAndCenterByHighlightedIds: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox({\r\n ...mapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? mapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : mapData.features,\r\n });\r\n\r\n const center = centerOfMass({\r\n ...mapData,\r\n features: zoomAndCenterByHighlightedIds\r\n ? mapData.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n (highlightedIds || []).length === 0 ||\r\n highlightedIds.indexOf(d.properties[mapProperty]) !== -1,\r\n )\r\n : mapData.features,\r\n });\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\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([0, 0])\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 xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\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 : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\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 </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\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 : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='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 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\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 /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Toggle if the map is centered and zoomed to the highlighted ids. */\r\n zoomAndCenterByHighlightedIds?: boolean;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n zoomAndCenterByHighlightedIds = false,\r\n } = 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\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === 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 xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n zoomAndCenterByHighlightedIds={zoomAndCenterByHighlightedIds}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","zoomAndCenterByHighlightedIds","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","features","d","length","indexOf","properties","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","findIndex","el","id","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","t27","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t28","t29","t30","t31","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t32","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t33","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t34","shape","onUpdateShape","useEffectEvent","t35","fetchAndParseJSON","then","d_1","t36","t37","t38","speed","interval","setInterval","clearInterval","t39","t40","getSliderMarks","markObj","console","error","t41","graphContainer","t42","t43","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t44","Pause","Play","SliderUI","nextValue","nextValue_0","t45","GraphArea","d_7","format","_temp8","getJenks","_temp9","_temp0","Spinner","t46","footnote","source","GraphFooter","t47","GraphContainer","d_9","d_8","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,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,+BAAAA;AAAAA,EAAAA,IACEjC,GACE,CAACkC,IAAYC,EAAa,IAAIC,EAClCJ,OAAgCK,SAAY,EAAE9B,IAAQ,OAAO,CAACyB,EAChE,GACM,CAACM,GAAeC,EAAgB,IAAIH,EAA6BC,MAAS,GAE1E,CAACG,IAAgBC,CAAiB,IAAIL,EAAcC,MAAS,GAE7D,CAACK,GAAeC,CAAgB,IAAIP,EAAcC,MAAS,GAC3D,CAACO,GAAQC,CAAS,IAAIT,EAA6BC,MAAS,GAC5D,CAAC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uBnP,EAAC+D;AAA+B;AArNvD,SAAAwK,GAAAzL,GAAA;AAAA,SA8M4BA,EAAE3C,WAAWiP,SAAU;AAAY;AA9M/D,SAAAxB,GAAAyB,GAAA;AAAA,SA6J4BrP,MAAM9C;AAAS;AA7J3C,SAAAyQ,GAAA2B,GAAA;AAAA,SA4J6CtP,MAAM9C;AAAS;AA5J5D,SAAAwQ,GAAA6B,GAAA;AAAA,SA4JyBvP,EAAClF;AAAK;AA5J/B,SAAA2S,GAAA+B,GAAA;AAAA,SA2J2CxP,MAAM9C;AAAS;AA3J1D,SAAAsQ,GAAAiC,GAAA;AAAA,SA2JuBzP,EAAClF;AAAK;AA3J7B,SAAA4P,GAAAgF,GAAAC,GAAA;AAAA,SAiEkBD,IAAIC;AAAC;AAjEvB,SAAAnF,GAAAxK,GAAA;AAAA,SA6DgBA,EAACoK;AAAK;"}
|
package/dist/ChoroplethMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),x=require("react"),dt=require("./getSliderMarks-CIuSoedo.cjs"),ft=require("./Spinner-jTMOLuw_.cjs"),ut=require("./parse-xYI9yrvL.cjs"),jt=require("./index-DQA8q5sC.cjs"),oe=require("./zoom-ChcvXFIz.cjs"),mt=require("./Typography-sa1UE0oF.cjs"),vt=require("./index-C5K--w8d.cjs"),bt=require("./numberFormattingFunction-02t-wJta.cjs"),Et=require("./Tooltip-BLa2EfMs.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),lt=require("./index-C6er0ety.cjs"),wt=require("./DetailsModal-DHttOA80.cjs"),Rt=require("./ordinal-CrsysVE-.cjs"),Ct=require("./threshold-DNsSUf8Q.cjs"),it=require("./select-Bnfk0lJx.cjs"),Je=require("./proxy-C4-uo6nS.cjs"),St=require("./use-in-view-C3o_ntMv.cjs"),$t=require("./index-CoobIWNj.cjs"),Dt=require("./GraphFooter.cjs"),Nt=require("./GraphHeader.cjs"),Ke=require("./Colors.cjs"),Mt=require("./fetchAndParseData-QTF6tjij.cjs"),Ot=require("./getUniqValue-NX8DgwND.cjs"),qt=require("./getJenks-BzJvhy_H.cjs"),pt=require("./GraphContainer-B1EDxJ0S.cjs");function Pt(h){const{data:e,colorDomain:l,colors:d,mapData:R,colorLegendTitle:D,categorical:T,height:E,width:j,scale:b,centerPoint:V,tooltip:re,mapBorderWidth:_,mapBorderColor:H,mapNoDataColor:ae,onSeriesMouseOver:ne,showColorScale:Ee,zoomScaleExtend:Ne,zoomTranslateExtend:Me,highlightedIds:X,onSeriesMouseClick:se,mapProperty:k,resetSelectionOnDoubleClick:ke,detailsOnClick:Y,styles:Oe,classNames:ie,mapProjection:O,zoomInteraction:q,animate:S,dimmedOpacity:P,customLayers:le,collapseColorScaleByDefault:we}=h,[N,I]=x.useState(void 0),ce=x.useRef(null),[qe,Re]=x.useState(we===void 0?!(j<680):!we),[de,J]=x.useState(void 0),[K,Z]=x.useState(void 0),[f,g]=x.useState(void 0),[ue,me]=x.useState(void 0),G=x.useRef(null),pe=St.useInView(G,{once:S.once,amount:S.amount}),Q=x.useRef(null),he=T?Rt.ordinal().domain(l).range(d):Ct.threshold().domain(l).range(d);x.useEffect(()=>{const o=it.select(Q.current),i=it.select(G.current),v=r=>{if(q==="noZoom")return!1;if(q==="button")return!r.type.includes("wheel");const s=r.type==="wheel",c=r.type.startsWith("touch"),n=r.type==="mousedown"||r.type==="mousemove";return c?!0:s?q==="scroll"?!0:r.ctrlKey:n&&!r.button&&!r.ctrlKey},a=oe.zoom().scaleExtent(Ne).translateExtent(Me||[[-20,-20],[j+20,E+20]]).filter(v).on("zoom",({transform:r})=>{o.attr("transform",r)});i.call(a),ce.current=a},[E,j,q]);const U=oe.index_default(R),w=vt.index_default(R),xe=U[2]-U[0],L=U[3]-U[1],Ce=j*190/960*360/xe,Se=E*190/678*180/L,z=b*Math.min(Ce,Se),M=O==="mercator"?oe.geoMercator().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="equalEarth"?oe.geoEqualEarth().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="naturalEarth"?oe.geoNaturalEarth1().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="orthographic"?oe.geoOrthographic().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):oe.geoAlbersUsa().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z),ge=o=>{if(!G.current||!ce.current)return;it.select(G.current).call(ce.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Je.motion.svg,{width:`${j}px`,height:`${E}px`,viewBox:`0 0 ${j} ${E}`,ref:G,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:Q,children:[le.filter(o=>o.position==="before").map(o=>o.layer),R.features.map((o,i)=>e.findIndex(a=>a.id===o.properties[k])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:N?P:X.length!==0?X.indexOf(o.properties[k])!==-1?1:P:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((a,r)=>{let s="";return a.forEach(c=>{let n=" M";c.forEach((m,$)=>{const C=M([m[0],m[1]]);$!==c.length-1?n=`${n}${C[0]} ${C[1]}L`:n=`${n}${C[0]} ${C[1]}`}),s+=n}),t.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:H,strokeWidth:_,fill:ae}},r)}):o.geometry.coordinates.map((a,r)=>{let s="M";return a.forEach((c,n)=>{const m=M([c[0],c[1]]);n!==a.length-1?s=`${s}${m[0]} ${m[1]}L`:s=`${s}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:H,strokeWidth:_,fill:ae}},r)})},i)),t.jsxRuntimeExports.jsx($t.AnimatePresence,{children:e.map(o=>{const i=R.features.findIndex(a=>o.id===a.properties[k]),v=kt.checkIfNullOrUndefined(o.x)?ae:he(o.x);return t.jsxRuntimeExports.jsx(Je.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:N?N===v?1:P:X.length!==0?X.indexOf(o.id)!==-1?1:P:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:a=>{Z(o),me(a.clientY),g(a.clientX),ne?.(o)},onMouseMove:a=>{Z(o),me(a.clientY),g(a.clientX)},onMouseLeave:()=>{Z(void 0),g(void 0),me(void 0),ne?.(void 0)},onClick:()=>{(se||Y)&&(jt.isEqual(de,o)&&ke?(J(void 0),se?.(void 0)):(J(o),se?.(o)))},children:i===-1?null:R.features[i].geometry.type==="MultiPolygon"?R.features[i].geometry.coordinates.map((a,r)=>{let s="";return a.forEach(c=>{let n=" M";c.forEach((m,$)=>{const C=M([m[0],m[1]]);$!==c.length-1?n=`${n}${C[0]} ${C[1]}L`:n=`${n}${C[0]} ${C[1]}`}),s+=n}),t.jsxRuntimeExports.jsx(Je.motion.path,{d:s,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:H,strokeWidth:_}},`${o.id}-${r}`)}):R.features[i].geometry.coordinates.map((a,r)=>{let s="M";return a.forEach((c,n)=>{const m=M([c[0],c[1]]);n!==a.length-1?s=`${s}${m[0]} ${m[1]}L`:s=`${s}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx(Je.motion.path,{d:s,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:H,strokeWidth:_}},`${o.id}-${r}`)})},o.id)})}),K?R.features.filter(o=>o.properties[k]===K.id).map((o,i)=>t.jsxRuntimeExports.jsx("g",{children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((v,a)=>{let r="";return v.forEach(s=>{let c=" M";s.forEach((n,m)=>{const $=M([n[0],n[1]]);m!==s.length-1?c=`${c}${$[0]} ${$[1]}L`:c=`${c}${$[0]} ${$[1]}`}),r+=c}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)}):o.geometry.coordinates.map((v,a)=>{let r="M";return v.forEach((s,c)=>{const n=M([s[0],s[1]]);c!==v.length-1?r=`${r}${n[0]} ${n[1]}L`:r=`${r}${n[0]} ${n[1]}`}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)})},i)):null,le.filter(o=>o.position==="after").map(o=>o.layer)]})}),Ee===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",ie?.colorLegend),children:qe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{Re(!1)},children:t.jsxRuntimeExports.jsx(lt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:T?void 0:"340px"},children:[D&&D!==""?t.jsxRuntimeExports.jsx(mt.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:D}):null,T?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:l.map((o,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{I(d[i%d.length])},onMouseLeave:()=>{I(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d[i%d.length]}}),t.jsxRuntimeExports.jsx(mt.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[l.map((o,i)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{I(d[i])},onMouseLeave:()=>{I(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:i*320/d.length+1,y:1,width:320/d.length-2,height:8,className:N===d[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:d[i],...N===d[i]?{}:{stroke:d[i]}}}),t.jsxRuntimeExports.jsx("text",{x:(i+1)*320/d.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:bt.numberFormattingFunction(o,"NA")})]},i)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{I(d[l.length])},onMouseLeave:()=>{I(void 0)},x:l.length*320/d.length+1,y:1,width:320/d.length-2,height:8,className:`cursor-pointer ${N===d[l.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:d[l.length],...N===d[l.length]?{}:{stroke:d[l.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Re(!0)},children:t.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"})})}),q==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ge("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ge("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:"–"})]})]}),Y&&de!==void 0?t.jsxRuntimeExports.jsx(wt.DetailsModal,{body:Y,data:de,setData:J,className:ie?.modal}):null,K&&re&&f&&ue?t.jsxRuntimeExports.jsx(Et.Tooltip,{data:K,body:re,xPos:f,yPos:ue,backgroundStyle:Oe?.tooltip,className:ie?.tooltip}):null]})}function It(h){const e=t.compilerRuntimeExports.c(121),{data:l,mapData:d,graphTitle:R,colors:D,sources:T,graphDescription:E,height:j,width:b,footNote:V,colorDomain:re,colorLegendTitle:_,scaleType:H,scale:ae,centerPoint:ne,padding:Ee,mapBorderWidth:Ne,mapNoDataColor:Me,backgroundColor:X,mapBorderColor:se,relativeHeight:k,tooltip:ke,onSeriesMouseOver:Y,isWorldMap:Oe,showColorScale:ie,zoomScaleExtend:O,zoomTranslateExtend:q,graphID:S,highlightedIds:P,onSeriesMouseClick:le,mapProperty:we,graphDownload:N,dataDownload:I,showAntarctica:ce,language:qe,minHeight:Re,theme:de,ariaLabel:J,resetSelectionOnDoubleClick:K,detailsOnClick:Z,styles:f,classNames:g,mapProjection:ue,zoomInteraction:me,animate:G,dimmedOpacity:pe,customLayers:Q,timeline:he,collapseColorScaleByDefault:U}=h,w=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,xe=V===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.":V,L=H===void 0?"threshold":H,Ce=ae===void 0?.95:ae,Se=Ne===void 0?.5:Ne,z=Me===void 0?Ke.Colors.light.graphNoData:Me,M=X===void 0?!1:X,ge=se===void 0?Ke.Colors.light.grays["gray-500"]:se,o=Oe===void 0?!0:Oe,i=ie===void 0?!0:ie;let v;e[0]!==O?(v=O===void 0?[.8,6]:O,e[0]=O,e[1]=v):v=e[1];const a=v;let r;e[2]!==P?(r=P===void 0?[]:P,e[2]=P,e[3]=r):r=e[3];const s=r,c=we===void 0?"ISO3":we,n=N===void 0?!1:N,m=I===void 0?!1:I,$=ce===void 0?!1:ce,C=qe===void 0?"en":qe,F=Re===void 0?0:Re,ee=de===void 0?"light":de,Ze=K===void 0?!0:K,Qe=me===void 0?"button":me,Pe=G===void 0?!1:G,et=pe===void 0?.3:pe;let Ie;e[4]!==Q?(Ie=Q===void 0?[]:Q,e[4]=Q,e[5]=Ie):Ie=e[5];const tt=Ie;let Le;e[6]!==he?(Le=he===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:he,e[6]=he,e[7]=Le):Le=e[7];const u=Le,[te,ht]=x.useState(0),[$e,xt]=x.useState(0),[W,gt]=x.useState(u.autoplay);let De;if(e[8]!==l||e[9]!==u.dateFormat){let y;e[11]!==u.dateFormat?(y=B=>ut.parse(`${B.date}`,u.dateFormat||"yyyy",new Date).getTime(),e[11]=u.dateFormat,e[12]=y):y=e[12],De=[...new Set(l.filter(_t).map(y))],De.sort(Vt),e[8]=l,e[9]=u.dateFormat,e[10]=De}else De=e[10];const p=De,[A,ot]=x.useState(u.autoplay?0:p.length-1),[ye,yt]=x.useState(void 0),rt=x.useRef(null),ct=x.useRef(null);let ze,Fe;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{const y=new ResizeObserver(B=>{ht(B[0].target.clientWidth||620),xt(B[0].target.clientHeight||480)});return rt.current&&y.observe(rt.current),()=>y.disconnect()},Fe=[],e[13]=ze,e[14]=Fe):(ze=e[13],Fe=e[14]),x.useEffect(ze,Fe);let We;e[15]===Symbol.for("react.memo_cache_sentinel")?(We=y=>{yt(y)},e[15]=We):We=e[15];const Ae=x.useEffectEvent(We);let Be;e[16]!==w||e[17]!==Ae?(Be=()=>{typeof w=="string"?Mt.fetchAndParseJSON(w).then(B=>{Ae(B)}):Ae(w)},e[16]=w,e[17]=Ae,e[18]=Be):Be=e[18];let Te;e[19]!==w?(Te=[w],e[19]=w,e[20]=Te):Te=e[20],x.useEffect(Be,Te);let Ve;e[21]!==re||e[22]!==D?.length||e[23]!==l||e[24]!==L?(Ve=re||(L==="categorical"?Ot.getUniqValue(l,"x"):qt.getJenks(l.map(Tt),D?.length||4)),e[21]=re,e[22]=D?.length,e[23]=l,e[24]=L,e[25]=Ve):Ve=e[25];const _e=Ve;let Ge,Ue;e[26]!==W||e[27]!==u.speed||e[28]!==p?(Ge=()=>{const y=setInterval(()=>{ot(B=>B<p.length-1?B+1:0)},(u.speed||2)*1e3);return W||clearInterval(y),()=>clearInterval(y)},Ue=[p,W,u.speed],e[26]=W,e[27]=u.speed,e[28]=p,e[29]=Ge,e[30]=Ue):(Ge=e[29],Ue=e[30]),x.useEffect(Ge,Ue);const at=u.dateFormat||"yyyy";let He;e[31]!==A||e[32]!==at||e[33]!==u.showOnlyActiveDate||e[34]!==p?(He=dt.getSliderMarks(p,A,u.showOnlyActiveDate,at),e[31]=A,e[32]=at,e[33]=u.showOnlyActiveDate,e[34]=p,e[35]=He):He=e[35];const Xe=He,nt=g?.graphContainer,st=f?.graphContainer;let fe;e[36]!==g?.description||e[37]!==g?.title||e[38]!==l||e[39]!==m||e[40]!==E||e[41]!==n||e[42]!==R||e[43]!==f?.description||e[44]!==f?.title||e[45]!==b?(fe=R||E||n||m?t.jsxRuntimeExports.jsx(Nt.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:R,graphDescription:E,width:b,graphDownload:n?ct:void 0,dataDownload:m?l.map(Bt).filter(At).length>0?l.map(Wt).filter(Ft):l.filter(zt):null}):null,e[36]=g?.description,e[37]=g?.title,e[38]=l,e[39]=m,e[40]=E,e[41]=n,e[42]=R,e[43]=f?.description,e[44]=f?.title,e[45]=b,e[46]=fe):fe=e[46];let je;e[47]!==A||e[48]!==Xe||e[49]!==W||e[50]!==u.enabled||e[51]!==p?(je=u.enabled&&p.length>0&&Xe?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{gt(!W)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":W?"Click to pause animation":"Click to play animation",children:W?t.jsxRuntimeExports.jsx(lt.Pause,{}):t.jsxRuntimeExports.jsx(lt.Play,{})}),t.jsxRuntimeExports.jsx(dt.Nr,{min:p[0],max:p[p.length-1],marks:Xe,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:y=>{ot(p.indexOf(y))},onChange:y=>{ot(p.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[47]=A,e[48]=Xe,e[49]=W,e[50]=u.enabled,e[51]=p,e[52]=je):je=e[52];let ve;e[53]!==Pe||e[54]!==ne||e[55]!==g||e[56]!==U||e[57]!==_||e[58]!==D||e[59]!==tt||e[60]!==l||e[61]!==Z||e[62]!==et||e[63]!==_e||e[64]!==j||e[65]!==s||e[66]!==A||e[67]!==o||e[68]!==ge||e[69]!==Se||e[70]!==z||e[71]!==ue||e[72]!==c||e[73]!==ye||e[74]!==F||e[75]!==le||e[76]!==Y||e[77]!==k||e[78]!==Ze||e[79]!==Ce||e[80]!==L||e[81]!==$||e[82]!==i||e[83]!==f||e[84]!==$e||e[85]!==te||e[86]!==ee||e[87]!==u.dateFormat||e[88]!==u.enabled||e[89]!==ke||e[90]!==p||e[91]!==b||e[92]!==Qe||e[93]!==a||e[94]!==q?(ve=t.jsxRuntimeExports.jsx(pt.GraphArea,{ref:rt,children:te&&$e&&ye?t.jsxRuntimeExports.jsx(Pt,{data:l.filter(y=>u.enabled?y.date===ut.format(new Date(p[A]),u.dateFormat||"yyyy"):y),mapData:$?ye:{...ye,features:ye.features.filter(Lt)},colorDomain:_e,width:te,height:$e,scale:Ce,centerPoint:ne,colors:D||(L==="categorical"?Ke.Colors[ee].categoricalColors.colors:Ke.Colors[ee].sequentialColors[`neutralColorsx0${_e.length+1}`]),colorLegendTitle:_,mapBorderWidth:Se,mapNoDataColor:z,categorical:L==="categorical",mapBorderColor:ge,tooltip:ke,onSeriesMouseOver:Y,isWorldMap:o,showColorScale:i,zoomScaleExtend:a,zoomTranslateExtend:q,onSeriesMouseClick:le,mapProperty:c,highlightedIds:s,resetSelectionOnDoubleClick:Ze,styles:f,classNames:g,detailsOnClick:Z,mapProjection:ue||(o?"naturalEarth":"mercator"),zoomInteraction:Qe,dimmedOpacity:et,animate:Pe===!0?{duration:.5,once:!0,amount:.5}:Pe||{duration:0,once:!0,amount:0},customLayers:tt,collapseColorScaleByDefault:U}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,j||(k?F?(b||te)*k>F?(b||te)*k:F:(b||te)*k:$e))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(ft.w,{"aria-label":"Loading graph"})})}),e[53]=Pe,e[54]=ne,e[55]=g,e[56]=U,e[57]=_,e[58]=D,e[59]=tt,e[60]=l,e[61]=Z,e[62]=et,e[63]=_e,e[64]=j,e[65]=s,e[66]=A,e[67]=o,e[68]=ge,e[69]=Se,e[70]=z,e[71]=ue,e[72]=c,e[73]=ye,e[74]=F,e[75]=le,e[76]=Y,e[77]=k,e[78]=Ze,e[79]=Ce,e[80]=L,e[81]=$,e[82]=i,e[83]=f,e[84]=$e,e[85]=te,e[86]=ee,e[87]=u.dateFormat,e[88]=u.enabled,e[89]=ke,e[90]=p,e[91]=b,e[92]=Qe,e[93]=a,e[94]=q,e[95]=ve):ve=e[95];let be;e[96]!==g?.footnote||e[97]!==g?.source||e[98]!==xe||e[99]!==T||e[100]!==f?.footnote||e[101]!==f?.source||e[102]!==b?(be=T||xe?t.jsxRuntimeExports.jsx(Dt.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:T,footNote:xe,width:b}):null,e[96]=g?.footnote,e[97]=g?.source,e[98]=xe,e[99]=T,e[100]=f?.footnote,e[101]=f?.source,e[102]=b,e[103]=be):be=e[103];let Ye;return e[104]!==J||e[105]!==M||e[106]!==S||e[107]!==j||e[108]!==C||e[109]!==F||e[110]!==Ee||e[111]!==k||e[112]!==nt||e[113]!==st||e[114]!==fe||e[115]!==je||e[116]!==ve||e[117]!==be||e[118]!==ee||e[119]!==b?(Ye=t.jsxRuntimeExports.jsxs(pt.GraphContainer,{className:nt,style:st,id:S,ref:ct,"aria-label":J,backgroundColor:M,theme:ee,language:C,minHeight:F,width:b,height:j,relativeHeight:k,padding:Ee,children:[fe,je,ve,be]}),e[104]=J,e[105]=M,e[106]=S,e[107]=j,e[108]=C,e[109]=F,e[110]=Ee,e[111]=k,e[112]=nt,e[113]=st,e[114]=fe,e[115]=je,e[116]=ve,e[117]=be,e[118]=ee,e[119]=b,e[120]=Ye):Ye=e[120],Ye}function Lt(h){return h.properties.NAME!=="Antarctica"}function zt(h){return h!==void 0}function Ft(h){return h!==void 0}function Wt(h){return h.data}function At(h){return h!==void 0}function Bt(h){return h.data}function Tt(h){return h.x}function Vt(h,e){return h-e}function _t(h){return h.date}exports.ChoroplethMap=It;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),x=require("react"),mt=require("./getSliderMarks-CIuSoedo.cjs"),vt=require("./Spinner-jTMOLuw_.cjs"),pt=require("./parse-xYI9yrvL.cjs"),bt=require("./index-DQA8q5sC.cjs"),re=require("./zoom-ChcvXFIz.cjs"),ht=require("./Typography-sa1UE0oF.cjs"),Et=require("./index-C5K--w8d.cjs"),kt=require("./numberFormattingFunction-02t-wJta.cjs"),wt=require("./Tooltip-BLa2EfMs.cjs"),Rt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./index-C6er0ety.cjs"),Ct=require("./DetailsModal-DHttOA80.cjs"),St=require("./ordinal-CrsysVE-.cjs"),$t=require("./threshold-DNsSUf8Q.cjs"),ct=require("./select-Bnfk0lJx.cjs"),Ke=require("./proxy-C4-uo6nS.cjs"),Dt=require("./use-in-view-C3o_ntMv.cjs"),Nt=require("./index-CoobIWNj.cjs"),Mt=require("./GraphFooter.cjs"),Ot=require("./GraphHeader.cjs"),Ze=require("./Colors.cjs"),qt=require("./fetchAndParseData-QTF6tjij.cjs"),It=require("./getUniqValue-NX8DgwND.cjs"),Pt=require("./getJenks-BzJvhy_H.cjs"),xt=require("./GraphContainer-B1EDxJ0S.cjs");function zt(h){const{data:e,colorDomain:l,colors:d,mapData:b,colorLegendTitle:N,categorical:V,height:w,width:j,scale:E,centerPoint:_,tooltip:ae,mapBorderWidth:H,mapBorderColor:Y,mapNoDataColor:se,onSeriesMouseOver:ne,showColorScale:ve,zoomScaleExtend:Me,zoomTranslateExtend:Oe,highlightedIds:D,onSeriesMouseClick:ie,mapProperty:k,resetSelectionOnDoubleClick:be,detailsOnClick:J,styles:qe,classNames:le,mapProjection:q,zoomInteraction:I,animate:S,dimmedOpacity:P,customLayers:ce,collapseColorScaleByDefault:Ee,zoomAndCenterByHighlightedIds:ke}=h,[M,z]=x.useState(void 0),de=x.useRef(null),[Ie,we]=x.useState(Ee===void 0?!(j<680):!Ee),[K,ue]=x.useState(void 0),[G,g]=x.useState(void 0),[y,Z]=x.useState(void 0),[Re,me]=x.useState(void 0),U=x.useRef(null),X=Dt.useInView(U,{once:S.once,amount:S.amount}),Q=x.useRef(null),Ce=V?St.ordinal().domain(l).range(d):$t.threshold().domain(l).range(d);x.useEffect(()=>{const o=ct.select(Q.current),i=ct.select(U.current),v=r=>{if(I==="noZoom")return!1;if(I==="button")return!r.type.includes("wheel");const n=r.type==="wheel",c=r.type.startsWith("touch"),s=r.type==="mousedown"||r.type==="mousemove";return c?!0:n?I==="scroll"?!0:r.ctrlKey:s&&!r.button&&!r.ctrlKey},a=re.zoom().scaleExtent(Me).translateExtent(Oe||[[-20,-20],[j+20,w+20]]).filter(v).on("zoom",({transform:r})=>{o.attr("transform",r)});i.call(a),de.current=a},[w,j,I]);const ee=re.index_default({...b,features:ke?b.features.filter(o=>(D||[]).length===0||D.indexOf(o.properties[k])!==-1):b.features}),R=Et.index_default({...b,features:ke?b.features.filter(o=>(D||[]).length===0||D.indexOf(o.properties[k])!==-1):b.features}),pe=ee[2]-ee[0],L=ee[3]-ee[1],Se=j*190/960*360/pe,$e=w*190/678*180/L,A=E*Math.min(Se,$e),O=q==="mercator"?re.geoMercator().rotate([0,0]).center(_||R.geometry.coordinates).translate([j/2,w/2]).scale(A):q==="equalEarth"?re.geoEqualEarth().rotate([0,0]).center(_||R.geometry.coordinates).translate([j/2,w/2]).scale(A):q==="naturalEarth"?re.geoNaturalEarth1().rotate([0,0]).center(_||R.geometry.coordinates).translate([j/2,w/2]).scale(A):q==="orthographic"?re.geoOrthographic().rotate([0,0]).center(_||R.geometry.coordinates).translate([j/2,w/2]).scale(A):re.geoAlbersUsa().rotate([0,0]).center(_||R.geometry.coordinates).translate([j/2,w/2]).scale(A),he=o=>{if(!U.current||!de.current)return;ct.select(U.current).call(de.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Ke.motion.svg,{width:`${j}px`,height:`${w}px`,viewBox:`0 0 ${j} ${w}`,ref:U,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:Q,children:[ce.filter(o=>o.position==="before").map(o=>o.layer),b.features.map((o,i)=>e.findIndex(a=>a.id===o.properties[k])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:M?P:D.length!==0?D.indexOf(o.properties[k])!==-1?1:P:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((a,r)=>{let n="";return a.forEach(c=>{let s=" M";c.forEach((m,$)=>{const C=O([m[0],m[1]]);$!==c.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),n+=s}),t.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:Y,strokeWidth:H,fill:se}},r)}):o.geometry.coordinates.map((a,r)=>{let n="M";return a.forEach((c,s)=>{const m=O([c[0],c[1]]);s!==a.length-1?n=`${n}${m[0]} ${m[1]}L`:n=`${n}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:Y,strokeWidth:H,fill:se}},r)})},i)),t.jsxRuntimeExports.jsx(Nt.AnimatePresence,{children:e.map(o=>{const i=b.features.findIndex(a=>o.id===a.properties[k]),v=Rt.checkIfNullOrUndefined(o.x)?se:Ce(o.x);return t.jsxRuntimeExports.jsx(Ke.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:M?M===v?1:P:D.length!==0?D.indexOf(o.id)!==-1?1:P:1,transition:{duration:S.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:a=>{g(o),me(a.clientY),Z(a.clientX),ne?.(o)},onMouseMove:a=>{g(o),me(a.clientY),Z(a.clientX)},onMouseLeave:()=>{g(void 0),Z(void 0),me(void 0),ne?.(void 0)},onClick:()=>{(ie||J)&&(bt.isEqual(K,o)&&be?(ue(void 0),ie?.(void 0)):(ue(o),ie?.(o)))},children:i===-1?null:b.features[i].geometry.type==="MultiPolygon"?b.features[i].geometry.coordinates.map((a,r)=>{let n="";return a.forEach(c=>{let s=" M";c.forEach((m,$)=>{const C=O([m[0],m[1]]);$!==c.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),n+=s}),t.jsxRuntimeExports.jsx(Ke.motion.path,{d:n,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:Y,strokeWidth:H}},`${o.id}-${r}`)}):b.features[i].geometry.coordinates.map((a,r)=>{let n="M";return a.forEach((c,s)=>{const m=O([c[0],c[1]]);s!==a.length-1?n=`${n}${m[0]} ${m[1]}L`:n=`${n}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx(Ke.motion.path,{d:n,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:Y,strokeWidth:H}},`${o.id}-${r}`)})},o.id)})}),G?b.features.filter(o=>o.properties[k]===G.id).map((o,i)=>t.jsxRuntimeExports.jsx("g",{children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((v,a)=>{let r="";return v.forEach(n=>{let c=" M";n.forEach((s,m)=>{const $=O([s[0],s[1]]);m!==n.length-1?c=`${c}${$[0]} ${$[1]}L`:c=`${c}${$[0]} ${$[1]}`}),r+=c}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)}):o.geometry.coordinates.map((v,a)=>{let r="M";return v.forEach((n,c)=>{const s=O([n[0],n[1]]);c!==v.length-1?r=`${r}${s[0]} ${s[1]}L`:r=`${r}${s[0]} ${s[1]}`}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)})},i)):null,ce.filter(o=>o.position==="after").map(o=>o.layer)]})}),ve===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",le?.colorLegend),children:Ie?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{we(!1)},children:t.jsxRuntimeExports.jsx(dt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:V?void 0:"340px"},children:[N&&N!==""?t.jsxRuntimeExports.jsx(ht.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:N}):null,V?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:l.map((o,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{z(d[i%d.length])},onMouseLeave:()=>{z(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d[i%d.length]}}),t.jsxRuntimeExports.jsx(ht.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[l.map((o,i)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{z(d[i])},onMouseLeave:()=>{z(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:i*320/d.length+1,y:1,width:320/d.length-2,height:8,className:M===d[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:d[i],...M===d[i]?{}:{stroke:d[i]}}}),t.jsxRuntimeExports.jsx("text",{x:(i+1)*320/d.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:kt.numberFormattingFunction(o,"NA")})]},i)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{z(d[l.length])},onMouseLeave:()=>{z(void 0)},x:l.length*320/d.length+1,y:1,width:320/d.length-2,height:8,className:`cursor-pointer ${M===d[l.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:d[l.length],...M===d[l.length]?{}:{stroke:d[l.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{we(!0)},children:t.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"})})}),I==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>he("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>he("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),J&&K!==void 0?t.jsxRuntimeExports.jsx(Ct.DetailsModal,{body:J,data:K,setData:ue,className:le?.modal}):null,G&&ae&&y&&Re?t.jsxRuntimeExports.jsx(wt.Tooltip,{data:G,body:ae,xPos:y,yPos:Re,backgroundStyle:qe?.tooltip,className:le?.tooltip}):null]})}function Lt(h){const e=t.compilerRuntimeExports.c(122),{data:l,mapData:d,graphTitle:b,colors:N,sources:V,graphDescription:w,height:j,width:E,footNote:_,colorDomain:ae,colorLegendTitle:H,scaleType:Y,scale:se,centerPoint:ne,padding:ve,mapBorderWidth:Me,mapNoDataColor:Oe,backgroundColor:D,mapBorderColor:ie,relativeHeight:k,tooltip:be,onSeriesMouseOver:J,isWorldMap:qe,showColorScale:le,zoomScaleExtend:q,zoomTranslateExtend:I,graphID:S,highlightedIds:P,onSeriesMouseClick:ce,mapProperty:Ee,graphDownload:ke,dataDownload:M,showAntarctica:z,language:de,minHeight:Ie,theme:we,ariaLabel:K,resetSelectionOnDoubleClick:ue,detailsOnClick:G,styles:g,classNames:y,mapProjection:Z,zoomInteraction:Re,animate:me,dimmedOpacity:U,customLayers:X,timeline:Q,collapseColorScaleByDefault:Ce,zoomAndCenterByHighlightedIds:ee}=h,R=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,pe=_===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":_,L=Y===void 0?"threshold":Y,Se=se===void 0?.95:se,$e=Me===void 0?.5:Me,A=Oe===void 0?Ze.Colors.light.graphNoData:Oe,O=D===void 0?!1:D,he=ie===void 0?Ze.Colors.light.grays["gray-500"]:ie,o=qe===void 0?!0:qe,i=le===void 0?!0:le;let v;e[0]!==q?(v=q===void 0?[.8,6]:q,e[0]=q,e[1]=v):v=e[1];const a=v;let r;e[2]!==P?(r=P===void 0?[]:P,e[2]=P,e[3]=r):r=e[3];const n=r,c=Ee===void 0?"ISO3":Ee,s=ke===void 0?!1:ke,m=M===void 0?!1:M,$=z===void 0?!1:z,C=de===void 0?"en":de,B=Ie===void 0?0:Ie,te=we===void 0?"light":we,Qe=ue===void 0?!0:ue,et=Re===void 0?"button":Re,Pe=me===void 0?!1:me,tt=U===void 0?.3:U;let ze;e[4]!==X?(ze=X===void 0?[]:X,e[4]=X,e[5]=ze):ze=e[5];const ot=ze;let Le;e[6]!==Q?(Le=Q===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Q,e[6]=Q,e[7]=Le):Le=e[7];const u=Le,rt=ee===void 0?!1:ee,[oe,gt]=x.useState(0),[De,ft]=x.useState(0),[F,yt]=x.useState(u.autoplay);let Ne;if(e[8]!==l||e[9]!==u.dateFormat){let f;e[11]!==u.dateFormat?(f=T=>pt.parse(`${T.date}`,u.dateFormat||"yyyy",new Date).getTime(),e[11]=u.dateFormat,e[12]=f):f=e[12],Ne=[...new Set(l.filter(Gt).map(f))],Ne.sort(Ht),e[8]=l,e[9]=u.dateFormat,e[10]=Ne}else Ne=e[10];const p=Ne,[W,at]=x.useState(u.autoplay?0:p.length-1),[xe,jt]=x.useState(void 0),st=x.useRef(null),ut=x.useRef(null);let Ae,Be;e[13]===Symbol.for("react.memo_cache_sentinel")?(Ae=()=>{const f=new ResizeObserver(T=>{gt(T[0].target.clientWidth||620),ft(T[0].target.clientHeight||480)});return st.current&&f.observe(st.current),()=>f.disconnect()},Be=[],e[13]=Ae,e[14]=Be):(Ae=e[13],Be=e[14]),x.useEffect(Ae,Be);let Fe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Fe=f=>{jt(f)},e[15]=Fe):Fe=e[15];const We=x.useEffectEvent(Fe);let Te;e[16]!==R||e[17]!==We?(Te=()=>{typeof R=="string"?qt.fetchAndParseJSON(R).then(T=>{We(T)}):We(R)},e[16]=R,e[17]=We,e[18]=Te):Te=e[18];let Ve;e[19]!==R?(Ve=[R],e[19]=R,e[20]=Ve):Ve=e[20],x.useEffect(Te,Ve);let _e;e[21]!==ae||e[22]!==N?.length||e[23]!==l||e[24]!==L?(_e=ae||(L==="categorical"?It.getUniqValue(l,"x"):Pt.getJenks(l.map(_t),N?.length||4)),e[21]=ae,e[22]=N?.length,e[23]=l,e[24]=L,e[25]=_e):_e=e[25];const He=_e;let Ge,Ue;e[26]!==F||e[27]!==u.speed||e[28]!==p?(Ge=()=>{const f=setInterval(()=>{at(T=>T<p.length-1?T+1:0)},(u.speed||2)*1e3);return F||clearInterval(f),()=>clearInterval(f)},Ue=[p,F,u.speed],e[26]=F,e[27]=u.speed,e[28]=p,e[29]=Ge,e[30]=Ue):(Ge=e[29],Ue=e[30]),x.useEffect(Ge,Ue);const nt=u.dateFormat||"yyyy";let Xe;e[31]!==W||e[32]!==nt||e[33]!==u.showOnlyActiveDate||e[34]!==p?(Xe=mt.getSliderMarks(p,W,u.showOnlyActiveDate,nt),e[31]=W,e[32]=nt,e[33]=u.showOnlyActiveDate,e[34]=p,e[35]=Xe):Xe=e[35];const Ye=Xe,it=y?.graphContainer,lt=g?.graphContainer;let ge;e[36]!==y?.description||e[37]!==y?.title||e[38]!==l||e[39]!==m||e[40]!==w||e[41]!==s||e[42]!==b||e[43]!==g?.description||e[44]!==g?.title||e[45]!==E?(ge=b||w||s||m?t.jsxRuntimeExports.jsx(Ot.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:y?.title,description:y?.description},graphTitle:b,graphDescription:w,width:E,graphDownload:s?ut:void 0,dataDownload:m?l.map(Vt).filter(Tt).length>0?l.map(Wt).filter(Ft):l.filter(Bt):null}):null,e[36]=y?.description,e[37]=y?.title,e[38]=l,e[39]=m,e[40]=w,e[41]=s,e[42]=b,e[43]=g?.description,e[44]=g?.title,e[45]=E,e[46]=ge):ge=e[46];let fe;e[47]!==W||e[48]!==Ye||e[49]!==F||e[50]!==u.enabled||e[51]!==p?(fe=u.enabled&&p.length>0&&Ye?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{yt(!F)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":F?"Click to pause animation":"Click to play animation",children:F?t.jsxRuntimeExports.jsx(dt.Pause,{}):t.jsxRuntimeExports.jsx(dt.Play,{})}),t.jsxRuntimeExports.jsx(mt.Nr,{min:p[0],max:p[p.length-1],marks:Ye,step:null,defaultValue:p[p.length-1],value:p[W],onChangeComplete:f=>{at(p.indexOf(f))},onChange:f=>{at(p.indexOf(f))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[47]=W,e[48]=Ye,e[49]=F,e[50]=u.enabled,e[51]=p,e[52]=fe):fe=e[52];let ye;e[53]!==Pe||e[54]!==ne||e[55]!==y||e[56]!==Ce||e[57]!==H||e[58]!==N||e[59]!==ot||e[60]!==l||e[61]!==G||e[62]!==tt||e[63]!==He||e[64]!==j||e[65]!==n||e[66]!==W||e[67]!==o||e[68]!==he||e[69]!==$e||e[70]!==A||e[71]!==Z||e[72]!==c||e[73]!==xe||e[74]!==B||e[75]!==ce||e[76]!==J||e[77]!==k||e[78]!==Qe||e[79]!==Se||e[80]!==L||e[81]!==$||e[82]!==i||e[83]!==g||e[84]!==De||e[85]!==oe||e[86]!==te||e[87]!==u.dateFormat||e[88]!==u.enabled||e[89]!==be||e[90]!==p||e[91]!==E||e[92]!==rt||e[93]!==et||e[94]!==a||e[95]!==I?(ye=t.jsxRuntimeExports.jsx(xt.GraphArea,{ref:st,children:oe&&De&&xe?t.jsxRuntimeExports.jsx(zt,{data:l.filter(f=>u.enabled?f.date===pt.format(new Date(p[W]),u.dateFormat||"yyyy"):f),mapData:$?xe:{...xe,features:xe.features.filter(At)},colorDomain:He,width:oe,height:De,scale:Se,centerPoint:ne,colors:N||(L==="categorical"?Ze.Colors[te].categoricalColors.colors:Ze.Colors[te].sequentialColors[`neutralColorsx0${He.length+1}`]),colorLegendTitle:H,mapBorderWidth:$e,mapNoDataColor:A,categorical:L==="categorical",mapBorderColor:he,tooltip:be,onSeriesMouseOver:J,isWorldMap:o,showColorScale:i,zoomScaleExtend:a,zoomTranslateExtend:I,onSeriesMouseClick:ce,mapProperty:c,highlightedIds:n,resetSelectionOnDoubleClick:Qe,styles:g,classNames:y,detailsOnClick:G,mapProjection:Z||(o?"naturalEarth":"mercator"),zoomInteraction:et,dimmedOpacity:tt,animate:Pe===!0?{duration:.5,once:!0,amount:.5}:Pe||{duration:0,once:!0,amount:0},customLayers:ot,zoomAndCenterByHighlightedIds:rt,collapseColorScaleByDefault:Ce}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(B,j||(k?B?(E||oe)*k>B?(E||oe)*k:B:(E||oe)*k:De))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(vt.w,{"aria-label":"Loading graph"})})}),e[53]=Pe,e[54]=ne,e[55]=y,e[56]=Ce,e[57]=H,e[58]=N,e[59]=ot,e[60]=l,e[61]=G,e[62]=tt,e[63]=He,e[64]=j,e[65]=n,e[66]=W,e[67]=o,e[68]=he,e[69]=$e,e[70]=A,e[71]=Z,e[72]=c,e[73]=xe,e[74]=B,e[75]=ce,e[76]=J,e[77]=k,e[78]=Qe,e[79]=Se,e[80]=L,e[81]=$,e[82]=i,e[83]=g,e[84]=De,e[85]=oe,e[86]=te,e[87]=u.dateFormat,e[88]=u.enabled,e[89]=be,e[90]=p,e[91]=E,e[92]=rt,e[93]=et,e[94]=a,e[95]=I,e[96]=ye):ye=e[96];let je;e[97]!==y?.footnote||e[98]!==y?.source||e[99]!==pe||e[100]!==V||e[101]!==g?.footnote||e[102]!==g?.source||e[103]!==E?(je=V||pe?t.jsxRuntimeExports.jsx(Mt.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:y?.footnote,source:y?.source},sources:V,footNote:pe,width:E}):null,e[97]=y?.footnote,e[98]=y?.source,e[99]=pe,e[100]=V,e[101]=g?.footnote,e[102]=g?.source,e[103]=E,e[104]=je):je=e[104];let Je;return e[105]!==K||e[106]!==O||e[107]!==S||e[108]!==j||e[109]!==C||e[110]!==B||e[111]!==ve||e[112]!==k||e[113]!==it||e[114]!==lt||e[115]!==ge||e[116]!==fe||e[117]!==ye||e[118]!==je||e[119]!==te||e[120]!==E?(Je=t.jsxRuntimeExports.jsxs(xt.GraphContainer,{className:it,style:lt,id:S,ref:ut,"aria-label":K,backgroundColor:O,theme:te,language:C,minHeight:B,width:E,height:j,relativeHeight:k,padding:ve,children:[ge,fe,ye,je]}),e[105]=K,e[106]=O,e[107]=S,e[108]=j,e[109]=C,e[110]=B,e[111]=ve,e[112]=k,e[113]=it,e[114]=lt,e[115]=ge,e[116]=fe,e[117]=ye,e[118]=je,e[119]=te,e[120]=E,e[121]=Je):Je=e[121],Je}function At(h){return h.properties.NAME!=="Antarctica"}function Bt(h){return h!==void 0}function Ft(h){return h!==void 0}function Wt(h){return h.data}function Tt(h){return h!==void 0}function Vt(h){return h.data}function _t(h){return h.x}function Ht(h,e){return h-e}function Gt(h){return h.date}exports.ChoroplethMap=Lt;
|
|
2
2
|
//# sourceMappingURL=ChoroplethMap.cjs.map
|