@undp/data-viz 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +957 -957
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.cjs.map +1 -1
- package/dist/BasicStatCard.js +45 -47
- package/dist/BasicStatCard.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +76 -56
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +157 -157
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +185 -185
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +2 -4
- package/dist/CirclePackingGraph.js.map +1 -1
- package/dist/Data/barChart.json +70 -0
- package/dist/Data/basic.csv +20 -0
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +224 -223
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +156 -156
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +326 -325
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +183 -183
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/{GraphEl-DzRon4cb.js → GraphEl-BZne2JIx.js} +3 -3
- package/dist/{GraphEl-DzRon4cb.js.map → GraphEl-BZne2JIx.js.map} +1 -1
- package/dist/{GraphEl-BkyLYXG5.cjs → GraphEl-D5MUfp45.cjs} +2 -2
- package/dist/{GraphEl-BkyLYXG5.cjs.map → GraphEl-D5MUfp45.cjs.map} +1 -1
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +133 -132
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.cjs.map +1 -1
- package/dist/MultiGraphDashboard.js +52 -50
- package/dist/MultiGraphDashboard.js.map +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs.map +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +11 -9
- package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +149 -148
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +182 -181
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +14 -12
- package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +123 -122
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.cjs.map +1 -1
- package/dist/SingleGraphDashboard.js +83 -79
- package/dist/SingleGraphDashboard.js.map +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs.map +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +49 -45
- package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +56 -52
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.cjs.map +1 -1
- package/dist/StatCardFromData.js +44 -46
- package/dist/StatCardFromData.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +134 -134
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/getNoOfTicks-C_1CFXv_.cjs +2 -0
- package/dist/getNoOfTicks-C_1CFXv_.cjs.map +1 -0
- package/dist/getNoOfTicks-CpmRjcRF.js +7 -0
- package/dist/getNoOfTicks-CpmRjcRF.js.map +1 -0
- package/dist/index-C6LorfZ-.cjs +2 -0
- package/dist/index-C6LorfZ-.cjs.map +1 -0
- package/dist/index-Ceppbd8C.js +342 -0
- package/dist/index-Ceppbd8C.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/index-DoY3Ga3W.cjs +0 -2
- package/dist/index-DoY3Ga3W.cjs.map +0 -1
- package/dist/index-leTnKT2q.js +0 -329
- package/dist/index-leTnKT2q.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 { Modal } from '@undp/design-system-react/Modal';\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 { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\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 <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\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 { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: 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 = sort(\r\n uniqBy(data, 'date', true).map(d =>\r\n parse(`${d}`, timeline.dateFormat || 'yyyy', new Date()).getTime(),\r\n ),\r\n (a, b) => ascending(a, b),\r\n );\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={width || svgWidth}\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 )}\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","Modal","__html","string2HTML","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","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","dateFormat","Date","getTime","_temp","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","t31","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t32","shape","onUpdateShape","useEffectEvent","t33","fetchAndParseJSON","then","d_0","t34","interval","setInterval","speed","clearInterval","markObj","getSliderMarks","console","error","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t38","Pause","Play","SliderUI","nextValue","nextValue_0","t39","GraphArea","d_6","date","format","_temp7","getJenks","_temp8","_temp9","Spinner","t40","footnote","source","GraphFooter","t41","GraphContainer","d_8","d_7","NAME","d_3","d_2","d_1","d_5","d_4","a","b","ascending"],"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,EAAAA,IACEhC,GACE,CAACiC,IAAYC,EAAa,IAAIC,EAClCH,OAAgCI,SAAY,EAAE7B,IAAQ,OAAO,CAACyB,EAChE,GACM,CAACK,GAAeC,EAAgB,IAAIH,EAA6BC,MAAS,GAE1E,CAACG,GAAgBC,EAAiB,IAAIL,EAAcC,MAAS,GAE7D,CAACK,GAAeC,EAAgB,IAAIP,EAAc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AAA;AAAA,SA+MuBrM,EAACyB;AAA+B;AA/MvD,SAAAgK,GAAAnL,GAAA;AAAA,SAwM4BA,EAAEE,WAAW8L,SAAU;AAAY;AAxM/D,SAAAzB,GAAA0B,GAAA;AAAA,SAuJ4BvM,MAAMpF;AAAS;AAvJ3C,SAAAgQ,GAAA4B,GAAA;AAAA,SAsJ6CxM,MAAMpF;AAAS;AAtJ5D,SAAA+P,GAAA8B,GAAA;AAAA,SAsJyBzM,EAACvH;AAAK;AAtJ/B,SAAAiS,GAAAgC,GAAA;AAAA,SAqJ2C1M,MAAMpF;AAAS;AArJ1D,SAAA6P,GAAAkC,GAAA;AAAA,SAqJuB3M,EAACvH;AAAK;AArJ7B,SAAAsP,GAAA6E,GAAAC,GAAA;AAAA,SA4DOC,GAAUF,GAAGC,CAAC;AAAC;"}
|
|
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 { Modal } from '@undp/design-system-react/Modal';\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 { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\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 <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\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 { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: 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 = sort(\r\n uniqBy(data, 'date', true).map(d =>\r\n parse(`${d}`, timeline.dateFormat || 'yyyy', new Date()).getTime(),\r\n ),\r\n (a, b) => ascending(a, b),\r\n );\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","Modal","__html","string2HTML","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","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","dateFormat","Date","getTime","_temp","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","t31","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t32","shape","onUpdateShape","useEffectEvent","t33","fetchAndParseJSON","then","d_0","t34","interval","setInterval","speed","clearInterval","markObj","getSliderMarks","console","error","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t38","Pause","Play","SliderUI","nextValue","nextValue_0","t39","GraphArea","d_6","date","format","_temp7","getJenks","_temp8","_temp9","Spinner","t40","footnote","source","GraphFooter","t41","GraphContainer","d_8","d_7","NAME","d_3","d_2","d_1","d_5","d_4","a","b","ascending"],"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,I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A1I,EAAA,GAAA,GAvKjB0I;AAuKiB;AA7Rd,SAAAN,GAAAQ,GAAA;AAAA,SAsNuBpM,EAAC2B;AAA+B;AAtNvD,SAAAgK,GAAAU,GAAA;AAAA,SA+MuBrM,EAACyB;AAA+B;AA/MvD,SAAAgK,GAAAnL,GAAA;AAAA,SAwM4BA,EAAEE,WAAW8L,SAAU;AAAY;AAxM/D,SAAAzB,GAAA0B,GAAA;AAAA,SAuJ4BvM,MAAMpF;AAAS;AAvJ3C,SAAAgQ,GAAA4B,GAAA;AAAA,SAsJ6CxM,MAAMpF;AAAS;AAtJ5D,SAAA+P,GAAA8B,GAAA;AAAA,SAsJyBzM,EAACvH;AAAK;AAtJ/B,SAAAiS,GAAAgC,GAAA;AAAA,SAqJ2C1M,MAAMpF;AAAS;AArJ1D,SAAA6P,GAAAkC,GAAA;AAAA,SAqJuB3M,EAACvH;AAAK;AArJ7B,SAAAsP,GAAA6E,GAAAC,GAAA;AAAA,SA4DOC,GAAUF,GAAGC,CAAC;AAAC;"}
|
package/dist/ChoroplethMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-CTPQjnHt.cjs"),p=require("react"),st=require("./getSliderMarks-BmADcPQt.cjs"),pt=require("./Spinner-DRMBUsX7.cjs"),it=require("./parse-hMnG_lRV.cjs"),mt=require("./index-DQA8q5sC.cjs"),re=require("./zoom-DPw8bba-.cjs"),ht=require("./Modal-JW_IExO3.cjs"),at=require("./Typography-DX7PlgQU.cjs"),xt=require("./index-DxXnJ8Ti.cjs"),gt=require("./numberFormattingFunction-02t-wJta.cjs"),yt=require("./Tooltip-4dJo4_AF.cjs"),ft=require("./string2HTML-CPGr_I5E.cjs"),jt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),rt=require("./index-DRXx7m-C.cjs"),vt=require("./ordinal-CrsysVE-.cjs"),bt=require("./threshold-DNsSUf8Q.cjs"),ot=require("./select-Bnfk0lJx.cjs"),Et=require("./use-in-view-QcfiW0w3.cjs"),Ge=require("./proxy-BxvUI_9l.cjs"),kt=require("./index-DG2bgAva.cjs"),Rt=require("./GraphFooter.cjs"),wt=require("./GraphHeader.cjs"),Ue=require("./Colors.cjs"),Ct=require("./fetchAndParseData-l5HGMAEs.cjs"),$t=require("./getUniqValue-RViz8tTw.cjs"),St=require("./getJenks-GYmdwBqm.cjs"),Nt=require("./uniqBy-O05lp2S5.cjs"),lt=require("./GraphContainer-d8A46BK2.cjs"),Dt=require("./sort-O96oMZLb.cjs"),Mt=require("./init-DU0ybBc_.cjs");function qt(x){const{data:e,colorDomain:c,colors:d,mapData:w,colorLegendTitle:D,categorical:B,height:k,width:g,scale:m,centerPoint:F,tooltip:ne,mapBorderWidth:V,mapBorderColor:U,mapNoDataColor:se,onSeriesMouseOver:ie,showColorScale:ve,zoomScaleExtend:De,zoomTranslateExtend:Me,highlightedIds:X,onSeriesMouseClick:ae,mapProperty:f,resetSelectionOnDoubleClick:be,detailsOnClick:M,styles:qe,classNames:Ee,mapProjection:I,zoomInteraction:L,animate:S,dimmedOpacity:z,customLayers:le,collapseColorScaleByDefault:ke}=x,[q,_]=p.useState(void 0),ce=p.useRef(null),[Oe,Re]=p.useState(ke===void 0?!(g<680):!ke),[A,Y]=p.useState(void 0),[J,K]=p.useState(void 0),[y,h]=p.useState(void 0),[de,ue]=p.useState(void 0),H=p.useRef(null),pe=Et.useInView(H,{once:S.once,amount:S.amount}),Z=p.useRef(null),Pe=B?vt.ordinal().domain(c).range(d):bt.threshold().domain(c).range(d);p.useEffect(()=>{const o=ot.select(Z.current),a=ot.select(H.current),j=r=>{if(L==="noZoom")return!1;if(L==="button")return!r.type.includes("wheel");const i=r.type==="wheel",l=r.type.startsWith("touch"),s=r.type==="mousedown"||r.type==="mousemove";return l?!0:i?L==="scroll"?!0:r.ctrlKey:s&&!r.button&&!r.ctrlKey},n=re.zoom().scaleExtent(De).translateExtent(Me||[[-20,-20],[g+20,k+20]]).filter(j).on("zoom",({transform:r})=>{o.attr("transform",r)});a.call(n),ce.current=n},[k,g,L]);const G=re.turf_bbox_default(w),R=xt.turf_center_of_mass_default(w),me=G[2]-G[0],T=G[3]-G[1],we=g*190/960*360/me,Ce=k*190/678*180/T,W=m*Math.min(we,Ce),O=I==="mercator"?re.geoMercator().rotate([0,0]).center(F||R.geometry.coordinates).translate([g/2,k/2]).scale(W):I==="equalEarth"?re.geoEqualEarth().rotate([0,0]).center(F||R.geometry.coordinates).translate([g/2,k/2]).scale(W):I==="naturalEarth"?re.geoNaturalEarth1().rotate([0,0]).center(F||R.geometry.coordinates).translate([g/2,k/2]).scale(W):I==="orthographic"?re.geoOrthographic().rotate([0,0]).center(F||R.geometry.coordinates).translate([g/2,k/2]).scale(W):re.geoAlbersUsa().rotate([0,0]).center(F||R.geometry.coordinates).translate([g/2,k/2]).scale(W),he=o=>{if(!H.current||!ce.current)return;ot.select(H.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(Ge.motion.svg,{width:`${g}px`,height:`${k}px`,viewBox:`0 0 ${g} ${k}`,ref:H,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:Z,children:[le.filter(o=>o.position==="before").map(o=>o.layer),w.features.map((o,a)=>e.findIndex(n=>n.id===o.properties[f])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:q?z:X.length!==0?X.indexOf(o.properties[f])!==-1?1:z:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((n,r)=>{let i="";return n.forEach(l=>{let s=" M";l.forEach((u,N)=>{const C=O([u[0],u[1]]);N!==l.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),i+=s}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:U,strokeWidth:V,fill:se}},r)}):o.geometry.coordinates.map((n,r)=>{let i="M";return n.forEach((l,s)=>{const u=O([l[0],l[1]]);s!==n.length-1?i=`${i}${u[0]} ${u[1]}L`:i=`${i}${u[0]} ${u[1]}`}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:U,strokeWidth:V,fill:se}},r)})},a)),t.jsxRuntimeExports.jsx(kt.AnimatePresence,{children:e.map(o=>{const a=w.features.findIndex(n=>o.id===n.properties[f]),j=jt.checkIfNullOrUndefined(o.x)?se:Pe(o.x);return t.jsxRuntimeExports.jsx(Ge.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:q?q===j?1:z:X.length!==0?X.indexOf(o.id)!==-1?1:z:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:n=>{K(o),ue(n.clientY),h(n.clientX),ie?.(o)},onMouseMove:n=>{K(o),ue(n.clientY),h(n.clientX)},onMouseLeave:()=>{K(void 0),h(void 0),ue(void 0),ie?.(void 0)},onClick:()=>{(ae||M)&&(mt.isEqual(A,o)&&be?(Y(void 0),ae?.(void 0)):(Y(o),ae?.(o)))},children:a===-1?null:w.features[a].geometry.type==="MultiPolygon"?w.features[a].geometry.coordinates.map((n,r)=>{let i="";return n.forEach(l=>{let s=" M";l.forEach((u,N)=>{const C=O([u[0],u[1]]);N!==l.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),i+=s}),t.jsxRuntimeExports.jsx(Ge.motion.path,{d:i,variants:{initial:{fill:j,opacity:0},whileInView:{fill:j,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:U,strokeWidth:V}},`${o.id}-${r}`)}):w.features[a].geometry.coordinates.map((n,r)=>{let i="M";return n.forEach((l,s)=>{const u=O([l[0],l[1]]);s!==n.length-1?i=`${i}${u[0]} ${u[1]}L`:i=`${i}${u[0]} ${u[1]}`}),t.jsxRuntimeExports.jsx(Ge.motion.path,{d:i,variants:{initial:{fill:j,opacity:0},whileInView:{fill:j,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:U,strokeWidth:V}},`${o.id}-${r}`)})},o.id)})}),J?w.features.filter(o=>o.properties[f]===J.id).map((o,a)=>t.jsxRuntimeExports.jsx("g",{children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((j,n)=>{let r="";return j.forEach(i=>{let l=" M";i.forEach((s,u)=>{const N=O([s[0],s[1]]);u!==i.length-1?l=`${l}${N[0]} ${N[1]}L`:l=`${l}${N[0]} ${N[1]}`}),r+=l}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},n)}):o.geometry.coordinates.map((j,n)=>{let r="M";return j.forEach((i,l)=>{const s=O([i[0],i[1]]);l!==j.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"}},n)})},a)):null,le.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",Ee?.colorLegend),children:Oe?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(rt.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:B?void 0:"340px"},children:[D&&D!==""?t.jsxRuntimeExports.jsx(at.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,B?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:c.map((o,a)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{_(d[a%d.length])},onMouseLeave:()=>{_(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d[a%d.length]}}),t.jsxRuntimeExports.jsx(at.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[c.map((o,a)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{_(d[a])},onMouseLeave:()=>{_(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:a*320/d.length+1,y:1,width:320/d.length-2,height:8,className:q===d[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:d[a],...q===d[a]?{}:{stroke:d[a]}}}),t.jsxRuntimeExports.jsx("text",{x:(a+1)*320/d.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:gt.numberFormattingFunction(o,"NA")})]},a)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{_(d[c.length])},onMouseLeave:()=>{_(void 0)},x:c.length*320/d.length+1,y:1,width:320/d.length-2,height:8,className:`cursor-pointer ${q===d[c.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:d[c.length],...q===d[c.length]?{}:{stroke:d[c.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"})})}),L==="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:"–"})]})]}),M&&A!==void 0?t.jsxRuntimeExports.jsx(ht.le,{open:A!==void 0,onClose:()=>{Y(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof M=="string"?{__html:ft.string2HTML(M,A)}:void 0,children:typeof M=="function"?M(A):null})}):null,J&&ne&&y&&de?t.jsxRuntimeExports.jsx(yt.Tooltip,{data:J,body:ne,xPos:y,yPos:de,backgroundStyle:qe?.tooltip,className:Ee?.tooltip}):null]})}function Ot(x){const e=t.compilerRuntimeExports.c(106),{data:c,mapData:d,graphTitle:w,colors:D,sources:B,graphDescription:k,height:g,width:m,footNote:F,colorDomain:ne,colorLegendTitle:V,scaleType:U,scale:se,centerPoint:ie,padding:ve,mapBorderWidth:De,mapNoDataColor:Me,backgroundColor:X,mapBorderColor:ae,relativeHeight:f,tooltip:be,onSeriesMouseOver:M,isWorldMap:qe,showColorScale:Ee,zoomScaleExtend:I,zoomTranslateExtend:L,graphID:S,highlightedIds:z,onSeriesMouseClick:le,mapProperty:ke,graphDownload:q,dataDownload:_,showAntarctica:ce,language:Oe,minHeight:Re,theme:A,ariaLabel:Y,resetSelectionOnDoubleClick:J,detailsOnClick:K,styles:y,classNames:h,mapProjection:de,zoomInteraction:ue,animate:H,dimmedOpacity:pe,customLayers:Z,timeline:Pe,collapseColorScaleByDefault:G}=x,R=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,me=F===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":F,T=U===void 0?"threshold":U,we=se===void 0?.95:se,Ce=De===void 0?.5:De,W=Me===void 0?Ue.Colors.light.graphNoData:Me,O=X===void 0?!1:X,he=ae===void 0?Ue.Colors.light.grays["gray-500"]:ae,o=qe===void 0?!0:qe,a=Ee===void 0?!0:Ee;let j;e[0]!==I?(j=I===void 0?[.8,6]:I,e[0]=I,e[1]=j):j=e[1];const n=j;let r;e[2]!==z?(r=z===void 0?[]:z,e[2]=z,e[3]=r):r=e[3];const i=r,l=ke===void 0?"ISO3":ke,s=q===void 0?!1:q,u=_===void 0?!1:_,N=ce===void 0?!1:ce,C=Oe===void 0?"en":Oe,$=Re===void 0?0:Re,Q=A===void 0?"light":A,Xe=J===void 0?!0:J,Ye=ue===void 0?"button":ue,Ie=H===void 0?!1:H,Je=pe===void 0?.3:pe;let Le;e[4]!==Z?(Le=Z===void 0?[]:Z,e[4]=Z,e[5]=Le):Le=e[5];const Ke=Le,E=Pe===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Pe,[P,ct]=p.useState(0),[$e,dt]=p.useState(0),[ee,Ze]=p.useState(E.autoplay),v=Dt.sort(Nt.uniqBy(c,"date",!0).map(b=>it.parse(`${b}`,E.dateFormat||"yyyy",new Date).getTime()),Bt),[te,Se]=p.useState(E.autoplay?0:v.length-1),[xe,ut]=p.useState(void 0),Qe=p.useRef(null),nt=p.useRef(null);let ze,_e;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{const b=new ResizeObserver(oe=>{ct(oe[0].target.clientWidth||620),dt(oe[0].target.clientHeight||480)});return Qe.current&&b.observe(Qe.current),()=>b.disconnect()},_e=[],e[6]=ze,e[7]=_e):(ze=e[6],_e=e[7]),p.useEffect(ze,_e);let Te;e[8]===Symbol.for("react.memo_cache_sentinel")?(Te=b=>{ut(b)},e[8]=Te):Te=e[8];const We=p.useEffectEvent(Te);let Be;e[9]!==R||e[10]!==We?(Be=()=>{typeof R=="string"?Ct.fetchAndParseJSON(R).then(oe=>{We(oe)}):We(R)},e[9]=R,e[10]=We,e[11]=Be):Be=e[11];let Fe;e[12]!==R?(Fe=[R],e[12]=R,e[13]=Fe):Fe=e[13],p.useEffect(Be,Fe);let Ve;e[14]!==ne||e[15]!==D?.length||e[16]!==c||e[17]!==T?(Ve=ne||(T==="categorical"?$t.getUniqValue(c,"x"):St.getJenks(c.map(Wt),D?.length||4)),e[14]=ne,e[15]=D?.length,e[16]=c,e[17]=T,e[18]=Ve):Ve=e[18];const Ne=Ve;p.useEffect(()=>{const b=setInterval(()=>{Se(oe=>oe<v.length-1?oe+1:0)},(E.speed||2)*1e3);return ee||clearInterval(b),()=>clearInterval(b)},[v,ee,E.speed]);const Ae=st.getSliderMarks(v,te,E.showOnlyActiveDate,E.dateFormat||"yyyy"),et=h?.graphContainer,tt=y?.graphContainer;let ge;e[19]!==h?.description||e[20]!==h?.title||e[21]!==c||e[22]!==u||e[23]!==k||e[24]!==s||e[25]!==w||e[26]!==y?.description||e[27]!==y?.title||e[28]!==m?(ge=w||k||s||u?t.jsxRuntimeExports.jsx(wt.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:h?.title,description:h?.description},graphTitle:w,graphDescription:k,width:m,graphDownload:s?nt:void 0,dataDownload:u?c.map(Tt).filter(_t).length>0?c.map(zt).filter(Lt):c.filter(It):null}):null,e[19]=h?.description,e[20]=h?.title,e[21]=c,e[22]=u,e[23]=k,e[24]=s,e[25]=w,e[26]=y?.description,e[27]=y?.title,e[28]=m,e[29]=ge):ge=e[29];let ye;e[30]!==te||e[31]!==Ae||e[32]!==ee||e[33]!==Se||e[34]!==Ze||e[35]!==E.enabled||e[36]!==v?(ye=E.enabled&&v.length>0&&Ae?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ze(!ee)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ee?"Click to pause animation":"Click to play animation",children:ee?t.jsxRuntimeExports.jsx(rt.Pause,{}):t.jsxRuntimeExports.jsx(rt.Play,{})}),t.jsxRuntimeExports.jsx(st.Nr,{min:v[0],max:v[v.length-1],marks:Ae,step:null,defaultValue:v[v.length-1],value:v[te],onChangeComplete:b=>{Se(v.indexOf(b))},onChange:b=>{Se(v.indexOf(b))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[30]=te,e[31]=Ae,e[32]=ee,e[33]=Se,e[34]=Ze,e[35]=E.enabled,e[36]=v,e[37]=ye):ye=e[37];let fe;e[38]!==Ie||e[39]!==ie||e[40]!==h||e[41]!==G||e[42]!==V||e[43]!==D||e[44]!==Ke||e[45]!==c||e[46]!==K||e[47]!==Je||e[48]!==Ne||e[49]!==g||e[50]!==i||e[51]!==te||e[52]!==o||e[53]!==he||e[54]!==Ce||e[55]!==W||e[56]!==de||e[57]!==l||e[58]!==xe||e[59]!==$||e[60]!==le||e[61]!==M||e[62]!==f||e[63]!==Xe||e[64]!==we||e[65]!==T||e[66]!==N||e[67]!==a||e[68]!==y||e[69]!==$e||e[70]!==P||e[71]!==Q||e[72]!==E.dateFormat||e[73]!==E.enabled||e[74]!==be||e[75]!==v||e[76]!==m||e[77]!==Ye||e[78]!==n||e[79]!==L?(fe=t.jsxRuntimeExports.jsx(lt.GraphArea,{ref:Qe,children:P&&$e&&xe?t.jsxRuntimeExports.jsx(qt,{data:c.filter(b=>E.enabled?b.date===it.format(new Date(v[te]),E.dateFormat||"yyyy"):b),mapData:N?xe:{...xe,features:xe.features.filter(Pt)},colorDomain:Ne,width:m||P,height:Math.max($,g||(f?$?(m||P)*f>$?(m||P)*f:$:(m||P)*f:$e)),scale:we,centerPoint:ie,colors:D||(T==="categorical"?Ue.Colors[Q].sequentialColors[`neutralColorsx0${Ne.length}`]:Ue.Colors[Q].sequentialColors[`neutralColorsx0${Ne.length+1}`]),colorLegendTitle:V,mapBorderWidth:Ce,mapNoDataColor:W,categorical:T==="categorical",mapBorderColor:he,tooltip:be,onSeriesMouseOver:M,isWorldMap:o,showColorScale:a,zoomScaleExtend:n,zoomTranslateExtend:L,onSeriesMouseClick:le,mapProperty:l,highlightedIds:i,resetSelectionOnDoubleClick:Xe,styles:y,classNames:h,detailsOnClick:K,mapProjection:de||(o?"naturalEarth":"mercator"),zoomInteraction:Ye,dimmedOpacity:Je,animate:Ie===!0?{duration:.5,once:!0,amount:.5}:Ie||{duration:0,once:!0,amount:0},customLayers:Ke,collapseColorScaleByDefault:G}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max($,g||(f?$?(m||P)*f>$?(m||P)*f:$:(m||P)*f:$e))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(pt.w,{"aria-label":"Loading graph"})})}),e[38]=Ie,e[39]=ie,e[40]=h,e[41]=G,e[42]=V,e[43]=D,e[44]=Ke,e[45]=c,e[46]=K,e[47]=Je,e[48]=Ne,e[49]=g,e[50]=i,e[51]=te,e[52]=o,e[53]=he,e[54]=Ce,e[55]=W,e[56]=de,e[57]=l,e[58]=xe,e[59]=$,e[60]=le,e[61]=M,e[62]=f,e[63]=Xe,e[64]=we,e[65]=T,e[66]=N,e[67]=a,e[68]=y,e[69]=$e,e[70]=P,e[71]=Q,e[72]=E.dateFormat,e[73]=E.enabled,e[74]=be,e[75]=v,e[76]=m,e[77]=Ye,e[78]=n,e[79]=L,e[80]=fe):fe=e[80];let je;e[81]!==h?.footnote||e[82]!==h?.source||e[83]!==me||e[84]!==B||e[85]!==y?.footnote||e[86]!==y?.source||e[87]!==m?(je=B||me?t.jsxRuntimeExports.jsx(Rt.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:B,footNote:me,width:m}):null,e[81]=h?.footnote,e[82]=h?.source,e[83]=me,e[84]=B,e[85]=y?.footnote,e[86]=y?.source,e[87]=m,e[88]=je):je=e[88];let He;return e[89]!==Y||e[90]!==O||e[91]!==S||e[92]!==g||e[93]!==C||e[94]!==$||e[95]!==ve||e[96]!==f||e[97]!==et||e[98]!==tt||e[99]!==ge||e[100]!==ye||e[101]!==fe||e[102]!==je||e[103]!==Q||e[104]!==m?(He=t.jsxRuntimeExports.jsxs(lt.GraphContainer,{className:et,style:tt,id:S,ref:nt,"aria-label":Y,backgroundColor:O,theme:Q,language:C,minHeight:$,width:m,height:g,relativeHeight:f,padding:ve,children:[ge,ye,fe,je]}),e[89]=Y,e[90]=O,e[91]=S,e[92]=g,e[93]=C,e[94]=$,e[95]=ve,e[96]=f,e[97]=et,e[98]=tt,e[99]=ge,e[100]=ye,e[101]=fe,e[102]=je,e[103]=Q,e[104]=m,e[105]=He):He=e[105],He}function Pt(x){return x.properties.NAME!=="Antarctica"}function It(x){return x!==void 0}function Lt(x){return x!==void 0}function zt(x){return x.data}function _t(x){return x!==void 0}function Tt(x){return x.data}function Wt(x){return x.x}function Bt(x,e){return Mt.ascending(x,e)}exports.ChoroplethMap=Ot;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-CTPQjnHt.cjs"),p=require("react"),st=require("./getSliderMarks-BmADcPQt.cjs"),pt=require("./Spinner-DRMBUsX7.cjs"),it=require("./parse-hMnG_lRV.cjs"),mt=require("./index-DQA8q5sC.cjs"),re=require("./zoom-DPw8bba-.cjs"),ht=require("./Modal-JW_IExO3.cjs"),at=require("./Typography-DX7PlgQU.cjs"),xt=require("./index-DxXnJ8Ti.cjs"),gt=require("./numberFormattingFunction-02t-wJta.cjs"),yt=require("./Tooltip-4dJo4_AF.cjs"),ft=require("./string2HTML-CPGr_I5E.cjs"),jt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),rt=require("./index-DRXx7m-C.cjs"),vt=require("./ordinal-CrsysVE-.cjs"),bt=require("./threshold-DNsSUf8Q.cjs"),ot=require("./select-Bnfk0lJx.cjs"),Et=require("./use-in-view-QcfiW0w3.cjs"),Ge=require("./proxy-BxvUI_9l.cjs"),kt=require("./index-DG2bgAva.cjs"),Rt=require("./GraphFooter.cjs"),wt=require("./GraphHeader.cjs"),Ue=require("./Colors.cjs"),Ct=require("./fetchAndParseData-l5HGMAEs.cjs"),$t=require("./getUniqValue-RViz8tTw.cjs"),St=require("./getJenks-GYmdwBqm.cjs"),Nt=require("./uniqBy-O05lp2S5.cjs"),lt=require("./GraphContainer-d8A46BK2.cjs"),Dt=require("./sort-O96oMZLb.cjs"),Mt=require("./init-DU0ybBc_.cjs");function qt(h){const{data:e,colorDomain:c,colors:d,mapData:w,colorLegendTitle:N,categorical:W,height:E,width:g,scale:v,centerPoint:B,tooltip:ne,mapBorderWidth:F,mapBorderColor:G,mapNoDataColor:se,onSeriesMouseOver:ie,showColorScale:ve,zoomScaleExtend:De,zoomTranslateExtend:Me,highlightedIds:U,onSeriesMouseClick:ae,mapProperty:k,resetSelectionOnDoubleClick:be,detailsOnClick:D,styles:qe,classNames:Ee,mapProjection:O,zoomInteraction:P,animate:$,dimmedOpacity:I,customLayers:le,collapseColorScaleByDefault:ke}=h,[M,L]=p.useState(void 0),ce=p.useRef(null),[Oe,Re]=p.useState(ke===void 0?!(g<680):!ke),[V,X]=p.useState(void 0),[Y,J]=p.useState(void 0),[x,m]=p.useState(void 0),[de,ue]=p.useState(void 0),A=p.useRef(null),pe=Et.useInView(A,{once:$.once,amount:$.amount}),K=p.useRef(null),Pe=W?vt.ordinal().domain(c).range(d):bt.threshold().domain(c).range(d);p.useEffect(()=>{const o=ot.select(K.current),a=ot.select(A.current),y=r=>{if(P==="noZoom")return!1;if(P==="button")return!r.type.includes("wheel");const i=r.type==="wheel",l=r.type.startsWith("touch"),s=r.type==="mousedown"||r.type==="mousemove";return l?!0:i?P==="scroll"?!0:r.ctrlKey:s&&!r.button&&!r.ctrlKey},n=re.zoom().scaleExtent(De).translateExtent(Me||[[-20,-20],[g+20,E+20]]).filter(y).on("zoom",({transform:r})=>{o.attr("transform",r)});a.call(n),ce.current=n},[E,g,P]);const H=re.turf_bbox_default(w),R=xt.turf_center_of_mass_default(w),me=H[2]-H[0],z=H[3]-H[1],we=g*190/960*360/me,Ce=E*190/678*180/z,_=v*Math.min(we,Ce),q=O==="mercator"?re.geoMercator().rotate([0,0]).center(B||R.geometry.coordinates).translate([g/2,E/2]).scale(_):O==="equalEarth"?re.geoEqualEarth().rotate([0,0]).center(B||R.geometry.coordinates).translate([g/2,E/2]).scale(_):O==="naturalEarth"?re.geoNaturalEarth1().rotate([0,0]).center(B||R.geometry.coordinates).translate([g/2,E/2]).scale(_):O==="orthographic"?re.geoOrthographic().rotate([0,0]).center(B||R.geometry.coordinates).translate([g/2,E/2]).scale(_):re.geoAlbersUsa().rotate([0,0]).center(B||R.geometry.coordinates).translate([g/2,E/2]).scale(_),he=o=>{if(!A.current||!ce.current)return;ot.select(A.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(Ge.motion.svg,{width:`${g}px`,height:`${E}px`,viewBox:`0 0 ${g} ${E}`,ref:A,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:K,children:[le.filter(o=>o.position==="before").map(o=>o.layer),w.features.map((o,a)=>e.findIndex(n=>n.id===o.properties[k])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:M?I:U.length!==0?U.indexOf(o.properties[k])!==-1?1:I:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((n,r)=>{let i="";return n.forEach(l=>{let s=" M";l.forEach((u,S)=>{const C=q([u[0],u[1]]);S!==l.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),i+=s}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:G,strokeWidth:F,fill:se}},r)}):o.geometry.coordinates.map((n,r)=>{let i="M";return n.forEach((l,s)=>{const u=q([l[0],l[1]]);s!==n.length-1?i=`${i}${u[0]} ${u[1]}L`:i=`${i}${u[0]} ${u[1]}`}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:G,strokeWidth:F,fill:se}},r)})},a)),t.jsxRuntimeExports.jsx(kt.AnimatePresence,{children:e.map(o=>{const a=w.features.findIndex(n=>o.id===n.properties[k]),y=jt.checkIfNullOrUndefined(o.x)?se:Pe(o.x);return t.jsxRuntimeExports.jsx(Ge.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:M?M===y?1:I:U.length!==0?U.indexOf(o.id)!==-1?1:I:1,transition:{duration:$.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:$.duration}},onMouseEnter:n=>{J(o),ue(n.clientY),m(n.clientX),ie?.(o)},onMouseMove:n=>{J(o),ue(n.clientY),m(n.clientX)},onMouseLeave:()=>{J(void 0),m(void 0),ue(void 0),ie?.(void 0)},onClick:()=>{(ae||D)&&(mt.isEqual(V,o)&&be?(X(void 0),ae?.(void 0)):(X(o),ae?.(o)))},children:a===-1?null:w.features[a].geometry.type==="MultiPolygon"?w.features[a].geometry.coordinates.map((n,r)=>{let i="";return n.forEach(l=>{let s=" M";l.forEach((u,S)=>{const C=q([u[0],u[1]]);S!==l.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),i+=s}),t.jsxRuntimeExports.jsx(Ge.motion.path,{d:i,variants:{initial:{fill:y,opacity:0},whileInView:{fill:y,opacity:1,transition:{duration:$.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:$.duration}},style:{stroke:G,strokeWidth:F}},`${o.id}-${r}`)}):w.features[a].geometry.coordinates.map((n,r)=>{let i="M";return n.forEach((l,s)=>{const u=q([l[0],l[1]]);s!==n.length-1?i=`${i}${u[0]} ${u[1]}L`:i=`${i}${u[0]} ${u[1]}`}),t.jsxRuntimeExports.jsx(Ge.motion.path,{d:i,variants:{initial:{fill:y,opacity:0},whileInView:{fill:y,opacity:1,transition:{duration:$.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:$.duration}},style:{stroke:G,strokeWidth:F}},`${o.id}-${r}`)})},o.id)})}),Y?w.features.filter(o=>o.properties[k]===Y.id).map((o,a)=>t.jsxRuntimeExports.jsx("g",{children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((y,n)=>{let r="";return y.forEach(i=>{let l=" M";i.forEach((s,u)=>{const S=q([s[0],s[1]]);u!==i.length-1?l=`${l}${S[0]} ${S[1]}L`:l=`${l}${S[0]} ${S[1]}`}),r+=l}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},n)}):o.geometry.coordinates.map((y,n)=>{let r="M";return y.forEach((i,l)=>{const s=q([i[0],i[1]]);l!==y.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"}},n)})},a)):null,le.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",Ee?.colorLegend),children:Oe?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(rt.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:W?void 0:"340px"},children:[N&&N!==""?t.jsxRuntimeExports.jsx(at.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,W?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:c.map((o,a)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{L(d[a%d.length])},onMouseLeave:()=>{L(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d[a%d.length]}}),t.jsxRuntimeExports.jsx(at.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},a))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[c.map((o,a)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{L(d[a])},onMouseLeave:()=>{L(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:a*320/d.length+1,y:1,width:320/d.length-2,height:8,className:M===d[a]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:d[a],...M===d[a]?{}:{stroke:d[a]}}}),t.jsxRuntimeExports.jsx("text",{x:(a+1)*320/d.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:gt.numberFormattingFunction(o,"NA")})]},a)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{L(d[c.length])},onMouseLeave:()=>{L(void 0)},x:c.length*320/d.length+1,y:1,width:320/d.length-2,height:8,className:`cursor-pointer ${M===d[c.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:d[c.length],...M===d[c.length]?{}:{stroke:d[c.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"})})}),P==="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:"–"})]})]}),D&&V!==void 0?t.jsxRuntimeExports.jsx(ht.le,{open:V!==void 0,onClose:()=>{X(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:ft.string2HTML(D,V)}:void 0,children:typeof D=="function"?D(V):null})}):null,Y&&ne&&x&&de?t.jsxRuntimeExports.jsx(yt.Tooltip,{data:Y,body:ne,xPos:x,yPos:de,backgroundStyle:qe?.tooltip,className:Ee?.tooltip}):null]})}function Ot(h){const e=t.compilerRuntimeExports.c(106),{data:c,mapData:d,graphTitle:w,colors:N,sources:W,graphDescription:E,height:g,width:v,footNote:B,colorDomain:ne,colorLegendTitle:F,scaleType:G,scale:se,centerPoint:ie,padding:ve,mapBorderWidth:De,mapNoDataColor:Me,backgroundColor:U,mapBorderColor:ae,relativeHeight:k,tooltip:be,onSeriesMouseOver:D,isWorldMap:qe,showColorScale:Ee,zoomScaleExtend:O,zoomTranslateExtend:P,graphID:$,highlightedIds:I,onSeriesMouseClick:le,mapProperty:ke,graphDownload:M,dataDownload:L,showAntarctica:ce,language:Oe,minHeight:Re,theme:V,ariaLabel:X,resetSelectionOnDoubleClick:Y,detailsOnClick:J,styles:x,classNames:m,mapProjection:de,zoomInteraction:ue,animate:A,dimmedOpacity:pe,customLayers:K,timeline:Pe,collapseColorScaleByDefault:H}=h,R=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,me=B===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":B,z=G===void 0?"threshold":G,we=se===void 0?.95:se,Ce=De===void 0?.5:De,_=Me===void 0?Ue.Colors.light.graphNoData:Me,q=U===void 0?!1:U,he=ae===void 0?Ue.Colors.light.grays["gray-500"]:ae,o=qe===void 0?!0:qe,a=Ee===void 0?!0:Ee;let y;e[0]!==O?(y=O===void 0?[.8,6]:O,e[0]=O,e[1]=y):y=e[1];const n=y;let r;e[2]!==I?(r=I===void 0?[]:I,e[2]=I,e[3]=r):r=e[3];const i=r,l=ke===void 0?"ISO3":ke,s=M===void 0?!1:M,u=L===void 0?!1:L,S=ce===void 0?!1:ce,C=Oe===void 0?"en":Oe,T=Re===void 0?0:Re,Z=V===void 0?"light":V,Xe=Y===void 0?!0:Y,Ye=ue===void 0?"button":ue,Ie=A===void 0?!1:A,Je=pe===void 0?.3:pe;let Le;e[4]!==K?(Le=K===void 0?[]:K,e[4]=K,e[5]=Le):Le=e[5];const Ke=Le,b=Pe===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Pe,[Q,ct]=p.useState(0),[$e,dt]=p.useState(0),[ee,Ze]=p.useState(b.autoplay),f=Dt.sort(Nt.uniqBy(c,"date",!0).map(j=>it.parse(`${j}`,b.dateFormat||"yyyy",new Date).getTime()),Bt),[te,Se]=p.useState(b.autoplay?0:f.length-1),[xe,ut]=p.useState(void 0),Qe=p.useRef(null),nt=p.useRef(null);let ze,_e;e[6]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{const j=new ResizeObserver(oe=>{ct(oe[0].target.clientWidth||620),dt(oe[0].target.clientHeight||480)});return Qe.current&&j.observe(Qe.current),()=>j.disconnect()},_e=[],e[6]=ze,e[7]=_e):(ze=e[6],_e=e[7]),p.useEffect(ze,_e);let Te;e[8]===Symbol.for("react.memo_cache_sentinel")?(Te=j=>{ut(j)},e[8]=Te):Te=e[8];const We=p.useEffectEvent(Te);let Be;e[9]!==R||e[10]!==We?(Be=()=>{typeof R=="string"?Ct.fetchAndParseJSON(R).then(oe=>{We(oe)}):We(R)},e[9]=R,e[10]=We,e[11]=Be):Be=e[11];let Fe;e[12]!==R?(Fe=[R],e[12]=R,e[13]=Fe):Fe=e[13],p.useEffect(Be,Fe);let Ve;e[14]!==ne||e[15]!==N?.length||e[16]!==c||e[17]!==z?(Ve=ne||(z==="categorical"?$t.getUniqValue(c,"x"):St.getJenks(c.map(Wt),N?.length||4)),e[14]=ne,e[15]=N?.length,e[16]=c,e[17]=z,e[18]=Ve):Ve=e[18];const Ne=Ve;p.useEffect(()=>{const j=setInterval(()=>{Se(oe=>oe<f.length-1?oe+1:0)},(b.speed||2)*1e3);return ee||clearInterval(j),()=>clearInterval(j)},[f,ee,b.speed]);const Ae=st.getSliderMarks(f,te,b.showOnlyActiveDate,b.dateFormat||"yyyy"),et=m?.graphContainer,tt=x?.graphContainer;let ge;e[19]!==m?.description||e[20]!==m?.title||e[21]!==c||e[22]!==u||e[23]!==E||e[24]!==s||e[25]!==w||e[26]!==x?.description||e[27]!==x?.title||e[28]!==v?(ge=w||E||s||u?t.jsxRuntimeExports.jsx(wt.GraphHeader,{styles:{title:x?.title,description:x?.description},classNames:{title:m?.title,description:m?.description},graphTitle:w,graphDescription:E,width:v,graphDownload:s?nt:void 0,dataDownload:u?c.map(Tt).filter(_t).length>0?c.map(zt).filter(Lt):c.filter(It):null}):null,e[19]=m?.description,e[20]=m?.title,e[21]=c,e[22]=u,e[23]=E,e[24]=s,e[25]=w,e[26]=x?.description,e[27]=x?.title,e[28]=v,e[29]=ge):ge=e[29];let ye;e[30]!==te||e[31]!==Ae||e[32]!==ee||e[33]!==Se||e[34]!==Ze||e[35]!==b.enabled||e[36]!==f?(ye=b.enabled&&f.length>0&&Ae?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ze(!ee)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ee?"Click to pause animation":"Click to play animation",children:ee?t.jsxRuntimeExports.jsx(rt.Pause,{}):t.jsxRuntimeExports.jsx(rt.Play,{})}),t.jsxRuntimeExports.jsx(st.Nr,{min:f[0],max:f[f.length-1],marks:Ae,step:null,defaultValue:f[f.length-1],value:f[te],onChangeComplete:j=>{Se(f.indexOf(j))},onChange:j=>{Se(f.indexOf(j))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[30]=te,e[31]=Ae,e[32]=ee,e[33]=Se,e[34]=Ze,e[35]=b.enabled,e[36]=f,e[37]=ye):ye=e[37];let fe;e[38]!==Ie||e[39]!==ie||e[40]!==m||e[41]!==H||e[42]!==F||e[43]!==N||e[44]!==Ke||e[45]!==c||e[46]!==J||e[47]!==Je||e[48]!==Ne||e[49]!==g||e[50]!==i||e[51]!==te||e[52]!==o||e[53]!==he||e[54]!==Ce||e[55]!==_||e[56]!==de||e[57]!==l||e[58]!==xe||e[59]!==T||e[60]!==le||e[61]!==D||e[62]!==k||e[63]!==Xe||e[64]!==we||e[65]!==z||e[66]!==S||e[67]!==a||e[68]!==x||e[69]!==$e||e[70]!==Q||e[71]!==Z||e[72]!==b.dateFormat||e[73]!==b.enabled||e[74]!==be||e[75]!==f||e[76]!==v||e[77]!==Ye||e[78]!==n||e[79]!==P?(fe=t.jsxRuntimeExports.jsx(lt.GraphArea,{ref:Qe,children:Q&&$e&&xe?t.jsxRuntimeExports.jsx(qt,{data:c.filter(j=>b.enabled?j.date===it.format(new Date(f[te]),b.dateFormat||"yyyy"):j),mapData:S?xe:{...xe,features:xe.features.filter(Pt)},colorDomain:Ne,width:Q,height:$e,scale:we,centerPoint:ie,colors:N||(z==="categorical"?Ue.Colors[Z].sequentialColors[`neutralColorsx0${Ne.length}`]:Ue.Colors[Z].sequentialColors[`neutralColorsx0${Ne.length+1}`]),colorLegendTitle:F,mapBorderWidth:Ce,mapNoDataColor:_,categorical:z==="categorical",mapBorderColor:he,tooltip:be,onSeriesMouseOver:D,isWorldMap:o,showColorScale:a,zoomScaleExtend:n,zoomTranslateExtend:P,onSeriesMouseClick:le,mapProperty:l,highlightedIds:i,resetSelectionOnDoubleClick:Xe,styles:x,classNames:m,detailsOnClick:J,mapProjection:de||(o?"naturalEarth":"mercator"),zoomInteraction:Ye,dimmedOpacity:Je,animate:Ie===!0?{duration:.5,once:!0,amount:.5}:Ie||{duration:0,once:!0,amount:0},customLayers:Ke,collapseColorScaleByDefault:H}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(T,g||(k?T?(v||Q)*k>T?(v||Q)*k:T:(v||Q)*k:$e))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(pt.w,{"aria-label":"Loading graph"})})}),e[38]=Ie,e[39]=ie,e[40]=m,e[41]=H,e[42]=F,e[43]=N,e[44]=Ke,e[45]=c,e[46]=J,e[47]=Je,e[48]=Ne,e[49]=g,e[50]=i,e[51]=te,e[52]=o,e[53]=he,e[54]=Ce,e[55]=_,e[56]=de,e[57]=l,e[58]=xe,e[59]=T,e[60]=le,e[61]=D,e[62]=k,e[63]=Xe,e[64]=we,e[65]=z,e[66]=S,e[67]=a,e[68]=x,e[69]=$e,e[70]=Q,e[71]=Z,e[72]=b.dateFormat,e[73]=b.enabled,e[74]=be,e[75]=f,e[76]=v,e[77]=Ye,e[78]=n,e[79]=P,e[80]=fe):fe=e[80];let je;e[81]!==m?.footnote||e[82]!==m?.source||e[83]!==me||e[84]!==W||e[85]!==x?.footnote||e[86]!==x?.source||e[87]!==v?(je=W||me?t.jsxRuntimeExports.jsx(Rt.GraphFooter,{styles:{footnote:x?.footnote,source:x?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:W,footNote:me,width:v}):null,e[81]=m?.footnote,e[82]=m?.source,e[83]=me,e[84]=W,e[85]=x?.footnote,e[86]=x?.source,e[87]=v,e[88]=je):je=e[88];let He;return e[89]!==X||e[90]!==q||e[91]!==$||e[92]!==g||e[93]!==C||e[94]!==T||e[95]!==ve||e[96]!==k||e[97]!==et||e[98]!==tt||e[99]!==ge||e[100]!==ye||e[101]!==fe||e[102]!==je||e[103]!==Z||e[104]!==v?(He=t.jsxRuntimeExports.jsxs(lt.GraphContainer,{className:et,style:tt,id:$,ref:nt,"aria-label":X,backgroundColor:q,theme:Z,language:C,minHeight:T,width:v,height:g,relativeHeight:k,padding:ve,children:[ge,ye,fe,je]}),e[89]=X,e[90]=q,e[91]=$,e[92]=g,e[93]=C,e[94]=T,e[95]=ve,e[96]=k,e[97]=et,e[98]=tt,e[99]=ge,e[100]=ye,e[101]=fe,e[102]=je,e[103]=Z,e[104]=v,e[105]=He):He=e[105],He}function Pt(h){return h.properties.NAME!=="Antarctica"}function It(h){return h!==void 0}function Lt(h){return h!==void 0}function zt(h){return h.data}function _t(h){return h!==void 0}function Tt(h){return h.data}function Wt(h){return h.x}function Bt(h,e){return Mt.ascending(h,e)}exports.ChoroplethMap=Ot;
|
|
2
2
|
//# sourceMappingURL=ChoroplethMap.cjs.map
|