@undp/data-viz 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.js +3 -3
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +1751 -1604
- package/dist/BarGraph.js.map +1 -1
- package/dist/BeeSwarmChart.js +2 -2
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +226 -214
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +544 -505
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +365 -350
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +305 -294
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DifferenceLineChart.js +3 -3
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +212 -199
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.js +3 -3
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +603 -556
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{GraphEl-ebgfxefq.js → GraphEl-DEzobeOM.js} +2 -2
- package/dist/{GraphEl-ebgfxefq.js.map → GraphEl-DEzobeOM.js.map} +1 -1
- package/dist/GriddedGraphs.js +1 -1
- package/dist/HeatMap.js +4 -4
- package/dist/Histogram.js +3 -3
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +344 -332
- package/dist/HybridMap.js.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +3 -3
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +453 -425
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.js +3 -3
- package/dist/ParetoChart.js +2 -2
- package/dist/RadarChart.js +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +467 -451
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SimpleLineChart.js +3 -3
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SlopeChart.js +1 -1
- package/dist/SparkLine.js +3 -3
- package/dist/StripChart.js +1 -1
- package/dist/ThreeDGlobe.js +2 -2
- package/dist/{band-CyHaVft5.js → band-DHUZ2X7J.js} +3 -3
- package/dist/{band-CyHaVft5.js.map → band-DHUZ2X7J.js.map} +1 -1
- package/dist/{index-BBV4tAeA.js → index-DPGq3eIL.js} +2 -2
- package/dist/{index-BBV4tAeA.js.map → index-DPGq3eIL.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{init-BJFW6EwE.js → init-BhZylTFx.js} +3 -3
- package/dist/{init-BJFW6EwE.js.map → init-BhZylTFx.js.map} +1 -1
- package/dist/{linear-BwnDd9KF.js → linear-BqltdMeF.js} +2 -2
- package/dist/{linear-BwnDd9KF.js.map → linear-BqltdMeF.js.map} +1 -1
- package/dist/{ordinal-P77xw8aL.js → ordinal-BJ6O_LC5.js} +2 -2
- package/dist/{ordinal-P77xw8aL.js.map → ordinal-BJ6O_LC5.js.map} +1 -1
- package/dist/{pow-DE4c7dbW.js → pow-CM2aze4M.js} +3 -3
- package/dist/{pow-DE4c7dbW.js.map → pow-CM2aze4M.js.map} +1 -1
- package/dist/{threshold-Bgr20hik.js → threshold-DFfqcDMa.js} +2 -2
- package/dist/{threshold-Bgr20hik.js.map → threshold-DFfqcDMa.js.map} +1 -1
- package/dist/{time-DCCfQk3V.js → time-BUL-dwnK.js} +3 -3
- package/dist/{time-DCCfQk3V.js.map → time-BUL-dwnK.js.map} +1 -1
- package/package.json +4 -4
- package/dist/sort-BIvMlUH1.js +0 -34
- package/dist/sort-BIvMlUH1.js.map +0 -1
- package/dist/sort-O96oMZLb.cjs +0 -2
- package/dist/sort-O96oMZLb.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(data, 'date', true).map(d =>\r\n parse(`${d}`, timeline.dateFormat || 'yyyy', new Date()).getTime(),\r\n ),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","dateFormat","Date","getTime","_temp","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","t31","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t32","shape","onUpdateShape","useEffectEvent","t33","fetchAndParseJSON","then","d_0","t34","interval","setInterval","speed","clearInterval","markObj","getSliderMarks","console","error","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t38","Pause","Play","SliderUI","nextValue","nextValue_0","t39","GraphArea","d_6","date","format","_temp7","getJenks","_temp8","_temp9","Spinner","t40","footnote","source","GraphFooter","t41","GraphContainer","d_8","d_7","NAME","d_3","d_2","d_1","d_5","d_4","a","b","ascending"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,EAAAA,IACEhC,GACE,CAACiC,IAAYC,EAAa,IAAIC,EAClCH,OAAgCI,SAAY,EAAE7B,IAAQ,OAAO,CAACyB,EAChE,GACM,CAACK,GAAeC,EAAgB,IAAIH,EAA6BC,MAAS,GAE1E,CAACG,IAAgBC,EAAiB,IAAIL,EAAcC,MAAS,GAE7D,CAACK,GAAeC,EAAgB,IAAIP,EAAcC,MAAS,GAC3D,CAACO,IAAQC,CAAS,IAAIT,EAA6BC,MAAS,GAC5D,CAACS,GAAQC,CAAS,IAAIX,EAA6BC,MAAS,GAC5DW,IAASC,G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"}
|
|
1
|
+
{"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(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\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","t30","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","parse","Date","getTime","Set","sort","_temp","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","fetchAndParseJSON","then","d_0","t35","t36","t37","speed","interval","setInterval","clearInterval","t38","t39","getSliderMarks","markObj","console","error","t40","graphContainer","t41","t42","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t43","Pause","Play","SliderUI","nextValue","nextValue_0","t44","GraphArea","d_6","date","format","_temp7","getJenks","_temp8","_temp9","Spinner","t45","footnote","source","GraphFooter","t46","GraphContainer","d_8","d_7","NAME","d_3","d_2","d_1","d_5","d_4","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6EO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AA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C,IAAApC,SAAAxK,GAAAwK,SAAAgJ,MAAAA,KAAAhJ,EAAA,GAAA,GAvKjBgJ;AAuKiB;AA9Rd,SAAAN,GAAAQ,GAAA;AAAA,SAuNuBzM,EAAC2B;AAA+B;AAvNvD,SAAAqK,GAAAU,GAAA;AAAA,SAgNuB1M,EAACyB;AAA+B;AAhNvD,SAAAqK,GAAAxL,GAAA;AAAA,SAyM4BA,EAAEE,WAAWmM,SAAU;AAAY;AAzM/D,SAAAzB,GAAA0B,GAAA;AAAA,SAwJ4B5M,MAAMpF;AAAS;AAxJ3C,SAAAqQ,GAAA4B,GAAA;AAAA,SAuJ6C7M,MAAMpF;AAAS;AAvJ5D,SAAAoQ,GAAA8B,GAAA;AAAA,SAuJyB9M,EAACvH;AAAK;AAvJ/B,SAAAsS,GAAAgC,GAAA;AAAA,SAsJ2C/M,MAAMpF;AAAS;AAtJ1D,SAAAkQ,GAAAkC,GAAA;AAAA,SAsJuBhN,EAACvH;AAAK;AAtJ7B,SAAAuP,GAAAiF,GAAAC,GAAA;AAAA,SA4DkBD,IAAIC;AAAC;"}
|
package/dist/BulletChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),ut=require("react"),Le=require("./index-Cno4Q0YE.cjs"),Ae=require("./index-DQA8q5sC.cjs"),pe=require("./index-CSNtgibC.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),Re=require("./Tooltip-uUdw6wJL.cjs"),p=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ke=require("./Axis-DxRV2yMi.cjs"),Oe=require("./AxisTitle-sS5bLLR7.cjs"),qe=require("./XAxesLabels-Bt5NZBmX.cjs"),Ve=require("./ReferenceLine-BH0qdf4R.cjs"),Te=require("./YTicksAndGridLines-4pxTRlRK.cjs"),$e=require("./XTicksAndGridLines-B6CELS7q.cjs"),Se=require("./YAxesLabels-DesLesUP.cjs"),Ne=require("./DetailsModal-BN0HDFlV.cjs"),Ee=require("./linear-BwPAspcq.cjs"),Ie=require("./band-VYfcZeJ2.cjs"),ze=require("./use-in-view-QcfiW0w3.cjs"),bt=require("./proxy-BxvUI_9l.cjs"),Ce=require("./index-DG2bgAva.cjs"),we=require("./Colors.cjs"),De=require("./EmptyState-sAEZ_5rU.cjs"),Me=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./GraphFooter.cjs"),Ue=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs");function Pe(e){const t=s.compilerRuntimeExports.c(156),{data:n,width:yt,height:Jt,barColor:$t,suffix:vt,prefix:k,barPadding:St,showLabels:Dt,showValues:Kt,showTicks:ie,truncateBy:Qt,leftMargin:ne,rightMargin:Ft,topMargin:Zt,bottomMargin:re,tooltip:ct,onSeriesMouseOver:xt,refValues:wt,maxValue:g,minValue:mt,highlightedDataPoints:J,onSeriesMouseClick:nt,labelOrder:T,maxBarThickness:Ut,minBarThickness:jt,resetSelectionOnDoubleClick:Bt,detailsOnClick:st,barAxisTitle:$,valueColor:K,noOfTicks:Mt,styles:f,classNames:a,targetStyle:c,targetColor:S,qualitativeRangeColors:Q,measureBarWidthFactor:h,animate:o,dimmedOpacity:x,precision:at,customLayers:Z,naLabel:O,targetLineThickness:_t}=e,D=ne===void 0?20:ne,Pt=Ft===void 0?20:Ft,se=Zt===void 0?20:Zt,Gt=re===void 0?25:re,ue=ut.useRef(null);let ae;t[0]!==o.amount||t[1]!==o.once?(ae={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=ae):ae=t[2];const V=ze.useInView(ue,ae),F=$?D+30:D;let Xt;t[3]!==Gt||t[4]!==Pt||t[5]!==F||t[6]!==se?(Xt={top:se,bottom:Gt,left:F,right:Pt},t[3]=Gt,t[4]=Pt,t[5]=F,t[6]=se,t[7]=Xt):Xt=t[7];const d=Xt,[_,le]=ut.useState(void 0),[tt,ft]=ut.useState(void 0),[At,te]=ut.useState(void 0),[ee,Yt]=ut.useState(void 0),m=yt-d.left-d.right,Rt=Jt-d.top-d.bottom;let et;t[8]!==n?(et=Math.max(...n.filter(di).map(fi))<0?0:Math.max(...n.filter(mi).map(xi)),t[8]=n,t[9]=et):et=t[9];const kt=et;let Ot;t[10]!==n?(Ot=Math.max(...n.filter(ci).map(ui))<0?0:Math.max(...n.filter(ri).map(oi)),t[10]=n,t[11]=Ot):Ot=t[11];const Vt=Ot;let Nt;t[12]!==n?(Nt=Math.max(...n.map(ai)),t[12]=n,t[13]=Nt):Nt=t[13];const Et=Nt;let It;t[14]!==kt||t[15]!==g||t[16]!==Et||t[17]!==Vt?(It=p.checkIfNullOrUndefined(g)?Math.max(...[kt,Vt,Et].filter(Number.isFinite))<0?0:Math.max(...[kt,Vt,Et].filter(Number.isFinite)):g,t[14]=kt,t[15]=g,t[16]=Et,t[17]=Vt,t[18]=It):It=t[18];const zt=It;let Ht;t[19]!==n?(Ht=Math.min(...n.filter(si).map(ni))>=0?0:Math.min(...n.filter(ii).map(ei)),t[19]=n,t[20]=Ht):Ht=t[20];const Ct=Ht;let Lt;t[21]!==n?(Lt=Math.min(...n.filter(ti).map(_e))>=0?0:Math.min(...n.filter(Ze).map(Qe)),t[21]=n,t[22]=Lt):Lt=t[22];const dt=Lt;let qt;t[23]!==Ct||t[24]!==mt||t[25]!==dt?(qt=p.checkIfNullOrUndefined(mt)?Math.min(...[Ct,dt].filter(Number.isFinite))>=0?0:Math.min(...[Ct,dt].filter(Number.isFinite)):mt,t[23]=Ct,t[24]=mt,t[25]=dt,t[26]=qt):qt=t[26];const y=qt;let N,E,U,B,I,P,G,v,M,A,z,C,w,j;if(t[27]!==o||t[28]!==$||t[29]!==$t||t[30]!==St||t[31]!==a?.graphObjectValues||t[32]!==a?.xAxis?.axis||t[33]!==a?.xAxis?.labels||t[34]!==a?.yAxis?.gridLines||t[35]!==a?.yAxis?.labels||t[36]!==a?.yAxis?.title||t[37]!==Z||t[38]!==n||t[39]!==st||t[40]!==x||t[41]!==Rt||t[42]!==m||t[43]!==Jt||t[44]!==J||t[45]!==V||t[46]!==T||t[47]!==D||t[48]!==d.bottom||t[49]!==d.left||t[50]!==d.right||t[51]!==d.top||t[52]!==Ut||t[53]!==h||t[54]!==jt||t[55]!==tt||t[56]!==O||t[57]!==Mt||t[58]!==nt||t[59]!==xt||t[60]!==at||t[61]!==k||t[62]!==Q||t[63]!==wt||t[64]!==Bt||t[65]!==Dt||t[66]!==ie||t[67]!==Kt||t[68]!==f?.graphObjectValues||t[69]!==f?.xAxis?.axis||t[70]!==f?.xAxis?.labels||t[71]!==f?.yAxis?.gridLines||t[72]!==f?.yAxis?.labels||t[73]!==f?.yAxis?.title||t[74]!==vt||t[75]!==S||t[76]!==_t||t[77]!==c||t[78]!==Qt||t[79]!==K||t[80]!==yt||t[81]!==zt||t[82]!==y){const u=Ee.linear().domain([y,zt]).range([Rt,0]).nice();let Tt;t[97]!==T?(Tt=(l,oe)=>({...l,id:T?`${l.label}`:`${oe}`}),t[97]=T,t[98]=Tt):Tt=t[98];const me=n.map(Tt),r=T||me.map(Ke),R=Ie.band().domain(r).range([0,jt?Math.max(m,jt*r.length):Ut?Math.min(m,Ut*r.length):m]).paddingInner(St),q=u.ticks(Mt);E=bt.motion.svg,A=`${yt}px`,z=`${Jt}px`,C=`0 0 ${yt} ${Jt}`,w="ltr",j=ue,I=`translate(${d.left},${d.top})`;const fe=u(y<0?0:y),ce=u(y<0?0:y),ht=y<0?0:y;let ot;t[99]!==O||t[100]!==at||t[101]!==k||t[102]!==vt||t[103]!==ht?(ot=je.numberFormattingFunction(ht,O,at,k,vt),t[99]=O,t[100]=at,t[101]=k,t[102]=vt,t[103]=ht,t[104]=ot):ot=t[104];const pt=a?.xAxis?.axis,Wt=a?.yAxis?.labels;let b;t[105]!==pt||t[106]!==Wt?(b={axis:pt,label:Wt},t[105]=pt,t[106]=Wt,t[107]=b):b=t[107];const gt=f?.xAxis?.axis,de=f?.yAxis?.labels;let i;t[108]!==gt||t[109]!==de?(i={axis:gt,label:de},t[108]=gt,t[109]=de,t[110]=i):i=t[110],P=s.jsxRuntimeExports.jsx(ke.Axis,{y1:fe,y2:ce,x1:0-D,x2:m+d.right,label:ot,labelPos:{x:0-D,dx:0,dy:zt<0?"1em":-5,y:u(y<0?0:y)},classNames:b,styles:i}),G=ie?s.jsxRuntimeExports.jsx(Te.YTicksAndGridLines,{values:q.filter(Je),y:q.filter(We).map(l=>u(l)),x1:0-D,x2:m+d.right,styles:{gridLines:f?.yAxis?.gridLines,labels:f?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:vt,prefix:k,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:at}):null;const rt=0-D-15,xe=Rt/2,ge=f?.yAxis?.title,be=a?.yAxis?.title;t[111]!==$||t[112]!==rt||t[113]!==xe||t[114]!==ge||t[115]!==be?(v=s.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:rt,y:xe,style:ge,className:be,text:$,rotate90:!0}),t[111]=$,t[112]=rt,t[113]=xe,t[114]=ge,t[115]=be,t[116]=v):v=t[116],t[117]!==Z?(M=Z.filter(He).map(Ye),t[117]=Z,t[118]=M):M=t[118],N=Ce.AnimatePresence,U=me.map(l=>p.checkIfNullOrUndefined(R(l.id))?null:s.jsxRuntimeExports.jsxs(bt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:oe=>{le(l),Yt(oe.clientY),te(oe.clientX),xt?.(l)},onClick:()=>{(nt||st)&&(Ae.isEqual(tt,l)&&Bt?(ft(void 0),nt?.(void 0)):(ft(l),nt?.(l)))},onMouseMove:oe=>{le(l),Yt(oe.clientY),te(oe.clientX)},onMouseLeave:()=>{le(void 0),te(void 0),Yt(void 0),xt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:R(`${l.id}`),y:0,opacity:J.length!==0?J.indexOf(l.label)!==-1?.85:x:.85},whileInView:{x:R(`${l.id}`),y:0,opacity:J.length!==0?J.indexOf(l.label)!==-1?.85:x:.85,transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",children:[l.qualitativeRange?l.qualitativeRange.map((oe,he)=>s.jsxRuntimeExports.jsx(bt.motion.rect,{x:0,exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0),fill:Q[he]},whileInView:{height:Math.abs(u(pe.sum(l.qualitativeRange.filter((ye,ve)=>ve<=he&&ye)))-u(pe.sum(l.qualitativeRange.filter((ye,ve)=>ve<he&&ye)))),y:u(pe.sum(l.qualitativeRange.filter((ye,ve)=>ve<=he&&ye))),fill:Q[he],transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",width:R.bandwidth()},he)):null,l.target&&c==="background"?s.jsxRuntimeExports.jsx(bt.motion.rect,{x:0,width:R.bandwidth(),exit:{height:0,y:u(0),fill:S,transition:{duration:o.duration}},variants:{initial:{height:0,fill:S,y:u(0)},whileInView:{height:Math.abs(u(l.target)-u(0)),fill:S,y:l.target>0?u(l.target):u(0),transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial"}):null,l.size?s.jsxRuntimeExports.jsx(bt.motion.rect,{x:R.bandwidth()*((1-h)/2),width:R.bandwidth()*h,style:{fill:$t},exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.size)-u(0)),y:l.size>0?u(l.size):u(0),transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial"}):null,l.target&&c==="line"?s.jsxRuntimeExports.jsx(bt.motion.rect,{x:0,width:R.bandwidth(),exit:{y:u(0),opacity:0,fill:S,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:S},whileInView:{y:u(l.target)-_t/2,opacity:1,fill:S,transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",height:_t}):null,Dt?s.jsxRuntimeExports.jsx(qe.XAxesLabels,{value:`${l.label}`.length<Qt?`${l.label}`:`${`${l.label}`.substring(0,Qt)}...`,y:(l.size||0)<0?0:u(0)+5,x:0,width:R.bandwidth(),height:(l.size||0)<0?u(0)-5:d.bottom,style:f?.xAxis?.labels,className:a?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:o,isInView:V}):null,Kt?s.jsxRuntimeExports.jsx(bt.motion.text,{x:R.bandwidth()/2,style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!K&&$t.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",a?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:K||$t},whileInView:{y:u(l.size||0),opacity:1,fill:K||$t,transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",children:je.numberFormattingFunction(l.size,O,at,k,vt)}):null]},l.label)),B=wt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:wt.map((l,oe)=>s.jsxRuntimeExports.jsx(Ve.RefLineY,{text:l.text,color:l.color,y:u(l.value),x1:0-D,x2:m+d.right,classNames:l.classNames,styles:l.styles,animate:o,isInView:V},oe))}):null,t[27]=o,t[28]=$,t[29]=$t,t[30]=St,t[31]=a?.graphObjectValues,t[32]=a?.xAxis?.axis,t[33]=a?.xAxis?.labels,t[34]=a?.yAxis?.gridLines,t[35]=a?.yAxis?.labels,t[36]=a?.yAxis?.title,t[37]=Z,t[38]=n,t[39]=st,t[40]=x,t[41]=Rt,t[42]=m,t[43]=Jt,t[44]=J,t[45]=V,t[46]=T,t[47]=D,t[48]=d.bottom,t[49]=d.left,t[50]=d.right,t[51]=d.top,t[52]=Ut,t[53]=h,t[54]=jt,t[55]=tt,t[56]=O,t[57]=Mt,t[58]=nt,t[59]=xt,t[60]=at,t[61]=k,t[62]=Q,t[63]=wt,t[64]=Bt,t[65]=Dt,t[66]=ie,t[67]=Kt,t[68]=f?.graphObjectValues,t[69]=f?.xAxis?.axis,t[70]=f?.xAxis?.labels,t[71]=f?.yAxis?.gridLines,t[72]=f?.yAxis?.labels,t[73]=f?.yAxis?.title,t[74]=vt,t[75]=S,t[76]=_t,t[77]=c,t[78]=Qt,t[79]=K,t[80]=yt,t[81]=zt,t[82]=y,t[83]=N,t[84]=E,t[85]=U,t[86]=B,t[87]=I,t[88]=P,t[89]=G,t[90]=v,t[91]=M,t[92]=A,t[93]=z,t[94]=C,t[95]=w,t[96]=j}else N=t[83],E=t[84],U=t[85],B=t[86],I=t[87],P=t[88],G=t[89],v=t[90],M=t[91],A=t[92],z=t[93],C=t[94],w=t[95],j=t[96];let X;t[119]!==N||t[120]!==U||t[121]!==B?(X=s.jsxRuntimeExports.jsxs(N,{children:[U,B]}),t[119]=N,t[120]=U,t[121]=B,t[122]=X):X=t[122];let Y;t[123]!==Z?(Y=Z.filter(Xe).map(Ge),t[123]=Z,t[124]=Y):Y=t[124];let H;t[125]!==I||t[126]!==P||t[127]!==G||t[128]!==v||t[129]!==M||t[130]!==X||t[131]!==Y?(H=s.jsxRuntimeExports.jsxs("g",{transform:I,children:[P,G,v,M,X,Y]}),t[125]=I,t[126]=P,t[127]=G,t[128]=v,t[129]=M,t[130]=X,t[131]=Y,t[132]=H):H=t[132];let W;t[133]!==E||t[134]!==A||t[135]!==z||t[136]!==C||t[137]!==w||t[138]!==j||t[139]!==H?(W=s.jsxRuntimeExports.jsx(E,{width:A,height:z,viewBox:C,direction:w,ref:j,children:H}),t[133]=E,t[134]=A,t[135]=z,t[136]=C,t[137]=w,t[138]=j,t[139]=H,t[140]=W):W=t[140];let L;t[141]!==a?.tooltip||t[142]!==At||t[143]!==ee||t[144]!==_||t[145]!==f?.tooltip||t[146]!==ct?(L=_&&ct&&At&&ee?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:_,body:ct,xPos:At,yPos:ee,backgroundStyle:f?.tooltip,className:a?.tooltip}):null,t[141]=a?.tooltip,t[142]=At,t[143]=ee,t[144]=_,t[145]=f?.tooltip,t[146]=ct,t[147]=L):L=t[147];let lt;t[148]!==a?.modal||t[149]!==st||t[150]!==tt?(lt=st&&tt!==void 0?s.jsxRuntimeExports.jsx(Ne.DetailsModal,{body:st,data:tt,setData:ft,className:a?.modal}):null,t[148]=a?.modal,t[149]=st,t[150]=tt,t[151]=lt):lt=t[151];let it;return t[152]!==W||t[153]!==L||t[154]!==lt?(it=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[W,L,lt]}),t[152]=W,t[153]=L,t[154]=lt,t[155]=it):it=t[155],it}function Ge(e){return e.layer}function Xe(e){return e.position==="after"}function Ye(e){return e.layer}function He(e){return e.position==="before"}function We(e){return e!==0}function Je(e){return e!==0}function Ke(e){return`${e.id}`}function Qe(e){return e.target}function Ze(e){return!p.checkIfNullOrUndefined(e.target)}function _e(e){return e.target}function ti(e){return!p.checkIfNullOrUndefined(e.target)}function ei(e){return e.size}function ii(e){return!p.checkIfNullOrUndefined(e.size)}function ni(e){return e.size}function si(e){return!p.checkIfNullOrUndefined(e.size)}function ai(e){return pe.sum((e.qualitativeRange||[]).filter(li))||0}function li(e){return!p.checkIfNullOrUndefined(e)}function oi(e){return e.target}function ri(e){return!p.checkIfNullOrUndefined(e.size)}function ui(e){return e.target}function ci(e){return!p.checkIfNullOrUndefined(e.target)}function xi(e){return e.size}function mi(e){return!p.checkIfNullOrUndefined(e.size)}function fi(e){return e.size}function di(e){return!p.checkIfNullOrUndefined(e.size)}function hi(e){const t=s.compilerRuntimeExports.c(148),{data:n,topMargin:yt,bottomMargin:Jt,leftMargin:$t,rightMargin:vt,barColor:k,suffix:St,prefix:Dt,barPadding:Kt,showValues:ie,showTicks:Qt,truncateBy:ne,width:Ft,height:Zt,showLabels:re,tooltip:ct,onSeriesMouseOver:xt,refValues:wt,highlightedDataPoints:g,maxValue:mt,minValue:J,onSeriesMouseClick:nt,labelOrder:T,rtl:Ut,maxBarThickness:jt,minBarThickness:Bt,resetSelectionOnDoubleClick:st,detailsOnClick:$,barAxisTitle:K,valueColor:Mt,noOfTicks:f,styles:a,classNames:c,targetStyle:S,targetColor:Q,qualitativeRangeColors:h,measureBarWidthFactor:o,animate:x,dimmedOpacity:at,precision:Z,customLayers:O,naLabel:_t,targetLineThickness:D}=e,Pt=yt===void 0?25:yt,se=Jt===void 0?10:Jt,Gt=$t===void 0?100:$t,ue=vt===void 0?40:vt,ae=ut.useRef(null);let V;t[0]!==x.amount||t[1]!==x.once?(V={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=V):V=t[2];const F=ze.useInView(ae,V),[Xt,d]=ut.useState(void 0),[_,le]=ut.useState(void 0),[tt,ft]=ut.useState(void 0),[At,te]=ut.useState(void 0),ee=K?Pt+25:Pt;let Yt;t[3]!==se||t[4]!==Gt||t[5]!==ue||t[6]!==ee?(Yt={top:ee,bottom:se,left:Gt,right:ue},t[3]=se,t[4]=Gt,t[5]=ue,t[6]=ee,t[7]=Yt):Yt=t[7];const m=Yt,Rt=Ft-m.left-m.right,et=Zt-m.top-m.bottom;let kt;t[8]!==n?(kt=Math.max(...n.filter(Fi).map(Di))<0?0:Math.max(...n.filter(Si).map($i)),t[8]=n,t[9]=kt):kt=t[9];const Ot=kt;let Vt;t[10]!==n?(Vt=Math.max(...n.filter(Ti).map(qi))<0?0:Math.max(...n.filter(Li).map(Ci)),t[10]=n,t[11]=Vt):Vt=t[11];const Nt=Vt;let Et;t[12]!==n?(Et=Math.max(...n.map(Ii)),t[12]=n,t[13]=Et):Et=t[13];const It=Et;let zt;t[14]!==Ot||t[15]!==mt||t[16]!==It||t[17]!==Nt?(zt=p.checkIfNullOrUndefined(mt)?Math.max(...[Ot,Nt,It].filter(Number.isFinite))<0?0:Math.max(...[Ot,Nt,It].filter(Number.isFinite)):mt,t[14]=Ot,t[15]=mt,t[16]=It,t[17]=Nt,t[18]=zt):zt=t[18];const Ht=zt;let Ct;t[19]!==n?(Ct=Math.min(...n.filter(Ei).map(Ni))>=0?0:Math.min(...n.filter(Vi).map(Oi)),t[19]=n,t[20]=Ct):Ct=t[20];const Lt=Ct;let dt;t[21]!==n?(dt=Math.min(...n.filter(ki).map(Ri))>=0?0:Math.min(...n.filter(Ai).map(Mi)),t[21]=n,t[22]=dt):dt=t[22];const qt=dt;let y;t[23]!==Lt||t[24]!==J||t[25]!==qt?(y=p.checkIfNullOrUndefined(J)?Math.min(...[Lt,qt].filter(Number.isFinite))>=0?0:Math.min(...[Lt,qt].filter(Number.isFinite)):J,t[23]=Lt,t[24]=J,t[25]=qt,t[26]=y):y=t[26];const N=y;let E,U,B,I,P,G,v,M,A,z,C,w,j,X;if(t[27]!==x||t[28]!==K||t[29]!==k||t[30]!==Kt||t[31]!==c?.graphObjectValues||t[32]!==c?.xAxis?.gridLines||t[33]!==c?.xAxis?.labels||t[34]!==c?.xAxis?.title||t[35]!==c?.yAxis?.axis||t[36]!==c?.yAxis?.labels||t[37]!==O||t[38]!==n||t[39]!==$||t[40]!==at||t[41]!==et||t[42]!==Rt||t[43]!==Zt||t[44]!==g||t[45]!==F||t[46]!==T||t[47]!==m.bottom||t[48]!==m.left||t[49]!==m.top||t[50]!==jt||t[51]!==o||t[52]!==Bt||t[53]!==_||t[54]!==_t||t[55]!==f||t[56]!==nt||t[57]!==xt||t[58]!==Z||t[59]!==Dt||t[60]!==h||t[61]!==wt||t[62]!==st||t[63]!==Ut||t[64]!==re||t[65]!==Qt||t[66]!==ie||t[67]!==a?.graphObjectValues||t[68]!==a?.xAxis?.gridLines||t[69]!==a?.xAxis?.labels||t[70]!==a?.xAxis?.title||t[71]!==a?.yAxis?.axis||t[72]!==a?.yAxis?.labels||t[73]!==St||t[74]!==Q||t[75]!==D||t[76]!==S||t[77]!==Pt||t[78]!==ne||t[79]!==Mt||t[80]!==Ft||t[81]!==Ht||t[82]!==N){let Tt;t[97]!==T?(Tt=(i,rt)=>({...i,id:T?`${i.label}`:`${rt}`}),t[97]=T,t[98]=Tt):Tt=t[98];const me=n.map(Tt),r=Ee.linear().domain([N,Ht]).range([0,Rt]).nice(),R=T||me.map(ji),q=Ie.band().domain(R).range([0,Bt?Math.max(et,Bt*R.length):jt?Math.min(et,jt*R.length):et]).paddingInner(Kt),fe=r.ticks(f);U=bt.motion.svg,z=`${Ft}px`,C=`${Zt}px`,w=`0 0 ${Ft} ${Zt}`,j="ltr",X=ae,P=`translate(${m.left},${m.top})`,G=Qt?s.jsxRuntimeExports.jsx($e.XTicksAndGridLines,{values:fe.filter(wi),x:fe.filter(vi).map(i=>r(i)),y1:0-Pt,y2:et+m.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},suffix:St,prefix:Dt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const ce=Rt/2,ht=0-m.top+15,ot=a?.xAxis?.title,pt=c?.xAxis?.title;t[99]!==K||t[100]!==ce||t[101]!==ht||t[102]!==ot||t[103]!==pt?(v=s.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:ce,y:ht,style:ot,className:pt,text:K}),t[99]=K,t[100]=ce,t[101]=ht,t[102]=ot,t[103]=pt,t[104]=v):v=t[104];const Wt=c?.yAxis?.axis;let b;t[105]!==Wt?(b={axis:Wt},t[105]=Wt,t[106]=b):b=t[106];const gt=a?.yAxis?.axis;let de;t[107]!==gt?(de={axis:gt},t[107]=gt,t[108]=de):de=t[108],M=s.jsxRuntimeExports.jsx(ke.Axis,{x1:r(N<0?0:N),x2:r(N<0?0:N),y1:-2.5,y2:et+m.bottom,classNames:b,styles:de}),t[109]!==O?(A=O.filter(yi).map(bi),t[109]=O,t[110]=A):A=t[110],E=Ce.AnimatePresence,B=me.map(i=>p.checkIfNullOrUndefined(q(i.id))?null:s.jsxRuntimeExports.jsxs(bt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:rt=>{d(i),te(rt.clientY),ft(rt.clientX),xt?.(i)},onClick:()=>{(nt||$)&&(Ae.isEqual(_,i)&&st?(le(void 0),nt?.(void 0)):(le(i),nt?.(i)))},onMouseMove:rt=>{d(i),te(rt.clientY),ft(rt.clientX)},onMouseLeave:()=>{d(void 0),ft(void 0),te(void 0),xt?.(void 0)},exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:0,y:q(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:at:.85},whileInView:{x:0,y:q(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:at:.85,transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:[i.qualitativeRange?i.qualitativeRange.map((rt,xe)=>s.jsxRuntimeExports.jsx(bt.motion.rect,{exit:{width:0,x:r(0),transition:{duration:x.duration}},variants:{initial:{x:r(0),width:0,fill:h[xe]},whileInView:{x:r(xe===0?0:pe.sum(i.qualitativeRange.filter((ge,be)=>be<xe&&ge))),width:r(rt),fill:h[xe],transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial",y:0,height:q.bandwidth()},xe)):null,i.target&&S==="background"?s.jsxRuntimeExports.jsx(bt.motion.rect,{y:0,x:i.target>=0?r(0):r(i.target),height:q.bandwidth(),exit:{width:0,x:r(0),fill:Q,transition:{duration:x.duration}},variants:{initial:{x:r(0),fill:Q,width:0},whileInView:{x:i.target>=0?r(0):r(i.target),fill:Q,width:i.target>=0?r(i.target)-r(0):r(0)-r(i.target),transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.size?s.jsxRuntimeExports.jsx(bt.motion.rect,{y:q.bandwidth()*((1-o)/2),style:{fill:k},height:q.bandwidth()*o,exit:{width:0,x:r(0),transition:{duration:x.duration}},variants:{initial:{x:r(0),width:0},whileInView:{x:i.size>=0?r(0):r(i.size),width:i.size>=0?r(i.size)-r(0):r(0)-r(i.size),transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.target&&S==="line"?s.jsxRuntimeExports.jsx(bt.motion.rect,{y:0,height:q.bandwidth(),width:D,exit:{opacity:0,x:r(0),fill:Q,transition:{duration:x.duration}},variants:{initial:{x:r(0),opacity:0,fill:Q},whileInView:{x:r(i.target)-D/2,opacity:1,fill:Q,transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,re?s.jsxRuntimeExports.jsx(Se.YAxesLabels,{value:`${i.label}`.length<ne?`${i.label}`:`${`${i.label}`.substring(0,ne)}...`,y:0,x:(i.size||0)<0?r(0):0-m.left,width:(i.size||0)<0?Ft-r(0):r(0)+m.left,height:q.bandwidth(),alignment:i.size&&i.size<0?"left":"right",style:a?.yAxis?.labels,className:c?.yAxis?.labels,animate:x,isInView:F}):null,ie?s.jsxRuntimeExports.jsx(bt.motion.text,{y:q.bandwidth()/2,style:{textAnchor:i.size&&i.size<0?"end":"start",...a?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!Mt&&k.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",c?.graphObjectValues),dx:i.size&&i.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:r(0),opacity:0,fill:Mt||k},whileInView:{x:i.size?r(i.size):r(0),opacity:1,fill:Mt||k,transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:je.numberFormattingFunction(i.size,_t,Z,Dt,St)}):null]},i.label)),I=wt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:wt.map((i,rt)=>s.jsxRuntimeExports.jsx(Ve.RefLineX,{text:i.text,color:i.color,x:r(i.value),y1:0-m.top,y2:et+m.bottom,textSide:r(i.value)>Rt*.75||Ut?"left":"right",classNames:i.classNames,styles:i.styles,animate:x,isInView:F},rt))}):null,t[27]=x,t[28]=K,t[29]=k,t[30]=Kt,t[31]=c?.graphObjectValues,t[32]=c?.xAxis?.gridLines,t[33]=c?.xAxis?.labels,t[34]=c?.xAxis?.title,t[35]=c?.yAxis?.axis,t[36]=c?.yAxis?.labels,t[37]=O,t[38]=n,t[39]=$,t[40]=at,t[41]=et,t[42]=Rt,t[43]=Zt,t[44]=g,t[45]=F,t[46]=T,t[47]=m.bottom,t[48]=m.left,t[49]=m.top,t[50]=jt,t[51]=o,t[52]=Bt,t[53]=_,t[54]=_t,t[55]=f,t[56]=nt,t[57]=xt,t[58]=Z,t[59]=Dt,t[60]=h,t[61]=wt,t[62]=st,t[63]=Ut,t[64]=re,t[65]=Qt,t[66]=ie,t[67]=a?.graphObjectValues,t[68]=a?.xAxis?.gridLines,t[69]=a?.xAxis?.labels,t[70]=a?.xAxis?.title,t[71]=a?.yAxis?.axis,t[72]=a?.yAxis?.labels,t[73]=St,t[74]=Q,t[75]=D,t[76]=S,t[77]=Pt,t[78]=ne,t[79]=Mt,t[80]=Ft,t[81]=Ht,t[82]=N,t[83]=E,t[84]=U,t[85]=B,t[86]=I,t[87]=P,t[88]=G,t[89]=v,t[90]=M,t[91]=A,t[92]=z,t[93]=C,t[94]=w,t[95]=j,t[96]=X}else E=t[83],U=t[84],B=t[85],I=t[86],P=t[87],G=t[88],v=t[89],M=t[90],A=t[91],z=t[92],C=t[93],w=t[94],j=t[95],X=t[96];let Y;t[111]!==E||t[112]!==B||t[113]!==I?(Y=s.jsxRuntimeExports.jsxs(E,{children:[B,I]}),t[111]=E,t[112]=B,t[113]=I,t[114]=Y):Y=t[114];let H;t[115]!==O?(H=O.filter(gi).map(pi),t[115]=O,t[116]=H):H=t[116];let W;t[117]!==P||t[118]!==G||t[119]!==v||t[120]!==M||t[121]!==A||t[122]!==Y||t[123]!==H?(W=s.jsxRuntimeExports.jsxs("g",{transform:P,children:[G,v,M,A,Y,H]}),t[117]=P,t[118]=G,t[119]=v,t[120]=M,t[121]=A,t[122]=Y,t[123]=H,t[124]=W):W=t[124];let L;t[125]!==U||t[126]!==z||t[127]!==C||t[128]!==w||t[129]!==j||t[130]!==X||t[131]!==W?(L=s.jsxRuntimeExports.jsx(U,{width:z,height:C,viewBox:w,direction:j,ref:X,children:W}),t[125]=U,t[126]=z,t[127]=C,t[128]=w,t[129]=j,t[130]=X,t[131]=W,t[132]=L):L=t[132];let lt;t[133]!==c?.tooltip||t[134]!==tt||t[135]!==At||t[136]!==Xt||t[137]!==a?.tooltip||t[138]!==ct?(lt=Xt&&ct&&tt&&At?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:Xt,body:ct,xPos:tt,yPos:At,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[133]=c?.tooltip,t[134]=tt,t[135]=At,t[136]=Xt,t[137]=a?.tooltip,t[138]=ct,t[139]=lt):lt=t[139];let it;t[140]!==c?.modal||t[141]!==$||t[142]!==_?(it=$&&_!==void 0?s.jsxRuntimeExports.jsx(Ne.DetailsModal,{body:$,data:_,setData:le,className:c?.modal}):null,t[140]=c?.modal,t[141]=$,t[142]=_,t[143]=it):it=t[143];let u;return t[144]!==L||t[145]!==lt||t[146]!==it?(u=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[L,lt,it]}),t[144]=L,t[145]=lt,t[146]=it,t[147]=u):u=t[147],u}function pi(e){return e.layer}function gi(e){return e.position==="after"}function bi(e){return e.layer}function yi(e){return e.position==="before"}function vi(e){return e!==0}function wi(e){return e!==0}function ji(e){return`${e.id}`}function Mi(e){return e.target}function Ai(e){return!p.checkIfNullOrUndefined(e.target)}function Ri(e){return e.target}function ki(e){return!p.checkIfNullOrUndefined(e.target)}function Oi(e){return e.size}function Vi(e){return!p.checkIfNullOrUndefined(e.size)}function Ni(e){return e.size}function Ei(e){return!p.checkIfNullOrUndefined(e.size)}function Ii(e){return pe.sum((e.qualitativeRange||[]).filter(zi))||0}function zi(e){return!p.checkIfNullOrUndefined(e)}function Ci(e){return e.target}function Li(e){return!p.checkIfNullOrUndefined(e.target)}function qi(e){return e.target}function Ti(e){return!p.checkIfNullOrUndefined(e.target)}function $i(e){return e.size}function Si(e){return!p.checkIfNullOrUndefined(e.size)}function Di(e){return e.size}function Fi(e){return!p.checkIfNullOrUndefined(e.size)}function Ui(e){const t=s.compilerRuntimeExports.c(95),{data:n,graphTitle:yt,barColor:Jt,barPadding:$t,showTicks:vt,leftMargin:k,rightMargin:St,topMargin:Dt,bottomMargin:Kt,truncateBy:ie,showLabels:Qt,showValues:ne,backgroundColor:Ft,suffix:Zt,prefix:re,sources:ct,graphDescription:xt,height:wt,width:g,footNote:mt,colorDomain:J,colorLegendTitle:nt,padding:T,relativeHeight:Ut,tooltip:jt,onSeriesMouseOver:Bt,refValues:st,showColorScale:$,graphID:K,maxValue:Mt,minValue:f,highlightedDataPoints:a,onSeriesMouseClick:c,valueColor:S,orientation:Q,styles:h,classNames:o,qualitativeRangeColors:x,targetColor:at,filterNA:Z,targetStyle:O,measureBarWidthFactor:_t,animate:D,dimmedOpacity:Pt,precision:se,customLayers:Gt,naLabel:ue,graphDownload:ae,dataDownload:V,language:F,theme:Xt,sortData:d,labelOrder:_,minHeight:le,maxBarThickness:tt,maxNumberOfBars:ft,minBarThickness:At,ariaLabel:te,resetSelectionOnDoubleClick:ee,detailsOnClick:Yt,barAxisTitle:m,noOfTicks:Rt,targetLineThickness:et}=e,kt=Jt===void 0?we.Colors.primaryColors["blue-600"]:Jt,Ot=$t===void 0?.25:$t,Vt=vt===void 0?!0:vt,Nt=ie===void 0?999:ie,Et=Qt===void 0?!0:Qt,It=ne===void 0?!0:ne,zt=Ft===void 0?!1:Ft,Ht=Zt===void 0?"":Zt,Ct=re===void 0?"":re,Lt=$===void 0?!0:$;let dt;t[0]!==a?(dt=a===void 0?[]:a,t[0]=a,t[1]=dt):dt=t[1];const qt=dt,y=Q===void 0?"vertical":Q,N=at===void 0?we.Colors.light.grays["gray-700"]:at,E=Z===void 0?!0:Z,U=O===void 0?"line":O,B=_t===void 0?.4:_t,I=D===void 0?!1:D,P=Pt===void 0?.3:Pt,G=se===void 0?2:se;let v;t[2]!==Gt?(v=Gt===void 0?[]:Gt,t[2]=Gt,t[3]=v):v=t[3];const M=v,A=ue===void 0?"NA":ue,z=ae===void 0?!1:ae,C=V===void 0?!1:V,w=F===void 0?"en":F,j=Xt===void 0?"light":Xt,X=le===void 0?0:le,Y=ee===void 0?!0:ee,H=Rt===void 0?5:Rt,W=et===void 0?2:et,[L,lt]=ut.useState(0),[it,u]=ut.useState(0),Tt=ut.useRef(null),me=ut.useRef(null),r=y==="horizontal"?hi:Pe;let R,q;t[4]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{const b=new ResizeObserver(gt=>{lt(gt[0].target.clientWidth||620),u(gt[0].target.clientHeight||480)});return Tt.current&&b.observe(Tt.current),()=>b.disconnect()},q=[],t[4]=R,t[5]=q):(R=t[4],q=t[5]),ut.useEffect(R,q);const fe=o?.graphContainer,ce=h?.graphContainer;let ht;t[6]!==o?.description||t[7]!==o?.title||t[8]!==n||t[9]!==C||t[10]!==xt||t[11]!==z||t[12]!==yt||t[13]!==h?.description||t[14]!==h?.title||t[15]!==g?(ht=yt||xt||z||C?s.jsxRuntimeExports.jsx(Ue.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:o?.title,description:o?.description},graphTitle:yt,graphDescription:xt,width:g,graphDownload:z?me:void 0,dataDownload:C?n.map(Hi).filter(Yi).length>0?n.map(Xi).filter(Gi):n.filter(Pi):null}):null,t[6]=o?.description,t[7]=o?.title,t[8]=n,t[9]=C,t[10]=xt,t[11]=z,t[12]=yt,t[13]=h?.description,t[14]=h?.title,t[15]=g,t[16]=ht):ht=t[16];let ot;t[17]!==r||t[18]!==I||t[19]!==m||t[20]!==kt||t[21]!==Ot||t[22]!==Kt||t[23]!==o||t[24]!==J||t[25]!==nt||t[26]!==M||t[27]!==n||t[28]!==Yt||t[29]!==P||t[30]!==E||t[31]!==qt||t[32]!==_||t[33]!==w||t[34]!==k||t[35]!==tt||t[36]!==ft||t[37]!==Mt||t[38]!==B||t[39]!==At||t[40]!==f||t[41]!==A||t[42]!==H||t[43]!==c||t[44]!==Bt||t[45]!==y||t[46]!==G||t[47]!==Ct||t[48]!==x||t[49]!==st||t[50]!==Y||t[51]!==St||t[52]!==Lt||t[53]!==Et||t[54]!==Vt||t[55]!==It||t[56]!==d||t[57]!==h||t[58]!==Ht||t[59]!==it||t[60]!==L||t[61]!==N||t[62]!==W||t[63]!==U||t[64]!==j||t[65]!==jt||t[66]!==Dt||t[67]!==Nt||t[68]!==S||t[69]!==g?(ot=n.length===0?s.jsxRuntimeExports.jsx(De.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Lt&&n.filter(Bi).length!==0&&J?s.jsxRuntimeExports.jsx(Be.ColorLegend,{width:g,colorLegendTitle:nt,colors:x||we.Colors[j].sequentialColors.positiveColorsx10,colorDomain:J,showNAColor:!1,className:o?.colorLegend}):null,s.jsxRuntimeExports.jsx(Me.GraphArea,{ref:Tt,children:L&&it?s.jsxRuntimeExports.jsx(r,{data:d?Le.orderBy(n.filter(b=>E?!p.checkIfNullOrUndefined(b.size):b),[b=>b.size===void 0?d==="asc"?(y==="horizontal"?1:-1)*(1/0):(y==="horizontal"?-1:1)*(1/0):b.size],[d]).filter((b,gt)=>ft?gt<ft:!0):n.filter(b=>E?!p.checkIfNullOrUndefined(b.size):b).filter((b,gt)=>ft?gt<ft:!0),barColor:kt,targetColor:N,width:L,refValues:st,height:it,suffix:Ht,prefix:Ct,barPadding:Ot,showLabels:Et,showValues:It,showTicks:Vt,truncateBy:Nt,leftMargin:k,rightMargin:St,qualitativeRangeColors:x||we.Colors[j].sequentialColors.positiveColorsx10,topMargin:Dt,bottomMargin:Kt,tooltip:jt,onSeriesMouseOver:Bt,maxValue:Mt,minValue:f,highlightedDataPoints:qt,onSeriesMouseClick:c,labelOrder:_,maxBarThickness:tt,minBarThickness:At,resetSelectionOnDoubleClick:Y,detailsOnClick:Yt,barAxisTitle:m,noOfTicks:H,valueColor:S,styles:h,classNames:o,targetStyle:U,dimmedOpacity:P,measureBarWidthFactor:B,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},precision:G,customLayers:M,naLabel:A,targetLineThickness:W,rtl:w==="ar"||w==="he"}):null})]}),t[17]=r,t[18]=I,t[19]=m,t[20]=kt,t[21]=Ot,t[22]=Kt,t[23]=o,t[24]=J,t[25]=nt,t[26]=M,t[27]=n,t[28]=Yt,t[29]=P,t[30]=E,t[31]=qt,t[32]=_,t[33]=w,t[34]=k,t[35]=tt,t[36]=ft,t[37]=Mt,t[38]=B,t[39]=At,t[40]=f,t[41]=A,t[42]=H,t[43]=c,t[44]=Bt,t[45]=y,t[46]=G,t[47]=Ct,t[48]=x,t[49]=st,t[50]=Y,t[51]=St,t[52]=Lt,t[53]=Et,t[54]=Vt,t[55]=It,t[56]=d,t[57]=h,t[58]=Ht,t[59]=it,t[60]=L,t[61]=N,t[62]=W,t[63]=U,t[64]=j,t[65]=jt,t[66]=Dt,t[67]=Nt,t[68]=S,t[69]=g,t[70]=ot):ot=t[70];let pt;t[71]!==o?.footnote||t[72]!==o?.source||t[73]!==mt||t[74]!==ct||t[75]!==h?.footnote||t[76]!==h?.source||t[77]!==g?(pt=ct||mt?s.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:ct,footNote:mt,width:g}):null,t[71]=o?.footnote,t[72]=o?.source,t[73]=mt,t[74]=ct,t[75]=h?.footnote,t[76]=h?.source,t[77]=g,t[78]=pt):pt=t[78];let Wt;return t[79]!==te||t[80]!==zt||t[81]!==K||t[82]!==wt||t[83]!==w||t[84]!==X||t[85]!==T||t[86]!==Ut||t[87]!==fe||t[88]!==ce||t[89]!==ht||t[90]!==ot||t[91]!==pt||t[92]!==j||t[93]!==g?(Wt=s.jsxRuntimeExports.jsxs(Me.GraphContainer,{className:fe,style:ce,id:K,ref:me,"aria-label":te,backgroundColor:zt,theme:j,language:w,minHeight:X,width:g,height:wt,relativeHeight:Ut,padding:T,children:[ht,ot,pt]}),t[79]=te,t[80]=zt,t[81]=K,t[82]=wt,t[83]=w,t[84]=X,t[85]=T,t[86]=Ut,t[87]=fe,t[88]=ce,t[89]=ht,t[90]=ot,t[91]=pt,t[92]=j,t[93]=g,t[94]=Wt):Wt=t[94],Wt}function Bi(e){return e.qualitativeRange}function Pi(e){return e!==void 0}function Gi(e){return e!==void 0}function Xi(e){return e.data}function Yi(e){return e!==void 0}function Hi(e){return e.data}exports.BulletChart=Ui;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-CTPQjnHt.cjs"),ft=require("react"),qe=require("./index-Cno4Q0YE.cjs"),Re=require("./index-DQA8q5sC.cjs"),ge=require("./index-CSNtgibC.cjs"),Me=require("./numberFormattingFunction-02t-wJta.cjs"),ke=require("./Tooltip-uUdw6wJL.cjs"),p=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Oe=require("./Axis-DxRV2yMi.cjs"),Ve=require("./AxisTitle-sS5bLLR7.cjs"),Te=require("./XAxesLabels-Bt5NZBmX.cjs"),Ie=require("./ReferenceLine-BH0qdf4R.cjs"),$e=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Se=require("./XTicksAndGridLines-B6CELS7q.cjs"),De=require("./YAxesLabels-DesLesUP.cjs"),Ne=require("./DetailsModal-BN0HDFlV.cjs"),Ee=require("./linear-BwPAspcq.cjs"),ze=require("./band-VYfcZeJ2.cjs"),Ce=require("./use-in-view-QcfiW0w3.cjs"),wt=require("./proxy-BxvUI_9l.cjs"),Le=require("./index-DG2bgAva.cjs"),je=require("./Colors.cjs"),Fe=require("./EmptyState-sAEZ_5rU.cjs"),Ae=require("./GraphContainer-d8A46BK2.cjs"),Ue=require("./GraphFooter.cjs"),Be=require("./GraphHeader.cjs"),Pe=require("./ColorLegend.cjs");function Ge(e){const t=a.compilerRuntimeExports.c(160),{data:s,width:jt,height:Zt,barColor:Ft,suffix:Mt,prefix:O,barPadding:Ut,showLabels:Bt,showValues:_t,showTicks:ae,truncateBy:te,leftMargin:le,rightMargin:Pt,topMargin:ee,bottomMargin:ce,tooltip:ht,onSeriesMouseOver:pt,refValues:At,maxValue:g,minValue:gt,highlightedDataPoints:J,onSeriesMouseClick:lt,labelOrder:j,maxBarThickness:Gt,minBarThickness:Rt,resetSelectionOnDoubleClick:Wt,detailsOnClick:ot,barAxisTitle:q,valueColor:K,noOfTicks:kt,styles:d,classNames:l,targetStyle:c,targetColor:T,qualitativeRangeColors:Q,measureBarWidthFactor:h,animate:o,dimmedOpacity:x,precision:rt,customLayers:Z,naLabel:V,targetLineThickness:ie}=e,$=le===void 0?20:le,Xt=Pt===void 0?20:Pt,oe=ee===void 0?20:ee,Yt=ce===void 0?25:ce,xe=ft.useRef(null);let re;t[0]!==o.amount||t[1]!==o.once?(re={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=re):re=t[2];const I=Ce.useInView(xe,re),S=q?$+30:$;let Ht;t[3]!==Yt||t[4]!==Xt||t[5]!==S||t[6]!==oe?(Ht={top:oe,bottom:Yt,left:S,right:Xt},t[3]=Yt,t[4]=Xt,t[5]=S,t[6]=oe,t[7]=Ht):Ht=t[7];const f=Ht,[_,ue]=ft.useState(void 0),[tt,bt]=ft.useState(void 0),[Ot,ne]=ft.useState(void 0),[se,Jt]=ft.useState(void 0),m=jt-f.left-f.right,Vt=Zt-f.top-f.bottom;let et;t[8]!==s?(et=Math.max(...s.filter(pi).map(hi))<0?0:Math.max(...s.filter(fi).map(di)),t[8]=s,t[9]=et):et=t[9];const It=et;let Nt;t[10]!==s?(Nt=Math.max(...s.filter(mi).map(xi))<0?0:Math.max(...s.filter(ci).map(ui)),t[10]=s,t[11]=Nt):Nt=t[11];const Et=Nt;let zt;t[12]!==s?(zt=Math.max(...s.map(oi)),t[12]=s,t[13]=zt):zt=t[13];const Ct=zt;let Lt;t[14]!==It||t[15]!==g||t[16]!==Ct||t[17]!==Et?(Lt=p.checkIfNullOrUndefined(g)?Math.max(...[It,Et,Ct].filter(Number.isFinite))<0?0:Math.max(...[It,Et,Ct].filter(Number.isFinite)):g,t[14]=It,t[15]=g,t[16]=Ct,t[17]=Et,t[18]=Lt):Lt=t[18];const qt=Lt;let Kt;t[19]!==s?(Kt=Math.min(...s.filter(li).map(ai))>=0?0:Math.min(...s.filter(si).map(ni)),t[19]=s,t[20]=Kt):Kt=t[20];const Tt=Kt;let $t;t[21]!==s?($t=Math.min(...s.filter(ii).map(ei))>=0?0:Math.min(...s.filter(ti).map(_e)),t[21]=s,t[22]=$t):$t=t[22];const yt=$t;let St;t[23]!==Tt||t[24]!==gt||t[25]!==yt?(St=p.checkIfNullOrUndefined(gt)?Math.min(...[Tt,yt].filter(Number.isFinite))>=0?0:Math.min(...[Tt,yt].filter(Number.isFinite)):gt,t[23]=Tt,t[24]=gt,t[25]=yt,t[26]=St):St=t[26];const v=St;let it;if(t[27]!==s||t[28]!==j){const u=new Set,n=s.map((dt,R)=>{const k=j?`${dt.label}`:`${R}`;return u.add(k),{...dt,id:k}}),M=j?j.filter(dt=>!u.has(dt)):[];it=[...n,...M.map(Ze)],t[27]=s,t[28]=j,t[29]=it}else it=t[29];const nt=it;let ut;t[30]!==nt||t[31]!==j?(ut=j??nt.map(Qe),t[30]=nt,t[31]=j,t[32]=ut):ut=t[32];const vt=ut;let D,F,U,N,B,P,E,w,b,y,G,W,X,Y;if(t[33]!==o||t[34]!==q||t[35]!==Ft||t[36]!==vt||t[37]!==Ut||t[38]!==l?.graphObjectValues||t[39]!==l?.xAxis?.axis||t[40]!==l?.xAxis?.labels||t[41]!==l?.yAxis?.gridLines||t[42]!==l?.yAxis?.labels||t[43]!==l?.yAxis?.title||t[44]!==Z||t[45]!==nt||t[46]!==ot||t[47]!==x||t[48]!==Vt||t[49]!==m||t[50]!==Zt||t[51]!==J||t[52]!==I||t[53]!==$||t[54]!==f.bottom||t[55]!==f.left||t[56]!==f.right||t[57]!==f.top||t[58]!==Gt||t[59]!==h||t[60]!==Rt||t[61]!==tt||t[62]!==V||t[63]!==kt||t[64]!==lt||t[65]!==pt||t[66]!==rt||t[67]!==O||t[68]!==Q||t[69]!==At||t[70]!==Wt||t[71]!==Bt||t[72]!==ae||t[73]!==_t||t[74]!==d?.graphObjectValues||t[75]!==d?.xAxis?.axis||t[76]!==d?.xAxis?.labels||t[77]!==d?.yAxis?.gridLines||t[78]!==d?.yAxis?.labels||t[79]!==d?.yAxis?.title||t[80]!==Mt||t[81]!==T||t[82]!==ie||t[83]!==c||t[84]!==te||t[85]!==K||t[86]!==jt||t[87]!==qt||t[88]!==v){const u=Ee.linear().domain([v,qt]).range([Vt,0]).nice(),n=ze.band().domain(vt).range([0,Rt?Math.max(m,Rt*vt.length):Gt?Math.min(m,Gt*vt.length):m]).paddingInner(Ut),M=u.ticks(kt);F=wt.motion.svg,y=`${jt}px`,G=`${Zt}px`,W=`0 0 ${jt} ${Zt}`,X="ltr",Y=xe,B=`translate(${f.left},${f.top})`;const dt=u(v<0?0:v),R=u(v<0?0:v),k=v<0?0:v;let L;t[103]!==V||t[104]!==rt||t[105]!==O||t[106]!==Mt||t[107]!==k?(L=Me.numberFormattingFunction(k,V,rt,O,Mt),t[103]=V,t[104]=rt,t[105]=O,t[106]=Mt,t[107]=k,t[108]=L):L=t[108];const Qt=l?.xAxis?.axis,A=l?.yAxis?.labels;let at;t[109]!==Qt||t[110]!==A?(at={axis:Qt,label:A},t[109]=Qt,t[110]=A,t[111]=at):at=t[111];const he=d?.xAxis?.axis,de=d?.yAxis?.labels;let i;t[112]!==he||t[113]!==de?(i={axis:he,label:de},t[112]=he,t[113]=de,t[114]=i):i=t[114],P=a.jsxRuntimeExports.jsx(Oe.Axis,{y1:dt,y2:R,x1:0-$,x2:m+f.right,label:L,labelPos:{x:0-$,dx:0,dy:qt<0?"1em":-5,y:u(v<0?0:v)},classNames:at,styles:i}),E=ae?a.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:M.filter(Ke),y:M.filter(Je).map(r=>u(r)),x1:0-$,x2:m+f.right,styles:{gridLines:d?.yAxis?.gridLines,labels:d?.yAxis?.labels},classNames:{gridLines:l?.yAxis?.gridLines,labels:l?.yAxis?.labels},suffix:Mt,prefix:O,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:rt}):null;const Dt=0-$-15,me=Vt/2,be=d?.yAxis?.title,ye=l?.yAxis?.title;t[115]!==q||t[116]!==Dt||t[117]!==me||t[118]!==be||t[119]!==ye?(w=a.jsxRuntimeExports.jsx(Ve.AxisTitle,{x:Dt,y:me,style:be,className:ye,text:q,rotate90:!0}),t[115]=q,t[116]=Dt,t[117]=me,t[118]=be,t[119]=ye,t[120]=w):w=t[120],t[121]!==Z?(b=Z.filter(He).map(Ye),t[121]=Z,t[122]=b):b=t[122],D=Le.AnimatePresence,U=nt.map(r=>p.checkIfNullOrUndefined(n(r.id))?null:a.jsxRuntimeExports.jsxs(wt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:fe=>{ue(r),Jt(fe.clientY),ne(fe.clientX),pt?.(r)},onClick:()=>{(lt||ot)&&(Re.isEqual(tt,r)&&Wt?(bt(void 0),lt?.(void 0)):(bt(r),lt?.(r)))},onMouseMove:fe=>{ue(r),Jt(fe.clientY),ne(fe.clientX)},onMouseLeave:()=>{ue(void 0),ne(void 0),Jt(void 0),pt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:n(`${r.id}`),y:0,opacity:J.length!==0?J.indexOf(r.label)!==-1?.85:x:.85},whileInView:{x:n(`${r.id}`),y:0,opacity:J.length!==0?J.indexOf(r.label)!==-1?.85:x:.85,transition:{duration:o.duration}}},initial:"initial",animate:I?"whileInView":"initial",children:[r.qualitativeRange?r.qualitativeRange.map((fe,pe)=>a.jsxRuntimeExports.jsx(wt.motion.rect,{x:0,exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0),fill:Q[pe]},whileInView:{height:Math.abs(u(ge.sum(r.qualitativeRange.filter((ve,we)=>we<=pe&&ve)))-u(ge.sum(r.qualitativeRange.filter((ve,we)=>we<pe&&ve)))),y:u(ge.sum(r.qualitativeRange.filter((ve,we)=>we<=pe&&ve))),fill:Q[pe],transition:{duration:o.duration}}},initial:"initial",animate:I?"whileInView":"initial",width:n.bandwidth()},pe)):null,r.target&&c==="background"?a.jsxRuntimeExports.jsx(wt.motion.rect,{x:0,width:n.bandwidth(),exit:{height:0,y:u(0),fill:T,transition:{duration:o.duration}},variants:{initial:{height:0,fill:T,y:u(0)},whileInView:{height:Math.abs(u(r.target)-u(0)),fill:T,y:r.target>0?u(r.target):u(0),transition:{duration:o.duration}}},initial:"initial",animate:I?"whileInView":"initial"}):null,r.size?a.jsxRuntimeExports.jsx(wt.motion.rect,{x:n.bandwidth()*((1-h)/2),width:n.bandwidth()*h,style:{fill:Ft},exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(r.size)-u(0)),y:r.size>0?u(r.size):u(0),transition:{duration:o.duration}}},initial:"initial",animate:I?"whileInView":"initial"}):null,r.target&&c==="line"?a.jsxRuntimeExports.jsx(wt.motion.rect,{x:0,width:n.bandwidth(),exit:{y:u(0),opacity:0,fill:T,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:T},whileInView:{y:u(r.target)-ie/2,opacity:1,fill:T,transition:{duration:o.duration}}},initial:"initial",animate:I?"whileInView":"initial",height:ie}):null,Bt?a.jsxRuntimeExports.jsx(Te.XAxesLabels,{value:`${r.label}`.length<te?`${r.label}`:`${`${r.label}`.substring(0,te)}...`,y:(r.size||0)<0?0:u(0)+5,x:0,width:n.bandwidth(),height:(r.size||0)<0?u(0)-5:f.bottom,style:d?.xAxis?.labels,className:l?.xAxis?.labels,alignment:(r.size||0)<0?"bottom":"top",animate:o,isInView:I}):null,_t?a.jsxRuntimeExports.jsx(wt.motion.text,{x:n.bandwidth()/2,style:{textAnchor:"middle",...d?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!K&&Ft.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",l?.graphObjectValues),dy:r.size?r.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:K||Ft},whileInView:{y:u(r.size||0),opacity:1,fill:K||Ft,transition:{duration:o.duration}}},initial:"initial",animate:I?"whileInView":"initial",children:Me.numberFormattingFunction(r.size,V,rt,O,Mt)}):null]},r.label)),N=At?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:At.map((r,fe)=>a.jsxRuntimeExports.jsx(Ie.RefLineY,{text:r.text,color:r.color,y:u(r.value),x1:0-$,x2:m+f.right,classNames:r.classNames,styles:r.styles,animate:o,isInView:I},fe))}):null,t[33]=o,t[34]=q,t[35]=Ft,t[36]=vt,t[37]=Ut,t[38]=l?.graphObjectValues,t[39]=l?.xAxis?.axis,t[40]=l?.xAxis?.labels,t[41]=l?.yAxis?.gridLines,t[42]=l?.yAxis?.labels,t[43]=l?.yAxis?.title,t[44]=Z,t[45]=nt,t[46]=ot,t[47]=x,t[48]=Vt,t[49]=m,t[50]=Zt,t[51]=J,t[52]=I,t[53]=$,t[54]=f.bottom,t[55]=f.left,t[56]=f.right,t[57]=f.top,t[58]=Gt,t[59]=h,t[60]=Rt,t[61]=tt,t[62]=V,t[63]=kt,t[64]=lt,t[65]=pt,t[66]=rt,t[67]=O,t[68]=Q,t[69]=At,t[70]=Wt,t[71]=Bt,t[72]=ae,t[73]=_t,t[74]=d?.graphObjectValues,t[75]=d?.xAxis?.axis,t[76]=d?.xAxis?.labels,t[77]=d?.yAxis?.gridLines,t[78]=d?.yAxis?.labels,t[79]=d?.yAxis?.title,t[80]=Mt,t[81]=T,t[82]=ie,t[83]=c,t[84]=te,t[85]=K,t[86]=jt,t[87]=qt,t[88]=v,t[89]=D,t[90]=F,t[91]=U,t[92]=N,t[93]=B,t[94]=P,t[95]=E,t[96]=w,t[97]=b,t[98]=y,t[99]=G,t[100]=W,t[101]=X,t[102]=Y}else D=t[89],F=t[90],U=t[91],N=t[92],B=t[93],P=t[94],E=t[95],w=t[96],b=t[97],y=t[98],G=t[99],W=t[100],X=t[101],Y=t[102];let z;t[123]!==D||t[124]!==U||t[125]!==N?(z=a.jsxRuntimeExports.jsxs(D,{children:[U,N]}),t[123]=D,t[124]=U,t[125]=N,t[126]=z):z=t[126];let ct;t[127]!==Z?(ct=Z.filter(Xe).map(We),t[127]=Z,t[128]=ct):ct=t[128];let C;t[129]!==B||t[130]!==P||t[131]!==E||t[132]!==w||t[133]!==b||t[134]!==z||t[135]!==ct?(C=a.jsxRuntimeExports.jsxs("g",{transform:B,children:[P,E,w,b,z,ct]}),t[129]=B,t[130]=P,t[131]=E,t[132]=w,t[133]=b,t[134]=z,t[135]=ct,t[136]=C):C=t[136];let xt;t[137]!==F||t[138]!==y||t[139]!==G||t[140]!==W||t[141]!==X||t[142]!==Y||t[143]!==C?(xt=a.jsxRuntimeExports.jsx(F,{width:y,height:G,viewBox:W,direction:X,ref:Y,children:C}),t[137]=F,t[138]=y,t[139]=G,t[140]=W,t[141]=X,t[142]=Y,t[143]=C,t[144]=xt):xt=t[144];let H;t[145]!==l?.tooltip||t[146]!==Ot||t[147]!==se||t[148]!==_||t[149]!==d?.tooltip||t[150]!==ht?(H=_&&ht&&Ot&&se?a.jsxRuntimeExports.jsx(ke.Tooltip,{data:_,body:ht,xPos:Ot,yPos:se,backgroundStyle:d?.tooltip,className:l?.tooltip}):null,t[145]=l?.tooltip,t[146]=Ot,t[147]=se,t[148]=_,t[149]=d?.tooltip,t[150]=ht,t[151]=H):H=t[151];let st;t[152]!==l?.modal||t[153]!==ot||t[154]!==tt?(st=ot&&tt!==void 0?a.jsxRuntimeExports.jsx(Ne.DetailsModal,{body:ot,data:tt,setData:bt,className:l?.modal}):null,t[152]=l?.modal,t[153]=ot,t[154]=tt,t[155]=st):st=t[155];let mt;return t[156]!==xt||t[157]!==H||t[158]!==st?(mt=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[xt,H,st]}),t[156]=xt,t[157]=H,t[158]=st,t[159]=mt):mt=t[159],mt}function We(e){return e.layer}function Xe(e){return e.position==="after"}function Ye(e){return e.layer}function He(e){return e.position==="before"}function Je(e){return e!==0}function Ke(e){return e!==0}function Qe(e){return`${e.id}`}function Ze(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function _e(e){return e.target}function ti(e){return!p.checkIfNullOrUndefined(e.target)}function ei(e){return e.target}function ii(e){return!p.checkIfNullOrUndefined(e.target)}function ni(e){return e.size}function si(e){return!p.checkIfNullOrUndefined(e.size)}function ai(e){return e.size}function li(e){return!p.checkIfNullOrUndefined(e.size)}function oi(e){return ge.sum((e.qualitativeRange||[]).filter(ri))||0}function ri(e){return!p.checkIfNullOrUndefined(e)}function ui(e){return e.target}function ci(e){return!p.checkIfNullOrUndefined(e.size)}function xi(e){return e.target}function mi(e){return!p.checkIfNullOrUndefined(e.target)}function di(e){return e.size}function fi(e){return!p.checkIfNullOrUndefined(e.size)}function hi(e){return e.size}function pi(e){return!p.checkIfNullOrUndefined(e.size)}function gi(e){const t=a.compilerRuntimeExports.c(152),{data:s,topMargin:jt,bottomMargin:Zt,leftMargin:Ft,rightMargin:Mt,barColor:O,suffix:Ut,prefix:Bt,barPadding:_t,showValues:ae,showTicks:te,truncateBy:le,width:Pt,height:ee,showLabels:ce,tooltip:ht,onSeriesMouseOver:pt,refValues:At,highlightedDataPoints:g,maxValue:gt,minValue:J,onSeriesMouseClick:lt,labelOrder:j,rtl:Gt,maxBarThickness:Rt,minBarThickness:Wt,resetSelectionOnDoubleClick:ot,detailsOnClick:q,barAxisTitle:K,valueColor:kt,noOfTicks:d,styles:l,classNames:c,targetStyle:T,targetColor:Q,qualitativeRangeColors:h,measureBarWidthFactor:o,animate:x,dimmedOpacity:rt,precision:Z,customLayers:V,naLabel:ie,targetLineThickness:$}=e,Xt=jt===void 0?25:jt,oe=Zt===void 0?10:Zt,Yt=Ft===void 0?100:Ft,xe=Mt===void 0?40:Mt,re=ft.useRef(null);let I;t[0]!==x.amount||t[1]!==x.once?(I={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=I):I=t[2];const S=Ce.useInView(re,I),[Ht,f]=ft.useState(void 0),[_,ue]=ft.useState(void 0),[tt,bt]=ft.useState(void 0),[Ot,ne]=ft.useState(void 0),se=K?Xt+25:Xt;let Jt;t[3]!==oe||t[4]!==Yt||t[5]!==xe||t[6]!==se?(Jt={top:se,bottom:oe,left:Yt,right:xe},t[3]=oe,t[4]=Yt,t[5]=xe,t[6]=se,t[7]=Jt):Jt=t[7];const m=Jt,Vt=Pt-m.left-m.right,et=ee-m.top-m.bottom;let It;t[8]!==s?(It=Math.max(...s.filter(Pi).map(Bi))<0?0:Math.max(...s.filter(Ui).map(Fi)),t[8]=s,t[9]=It):It=t[9];const Nt=It;let Et;t[10]!==s?(Et=Math.max(...s.filter(Di).map(Si))<0?0:Math.max(...s.filter($i).map(Ti)),t[10]=s,t[11]=Et):Et=t[11];const zt=Et;let Ct;t[12]!==s?(Ct=Math.max(...s.map(Li)),t[12]=s,t[13]=Ct):Ct=t[13];const Lt=Ct;let qt;t[14]!==Nt||t[15]!==gt||t[16]!==Lt||t[17]!==zt?(qt=p.checkIfNullOrUndefined(gt)?Math.max(...[Nt,zt,Lt].filter(Number.isFinite))<0?0:Math.max(...[Nt,zt,Lt].filter(Number.isFinite)):gt,t[14]=Nt,t[15]=gt,t[16]=Lt,t[17]=zt,t[18]=qt):qt=t[18];const Kt=qt;let Tt;t[19]!==s?(Tt=Math.min(...s.filter(Ci).map(zi))>=0?0:Math.min(...s.filter(Ei).map(Ni)),t[19]=s,t[20]=Tt):Tt=t[20];const $t=Tt;let yt;t[21]!==s?(yt=Math.min(...s.filter(Ii).map(Vi))>=0?0:Math.min(...s.filter(Oi).map(ki)),t[21]=s,t[22]=yt):yt=t[22];const St=yt;let v;t[23]!==$t||t[24]!==J||t[25]!==St?(v=p.checkIfNullOrUndefined(J)?Math.min(...[$t,St].filter(Number.isFinite))>=0?0:Math.min(...[$t,St].filter(Number.isFinite)):J,t[23]=$t,t[24]=J,t[25]=St,t[26]=v):v=t[26];const it=v;let nt;if(t[27]!==s||t[28]!==j){const n=new Set,M=s.map((R,k)=>{const L=j?`${R.label}`:`${k}`;return n.add(L),{...R,id:L}}),dt=j?j.filter(R=>!n.has(R)):[];nt=[...M,...dt.map(Ri)],t[27]=s,t[28]=j,t[29]=nt}else nt=t[29];const ut=nt;let vt;t[30]!==ut||t[31]!==j?(vt=j??ut.map(Ai),t[30]=ut,t[31]=j,t[32]=vt):vt=t[32];const D=vt;let F,U,N,B,P,E,w,b,y,G,W,X,Y,z;if(t[33]!==x||t[34]!==K||t[35]!==O||t[36]!==D||t[37]!==_t||t[38]!==c?.graphObjectValues||t[39]!==c?.xAxis?.gridLines||t[40]!==c?.xAxis?.labels||t[41]!==c?.xAxis?.title||t[42]!==c?.yAxis?.axis||t[43]!==c?.yAxis?.labels||t[44]!==V||t[45]!==ut||t[46]!==q||t[47]!==rt||t[48]!==et||t[49]!==Vt||t[50]!==ee||t[51]!==g||t[52]!==S||t[53]!==m.bottom||t[54]!==m.left||t[55]!==m.top||t[56]!==Rt||t[57]!==o||t[58]!==Wt||t[59]!==_||t[60]!==ie||t[61]!==d||t[62]!==lt||t[63]!==pt||t[64]!==Z||t[65]!==Bt||t[66]!==h||t[67]!==At||t[68]!==ot||t[69]!==Gt||t[70]!==ce||t[71]!==te||t[72]!==ae||t[73]!==l?.graphObjectValues||t[74]!==l?.xAxis?.gridLines||t[75]!==l?.xAxis?.labels||t[76]!==l?.xAxis?.title||t[77]!==l?.yAxis?.axis||t[78]!==l?.yAxis?.labels||t[79]!==Ut||t[80]!==Q||t[81]!==$||t[82]!==T||t[83]!==Xt||t[84]!==le||t[85]!==kt||t[86]!==Pt||t[87]!==Kt||t[88]!==it){const n=Ee.linear().domain([it,Kt]).range([0,Vt]).nice(),M=ze.band().domain(D).range([0,Wt?Math.max(et,Wt*D.length):Rt?Math.min(et,Rt*D.length):et]).paddingInner(_t),dt=n.ticks(d);U=wt.motion.svg,G=`${Pt}px`,W=`${ee}px`,X=`0 0 ${Pt} ${ee}`,Y="ltr",z=re,P=`translate(${m.left},${m.top})`,E=te?a.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:dt.filter(Mi),x:dt.filter(ji).map(i=>n(i)),y1:0-Xt,y2:et+m.bottom,styles:{gridLines:l?.xAxis?.gridLines,labels:l?.xAxis?.labels},classNames:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},suffix:Ut,prefix:Bt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const R=Vt/2,k=0-m.top+15,L=l?.xAxis?.title,Qt=c?.xAxis?.title;t[103]!==K||t[104]!==R||t[105]!==k||t[106]!==L||t[107]!==Qt?(w=a.jsxRuntimeExports.jsx(Ve.AxisTitle,{x:R,y:k,style:L,className:Qt,text:K}),t[103]=K,t[104]=R,t[105]=k,t[106]=L,t[107]=Qt,t[108]=w):w=t[108];const A=c?.yAxis?.axis;let at;t[109]!==A?(at={axis:A},t[109]=A,t[110]=at):at=t[110];const he=l?.yAxis?.axis;let de;t[111]!==he?(de={axis:he},t[111]=he,t[112]=de):de=t[112],b=a.jsxRuntimeExports.jsx(Oe.Axis,{x1:n(it<0?0:it),x2:n(it<0?0:it),y1:-2.5,y2:et+m.bottom,classNames:at,styles:de}),t[113]!==V?(y=V.filter(wi).map(vi),t[113]=V,t[114]=y):y=t[114],F=Le.AnimatePresence,N=ut.map(i=>p.checkIfNullOrUndefined(M(i.id))?null:a.jsxRuntimeExports.jsxs(wt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:Dt=>{f(i),ne(Dt.clientY),bt(Dt.clientX),pt?.(i)},onClick:()=>{(lt||q)&&(Re.isEqual(_,i)&&ot?(ue(void 0),lt?.(void 0)):(ue(i),lt?.(i)))},onMouseMove:Dt=>{f(i),ne(Dt.clientY),bt(Dt.clientX)},onMouseLeave:()=>{f(void 0),bt(void 0),ne(void 0),pt?.(void 0)},exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:0,y:M(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:rt:.85},whileInView:{x:0,y:M(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:rt:.85,transition:{duration:x.duration}}},initial:"initial",animate:S?"whileInView":"initial",children:[i.qualitativeRange?i.qualitativeRange.map((Dt,me)=>a.jsxRuntimeExports.jsx(wt.motion.rect,{exit:{width:0,x:n(0),transition:{duration:x.duration}},variants:{initial:{x:n(0),width:0,fill:h[me]},whileInView:{x:n(me===0?0:ge.sum(i.qualitativeRange.filter((be,ye)=>ye<me&&be))),width:n(Dt),fill:h[me],transition:{duration:x.duration}}},initial:"initial",animate:S?"whileInView":"initial",y:0,height:M.bandwidth()},me)):null,i.target&&T==="background"?a.jsxRuntimeExports.jsx(wt.motion.rect,{y:0,x:i.target>=0?n(0):n(i.target),height:M.bandwidth(),exit:{width:0,x:n(0),fill:Q,transition:{duration:x.duration}},variants:{initial:{x:n(0),fill:Q,width:0},whileInView:{x:i.target>=0?n(0):n(i.target),fill:Q,width:i.target>=0?n(i.target)-n(0):n(0)-n(i.target),transition:{duration:x.duration}}},initial:"initial",animate:S?"whileInView":"initial"}):null,i.size?a.jsxRuntimeExports.jsx(wt.motion.rect,{y:M.bandwidth()*((1-o)/2),style:{fill:O},height:M.bandwidth()*o,exit:{width:0,x:n(0),transition:{duration:x.duration}},variants:{initial:{x:n(0),width:0},whileInView:{x:i.size>=0?n(0):n(i.size),width:i.size>=0?n(i.size)-n(0):n(0)-n(i.size),transition:{duration:x.duration}}},initial:"initial",animate:S?"whileInView":"initial"}):null,i.target&&T==="line"?a.jsxRuntimeExports.jsx(wt.motion.rect,{y:0,height:M.bandwidth(),width:$,exit:{opacity:0,x:n(0),fill:Q,transition:{duration:x.duration}},variants:{initial:{x:n(0),opacity:0,fill:Q},whileInView:{x:n(i.target)-$/2,opacity:1,fill:Q,transition:{duration:x.duration}}},initial:"initial",animate:S?"whileInView":"initial"}):null,ce?a.jsxRuntimeExports.jsx(De.YAxesLabels,{value:`${i.label}`.length<le?`${i.label}`:`${`${i.label}`.substring(0,le)}...`,y:0,x:(i.size||0)<0?n(0):0-m.left,width:(i.size||0)<0?Pt-n(0):n(0)+m.left,height:M.bandwidth(),alignment:i.size&&i.size<0?"left":"right",style:l?.yAxis?.labels,className:c?.yAxis?.labels,animate:x,isInView:S}):null,ae?a.jsxRuntimeExports.jsx(wt.motion.text,{y:M.bandwidth()/2,style:{textAnchor:i.size&&i.size<0?"end":"start",...l?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!kt&&O.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",c?.graphObjectValues),dx:i.size&&i.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:n(0),opacity:0,fill:kt||O},whileInView:{x:i.size?n(i.size):n(0),opacity:1,fill:kt||O,transition:{duration:x.duration}}},initial:"initial",animate:S?"whileInView":"initial",children:Me.numberFormattingFunction(i.size,ie,Z,Bt,Ut)}):null]},i.label)),B=At?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:At.map((i,Dt)=>a.jsxRuntimeExports.jsx(Ie.RefLineX,{text:i.text,color:i.color,x:n(i.value),y1:0-m.top,y2:et+m.bottom,textSide:n(i.value)>Vt*.75||Gt?"left":"right",classNames:i.classNames,styles:i.styles,animate:x,isInView:S},Dt))}):null,t[33]=x,t[34]=K,t[35]=O,t[36]=D,t[37]=_t,t[38]=c?.graphObjectValues,t[39]=c?.xAxis?.gridLines,t[40]=c?.xAxis?.labels,t[41]=c?.xAxis?.title,t[42]=c?.yAxis?.axis,t[43]=c?.yAxis?.labels,t[44]=V,t[45]=ut,t[46]=q,t[47]=rt,t[48]=et,t[49]=Vt,t[50]=ee,t[51]=g,t[52]=S,t[53]=m.bottom,t[54]=m.left,t[55]=m.top,t[56]=Rt,t[57]=o,t[58]=Wt,t[59]=_,t[60]=ie,t[61]=d,t[62]=lt,t[63]=pt,t[64]=Z,t[65]=Bt,t[66]=h,t[67]=At,t[68]=ot,t[69]=Gt,t[70]=ce,t[71]=te,t[72]=ae,t[73]=l?.graphObjectValues,t[74]=l?.xAxis?.gridLines,t[75]=l?.xAxis?.labels,t[76]=l?.xAxis?.title,t[77]=l?.yAxis?.axis,t[78]=l?.yAxis?.labels,t[79]=Ut,t[80]=Q,t[81]=$,t[82]=T,t[83]=Xt,t[84]=le,t[85]=kt,t[86]=Pt,t[87]=Kt,t[88]=it,t[89]=F,t[90]=U,t[91]=N,t[92]=B,t[93]=P,t[94]=E,t[95]=w,t[96]=b,t[97]=y,t[98]=G,t[99]=W,t[100]=X,t[101]=Y,t[102]=z}else F=t[89],U=t[90],N=t[91],B=t[92],P=t[93],E=t[94],w=t[95],b=t[96],y=t[97],G=t[98],W=t[99],X=t[100],Y=t[101],z=t[102];let ct;t[115]!==F||t[116]!==N||t[117]!==B?(ct=a.jsxRuntimeExports.jsxs(F,{children:[N,B]}),t[115]=F,t[116]=N,t[117]=B,t[118]=ct):ct=t[118];let C;t[119]!==V?(C=V.filter(yi).map(bi),t[119]=V,t[120]=C):C=t[120];let xt;t[121]!==P||t[122]!==E||t[123]!==w||t[124]!==b||t[125]!==y||t[126]!==ct||t[127]!==C?(xt=a.jsxRuntimeExports.jsxs("g",{transform:P,children:[E,w,b,y,ct,C]}),t[121]=P,t[122]=E,t[123]=w,t[124]=b,t[125]=y,t[126]=ct,t[127]=C,t[128]=xt):xt=t[128];let H;t[129]!==U||t[130]!==G||t[131]!==W||t[132]!==X||t[133]!==Y||t[134]!==z||t[135]!==xt?(H=a.jsxRuntimeExports.jsx(U,{width:G,height:W,viewBox:X,direction:Y,ref:z,children:xt}),t[129]=U,t[130]=G,t[131]=W,t[132]=X,t[133]=Y,t[134]=z,t[135]=xt,t[136]=H):H=t[136];let st;t[137]!==c?.tooltip||t[138]!==tt||t[139]!==Ot||t[140]!==Ht||t[141]!==l?.tooltip||t[142]!==ht?(st=Ht&&ht&&tt&&Ot?a.jsxRuntimeExports.jsx(ke.Tooltip,{data:Ht,body:ht,xPos:tt,yPos:Ot,backgroundStyle:l?.tooltip,className:c?.tooltip}):null,t[137]=c?.tooltip,t[138]=tt,t[139]=Ot,t[140]=Ht,t[141]=l?.tooltip,t[142]=ht,t[143]=st):st=t[143];let mt;t[144]!==c?.modal||t[145]!==q||t[146]!==_?(mt=q&&_!==void 0?a.jsxRuntimeExports.jsx(Ne.DetailsModal,{body:q,data:_,setData:ue,className:c?.modal}):null,t[144]=c?.modal,t[145]=q,t[146]=_,t[147]=mt):mt=t[147];let u;return t[148]!==H||t[149]!==st||t[150]!==mt?(u=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[H,st,mt]}),t[148]=H,t[149]=st,t[150]=mt,t[151]=u):u=t[151],u}function bi(e){return e.layer}function yi(e){return e.position==="after"}function vi(e){return e.layer}function wi(e){return e.position==="before"}function ji(e){return e!==0}function Mi(e){return e!==0}function Ai(e){return`${e.id}`}function Ri(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function ki(e){return e.target}function Oi(e){return!p.checkIfNullOrUndefined(e.target)}function Vi(e){return e.target}function Ii(e){return!p.checkIfNullOrUndefined(e.target)}function Ni(e){return e.size}function Ei(e){return!p.checkIfNullOrUndefined(e.size)}function zi(e){return e.size}function Ci(e){return!p.checkIfNullOrUndefined(e.size)}function Li(e){return ge.sum((e.qualitativeRange||[]).filter(qi))||0}function qi(e){return!p.checkIfNullOrUndefined(e)}function Ti(e){return e.target}function $i(e){return!p.checkIfNullOrUndefined(e.target)}function Si(e){return e.target}function Di(e){return!p.checkIfNullOrUndefined(e.target)}function Fi(e){return e.size}function Ui(e){return!p.checkIfNullOrUndefined(e.size)}function Bi(e){return e.size}function Pi(e){return!p.checkIfNullOrUndefined(e.size)}function Gi(e){const t=a.compilerRuntimeExports.c(95),{data:s,graphTitle:jt,barColor:Zt,barPadding:Ft,showTicks:Mt,leftMargin:O,rightMargin:Ut,topMargin:Bt,bottomMargin:_t,truncateBy:ae,showLabels:te,showValues:le,backgroundColor:Pt,suffix:ee,prefix:ce,sources:ht,graphDescription:pt,height:At,width:g,footNote:gt,colorDomain:J,colorLegendTitle:lt,padding:j,relativeHeight:Gt,tooltip:Rt,onSeriesMouseOver:Wt,refValues:ot,showColorScale:q,graphID:K,maxValue:kt,minValue:d,highlightedDataPoints:l,onSeriesMouseClick:c,valueColor:T,orientation:Q,styles:h,classNames:o,qualitativeRangeColors:x,targetColor:rt,filterNA:Z,targetStyle:V,measureBarWidthFactor:ie,animate:$,dimmedOpacity:Xt,precision:oe,customLayers:Yt,naLabel:xe,graphDownload:re,dataDownload:I,language:S,theme:Ht,sortData:f,labelOrder:_,minHeight:ue,maxBarThickness:tt,maxNumberOfBars:bt,minBarThickness:Ot,ariaLabel:ne,resetSelectionOnDoubleClick:se,detailsOnClick:Jt,barAxisTitle:m,noOfTicks:Vt,targetLineThickness:et}=e,It=Zt===void 0?je.Colors.primaryColors["blue-600"]:Zt,Nt=Ft===void 0?.25:Ft,Et=Mt===void 0?!0:Mt,zt=ae===void 0?999:ae,Ct=te===void 0?!0:te,Lt=le===void 0?!0:le,qt=Pt===void 0?!1:Pt,Kt=ee===void 0?"":ee,Tt=ce===void 0?"":ce,$t=q===void 0?!0:q;let yt;t[0]!==l?(yt=l===void 0?[]:l,t[0]=l,t[1]=yt):yt=t[1];const St=yt,v=Q===void 0?"vertical":Q,it=rt===void 0?je.Colors.light.grays["gray-700"]:rt,nt=Z===void 0?!0:Z,ut=V===void 0?"line":V,vt=ie===void 0?.4:ie,D=$===void 0?!1:$,F=Xt===void 0?.3:Xt,U=oe===void 0?2:oe;let N;t[2]!==Yt?(N=Yt===void 0?[]:Yt,t[2]=Yt,t[3]=N):N=t[3];const B=N,P=xe===void 0?"NA":xe,E=re===void 0?!1:re,w=I===void 0?!1:I,b=S===void 0?"en":S,y=Ht===void 0?"light":Ht,G=ue===void 0?0:ue,W=se===void 0?!0:se,X=Vt===void 0?5:Vt,Y=et===void 0?2:et,[z,ct]=ft.useState(0),[C,xt]=ft.useState(0),H=ft.useRef(null),st=ft.useRef(null),mt=v==="horizontal"?gi:Ge;let u,n;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{const A=new ResizeObserver(at=>{ct(at[0].target.clientWidth||620),xt(at[0].target.clientHeight||480)});return H.current&&A.observe(H.current),()=>A.disconnect()},n=[],t[4]=u,t[5]=n):(u=t[4],n=t[5]),ft.useEffect(u,n);const M=o?.graphContainer,dt=h?.graphContainer;let R;t[6]!==o?.description||t[7]!==o?.title||t[8]!==s||t[9]!==w||t[10]!==pt||t[11]!==E||t[12]!==jt||t[13]!==h?.description||t[14]!==h?.title||t[15]!==g?(R=jt||pt||E||w?a.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:o?.title,description:o?.description},graphTitle:jt,graphDescription:pt,width:g,graphDownload:E?st:void 0,dataDownload:w?s.map(Ki).filter(Ji).length>0?s.map(Hi).filter(Yi):s.filter(Xi):null}):null,t[6]=o?.description,t[7]=o?.title,t[8]=s,t[9]=w,t[10]=pt,t[11]=E,t[12]=jt,t[13]=h?.description,t[14]=h?.title,t[15]=g,t[16]=R):R=t[16];let k;t[17]!==mt||t[18]!==D||t[19]!==m||t[20]!==It||t[21]!==Nt||t[22]!==_t||t[23]!==o||t[24]!==J||t[25]!==lt||t[26]!==B||t[27]!==s||t[28]!==Jt||t[29]!==F||t[30]!==nt||t[31]!==St||t[32]!==_||t[33]!==b||t[34]!==O||t[35]!==tt||t[36]!==bt||t[37]!==kt||t[38]!==vt||t[39]!==Ot||t[40]!==d||t[41]!==P||t[42]!==X||t[43]!==c||t[44]!==Wt||t[45]!==v||t[46]!==U||t[47]!==Tt||t[48]!==x||t[49]!==ot||t[50]!==W||t[51]!==Ut||t[52]!==$t||t[53]!==Ct||t[54]!==Et||t[55]!==Lt||t[56]!==f||t[57]!==h||t[58]!==Kt||t[59]!==C||t[60]!==z||t[61]!==it||t[62]!==Y||t[63]!==ut||t[64]!==y||t[65]!==Rt||t[66]!==Bt||t[67]!==zt||t[68]!==T||t[69]!==g?(k=s.length===0?a.jsxRuntimeExports.jsx(Fe.EmptyState,{}):a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[$t&&s.filter(Wi).length!==0&&J?a.jsxRuntimeExports.jsx(Pe.ColorLegend,{width:g,colorLegendTitle:lt,colors:x||je.Colors[y].sequentialColors.positiveColorsx10,colorDomain:J,showNAColor:!1,className:o?.colorLegend}):null,a.jsxRuntimeExports.jsx(Ae.GraphArea,{ref:H,children:z&&C?a.jsxRuntimeExports.jsx(mt,{data:f?qe.orderBy(s.filter(A=>nt?!p.checkIfNullOrUndefined(A.size):A),[A=>A.size===void 0?f==="asc"?(v==="horizontal"?1:-1)*(1/0):(v==="horizontal"?-1:1)*(1/0):A.size],[f]).filter((A,at)=>bt?at<bt:!0):s.filter(A=>nt?!p.checkIfNullOrUndefined(A.size):A).filter((A,at)=>bt?at<bt:!0),barColor:It,targetColor:it,width:z,refValues:ot,height:C,suffix:Kt,prefix:Tt,barPadding:Nt,showLabels:Ct,showValues:Lt,showTicks:Et,truncateBy:zt,leftMargin:O,rightMargin:Ut,qualitativeRangeColors:x||je.Colors[y].sequentialColors.positiveColorsx10,topMargin:Bt,bottomMargin:_t,tooltip:Rt,onSeriesMouseOver:Wt,maxValue:kt,minValue:d,highlightedDataPoints:St,onSeriesMouseClick:c,labelOrder:_,maxBarThickness:tt,minBarThickness:Ot,resetSelectionOnDoubleClick:W,detailsOnClick:Jt,barAxisTitle:m,noOfTicks:X,valueColor:T,styles:h,classNames:o,targetStyle:ut,dimmedOpacity:F,measureBarWidthFactor:vt,animate:D===!0?{duration:.5,once:!0,amount:.5}:D||{duration:0,once:!0,amount:0},precision:U,customLayers:B,naLabel:P,targetLineThickness:Y,rtl:b==="ar"||b==="he"}):null})]}),t[17]=mt,t[18]=D,t[19]=m,t[20]=It,t[21]=Nt,t[22]=_t,t[23]=o,t[24]=J,t[25]=lt,t[26]=B,t[27]=s,t[28]=Jt,t[29]=F,t[30]=nt,t[31]=St,t[32]=_,t[33]=b,t[34]=O,t[35]=tt,t[36]=bt,t[37]=kt,t[38]=vt,t[39]=Ot,t[40]=d,t[41]=P,t[42]=X,t[43]=c,t[44]=Wt,t[45]=v,t[46]=U,t[47]=Tt,t[48]=x,t[49]=ot,t[50]=W,t[51]=Ut,t[52]=$t,t[53]=Ct,t[54]=Et,t[55]=Lt,t[56]=f,t[57]=h,t[58]=Kt,t[59]=C,t[60]=z,t[61]=it,t[62]=Y,t[63]=ut,t[64]=y,t[65]=Rt,t[66]=Bt,t[67]=zt,t[68]=T,t[69]=g,t[70]=k):k=t[70];let L;t[71]!==o?.footnote||t[72]!==o?.source||t[73]!==gt||t[74]!==ht||t[75]!==h?.footnote||t[76]!==h?.source||t[77]!==g?(L=ht||gt?a.jsxRuntimeExports.jsx(Ue.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:ht,footNote:gt,width:g}):null,t[71]=o?.footnote,t[72]=o?.source,t[73]=gt,t[74]=ht,t[75]=h?.footnote,t[76]=h?.source,t[77]=g,t[78]=L):L=t[78];let Qt;return t[79]!==ne||t[80]!==qt||t[81]!==K||t[82]!==At||t[83]!==b||t[84]!==G||t[85]!==j||t[86]!==Gt||t[87]!==M||t[88]!==dt||t[89]!==R||t[90]!==k||t[91]!==L||t[92]!==y||t[93]!==g?(Qt=a.jsxRuntimeExports.jsxs(Ae.GraphContainer,{className:M,style:dt,id:K,ref:st,"aria-label":ne,backgroundColor:qt,theme:y,language:b,minHeight:G,width:g,height:At,relativeHeight:Gt,padding:j,children:[R,k,L]}),t[79]=ne,t[80]=qt,t[81]=K,t[82]=At,t[83]=b,t[84]=G,t[85]=j,t[86]=Gt,t[87]=M,t[88]=dt,t[89]=R,t[90]=k,t[91]=L,t[92]=y,t[93]=g,t[94]=Qt):Qt=t[94],Qt}function Wi(e){return e.qualitativeRange}function Xi(e){return e!==void 0}function Yi(e){return e!==void 0}function Hi(e){return e.data}function Ji(e){return e!==void 0}function Ki(e){return e.data}exports.BulletChart=Gi;
|
|
2
2
|
//# sourceMappingURL=BulletChart.cjs.map
|