@undp/data-viz 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +129 -120
- package/dist/BarGraph.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +49 -46
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.d.ts +11 -0
- package/dist/BulletChart.js +747 -700
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +7 -4
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +52 -49
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +37 -34
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +41 -38
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GraphEl-YKUlz-37.cjs +2 -0
- package/dist/GraphEl-YKUlz-37.cjs.map +1 -0
- package/dist/{GraphEl-DEzobeOM.js → GraphEl-sVZvlyWe.js} +2 -1
- package/dist/GraphEl-sVZvlyWe.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.js +2 -2
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +62 -59
- package/dist/HybridMap.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +7 -4
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/Types.d.ts +1 -0
- package/dist/ensureCompleteData-DS7gCvVd.js +122 -0
- package/dist/ensureCompleteData-DS7gCvVd.js.map +1 -0
- package/dist/ensureCompleteData-Oib-vGb0.cjs +2 -0
- package/dist/ensureCompleteData-Oib-vGb0.cjs.map +1 -0
- package/dist/getSchema.cjs +1 -1
- package/dist/getSchema.cjs.map +1 -1
- package/dist/getSchema.js +15 -15
- package/dist/getSchema.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -2
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +2 -2
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs +2 -0
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs.map +1 -0
- package/dist/{transformDataForAggregation-DEU__LUl.js → transformDataForAggregation-j34UL73s.js} +14 -10
- package/dist/transformDataForAggregation-j34UL73s.js.map +1 -0
- package/dist/{transformDataForGraphFromFile-CzepNVGZ.cjs → transformDataForGraphFromFile-CuXxR8uA.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-CzepNVGZ.cjs.map → transformDataForGraphFromFile-CuXxR8uA.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-CSG24iF6.js → transformDataForGraphFromFile-DyP-83Nh.js} +2 -2
- package/dist/{transformDataForGraphFromFile-CSG24iF6.js.map → transformDataForGraphFromFile-DyP-83Nh.js.map} +1 -1
- package/package.json +1 -1
- package/dist/GraphEl-B16EYkko.cjs +0 -2
- package/dist/GraphEl-B16EYkko.cjs.map +0 -1
- package/dist/GraphEl-DEzobeOM.js.map +0 -1
- package/dist/ensureCompleteData-DNKEGRiP.js +0 -102
- package/dist/ensureCompleteData-DNKEGRiP.js.map +0 -1
- package/dist/ensureCompleteData-I6nYmT8E.cjs +0 -2
- package/dist/ensureCompleteData-I6nYmT8E.cjs.map +0 -1
- package/dist/transformDataForAggregation-DEU__LUl.js.map +0 -1
- package/dist/transformDataForAggregation-XNg0OGYE.cjs +0 -2
- package/dist/transformDataForAggregation-XNg0OGYE.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DotDensityMap.js","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, 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 { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // 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 handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.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) 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 </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\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 y={0}\r\n className='fill-primary-gray-600 dark:fill-primary-gray-300 text-sm'\r\n style={{ textAnchor: 'start' }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** 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 /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(data.map(d => parse(`${d}`, timeline.dateFormat || 'yyyy', new Date()).getTime())),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","el","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","color","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","textAnchor","cn","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","timeline","t24","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","parse","Date","getTime","Set","sort","_temp","uniqDatesSorted","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_0","t33","t34","t35","speed","interval","setInterval","clearInterval","t36","t37","getSliderMarks","markObj","t38","graphContainer","t39","t40","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t41","Pause","Play","SliderUI","nextValue","nextValue_0","t42","GraphArea","d_6","date","format","_temp7","_temp8","uniqBy","_temp9","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp0","_temp1","Spinner","t43","footnote","source","GraphFooter","t44","GraphContainer","d_8","d_7","el_1","el_0","properties","NAME","d_3","d_2","d_1","d_5","d_4","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyEO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,QAAAA;AAAAA,IAC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/B,SAAAqR,GAAAyC,GAAA;AAAA,SAgJ2CtQ,MAAMrB;AAAS;AAhJ1D,SAAAiP,GAAA2C,GAAA;AAAA,SAgJuBvQ,EAACxD;AAAK;AAhJ7B,SAAAuO,GAAAyF,GAAAC,GAAA;AAAA,SA4DkBD,IAAIC;AAAC;"}
|
|
1
|
+
{"version":3,"file":"DotDensityMap.js","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, 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 { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // 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 handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.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) 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 </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\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 y={0}\r\n className='fill-primary-gray-600 dark:fill-primary-gray-300 text-sm'\r\n style={{ textAnchor: 'start' }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** 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 /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","el","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","color","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","textAnchor","cn","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","timeline","t24","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_1","t33","t34","t35","speed","interval","setInterval","clearInterval","t36","t37","getSliderMarks","markObj","t38","graphContainer","t39","t40","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t41","Pause","Play","SliderUI","nextValue","nextValue_0","t42","GraphArea","d_7","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t43","footnote","source","GraphFooter","t44","GraphContainer","d_9","d_8","el_1","el_0","properties","NAME","d_4","d_3","d_2","d_6","d_5","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyEO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACA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2CxQ,MAAMrB;AAAS;AApJ1D,SAAAoP,GAAA0C,GAAA;AAAA,SAoJuBzQ,EAACxD;AAAK;AApJ7B,SAAA0O,GAAAwF,GAAAC,GAAA;AAAA,SAgEkBD,IAAIC;AAAC;AAhEvB,SAAA3F,GAAAhL,GAAA;AAAA,SA4DgBA,EAAC4K;AAAK;"}
|
package/dist/DumbbellChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),Ee=require("./index-Cno4Q0YE.cjs"),je=require("./parse-hMnG_lRV.cjs"),T=require("react"),Oe=require("./getSliderMarks-BmADcPQt.cjs"),Me=require("./index-DQA8q5sC.cjs"),ke=require("./numberFormattingFunction-02t-wJta.cjs"),Ie=require("./Tooltip-uUdw6wJL.cjs"),qt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Le=require("./AxisTitle-sS5bLLR7.cjs"),Fe=require("./Axis-DxRV2yMi.cjs"),Pe=require("./XAxesLabels-Bt5NZBmX.cjs"),$e=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Ne=require("./ReferenceLine-BH0qdf4R.cjs"),We=require("./XTicksAndGridLines-B6CELS7q.cjs"),Ge=require("./YAxesLabels-DesLesUP.cjs"),Ve=require("./DetailsModal-BN0HDFlV.cjs"),De=require("./linear-BwPAspcq.cjs"),Se=require("./band-VYfcZeJ2.cjs"),Te=require("./use-in-view-QcfiW0w3.cjs"),Tt=require("./proxy-BxvUI_9l.cjs"),qe=require("./index-DG2bgAva.cjs"),Ae=require("./ensureCompleteData-I6nYmT8E.cjs"),Re=require("./GraphContainer-d8A46BK2.cjs"),Be=require("./GraphHeader.cjs"),Ce=require("./index-DRXx7m-C.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./ColorLegendWithMouseOver.cjs"),He=require("./EmptyState-sAEZ_5rU.cjs"),Ue=require("./Colors.cjs");function ze(e){const t=i.compilerRuntimeExports.c(146),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,barPadding:Ft,showTicks:Mt,truncateBy:It,width:wt,height:jt,radius:ht,showLabels:At,tooltip:g,onSeriesMouseOver:at,maxValue:Lt,minValue:E,onSeriesMouseClick:ct,showValues:Zt,suffix:ft,prefix:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,animate:p,precision:m,customLayers:X,highlightedDataPoints:W,dimmedOpacity:ut}=e,b=Jt===void 0?20:Jt,Gt=se===void 0?20:se,Bt=Kt===void 0?20:Kt,Dt=Qt===void 0?25:Qt,te=T.useRef(null);let Yt;t[0]!==p.amount||t[1]!==p.once?(Yt={once:p.once,amount:p.amount},t[0]=p.amount,t[1]=p.once,t[2]=Yt):Yt=t[2];const H=Te.useInView(te,Yt),U=P?b+30:b;let Xt;t[3]!==Dt||t[4]!==Gt||t[5]!==U||t[6]!==Bt?(Xt={top:Bt,bottom:Dt,left:U,right:Gt},t[3]=Dt,t[4]=Gt,t[5]=U,t[6]=Bt,t[7]=Xt):Xt=t[7];const l=Xt,o=wt-l.left-l.right,rt=jt-l.top-l.bottom,[lt,Ht]=T.useState(void 0),[yt,gt]=T.useState(void 0),[Ut,Et]=T.useState(void 0),[Ot,zt]=T.useState(void 0);let Rt;if(t[8]!==d||t[9]!==y){const f=new Set,h=d.map((v,w)=>{const a=y?`${v.label}`:`${w}`;return f.add(a),{...v,id:a}}),M=y?y.filter(v=>!f.has(v)):[];let mt;t[11]!==d[0]?(mt=v=>({id:v,label:v,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=mt):mt=t[12],Rt=[...h,...M.map(mt)],t[8]=d,t[9]=y,t[10]=Rt}else Rt=t[10];const G=Rt;let $;t[13]!==G||t[14]!==y?($=y??G.map(oi),t[13]=G,t[14]=y,t[15]=$):$=t[15];const St=$;let bt,z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V;if(t[16]!==p||t[17]!==L||t[18]!==P||t[19]!==St||t[20]!==Ft||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.axis||t[24]!==n?.xAxis?.labels||t[25]!==n?.yAxis?.gridLines||t[26]!==n?.yAxis?.labels||t[27]!==n?.yAxis?.title||t[28]!==Pt||t[29]!==X||t[30]!==G||t[31]!==O||t[32]!==ut||t[33]!==k||t[34]!==rt||t[35]!==o||t[36]!==jt||t[37]!==W||t[38]!==H||t[39]!==b||t[40]!==l.bottom||t[41]!==l.left||t[42]!==l.right||t[43]!==l.top||t[44]!==kt||t[45]!==Lt||t[46]!==$t||t[47]!==E||t[48]!==yt||t[49]!==Wt||t[50]!==ct||t[51]!==at||t[52]!==m||t[53]!==q||t[54]!==ht||t[55]!==Vt||t[56]!==_t||t[57]!==F||t[58]!==At||t[59]!==Mt||t[60]!==Zt||t[61]!==s?.dataConnectors||t[62]!==s?.graphObjectValues||t[63]!==s?.xAxis?.axis||t[64]!==s?.xAxis?.labels||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==s?.yAxis?.title||t[68]!==ft||t[69]!==It||t[70]!==Nt||t[71]!==wt){const f=De.linear().domain([E,Lt]).range([rt,0]).nice(),h=Se.band().domain(St).range([0,$t?Math.max(o,$t*G.length):kt?Math.min(o,kt*G.length):o]).paddingInner(Ft),M=f.ticks(Wt);z=Tt.motion.svg,C=`${wt}px`,_=`${jt}px`,tt=`0 0 ${wt} ${jt}`,et="ltr",A=te,t[87]!==L?(N=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=N):N=t[88],K=`translate(${l.left},${l.top})`;const mt=f(E<0?0:E),v=f(E<0?0:E),w=E<0?0:E;let a;t[89]!==m||t[90]!==q||t[91]!==ft||t[92]!==w?(a=ke.numberFormattingFunction(w,"NA",m,q,ft),t[89]=m,t[90]=q,t[91]=ft,t[92]=w,t[93]=a):a=t[93];const pt=n?.xAxis?.axis,ie=n?.yAxis?.labels;let vt;t[94]!==pt||t[95]!==ie?(vt={axis:pt,label:ie},t[94]=pt,t[95]=ie,t[96]=vt):vt=t[96];const ne=s?.xAxis?.axis,Y=s?.yAxis?.labels;let c;t[97]!==ne||t[98]!==Y?(c={axis:ne,label:Y},t[97]=ne,t[98]=Y,t[99]=c):c=t[99],Q=i.jsxRuntimeExports.jsx(Fe.Axis,{y1:mt,y2:v,x1:0-b,x2:o+l.right,label:a,labelPos:{x:0-b,dx:0,dy:Lt<0?"1em":-5,y:f(E<0?0:E)},classNames:vt,styles:c}),Z=Mt?i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:M.filter(si),y:M.filter(ni).map(x=>f(x)),x1:0-b,x2:o+l.right,styles:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},classNames:{gridLines:n?.yAxis?.gridLines,labels:n?.yAxis?.labels},suffix:ft,prefix:q,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:m}):null;const S=0-b-15,r=rt/2,I=s?.yAxis?.title,ae=n?.yAxis?.title;t[100]!==P||t[101]!==S||t[102]!==r||t[103]!==I||t[104]!==ae?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:S,y:r,style:I,className:ae,text:P,rotate90:!0}),t[100]=P,t[101]=S,t[102]=r,t[103]=I,t[104]=ae,t[105]=j):j=t[105],t[106]!==X?(R=X.filter(ii).map(ei),t[106]=X,t[107]=R):R=t[107],bt=qe.AnimatePresence,V=G.map(x=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85},whileInView:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",exit:{opacity:0,transition:{duration:p.duration}},children:[At?i.jsxRuntimeExports.jsx(Pe.XAxesLabels,{value:`${x.label}`.length<It?`${x.label}`:`${`${x.label}`.substring(0,It)}...`,y:rt+5,x:0-h.bandwidth()/2,width:h.bandwidth(),height:l.bottom,style:s?.xAxis?.labels,className:n?.xAxis?.labels,alignment:"top",animate:p,isInView:H}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{x1:0,x2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&x.x.indexOf(Math.min(...x.x.filter(ti)))===0?"url(#arrow)":"",markerStart:L&&x.x.indexOf(Math.min(...x.x.filter(_e)))===x.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:f(Math.min(...x.x.filter(Ze)))+ht,y2:f(Math.max(...x.x.filter(Qe)))-ht,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),x.x.map((ee,ot)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX),at?.({...x,xIndex:ot})},onClick:()=>{(ct||O)&&(Me.isEqual(yt,{...x,xIndex:ot})&&_t?(gt(void 0),ct?.(void 0)):(gt({...x,xIndex:ot}),ct&&ct({...x,xIndex:ot})))},onMouseMove:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX)},onMouseLeave:()=>{Ht(void 0),Et(void 0),zt(void 0),at?.(void 0)},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{opacity:F?k[ot]===F?1:.3:1},whileInView:{opacity:F?k[ot]===F?1:.3:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:qt.checkIfNullOrUndefined(ee)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cx:0,r:ht,style:{fill:k[ot],fillOpacity:.85,stroke:k[ot],strokeWidth:1},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{cy:f(0),opacity:0},whileInView:{cy:f(ee||0),opacity:qt.checkIfNullOrUndefined(ee)?0:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),Zt?i.jsxRuntimeExports.jsx(Tt.motion.text,{x:0,style:{textAnchor:"start",...s?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(ee)?"opacity-0":"opacity-100",n?.graphObjectValues),dx:ht+3,dy:"0.33em",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y:f(0),opacity:0,fill:Nt||k[ot]},whileInView:{y:f(ee||0),fill:Nt||k[ot],opacity:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:ke.numberFormattingFunction(ee,"NA",m,q,ft)}):null]})},ot))]},x.label)),J=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((x,ee)=>i.jsxRuntimeExports.jsx(Ne.RefLineY,{text:x.text,color:x.color,y:f(x.value),x1:0-b,x2:o+l.right,classNames:x.classNames,styles:x.styles,animate:p,isInView:H},ee))}):null,t[16]=p,t[17]=L,t[18]=P,t[19]=St,t[20]=Ft,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.axis,t[24]=n?.xAxis?.labels,t[25]=n?.yAxis?.gridLines,t[26]=n?.yAxis?.labels,t[27]=n?.yAxis?.title,t[28]=Pt,t[29]=X,t[30]=G,t[31]=O,t[32]=ut,t[33]=k,t[34]=rt,t[35]=o,t[36]=jt,t[37]=W,t[38]=H,t[39]=b,t[40]=l.bottom,t[41]=l.left,t[42]=l.right,t[43]=l.top,t[44]=kt,t[45]=Lt,t[46]=$t,t[47]=E,t[48]=yt,t[49]=Wt,t[50]=ct,t[51]=at,t[52]=m,t[53]=q,t[54]=ht,t[55]=Vt,t[56]=_t,t[57]=F,t[58]=At,t[59]=Mt,t[60]=Zt,t[61]=s?.dataConnectors,t[62]=s?.graphObjectValues,t[63]=s?.xAxis?.axis,t[64]=s?.xAxis?.labels,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=s?.yAxis?.title,t[68]=ft,t[69]=It,t[70]=Nt,t[71]=wt,t[72]=bt,t[73]=z,t[74]=J,t[75]=K,t[76]=Q,t[77]=Z,t[78]=j,t[79]=R,t[80]=C,t[81]=_,t[82]=tt,t[83]=et,t[84]=A,t[85]=N,t[86]=V}else bt=t[72],z=t[73],J=t[74],K=t[75],Q=t[76],Z=t[77],j=t[78],R=t[79],C=t[80],_=t[81],tt=t[82],et=t[83],A=t[84],N=t[85],V=t[86];let it;t[108]!==bt||t[109]!==J||t[110]!==V?(it=i.jsxRuntimeExports.jsxs(bt,{children:[V,J]}),t[108]=bt,t[109]=J,t[110]=V,t[111]=it):it=t[111];let nt;t[112]!==X?(nt=X.filter(Ke).map(Je),t[112]=X,t[113]=nt):nt=t[113];let xt;t[114]!==K||t[115]!==Q||t[116]!==Z||t[117]!==j||t[118]!==R||t[119]!==it||t[120]!==nt?(xt=i.jsxRuntimeExports.jsxs("g",{transform:K,children:[Q,Z,j,R,it,nt]}),t[114]=K,t[115]=Q,t[116]=Z,t[117]=j,t[118]=R,t[119]=it,t[120]=nt,t[121]=xt):xt=t[121];let D;t[122]!==z||t[123]!==C||t[124]!==_||t[125]!==tt||t[126]!==et||t[127]!==A||t[128]!==N||t[129]!==xt?(D=i.jsxRuntimeExports.jsxs(z,{width:C,height:_,viewBox:tt,direction:et,ref:A,children:[N,xt]}),t[122]=z,t[123]=C,t[124]=_,t[125]=tt,t[126]=et,t[127]=A,t[128]=N,t[129]=xt,t[130]=D):D=t[130];let B;t[131]!==n?.tooltip||t[132]!==Ut||t[133]!==Ot||t[134]!==lt||t[135]!==s?.tooltip||t[136]!==g?(B=lt&&g&&Ut&&Ot?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:lt,body:g,xPos:Ut,yPos:Ot,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[131]=n?.tooltip,t[132]=Ut,t[133]=Ot,t[134]=lt,t[135]=s?.tooltip,t[136]=g,t[137]=B):B=t[137];let st;t[138]!==n?.modal||t[139]!==O||t[140]!==yt?(st=O&&yt!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:yt,setData:gt,className:n?.modal}):null,t[138]=n?.modal,t[139]=O,t[140]=yt,t[141]=st):st=t[141];let dt;return t[142]!==D||t[143]!==B||t[144]!==st?(dt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[D,B,st]}),t[142]=D,t[143]=B,t[144]=st,t[145]=dt):dt=t[145],dt}function Je(e){return e.layer}function Ke(e){return e.position==="after"}function Qe(e){return e!==null}function Ze(e){return e!==null}function _e(e){return e!==null}function ti(e){return e!==null}function ei(e){return e.layer}function ii(e){return e.position==="before"}function ni(e){return e!==0}function si(e){return e!==0}function oi(e){return`${e.id}`}function ai(e){const t=i.compilerRuntimeExports.c(139),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,suffix:Ft,prefix:Mt,barPadding:It,showValues:wt,showTicks:jt,truncateBy:ht,width:At,height:g,radius:at,showLabels:Lt,tooltip:E,onSeriesMouseOver:ct,maxValue:Zt,minValue:ft,onSeriesMouseClick:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,rtl:p,animate:m,precision:X,customLayers:W,highlightedDataPoints:ut,dimmedOpacity:b}=e,Gt=Jt===void 0?100:Jt,Bt=se===void 0?40:se,Dt=Kt===void 0?20:Kt,te=Qt===void 0?10:Qt,Yt=T.useRef(null);let H;t[0]!==m.amount||t[1]!==m.once?(H={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=H):H=t[2];const U=Te.useInView(Yt,H),Xt=P?Dt+25:Dt;let l;t[3]!==te||t[4]!==Gt||t[5]!==Bt||t[6]!==Xt?(l={top:Xt,bottom:te,left:Gt,right:Bt},t[3]=te,t[4]=Gt,t[5]=Bt,t[6]=Xt,t[7]=l):l=t[7];const o=l,rt=At-o.left-o.right,lt=g-o.top-o.bottom,[Ht,yt]=T.useState(void 0),[gt,Ut]=T.useState(void 0),[Et,Ot]=T.useState(void 0),[zt,Rt]=T.useState(void 0);let G;if(t[8]!==d||t[9]!==y){const h=new Set,M=d.map((w,a)=>{const pt=y?`${w.label}`:`${a}`;return h.add(pt),{...w,id:pt}}),mt=y?y.filter(w=>!h.has(w)):[];let v;t[11]!==d[0]?(v=w=>({id:w,label:w,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=v):v=t[12],G=[...M,...mt.map(v)],t[8]=d,t[9]=y,t[10]=G}else G=t[10];const $=G;let St;t[13]!==$||t[14]!==y?(St=y??$.map(yi),t[13]=$,t[14]=y,t[15]=St):St=t[15];const bt=St;let z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V,it;if(t[16]!==m||t[17]!==L||t[18]!==P||t[19]!==bt||t[20]!==It||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.gridLines||t[24]!==n?.xAxis?.labels||t[25]!==n?.xAxis?.title||t[26]!==n?.yAxis?.gridLines||t[27]!==n?.yAxis?.labels||t[28]!==Pt||t[29]!==W||t[30]!==$||t[31]!==O||t[32]!==b||t[33]!==k||t[34]!==lt||t[35]!==rt||t[36]!==g||t[37]!==ut||t[38]!==U||t[39]!==o.bottom||t[40]!==o.left||t[41]!==o.top||t[42]!==kt||t[43]!==Zt||t[44]!==$t||t[45]!==ft||t[46]!==gt||t[47]!==Wt||t[48]!==q||t[49]!==ct||t[50]!==X||t[51]!==Mt||t[52]!==at||t[53]!==Vt||t[54]!==_t||t[55]!==p||t[56]!==F||t[57]!==Lt||t[58]!==jt||t[59]!==wt||t[60]!==s?.dataConnectors||t[61]!==s?.graphObjectValues||t[62]!==s?.xAxis?.gridLines||t[63]!==s?.xAxis?.labels||t[64]!==s?.xAxis?.title||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==Ft||t[68]!==Dt||t[69]!==ht||t[70]!==Nt||t[71]!==At){const h=De.linear().domain([ft,Zt]).range([0,rt]).nice(),M=Se.band().domain(bt).range([0,$t?Math.max(lt,$t*$.length):kt?Math.min(lt,kt*$.length):lt]).paddingInner(It),mt=h.ticks(Wt);J=Tt.motion.svg,_=`${At}px`,tt=`${g}px`,et=`0 0 ${At} ${g}`,A="ltr",N=Yt,t[87]!==L?(V=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=V):V=t[88],Q=`translate(${o.left},${o.top})`,Z=jt?i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:mt.filter(fi),x:mt.filter(hi).map(c=>h(c)),y1:0-Dt,y2:lt+o.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:Ft,prefix:Mt,labelType:"secondary",showGridLines:!0,precision:X}):null;const v=rt/2,w=0-o.top+15,a=s?.xAxis?.title,pt=n?.xAxis?.title;t[89]!==P||t[90]!==v||t[91]!==w||t[92]!==a||t[93]!==pt?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:v,y:w,style:a,className:pt,text:P}),t[89]=P,t[90]=v,t[91]=w,t[92]=a,t[93]=pt,t[94]=j):j=t[94];const ie=s?.yAxis?.gridLines;let vt;t[95]!==ie?(vt={gridLines:ie},t[95]=ie,t[96]=vt):vt=t[96];const ne=n?.yAxis?.gridLines;let Y;t[97]!==ne?(Y={gridLines:ne},t[97]=ne,t[98]=Y):Y=t[98],R=i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{y:$.map(c=>M(`${c.id}`)+M.bandwidth()/2),x1:0,x2:rt,styles:vt,classNames:Y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}),t[99]!==W?(C=W.filter(pi).map(mi),t[99]=W,t[100]=C):C=t[100],z=qe.AnimatePresence,it=$.map(c=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85},whileInView:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:[Lt?i.jsxRuntimeExports.jsx(Ge.YAxesLabels,{value:`${c.label}`.length<ht?`${c.label}`:`${`${c.label}`.substring(0,ht)}...`,y:0-M.bandwidth()/2,x:0-o.left,width:o.left,height:M.bandwidth(),alignment:"right",style:s?.yAxis?.labels,className:n?.yAxis?.labels,animate:m,isInView:U}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{y1:0,y2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&c.x.indexOf(Math.min(...c.x.filter(di)))===0?"url(#arrow)":"",markerStart:L&&c.x.indexOf(Math.min(...c.x.filter(xi)))===c.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:h(Math.min(...c.x.filter(ui)))+at,x2:h(Math.max(...c.x.filter(ci)))-at,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),c.x.map((S,r)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX),ct?.({...c,xIndex:r})},onClick:()=>{(q||O)&&(Me.isEqual(gt,{...c,xIndex:r})&&_t?(Ut(void 0),q?.(void 0)):(Ut({...c,xIndex:r}),q&&q({...c,xIndex:r})))},onMouseMove:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX)},onMouseLeave:()=>{yt(void 0),Ot(void 0),Rt(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:F?k[r]===F?1:.3:1},whileInView:{opacity:F?k[r]===F?1:.3:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:qt.checkIfNullOrUndefined(S)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cy:0,r:at,style:{fill:k[r],fillOpacity:.85,stroke:k[r],strokeWidth:1,opacity:qt.checkIfNullOrUndefined(S)?0:1},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{cx:h(0),opacity:0},whileInView:{cx:h(S||0),opacity:qt.checkIfNullOrUndefined(S)?0:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),wt?i.jsxRuntimeExports.jsx(Tt.motion.text,{y:0,style:{textAnchor:"middle",...s?.graphObjectValues||{}},dx:0,dy:0-at-3,className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(S)?"0opacity-0":"opacity-100",n?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:h(0),opacity:0,fill:Nt||k[r]},whileInView:{x:h(S||0),fill:Nt||k[r],opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:ke.numberFormattingFunction(S,"NA",X,Mt,Ft)}):null]})},r))]},c.label)),K=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((c,S)=>i.jsxRuntimeExports.jsx(Ne.RefLineX,{text:c.text,color:c.color,x:h(c.value),y1:0-o.top,y2:lt+o.bottom,textSide:h(c.value)>rt*.75||p?"left":"right",classNames:c.classNames,styles:c.styles,animate:m,isInView:U},S))}):null,t[16]=m,t[17]=L,t[18]=P,t[19]=bt,t[20]=It,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.gridLines,t[24]=n?.xAxis?.labels,t[25]=n?.xAxis?.title,t[26]=n?.yAxis?.gridLines,t[27]=n?.yAxis?.labels,t[28]=Pt,t[29]=W,t[30]=$,t[31]=O,t[32]=b,t[33]=k,t[34]=lt,t[35]=rt,t[36]=g,t[37]=ut,t[38]=U,t[39]=o.bottom,t[40]=o.left,t[41]=o.top,t[42]=kt,t[43]=Zt,t[44]=$t,t[45]=ft,t[46]=gt,t[47]=Wt,t[48]=q,t[49]=ct,t[50]=X,t[51]=Mt,t[52]=at,t[53]=Vt,t[54]=_t,t[55]=p,t[56]=F,t[57]=Lt,t[58]=jt,t[59]=wt,t[60]=s?.dataConnectors,t[61]=s?.graphObjectValues,t[62]=s?.xAxis?.gridLines,t[63]=s?.xAxis?.labels,t[64]=s?.xAxis?.title,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=Ft,t[68]=Dt,t[69]=ht,t[70]=Nt,t[71]=At,t[72]=z,t[73]=J,t[74]=K,t[75]=Q,t[76]=Z,t[77]=j,t[78]=R,t[79]=C,t[80]=_,t[81]=tt,t[82]=et,t[83]=A,t[84]=N,t[85]=V,t[86]=it}else z=t[72],J=t[73],K=t[74],Q=t[75],Z=t[76],j=t[77],R=t[78],C=t[79],_=t[80],tt=t[81],et=t[82],A=t[83],N=t[84],V=t[85],it=t[86];let nt;t[101]!==z||t[102]!==K||t[103]!==it?(nt=i.jsxRuntimeExports.jsxs(z,{children:[it,K]}),t[101]=z,t[102]=K,t[103]=it,t[104]=nt):nt=t[104];let xt;t[105]!==W?(xt=W.filter(li).map(ri),t[105]=W,t[106]=xt):xt=t[106];let D;t[107]!==Q||t[108]!==Z||t[109]!==j||t[110]!==R||t[111]!==C||t[112]!==nt||t[113]!==xt?(D=i.jsxRuntimeExports.jsxs("g",{transform:Q,children:[Z,j,R,C,nt,xt]}),t[107]=Q,t[108]=Z,t[109]=j,t[110]=R,t[111]=C,t[112]=nt,t[113]=xt,t[114]=D):D=t[114];let B;t[115]!==J||t[116]!==_||t[117]!==tt||t[118]!==et||t[119]!==A||t[120]!==N||t[121]!==V||t[122]!==D?(B=i.jsxRuntimeExports.jsxs(J,{width:_,height:tt,viewBox:et,direction:A,ref:N,children:[V,D]}),t[115]=J,t[116]=_,t[117]=tt,t[118]=et,t[119]=A,t[120]=N,t[121]=V,t[122]=D,t[123]=B):B=t[123];let st;t[124]!==n?.tooltip||t[125]!==Et||t[126]!==zt||t[127]!==Ht||t[128]!==s?.tooltip||t[129]!==E?(st=Ht&&E&&Et&&zt?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:Ht,body:E,xPos:Et,yPos:zt,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[124]=n?.tooltip,t[125]=Et,t[126]=zt,t[127]=Ht,t[128]=s?.tooltip,t[129]=E,t[130]=st):st=t[130];let dt;t[131]!==n?.modal||t[132]!==O||t[133]!==gt?(dt=O&>!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:gt,setData:Ut,className:n?.modal}):null,t[131]=n?.modal,t[132]=O,t[133]=gt,t[134]=dt):dt=t[134];let f;return t[135]!==B||t[136]!==st||t[137]!==dt?(f=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[B,st,dt]}),t[135]=B,t[136]=st,t[137]=dt,t[138]=f):f=t[138],f}function ri(e){return e.layer}function li(e){return e.position==="after"}function ci(e){return e!==null}function ui(e){return e!==null}function xi(e){return e!==null}function di(e){return e!==null}function mi(e){return e.layer}function pi(e){return e.position==="before"}function hi(e,t){return t!==0}function fi(e,t){return t!==0}function yi(e){return`${e.id}`}function gi(e){const t=i.compilerRuntimeExports.c(120),{data:d,graphTitle:Jt,colors:se,sources:Kt,graphDescription:Qt,barPadding:k,showTicks:Ft,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:ht,height:At,width:g,footNote:at,colorDomain:Lt,colorLegendTitle:E,padding:ct,backgroundColor:Zt,radius:ft,tooltip:q,showLabels:F,relativeHeight:L,onSeriesMouseOver:Pt,graphID:kt,suffix:$t,prefix:_t,maxValue:O,minValue:P,onSeriesMouseClick:Wt,graphDownload:Nt,dataDownload:s,showValues:n,sortParameter:y,arrowConnector:Vt,connectorStrokeWidth:p,language:m,minHeight:X,theme:W,maxBarThickness:ut,maxNumberOfBars:b,minBarThickness:Gt,ariaLabel:Bt,resetSelectionOnDoubleClick:Dt,detailsOnClick:te,axisTitle:Yt,noOfTicks:H,valueColor:U,orientation:Xt,styles:l,classNames:o,labelOrder:rt,refValues:lt,filterNA:Ht,animate:yt,precision:gt,showColorScale:Ut,customLayers:Et,highlightedDataPoints:Ot,dimmedOpacity:zt,timeline:Rt,sortData:G}=e,$=se===void 0?Ue.Colors.light.categoricalColors.colors:se,St=k===void 0?.25:k,bt=Ft===void 0?!0:Ft,z=ht===void 0?999:ht,J=Zt===void 0?!0:Zt,K=ft===void 0?3:ft,Q=F===void 0?!0:F,Z=$t===void 0?"":$t,j=_t===void 0?"":_t,R=Nt===void 0?!1:Nt,C=s===void 0?!1:s,_=n===void 0?!0:n,tt=Vt===void 0?!1:Vt,et=p===void 0?2:p,A=m===void 0?"en":m,N=X===void 0?0:X,V=W===void 0?"light":W,it=Dt===void 0?!0:Dt,nt=H===void 0?5:H,xt=Xt===void 0?"vertical":Xt,D=Ht===void 0?!0:Ht,B=yt===void 0?!1:yt,st=gt===void 0?2:gt,dt=Ut===void 0?!0:Ut;let f;t[0]!==Et?(f=Et===void 0?[]:Et,t[0]=Et,t[1]=f):f=t[1];const h=f;let M;t[2]!==Ot?(M=Ot===void 0?[]:Ot,t[2]=Ot,t[3]=M):M=t[3];const mt=M,v=zt===void 0?.3:zt;let w;t[4]!==Rt?(w=Rt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Rt,t[4]=Rt,t[5]=w):w=t[5];const a=w,[pt,ie]=T.useState(0),[vt,ne]=T.useState(0),[Y,c]=T.useState(a.autoplay);let S;if(t[6]!==d||t[7]!==a.dateFormat){let u;t[9]!==a.dateFormat?(u=Ct=>je.parse(`${Ct}`,a.dateFormat||"yyyy",new Date).getTime(),t[9]=a.dateFormat,t[10]=u):u=t[10],S=[...new Set(d.map(u))],S.sort(Si),t[6]=d,t[7]=a.dateFormat,t[8]=S}else S=t[8];const r=S,[I,ae]=T.useState(a.autoplay?0:r.length-1),[x,ee]=T.useState(void 0),ot=T.useRef(null),oe=T.useRef(null);let xe,de;t[11]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{const u=new ResizeObserver(Ct=>{ie(Ct[0].target.clientWidth||620),ne(Ct[0].target.clientHeight||480)});return ot.current&&u.observe(ot.current),()=>u.disconnect()},de=[],t[11]=xe,t[12]=de):(xe=t[11],de=t[12]),T.useEffect(xe,de);let me,pe;t[13]!==Y||t[14]!==a.speed||t[15]!==r?(me=()=>{const u=setInterval(()=>{ae(Ct=>Ct<r.length-1?Ct+1:0)},(a.speed||2)*1e3);return Y||clearInterval(u),()=>clearInterval(u)},pe=[r,Y,a.speed],t[13]=Y,t[14]=a.speed,t[15]=r,t[16]=me,t[17]=pe):(me=t[16],pe=t[17]),T.useEffect(me,pe);const ge=a.dateFormat||"yyyy";let he;t[18]!==I||t[19]!==ge||t[20]!==a.showOnlyActiveDate||t[21]!==r?(he=Oe.getSliderMarks(r,I,a.showOnlyActiveDate,ge),t[18]=I,t[19]=ge,t[20]=a.showOnlyActiveDate,t[21]=r,t[22]=he):he=t[22];const fe=he,be=xt==="horizontal"?ai:ze,ve=o?.graphContainer,we=l?.graphContainer;let re;t[23]!==o?.description||t[24]!==o?.title||t[25]!==d||t[26]!==C||t[27]!==Qt||t[28]!==R||t[29]!==Jt||t[30]!==l?.description||t[31]!==l?.title||t[32]!==g?(re=Jt||Qt||R||C?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Jt,graphDescription:Qt,width:g,graphDownload:R?oe:void 0,dataDownload:C?d.map(Di).filter(Vi).length>0?d.map(Ni).filter($i):d.filter(Li):null}):null,t[23]=o?.description,t[24]=o?.title,t[25]=d,t[26]=C,t[27]=Qt,t[28]=R,t[29]=Jt,t[30]=l?.description,t[31]=l?.title,t[32]=g,t[33]=re):re=t[33];let le;t[34]!==I||t[35]!==fe||t[36]!==Y||t[37]!==a.enabled||t[38]!==r?(le=a.enabled&&r.length>0&&fe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{c(!Y)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Y?"Click to pause animation":"Click to play animation",children:Y?i.jsxRuntimeExports.jsx(Ce.Pause,{}):i.jsxRuntimeExports.jsx(Ce.Play,{})}),i.jsxRuntimeExports.jsx(Oe.Nr,{min:r[0],max:r[r.length-1],marks:fe,step:null,defaultValue:r[r.length-1],value:r[I],onChangeComplete:u=>{ae(r.indexOf(u))},onChange:u=>{ae(r.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[34]=I,t[35]=fe,t[36]=Y,t[37]=a.enabled,t[38]=r,t[39]=le):le=t[39];let ce;t[40]!==be||t[41]!==B||t[42]!==tt||t[43]!==Yt||t[44]!==St||t[45]!==jt||t[46]!==o||t[47]!==Lt||t[48]!==E||t[49]!==$||t[50]!==et||t[51]!==h||t[52]!==d||t[53]!==te||t[54]!==v||t[55]!==D||t[56]!==mt||t[57]!==I||t[58]!==rt||t[59]!==A||t[60]!==Mt||t[61]!==ut||t[62]!==b||t[63]!==O||t[64]!==Gt||t[65]!==P||t[66]!==nt||t[67]!==Wt||t[68]!==Pt||t[69]!==st||t[70]!==j||t[71]!==K||t[72]!==lt||t[73]!==it||t[74]!==It||t[75]!==x||t[76]!==dt||t[77]!==Q||t[78]!==bt||t[79]!==_||t[80]!==G||t[81]!==y||t[82]!==l||t[83]!==Z||t[84]!==vt||t[85]!==pt||t[86]!==a.dateFormat||t[87]!==a.enabled||t[88]!==q||t[89]!==wt||t[90]!==z||t[91]!==r||t[92]!==U||t[93]!==g?(ce=d.length===0?i.jsxRuntimeExports.jsx(He.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[dt?i.jsxRuntimeExports.jsx(Xe.ColorLegendWithMouseOver,{width:g,colorDomain:Lt,colors:$,colorLegendTitle:E,setSelectedColor:ee,showNAColor:!1,className:o?.colorLegend}):null,i.jsxRuntimeExports.jsx(Re.GraphArea,{ref:ot,children:pt&&vt?i.jsxRuntimeExports.jsx(be,{data:y!==void 0?y==="diff"?Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ii):u),Mi,[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ci):u),u=>qt.checkIfNullOrUndefined(u.x[y])?-1/0:u.x[y],[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>D?!u.x.every(Ri):u).filter((u,Ct)=>b?Ct<b:!0),dotColors:$,width:pt,height:vt,radius:K,barPadding:St,showTicks:bt,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:z,showLabels:Q,showValues:_,tooltip:q,suffix:Z,prefix:j,onSeriesMouseOver:Pt,maxValue:qt.checkIfNullOrUndefined(O)?Math.max(...d.map(Ei))<0?0:Math.max(...d.map(Ai)):O,minValue:qt.checkIfNullOrUndefined(P)?Math.min(...d.map(wi))>0?0:Math.min(...d.map(bi)):P,onSeriesMouseClick:Wt,selectedColor:x,arrowConnector:tt,connectorStrokeWidth:et,maxBarThickness:ut,minBarThickness:Gt,resetSelectionOnDoubleClick:it,detailsOnClick:te,axisTitle:Yt,noOfTicks:nt,valueColor:U,styles:l,classNames:o,labelOrder:rt,refValues:lt,animate:B===!0?{duration:.5,once:!0,amount:.5}:B||{duration:0,once:!0,amount:0},precision:st,customLayers:h,highlightedDataPoints:mt,dimmedOpacity:v,rtl:A==="ar"||A==="he"}):null})]}),t[40]=be,t[41]=B,t[42]=tt,t[43]=Yt,t[44]=St,t[45]=jt,t[46]=o,t[47]=Lt,t[48]=E,t[49]=$,t[50]=et,t[51]=h,t[52]=d,t[53]=te,t[54]=v,t[55]=D,t[56]=mt,t[57]=I,t[58]=rt,t[59]=A,t[60]=Mt,t[61]=ut,t[62]=b,t[63]=O,t[64]=Gt,t[65]=P,t[66]=nt,t[67]=Wt,t[68]=Pt,t[69]=st,t[70]=j,t[71]=K,t[72]=lt,t[73]=it,t[74]=It,t[75]=x,t[76]=dt,t[77]=Q,t[78]=bt,t[79]=_,t[80]=G,t[81]=y,t[82]=l,t[83]=Z,t[84]=vt,t[85]=pt,t[86]=a.dateFormat,t[87]=a.enabled,t[88]=q,t[89]=wt,t[90]=z,t[91]=r,t[92]=U,t[93]=g,t[94]=ce):ce=t[94];let ue;t[95]!==o?.footnote||t[96]!==o?.source||t[97]!==at||t[98]!==Kt||t[99]!==l?.footnote||t[100]!==l?.source||t[101]!==g?(ue=Kt||at?i.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:Kt,footNote:at,width:g}):null,t[95]=o?.footnote,t[96]=o?.source,t[97]=at,t[98]=Kt,t[99]=l?.footnote,t[100]=l?.source,t[101]=g,t[102]=ue):ue=t[102];let ye;return t[103]!==Bt||t[104]!==J||t[105]!==kt||t[106]!==At||t[107]!==A||t[108]!==N||t[109]!==ct||t[110]!==L||t[111]!==ve||t[112]!==we||t[113]!==re||t[114]!==le||t[115]!==ce||t[116]!==ue||t[117]!==V||t[118]!==g?(ye=i.jsxRuntimeExports.jsxs(Re.GraphContainer,{className:ve,style:we,id:kt,ref:oe,"aria-label":Bt,backgroundColor:J,theme:V,language:A,minHeight:N,width:g,height:At,relativeHeight:L,padding:ct,children:[re,le,ce,ue]}),t[103]=Bt,t[104]=J,t[105]=kt,t[106]=At,t[107]=A,t[108]=N,t[109]=ct,t[110]=L,t[111]=ve,t[112]=we,t[113]=re,t[114]=le,t[115]=ce,t[116]=ue,t[117]=V,t[118]=g,t[119]=ye):ye=t[119],ye}function bi(e){return Math.min(...e.x.filter(vi))}function vi(e){return e!==null}function wi(e){return Math.min(...e.x.filter(ji))}function ji(e){return e!==null}function Ai(e){return Math.max(...e.x.filter(ki))}function ki(e){return e!==null}function Ei(e){return Math.max(...e.x.filter(Oi))}function Oi(e){return e!==null}function Ri(e){return e==null}function Ci(e){return e==null}function Mi(e){return qt.checkIfNullOrUndefined(e.x[e.x.length-1])||qt.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0]}function Ii(e){return e==null}function Li(e){return e!==void 0}function $i(e){return e!==void 0}function Ni(e){return e.data}function Vi(e){return e!==void 0}function Di(e){return e.data}function Si(e,t){return e-t}exports.DumbbellChart=gi;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),Ee=require("./index-Cno4Q0YE.cjs"),je=require("./parse-hMnG_lRV.cjs"),T=require("react"),Oe=require("./getSliderMarks-BmADcPQt.cjs"),Me=require("./index-DQA8q5sC.cjs"),ke=require("./numberFormattingFunction-02t-wJta.cjs"),Ie=require("./Tooltip-uUdw6wJL.cjs"),qt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Le=require("./AxisTitle-sS5bLLR7.cjs"),Fe=require("./Axis-DxRV2yMi.cjs"),Pe=require("./XAxesLabels-Bt5NZBmX.cjs"),$e=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Ne=require("./ReferenceLine-BH0qdf4R.cjs"),We=require("./XTicksAndGridLines-B6CELS7q.cjs"),Ge=require("./YAxesLabels-DesLesUP.cjs"),Ve=require("./DetailsModal-BN0HDFlV.cjs"),De=require("./linear-BwPAspcq.cjs"),Se=require("./band-VYfcZeJ2.cjs"),Te=require("./use-in-view-QcfiW0w3.cjs"),Tt=require("./proxy-BxvUI_9l.cjs"),qe=require("./index-DG2bgAva.cjs"),Ae=require("./ensureCompleteData-Oib-vGb0.cjs"),Re=require("./GraphContainer-d8A46BK2.cjs"),Be=require("./GraphHeader.cjs"),Ce=require("./index-DRXx7m-C.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./ColorLegendWithMouseOver.cjs"),He=require("./EmptyState-sAEZ_5rU.cjs"),Ue=require("./Colors.cjs");function ze(e){const t=i.compilerRuntimeExports.c(146),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,barPadding:Ft,showTicks:Mt,truncateBy:It,width:wt,height:jt,radius:ht,showLabels:At,tooltip:g,onSeriesMouseOver:at,maxValue:Lt,minValue:E,onSeriesMouseClick:ct,showValues:Zt,suffix:ft,prefix:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,animate:p,precision:m,customLayers:X,highlightedDataPoints:W,dimmedOpacity:ut}=e,b=Jt===void 0?20:Jt,Gt=se===void 0?20:se,Bt=Kt===void 0?20:Kt,Dt=Qt===void 0?25:Qt,te=T.useRef(null);let Yt;t[0]!==p.amount||t[1]!==p.once?(Yt={once:p.once,amount:p.amount},t[0]=p.amount,t[1]=p.once,t[2]=Yt):Yt=t[2];const H=Te.useInView(te,Yt),U=P?b+30:b;let Xt;t[3]!==Dt||t[4]!==Gt||t[5]!==U||t[6]!==Bt?(Xt={top:Bt,bottom:Dt,left:U,right:Gt},t[3]=Dt,t[4]=Gt,t[5]=U,t[6]=Bt,t[7]=Xt):Xt=t[7];const l=Xt,o=wt-l.left-l.right,rt=jt-l.top-l.bottom,[lt,Ht]=T.useState(void 0),[yt,gt]=T.useState(void 0),[Ut,Et]=T.useState(void 0),[Ot,zt]=T.useState(void 0);let Rt;if(t[8]!==d||t[9]!==y){const f=new Set,h=d.map((v,w)=>{const a=y?`${v.label}`:`${w}`;return f.add(a),{...v,id:a}}),M=y?y.filter(v=>!f.has(v)):[];let mt;t[11]!==d[0]?(mt=v=>({id:v,label:v,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=mt):mt=t[12],Rt=[...h,...M.map(mt)],t[8]=d,t[9]=y,t[10]=Rt}else Rt=t[10];const G=Rt;let $;t[13]!==G||t[14]!==y?($=y??G.map(oi),t[13]=G,t[14]=y,t[15]=$):$=t[15];const St=$;let bt,z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V;if(t[16]!==p||t[17]!==L||t[18]!==P||t[19]!==St||t[20]!==Ft||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.axis||t[24]!==n?.xAxis?.labels||t[25]!==n?.yAxis?.gridLines||t[26]!==n?.yAxis?.labels||t[27]!==n?.yAxis?.title||t[28]!==Pt||t[29]!==X||t[30]!==G||t[31]!==O||t[32]!==ut||t[33]!==k||t[34]!==rt||t[35]!==o||t[36]!==jt||t[37]!==W||t[38]!==H||t[39]!==b||t[40]!==l.bottom||t[41]!==l.left||t[42]!==l.right||t[43]!==l.top||t[44]!==kt||t[45]!==Lt||t[46]!==$t||t[47]!==E||t[48]!==yt||t[49]!==Wt||t[50]!==ct||t[51]!==at||t[52]!==m||t[53]!==q||t[54]!==ht||t[55]!==Vt||t[56]!==_t||t[57]!==F||t[58]!==At||t[59]!==Mt||t[60]!==Zt||t[61]!==s?.dataConnectors||t[62]!==s?.graphObjectValues||t[63]!==s?.xAxis?.axis||t[64]!==s?.xAxis?.labels||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==s?.yAxis?.title||t[68]!==ft||t[69]!==It||t[70]!==Nt||t[71]!==wt){const f=De.linear().domain([E,Lt]).range([rt,0]).nice(),h=Se.band().domain(St).range([0,$t?Math.max(o,$t*G.length):kt?Math.min(o,kt*G.length):o]).paddingInner(Ft),M=f.ticks(Wt);z=Tt.motion.svg,C=`${wt}px`,_=`${jt}px`,tt=`0 0 ${wt} ${jt}`,et="ltr",A=te,t[87]!==L?(N=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=N):N=t[88],K=`translate(${l.left},${l.top})`;const mt=f(E<0?0:E),v=f(E<0?0:E),w=E<0?0:E;let a;t[89]!==m||t[90]!==q||t[91]!==ft||t[92]!==w?(a=ke.numberFormattingFunction(w,"NA",m,q,ft),t[89]=m,t[90]=q,t[91]=ft,t[92]=w,t[93]=a):a=t[93];const pt=n?.xAxis?.axis,ie=n?.yAxis?.labels;let vt;t[94]!==pt||t[95]!==ie?(vt={axis:pt,label:ie},t[94]=pt,t[95]=ie,t[96]=vt):vt=t[96];const ne=s?.xAxis?.axis,Y=s?.yAxis?.labels;let c;t[97]!==ne||t[98]!==Y?(c={axis:ne,label:Y},t[97]=ne,t[98]=Y,t[99]=c):c=t[99],Q=i.jsxRuntimeExports.jsx(Fe.Axis,{y1:mt,y2:v,x1:0-b,x2:o+l.right,label:a,labelPos:{x:0-b,dx:0,dy:Lt<0?"1em":-5,y:f(E<0?0:E)},classNames:vt,styles:c}),Z=Mt?i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:M.filter(si),y:M.filter(ni).map(x=>f(x)),x1:0-b,x2:o+l.right,styles:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},classNames:{gridLines:n?.yAxis?.gridLines,labels:n?.yAxis?.labels},suffix:ft,prefix:q,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:m}):null;const S=0-b-15,r=rt/2,I=s?.yAxis?.title,ae=n?.yAxis?.title;t[100]!==P||t[101]!==S||t[102]!==r||t[103]!==I||t[104]!==ae?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:S,y:r,style:I,className:ae,text:P,rotate90:!0}),t[100]=P,t[101]=S,t[102]=r,t[103]=I,t[104]=ae,t[105]=j):j=t[105],t[106]!==X?(R=X.filter(ii).map(ei),t[106]=X,t[107]=R):R=t[107],bt=qe.AnimatePresence,V=G.map(x=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85},whileInView:{x:h(`${x.id}`)+h.bandwidth()/2,y:0,opacity:W.length!==0?W.indexOf(x.label)!==-1?.85:ut:.85,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",exit:{opacity:0,transition:{duration:p.duration}},children:[At?i.jsxRuntimeExports.jsx(Pe.XAxesLabels,{value:`${x.label}`.length<It?`${x.label}`:`${`${x.label}`.substring(0,It)}...`,y:rt+5,x:0-h.bandwidth()/2,width:h.bandwidth(),height:l.bottom,style:s?.xAxis?.labels,className:n?.xAxis?.labels,alignment:"top",animate:p,isInView:H}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{x1:0,x2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&x.x.indexOf(Math.min(...x.x.filter(ti)))===0?"url(#arrow)":"",markerStart:L&&x.x.indexOf(Math.min(...x.x.filter(_e)))===x.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:f(Math.min(...x.x.filter(Ze)))+ht,y2:f(Math.max(...x.x.filter(Qe)))-ht,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),x.x.map((ee,ot)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX),at?.({...x,xIndex:ot})},onClick:()=>{(ct||O)&&(Me.isEqual(yt,{...x,xIndex:ot})&&_t?(gt(void 0),ct?.(void 0)):(gt({...x,xIndex:ot}),ct&&ct({...x,xIndex:ot})))},onMouseMove:oe=>{Ht({...x,xIndex:ot}),zt(oe.clientY),Et(oe.clientX)},onMouseLeave:()=>{Ht(void 0),Et(void 0),zt(void 0),at?.(void 0)},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{opacity:F?k[ot]===F?1:.3:1},whileInView:{opacity:F?k[ot]===F?1:.3:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:qt.checkIfNullOrUndefined(ee)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cx:0,r:ht,style:{fill:k[ot],fillOpacity:.85,stroke:k[ot],strokeWidth:1},exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{cy:f(0),opacity:0},whileInView:{cy:f(ee||0),opacity:qt.checkIfNullOrUndefined(ee)?0:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial"}),Zt?i.jsxRuntimeExports.jsx(Tt.motion.text,{x:0,style:{textAnchor:"start",...s?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(ee)?"opacity-0":"opacity-100",n?.graphObjectValues),dx:ht+3,dy:"0.33em",exit:{opacity:0,transition:{duration:p.duration}},variants:{initial:{y:f(0),opacity:0,fill:Nt||k[ot]},whileInView:{y:f(ee||0),fill:Nt||k[ot],opacity:1,transition:{duration:p.duration}}},initial:"initial",animate:H?"whileInView":"initial",children:ke.numberFormattingFunction(ee,"NA",m,q,ft)}):null]})},ot))]},x.label)),J=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((x,ee)=>i.jsxRuntimeExports.jsx(Ne.RefLineY,{text:x.text,color:x.color,y:f(x.value),x1:0-b,x2:o+l.right,classNames:x.classNames,styles:x.styles,animate:p,isInView:H},ee))}):null,t[16]=p,t[17]=L,t[18]=P,t[19]=St,t[20]=Ft,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.axis,t[24]=n?.xAxis?.labels,t[25]=n?.yAxis?.gridLines,t[26]=n?.yAxis?.labels,t[27]=n?.yAxis?.title,t[28]=Pt,t[29]=X,t[30]=G,t[31]=O,t[32]=ut,t[33]=k,t[34]=rt,t[35]=o,t[36]=jt,t[37]=W,t[38]=H,t[39]=b,t[40]=l.bottom,t[41]=l.left,t[42]=l.right,t[43]=l.top,t[44]=kt,t[45]=Lt,t[46]=$t,t[47]=E,t[48]=yt,t[49]=Wt,t[50]=ct,t[51]=at,t[52]=m,t[53]=q,t[54]=ht,t[55]=Vt,t[56]=_t,t[57]=F,t[58]=At,t[59]=Mt,t[60]=Zt,t[61]=s?.dataConnectors,t[62]=s?.graphObjectValues,t[63]=s?.xAxis?.axis,t[64]=s?.xAxis?.labels,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=s?.yAxis?.title,t[68]=ft,t[69]=It,t[70]=Nt,t[71]=wt,t[72]=bt,t[73]=z,t[74]=J,t[75]=K,t[76]=Q,t[77]=Z,t[78]=j,t[79]=R,t[80]=C,t[81]=_,t[82]=tt,t[83]=et,t[84]=A,t[85]=N,t[86]=V}else bt=t[72],z=t[73],J=t[74],K=t[75],Q=t[76],Z=t[77],j=t[78],R=t[79],C=t[80],_=t[81],tt=t[82],et=t[83],A=t[84],N=t[85],V=t[86];let it;t[108]!==bt||t[109]!==J||t[110]!==V?(it=i.jsxRuntimeExports.jsxs(bt,{children:[V,J]}),t[108]=bt,t[109]=J,t[110]=V,t[111]=it):it=t[111];let nt;t[112]!==X?(nt=X.filter(Ke).map(Je),t[112]=X,t[113]=nt):nt=t[113];let xt;t[114]!==K||t[115]!==Q||t[116]!==Z||t[117]!==j||t[118]!==R||t[119]!==it||t[120]!==nt?(xt=i.jsxRuntimeExports.jsxs("g",{transform:K,children:[Q,Z,j,R,it,nt]}),t[114]=K,t[115]=Q,t[116]=Z,t[117]=j,t[118]=R,t[119]=it,t[120]=nt,t[121]=xt):xt=t[121];let D;t[122]!==z||t[123]!==C||t[124]!==_||t[125]!==tt||t[126]!==et||t[127]!==A||t[128]!==N||t[129]!==xt?(D=i.jsxRuntimeExports.jsxs(z,{width:C,height:_,viewBox:tt,direction:et,ref:A,children:[N,xt]}),t[122]=z,t[123]=C,t[124]=_,t[125]=tt,t[126]=et,t[127]=A,t[128]=N,t[129]=xt,t[130]=D):D=t[130];let B;t[131]!==n?.tooltip||t[132]!==Ut||t[133]!==Ot||t[134]!==lt||t[135]!==s?.tooltip||t[136]!==g?(B=lt&&g&&Ut&&Ot?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:lt,body:g,xPos:Ut,yPos:Ot,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[131]=n?.tooltip,t[132]=Ut,t[133]=Ot,t[134]=lt,t[135]=s?.tooltip,t[136]=g,t[137]=B):B=t[137];let st;t[138]!==n?.modal||t[139]!==O||t[140]!==yt?(st=O&&yt!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:yt,setData:gt,className:n?.modal}):null,t[138]=n?.modal,t[139]=O,t[140]=yt,t[141]=st):st=t[141];let dt;return t[142]!==D||t[143]!==B||t[144]!==st?(dt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[D,B,st]}),t[142]=D,t[143]=B,t[144]=st,t[145]=dt):dt=t[145],dt}function Je(e){return e.layer}function Ke(e){return e.position==="after"}function Qe(e){return e!==null}function Ze(e){return e!==null}function _e(e){return e!==null}function ti(e){return e!==null}function ei(e){return e.layer}function ii(e){return e.position==="before"}function ni(e){return e!==0}function si(e){return e!==0}function oi(e){return`${e.id}`}function ai(e){const t=i.compilerRuntimeExports.c(139),{data:d,leftMargin:Jt,rightMargin:se,topMargin:Kt,bottomMargin:Qt,dotColors:k,suffix:Ft,prefix:Mt,barPadding:It,showValues:wt,showTicks:jt,truncateBy:ht,width:At,height:g,radius:at,showLabels:Lt,tooltip:E,onSeriesMouseOver:ct,maxValue:Zt,minValue:ft,onSeriesMouseClick:q,selectedColor:F,arrowConnector:L,connectorStrokeWidth:Pt,maxBarThickness:kt,minBarThickness:$t,resetSelectionOnDoubleClick:_t,detailsOnClick:O,axisTitle:P,noOfTicks:Wt,valueColor:Nt,styles:s,classNames:n,labelOrder:y,refValues:Vt,rtl:p,animate:m,precision:X,customLayers:W,highlightedDataPoints:ut,dimmedOpacity:b}=e,Gt=Jt===void 0?100:Jt,Bt=se===void 0?40:se,Dt=Kt===void 0?20:Kt,te=Qt===void 0?10:Qt,Yt=T.useRef(null);let H;t[0]!==m.amount||t[1]!==m.once?(H={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=H):H=t[2];const U=Te.useInView(Yt,H),Xt=P?Dt+25:Dt;let l;t[3]!==te||t[4]!==Gt||t[5]!==Bt||t[6]!==Xt?(l={top:Xt,bottom:te,left:Gt,right:Bt},t[3]=te,t[4]=Gt,t[5]=Bt,t[6]=Xt,t[7]=l):l=t[7];const o=l,rt=At-o.left-o.right,lt=g-o.top-o.bottom,[Ht,yt]=T.useState(void 0),[gt,Ut]=T.useState(void 0),[Et,Ot]=T.useState(void 0),[zt,Rt]=T.useState(void 0);let G;if(t[8]!==d||t[9]!==y){const h=new Set,M=d.map((w,a)=>{const pt=y?`${w.label}`:`${a}`;return h.add(pt),{...w,id:pt}}),mt=y?y.filter(w=>!h.has(w)):[];let v;t[11]!==d[0]?(v=w=>({id:w,label:w,x:Array(d[0].x.length).fill(null)}),t[11]=d[0],t[12]=v):v=t[12],G=[...M,...mt.map(v)],t[8]=d,t[9]=y,t[10]=G}else G=t[10];const $=G;let St;t[13]!==$||t[14]!==y?(St=y??$.map(yi),t[13]=$,t[14]=y,t[15]=St):St=t[15];const bt=St;let z,J,K,Q,Z,j,R,C,_,tt,et,A,N,V,it;if(t[16]!==m||t[17]!==L||t[18]!==P||t[19]!==bt||t[20]!==It||t[21]!==n?.dataConnectors||t[22]!==n?.graphObjectValues||t[23]!==n?.xAxis?.gridLines||t[24]!==n?.xAxis?.labels||t[25]!==n?.xAxis?.title||t[26]!==n?.yAxis?.gridLines||t[27]!==n?.yAxis?.labels||t[28]!==Pt||t[29]!==W||t[30]!==$||t[31]!==O||t[32]!==b||t[33]!==k||t[34]!==lt||t[35]!==rt||t[36]!==g||t[37]!==ut||t[38]!==U||t[39]!==o.bottom||t[40]!==o.left||t[41]!==o.top||t[42]!==kt||t[43]!==Zt||t[44]!==$t||t[45]!==ft||t[46]!==gt||t[47]!==Wt||t[48]!==q||t[49]!==ct||t[50]!==X||t[51]!==Mt||t[52]!==at||t[53]!==Vt||t[54]!==_t||t[55]!==p||t[56]!==F||t[57]!==Lt||t[58]!==jt||t[59]!==wt||t[60]!==s?.dataConnectors||t[61]!==s?.graphObjectValues||t[62]!==s?.xAxis?.gridLines||t[63]!==s?.xAxis?.labels||t[64]!==s?.xAxis?.title||t[65]!==s?.yAxis?.gridLines||t[66]!==s?.yAxis?.labels||t[67]!==Ft||t[68]!==Dt||t[69]!==ht||t[70]!==Nt||t[71]!==At){const h=De.linear().domain([ft,Zt]).range([0,rt]).nice(),M=Se.band().domain(bt).range([0,$t?Math.max(lt,$t*$.length):kt?Math.min(lt,kt*$.length):lt]).paddingInner(It),mt=h.ticks(Wt);J=Tt.motion.svg,_=`${At}px`,tt=`${g}px`,et=`0 0 ${At} ${g}`,A="ltr",N=Yt,t[87]!==L?(V=L?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,t[87]=L,t[88]=V):V=t[88],Q=`translate(${o.left},${o.top})`,Z=jt?i.jsxRuntimeExports.jsx(We.XTicksAndGridLines,{values:mt.filter(fi),x:mt.filter(hi).map(c=>h(c)),y1:0-Dt,y2:lt+o.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:Ft,prefix:Mt,labelType:"secondary",showGridLines:!0,precision:X}):null;const v=rt/2,w=0-o.top+15,a=s?.xAxis?.title,pt=n?.xAxis?.title;t[89]!==P||t[90]!==v||t[91]!==w||t[92]!==a||t[93]!==pt?(j=i.jsxRuntimeExports.jsx(Le.AxisTitle,{x:v,y:w,style:a,className:pt,text:P}),t[89]=P,t[90]=v,t[91]=w,t[92]=a,t[93]=pt,t[94]=j):j=t[94];const ie=s?.yAxis?.gridLines;let vt;t[95]!==ie?(vt={gridLines:ie},t[95]=ie,t[96]=vt):vt=t[96];const ne=n?.yAxis?.gridLines;let Y;t[97]!==ne?(Y={gridLines:ne},t[97]=ne,t[98]=Y):Y=t[98],R=i.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{y:$.map(c=>M(`${c.id}`)+M.bandwidth()/2),x1:0,x2:rt,styles:vt,classNames:Y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:X}),t[99]!==W?(C=W.filter(pi).map(mi),t[99]=W,t[100]=C):C=t[100],z=qe.AnimatePresence,it=$.map(c=>i.jsxRuntimeExports.jsxs(Tt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85},whileInView:{x:0,y:M(`${c.id}`)+M.bandwidth()/2,opacity:ut.length!==0?ut.indexOf(c.label)!==-1?.85:b:.85,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:[Lt?i.jsxRuntimeExports.jsx(Ge.YAxesLabels,{value:`${c.label}`.length<ht?`${c.label}`:`${`${c.label}`.substring(0,ht)}...`,y:0-M.bandwidth()/2,x:0-o.left,width:o.left,height:M.bandwidth(),alignment:"right",style:s?.yAxis?.labels,className:n?.yAxis?.labels,animate:m,isInView:U}):null,i.jsxRuntimeExports.jsx(Tt.motion.line,{y1:0,y2:0,style:{strokeWidth:Pt,...s?.dataConnectors||{},opacity:F?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",n?.dataConnectors),markerEnd:L&&c.x.indexOf(Math.min(...c.x.filter(di)))===0?"url(#arrow)":"",markerStart:L&&c.x.indexOf(Math.min(...c.x.filter(xi)))===c.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:h(Math.min(...c.x.filter(ui)))+at,x2:h(Math.max(...c.x.filter(ci)))-at,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),c.x.map((S,r)=>i.jsxRuntimeExports.jsx(Tt.motion.g,{onMouseEnter:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX),ct?.({...c,xIndex:r})},onClick:()=>{(q||O)&&(Me.isEqual(gt,{...c,xIndex:r})&&_t?(Ut(void 0),q?.(void 0)):(Ut({...c,xIndex:r}),q&&q({...c,xIndex:r})))},onMouseMove:I=>{yt({...c,xIndex:r}),Rt(I.clientY),Ot(I.clientX)},onMouseLeave:()=>{yt(void 0),Ot(void 0),Rt(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{opacity:F?k[r]===F?1:.3:1},whileInView:{opacity:F?k[r]===F?1:.3:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:qt.checkIfNullOrUndefined(S)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(Tt.motion.circle,{cy:0,r:at,style:{fill:k[r],fillOpacity:.85,stroke:k[r],strokeWidth:1,opacity:qt.checkIfNullOrUndefined(S)?0:1},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{cx:h(0),opacity:0},whileInView:{cx:h(S||0),opacity:qt.checkIfNullOrUndefined(S)?0:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial"}),wt?i.jsxRuntimeExports.jsx(Tt.motion.text,{y:0,style:{textAnchor:"middle",...s?.graphObjectValues||{}},dx:0,dy:0-at-3,className:i.mo("graph-value text-sm font-bold",qt.checkIfNullOrUndefined(S)?"0opacity-0":"opacity-100",n?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:h(0),opacity:0,fill:Nt||k[r]},whileInView:{x:h(S||0),fill:Nt||k[r],opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:U?"whileInView":"initial",children:ke.numberFormattingFunction(S,"NA",X,Mt,Ft)}):null]})},r))]},c.label)),K=Vt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Vt.map((c,S)=>i.jsxRuntimeExports.jsx(Ne.RefLineX,{text:c.text,color:c.color,x:h(c.value),y1:0-o.top,y2:lt+o.bottom,textSide:h(c.value)>rt*.75||p?"left":"right",classNames:c.classNames,styles:c.styles,animate:m,isInView:U},S))}):null,t[16]=m,t[17]=L,t[18]=P,t[19]=bt,t[20]=It,t[21]=n?.dataConnectors,t[22]=n?.graphObjectValues,t[23]=n?.xAxis?.gridLines,t[24]=n?.xAxis?.labels,t[25]=n?.xAxis?.title,t[26]=n?.yAxis?.gridLines,t[27]=n?.yAxis?.labels,t[28]=Pt,t[29]=W,t[30]=$,t[31]=O,t[32]=b,t[33]=k,t[34]=lt,t[35]=rt,t[36]=g,t[37]=ut,t[38]=U,t[39]=o.bottom,t[40]=o.left,t[41]=o.top,t[42]=kt,t[43]=Zt,t[44]=$t,t[45]=ft,t[46]=gt,t[47]=Wt,t[48]=q,t[49]=ct,t[50]=X,t[51]=Mt,t[52]=at,t[53]=Vt,t[54]=_t,t[55]=p,t[56]=F,t[57]=Lt,t[58]=jt,t[59]=wt,t[60]=s?.dataConnectors,t[61]=s?.graphObjectValues,t[62]=s?.xAxis?.gridLines,t[63]=s?.xAxis?.labels,t[64]=s?.xAxis?.title,t[65]=s?.yAxis?.gridLines,t[66]=s?.yAxis?.labels,t[67]=Ft,t[68]=Dt,t[69]=ht,t[70]=Nt,t[71]=At,t[72]=z,t[73]=J,t[74]=K,t[75]=Q,t[76]=Z,t[77]=j,t[78]=R,t[79]=C,t[80]=_,t[81]=tt,t[82]=et,t[83]=A,t[84]=N,t[85]=V,t[86]=it}else z=t[72],J=t[73],K=t[74],Q=t[75],Z=t[76],j=t[77],R=t[78],C=t[79],_=t[80],tt=t[81],et=t[82],A=t[83],N=t[84],V=t[85],it=t[86];let nt;t[101]!==z||t[102]!==K||t[103]!==it?(nt=i.jsxRuntimeExports.jsxs(z,{children:[it,K]}),t[101]=z,t[102]=K,t[103]=it,t[104]=nt):nt=t[104];let xt;t[105]!==W?(xt=W.filter(li).map(ri),t[105]=W,t[106]=xt):xt=t[106];let D;t[107]!==Q||t[108]!==Z||t[109]!==j||t[110]!==R||t[111]!==C||t[112]!==nt||t[113]!==xt?(D=i.jsxRuntimeExports.jsxs("g",{transform:Q,children:[Z,j,R,C,nt,xt]}),t[107]=Q,t[108]=Z,t[109]=j,t[110]=R,t[111]=C,t[112]=nt,t[113]=xt,t[114]=D):D=t[114];let B;t[115]!==J||t[116]!==_||t[117]!==tt||t[118]!==et||t[119]!==A||t[120]!==N||t[121]!==V||t[122]!==D?(B=i.jsxRuntimeExports.jsxs(J,{width:_,height:tt,viewBox:et,direction:A,ref:N,children:[V,D]}),t[115]=J,t[116]=_,t[117]=tt,t[118]=et,t[119]=A,t[120]=N,t[121]=V,t[122]=D,t[123]=B):B=t[123];let st;t[124]!==n?.tooltip||t[125]!==Et||t[126]!==zt||t[127]!==Ht||t[128]!==s?.tooltip||t[129]!==E?(st=Ht&&E&&Et&&zt?i.jsxRuntimeExports.jsx(Ie.Tooltip,{data:Ht,body:E,xPos:Et,yPos:zt,backgroundStyle:s?.tooltip,className:n?.tooltip}):null,t[124]=n?.tooltip,t[125]=Et,t[126]=zt,t[127]=Ht,t[128]=s?.tooltip,t[129]=E,t[130]=st):st=t[130];let dt;t[131]!==n?.modal||t[132]!==O||t[133]!==gt?(dt=O&>!==void 0?i.jsxRuntimeExports.jsx(Ve.DetailsModal,{body:O,data:gt,setData:Ut,className:n?.modal}):null,t[131]=n?.modal,t[132]=O,t[133]=gt,t[134]=dt):dt=t[134];let f;return t[135]!==B||t[136]!==st||t[137]!==dt?(f=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[B,st,dt]}),t[135]=B,t[136]=st,t[137]=dt,t[138]=f):f=t[138],f}function ri(e){return e.layer}function li(e){return e.position==="after"}function ci(e){return e!==null}function ui(e){return e!==null}function xi(e){return e!==null}function di(e){return e!==null}function mi(e){return e.layer}function pi(e){return e.position==="before"}function hi(e,t){return t!==0}function fi(e,t){return t!==0}function yi(e){return`${e.id}`}function gi(e){const t=i.compilerRuntimeExports.c(120),{data:d,graphTitle:Jt,colors:se,sources:Kt,graphDescription:Qt,barPadding:k,showTicks:Ft,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:ht,height:At,width:g,footNote:at,colorDomain:Lt,colorLegendTitle:E,padding:ct,backgroundColor:Zt,radius:ft,tooltip:q,showLabels:F,relativeHeight:L,onSeriesMouseOver:Pt,graphID:kt,suffix:$t,prefix:_t,maxValue:O,minValue:P,onSeriesMouseClick:Wt,graphDownload:Nt,dataDownload:s,showValues:n,sortParameter:y,arrowConnector:Vt,connectorStrokeWidth:p,language:m,minHeight:X,theme:W,maxBarThickness:ut,maxNumberOfBars:b,minBarThickness:Gt,ariaLabel:Bt,resetSelectionOnDoubleClick:Dt,detailsOnClick:te,axisTitle:Yt,noOfTicks:H,valueColor:U,orientation:Xt,styles:l,classNames:o,labelOrder:rt,refValues:lt,filterNA:Ht,animate:yt,precision:gt,showColorScale:Ut,customLayers:Et,highlightedDataPoints:Ot,dimmedOpacity:zt,timeline:Rt,sortData:G}=e,$=se===void 0?Ue.Colors.light.categoricalColors.colors:se,St=k===void 0?.25:k,bt=Ft===void 0?!0:Ft,z=ht===void 0?999:ht,J=Zt===void 0?!0:Zt,K=ft===void 0?3:ft,Q=F===void 0?!0:F,Z=$t===void 0?"":$t,j=_t===void 0?"":_t,R=Nt===void 0?!1:Nt,C=s===void 0?!1:s,_=n===void 0?!0:n,tt=Vt===void 0?!1:Vt,et=p===void 0?2:p,A=m===void 0?"en":m,N=X===void 0?0:X,V=W===void 0?"light":W,it=Dt===void 0?!0:Dt,nt=H===void 0?5:H,xt=Xt===void 0?"vertical":Xt,D=Ht===void 0?!0:Ht,B=yt===void 0?!1:yt,st=gt===void 0?2:gt,dt=Ut===void 0?!0:Ut;let f;t[0]!==Et?(f=Et===void 0?[]:Et,t[0]=Et,t[1]=f):f=t[1];const h=f;let M;t[2]!==Ot?(M=Ot===void 0?[]:Ot,t[2]=Ot,t[3]=M):M=t[3];const mt=M,v=zt===void 0?.3:zt;let w;t[4]!==Rt?(w=Rt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:Rt,t[4]=Rt,t[5]=w):w=t[5];const a=w,[pt,ie]=T.useState(0),[vt,ne]=T.useState(0),[Y,c]=T.useState(a.autoplay);let S;if(t[6]!==d||t[7]!==a.dateFormat){let u;t[9]!==a.dateFormat?(u=Ct=>je.parse(`${Ct.date}`,a.dateFormat||"yyyy",new Date).getTime(),t[9]=a.dateFormat,t[10]=u):u=t[10],S=[...new Set(d.filter(Ti).map(u))],S.sort(Si),t[6]=d,t[7]=a.dateFormat,t[8]=S}else S=t[8];const r=S,[I,ae]=T.useState(a.autoplay?0:r.length-1),[x,ee]=T.useState(void 0),ot=T.useRef(null),oe=T.useRef(null);let xe,de;t[11]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>{const u=new ResizeObserver(Ct=>{ie(Ct[0].target.clientWidth||620),ne(Ct[0].target.clientHeight||480)});return ot.current&&u.observe(ot.current),()=>u.disconnect()},de=[],t[11]=xe,t[12]=de):(xe=t[11],de=t[12]),T.useEffect(xe,de);let me,pe;t[13]!==Y||t[14]!==a.speed||t[15]!==r?(me=()=>{const u=setInterval(()=>{ae(Ct=>Ct<r.length-1?Ct+1:0)},(a.speed||2)*1e3);return Y||clearInterval(u),()=>clearInterval(u)},pe=[r,Y,a.speed],t[13]=Y,t[14]=a.speed,t[15]=r,t[16]=me,t[17]=pe):(me=t[16],pe=t[17]),T.useEffect(me,pe);const ge=a.dateFormat||"yyyy";let he;t[18]!==I||t[19]!==ge||t[20]!==a.showOnlyActiveDate||t[21]!==r?(he=Oe.getSliderMarks(r,I,a.showOnlyActiveDate,ge),t[18]=I,t[19]=ge,t[20]=a.showOnlyActiveDate,t[21]=r,t[22]=he):he=t[22];const fe=he,be=xt==="horizontal"?ai:ze,ve=o?.graphContainer,we=l?.graphContainer;let re;t[23]!==o?.description||t[24]!==o?.title||t[25]!==d||t[26]!==C||t[27]!==Qt||t[28]!==R||t[29]!==Jt||t[30]!==l?.description||t[31]!==l?.title||t[32]!==g?(re=Jt||Qt||R||C?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:l?.title,description:l?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Jt,graphDescription:Qt,width:g,graphDownload:R?oe:void 0,dataDownload:C?d.map(Di).filter(Vi).length>0?d.map(Ni).filter($i):d.filter(Li):null}):null,t[23]=o?.description,t[24]=o?.title,t[25]=d,t[26]=C,t[27]=Qt,t[28]=R,t[29]=Jt,t[30]=l?.description,t[31]=l?.title,t[32]=g,t[33]=re):re=t[33];let le;t[34]!==I||t[35]!==fe||t[36]!==Y||t[37]!==a.enabled||t[38]!==r?(le=a.enabled&&r.length>0&&fe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{c(!Y)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Y?"Click to pause animation":"Click to play animation",children:Y?i.jsxRuntimeExports.jsx(Ce.Pause,{}):i.jsxRuntimeExports.jsx(Ce.Play,{})}),i.jsxRuntimeExports.jsx(Oe.Nr,{min:r[0],max:r[r.length-1],marks:fe,step:null,defaultValue:r[r.length-1],value:r[I],onChangeComplete:u=>{ae(r.indexOf(u))},onChange:u=>{ae(r.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[34]=I,t[35]=fe,t[36]=Y,t[37]=a.enabled,t[38]=r,t[39]=le):le=t[39];let ce;t[40]!==be||t[41]!==B||t[42]!==tt||t[43]!==Yt||t[44]!==St||t[45]!==jt||t[46]!==o||t[47]!==Lt||t[48]!==E||t[49]!==$||t[50]!==et||t[51]!==h||t[52]!==d||t[53]!==te||t[54]!==v||t[55]!==D||t[56]!==mt||t[57]!==I||t[58]!==rt||t[59]!==A||t[60]!==Mt||t[61]!==ut||t[62]!==b||t[63]!==O||t[64]!==Gt||t[65]!==P||t[66]!==nt||t[67]!==Wt||t[68]!==Pt||t[69]!==st||t[70]!==j||t[71]!==K||t[72]!==lt||t[73]!==it||t[74]!==It||t[75]!==x||t[76]!==dt||t[77]!==Q||t[78]!==bt||t[79]!==_||t[80]!==G||t[81]!==y||t[82]!==l||t[83]!==Z||t[84]!==vt||t[85]!==pt||t[86]!==a.dateFormat||t[87]!==a.enabled||t[88]!==q||t[89]!==wt||t[90]!==z||t[91]!==r||t[92]!==U||t[93]!==g?(ce=d.length===0?i.jsxRuntimeExports.jsx(He.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[dt?i.jsxRuntimeExports.jsx(Xe.ColorLegendWithMouseOver,{width:g,colorDomain:Lt,colors:$,colorLegendTitle:E,setSelectedColor:ee,showNAColor:!1,className:o?.colorLegend}):null,i.jsxRuntimeExports.jsx(Re.GraphArea,{ref:ot,children:pt&&vt?i.jsxRuntimeExports.jsx(be,{data:y!==void 0?y==="diff"?Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ii):u),Mi,[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ee.orderBy(Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>a.enabled?u.date===je.format(new Date(r[I]),a.dateFormat||"yyyy"):u).filter(u=>D?!u.x.every(Ci):u),u=>qt.checkIfNullOrUndefined(u.x[y])?-1/0:u.x[y],[G||"asc"]).filter((u,Ct)=>b?Ct<b:!0):Ae.ensureCompleteDataForDumbbellChart(d,a.dateFormat||"yyyy").filter(u=>D?!u.x.every(Ri):u).filter((u,Ct)=>b?Ct<b:!0),dotColors:$,width:pt,height:vt,radius:K,barPadding:St,showTicks:bt,leftMargin:Mt,rightMargin:It,topMargin:wt,bottomMargin:jt,truncateBy:z,showLabels:Q,showValues:_,tooltip:q,suffix:Z,prefix:j,onSeriesMouseOver:Pt,maxValue:qt.checkIfNullOrUndefined(O)?Math.max(...d.map(Ei))<0?0:Math.max(...d.map(Ai)):O,minValue:qt.checkIfNullOrUndefined(P)?Math.min(...d.map(wi))>0?0:Math.min(...d.map(bi)):P,onSeriesMouseClick:Wt,selectedColor:x,arrowConnector:tt,connectorStrokeWidth:et,maxBarThickness:ut,minBarThickness:Gt,resetSelectionOnDoubleClick:it,detailsOnClick:te,axisTitle:Yt,noOfTicks:nt,valueColor:U,styles:l,classNames:o,labelOrder:rt,refValues:lt,animate:B===!0?{duration:.5,once:!0,amount:.5}:B||{duration:0,once:!0,amount:0},precision:st,customLayers:h,highlightedDataPoints:mt,dimmedOpacity:v,rtl:A==="ar"||A==="he"}):null})]}),t[40]=be,t[41]=B,t[42]=tt,t[43]=Yt,t[44]=St,t[45]=jt,t[46]=o,t[47]=Lt,t[48]=E,t[49]=$,t[50]=et,t[51]=h,t[52]=d,t[53]=te,t[54]=v,t[55]=D,t[56]=mt,t[57]=I,t[58]=rt,t[59]=A,t[60]=Mt,t[61]=ut,t[62]=b,t[63]=O,t[64]=Gt,t[65]=P,t[66]=nt,t[67]=Wt,t[68]=Pt,t[69]=st,t[70]=j,t[71]=K,t[72]=lt,t[73]=it,t[74]=It,t[75]=x,t[76]=dt,t[77]=Q,t[78]=bt,t[79]=_,t[80]=G,t[81]=y,t[82]=l,t[83]=Z,t[84]=vt,t[85]=pt,t[86]=a.dateFormat,t[87]=a.enabled,t[88]=q,t[89]=wt,t[90]=z,t[91]=r,t[92]=U,t[93]=g,t[94]=ce):ce=t[94];let ue;t[95]!==o?.footnote||t[96]!==o?.source||t[97]!==at||t[98]!==Kt||t[99]!==l?.footnote||t[100]!==l?.source||t[101]!==g?(ue=Kt||at?i.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:l?.footnote,source:l?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:Kt,footNote:at,width:g}):null,t[95]=o?.footnote,t[96]=o?.source,t[97]=at,t[98]=Kt,t[99]=l?.footnote,t[100]=l?.source,t[101]=g,t[102]=ue):ue=t[102];let ye;return t[103]!==Bt||t[104]!==J||t[105]!==kt||t[106]!==At||t[107]!==A||t[108]!==N||t[109]!==ct||t[110]!==L||t[111]!==ve||t[112]!==we||t[113]!==re||t[114]!==le||t[115]!==ce||t[116]!==ue||t[117]!==V||t[118]!==g?(ye=i.jsxRuntimeExports.jsxs(Re.GraphContainer,{className:ve,style:we,id:kt,ref:oe,"aria-label":Bt,backgroundColor:J,theme:V,language:A,minHeight:N,width:g,height:At,relativeHeight:L,padding:ct,children:[re,le,ce,ue]}),t[103]=Bt,t[104]=J,t[105]=kt,t[106]=At,t[107]=A,t[108]=N,t[109]=ct,t[110]=L,t[111]=ve,t[112]=we,t[113]=re,t[114]=le,t[115]=ce,t[116]=ue,t[117]=V,t[118]=g,t[119]=ye):ye=t[119],ye}function bi(e){return Math.min(...e.x.filter(vi))}function vi(e){return e!==null}function wi(e){return Math.min(...e.x.filter(ji))}function ji(e){return e!==null}function Ai(e){return Math.max(...e.x.filter(ki))}function ki(e){return e!==null}function Ei(e){return Math.max(...e.x.filter(Oi))}function Oi(e){return e!==null}function Ri(e){return e==null}function Ci(e){return e==null}function Mi(e){return qt.checkIfNullOrUndefined(e.x[e.x.length-1])||qt.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0]}function Ii(e){return e==null}function Li(e){return e!==void 0}function $i(e){return e!==void 0}function Ni(e){return e.data}function Vi(e){return e!==void 0}function Di(e){return e.data}function Si(e,t){return e-t}function Ti(e){return e.date}exports.DumbbellChart=gi;
|
|
2
2
|
//# sourceMappingURL=DumbbellChart.cjs.map
|