@undp/data-viz 2.1.1 → 2.1.3
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.cjs +1 -1
- package/dist/AreaChart.js +2 -2
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +129 -120
- package/dist/BarGraph.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +49 -46
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.d.ts +11 -0
- package/dist/BulletChart.js +758 -711
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +7 -4
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +52 -49
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +2 -2
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.d.ts +10 -0
- package/dist/DonutChart.js +230 -264
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +37 -34
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +41 -38
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GraphEl-BLMih7RN.cjs +2 -0
- package/dist/GraphEl-BLMih7RN.cjs.map +1 -0
- package/dist/{GraphEl-DEzobeOM.js → GraphEl-CRrAlbcr.js} +5 -2
- package/dist/GraphEl-CRrAlbcr.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +2 -2
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +62 -59
- package/dist/HybridMap.js.map +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +2 -2
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +7 -4
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +2 -2
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/Types.d.ts +2 -0
- package/dist/{area-BE2wo7fv.js → area-B6r7cv2o.js} +5 -5
- package/dist/{area-BE2wo7fv.js.map → area-B6r7cv2o.js.map} +1 -1
- package/dist/area-C1gxfNGD.cjs +2 -0
- package/dist/{area-D3Qx7k7K.cjs.map → area-C1gxfNGD.cjs.map} +1 -1
- package/dist/array-DMyR1sql.cjs +2 -0
- package/dist/array-DMyR1sql.cjs.map +1 -0
- package/dist/array-USo-Szhp.js +13 -0
- package/dist/array-USo-Szhp.js.map +1 -0
- package/dist/ensureCompleteData-DH5c52Ub.js +122 -0
- package/dist/ensureCompleteData-DH5c52Ub.js.map +1 -0
- package/dist/ensureCompleteData-pZ9QO6kB.cjs +2 -0
- package/dist/ensureCompleteData-pZ9QO6kB.cjs.map +1 -0
- package/dist/getSchema.cjs +1 -1
- package/dist/getSchema.cjs.map +1 -1
- package/dist/getSchema.js +15 -15
- package/dist/getSchema.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +2 -2
- package/dist/line-DFlZsxI1.js +144 -0
- package/dist/line-DFlZsxI1.js.map +1 -0
- package/dist/line-DaEMhXmx.cjs +2 -0
- package/dist/line-DaEMhXmx.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.js +2 -2
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs +2 -0
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs.map +1 -0
- package/dist/{transformDataForAggregation-DEU__LUl.js → transformDataForAggregation-j34UL73s.js} +14 -10
- package/dist/transformDataForAggregation-j34UL73s.js.map +1 -0
- package/dist/{transformDataForGraphFromFile-CzepNVGZ.cjs → transformDataForGraphFromFile-CuXxR8uA.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-CzepNVGZ.cjs.map → transformDataForGraphFromFile-CuXxR8uA.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-CSG24iF6.js → transformDataForGraphFromFile-DyP-83Nh.js} +2 -2
- package/dist/{transformDataForGraphFromFile-CSG24iF6.js.map → transformDataForGraphFromFile-DyP-83Nh.js.map} +1 -1
- package/package.json +1 -1
- package/dist/GraphEl-B16EYkko.cjs +0 -2
- package/dist/GraphEl-B16EYkko.cjs.map +0 -1
- package/dist/GraphEl-DEzobeOM.js.map +0 -1
- package/dist/area-D3Qx7k7K.cjs +0 -2
- package/dist/array-B7TkkRH0.js +0 -89
- package/dist/array-B7TkkRH0.js.map +0 -1
- package/dist/array-DKbXV8lR.cjs +0 -2
- package/dist/array-DKbXV8lR.cjs.map +0 -1
- package/dist/ensureCompleteData-DNKEGRiP.js +0 -102
- package/dist/ensureCompleteData-DNKEGRiP.js.map +0 -1
- package/dist/ensureCompleteData-I6nYmT8E.cjs +0 -2
- package/dist/ensureCompleteData-I6nYmT8E.cjs.map +0 -1
- package/dist/line-CPfhohvF.js +0 -68
- package/dist/line-CPfhohvF.js.map +0 -1
- package/dist/line-DHV4JwCR.cjs +0 -2
- package/dist/line-DHV4JwCR.cjs.map +0 -1
- package/dist/transformDataForAggregation-DEU__LUl.js.map +0 -1
- package/dist/transformDataForAggregation-XNg0OGYE.cjs +0 -2
- package/dist/transformDataForAggregation-XNg0OGYE.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\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 colorDomain: (number | string)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\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 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 return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <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 </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 color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\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 onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\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 d={masterPath}\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 style={{\r\n stroke: mapBorderColor,\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 style={{\r\n stroke: mapBorderColor,\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 // 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={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\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 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { 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 ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\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: ChoroplethMapDataType[];\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 */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** 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 /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\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 /** 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 /** 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 ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\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 tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n 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 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 const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\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 classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\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 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","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","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","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","i","findIndex","el","id","properties","length","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","timeline","t24","Colors","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","parse","Date","getTime","Set","sort","_temp","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_0","t33","t34","getUniqValue","getJenks","_temp2","t35","t36","speed","interval","setInterval","clearInterval","t37","t38","getSliderMarks","markObj","t39","graphContainer","t40","t41","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t42","Pause","Play","SliderUI","nextValue","nextValue_0","t43","GraphArea","d_7","date","format","_temp8","categoricalColors","sequentialColors","max","Spinner","t44","footnote","source","GraphFooter","t45","GraphContainer","NAME","d_4","d_3","d_2","d_6","d_5","d_1","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;A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6CtM,MAAM7E;AAAS;AAxJ5D,SAAAwP,GAAA4B,GAAA;AAAA,SAwJyBvM,EAAC/G;AAAK;AAxJ/B,SAAAyR,GAAA8B,GAAA;AAAA,SAuJ2CxM,MAAM7E;AAAS;AAvJ1D,SAAAsP,GAAAgC,GAAA;AAAA,SAuJuBzM,EAAC/G;AAAK;AAvJ7B,SAAAsQ,GAAAmD,GAAA;AAAA,SAkGiB1M,EAAC2B;AAA+B;AAlGjD,SAAA8F,GAAAkF,GAAAC,GAAA;AAAA,SA0DkBD,IAAIC;AAAC;"}
|
|
1
|
+
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\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 colorDomain: (number | string)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\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 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 return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <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 </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 color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\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 onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\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 d={masterPath}\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 style={{\r\n stroke: mapBorderColor,\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 style={{\r\n stroke: mapBorderColor,\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 // 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={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\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 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { 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 ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\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: ChoroplethMapDataType[];\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 */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** 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 /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\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 /** 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 /** 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 ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\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 tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n 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 const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\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 classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\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 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","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","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","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","i","findIndex","el","id","properties","length","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","timeline","t24","Colors","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_1","t33","t34","getUniqValue","getJenks","_temp3","t35","t36","speed","interval","setInterval","clearInterval","t37","t38","getSliderMarks","markObj","t39","graphContainer","t40","t41","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t42","Pause","Play","SliderUI","nextValue","nextValue_0","t43","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t44","footnote","source","GraphFooter","t45","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":";;;;;;;;;;;;;;;;;;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AA,GACPL,SAAAA,IAERyG,UAAAA;AAAAA,IAAAA;AAAAA,IAuBAS;AAAAA,IA6BDM;AAAAA,IAkFCS;AAAAA,EAAAA,GAYH,GAAiB5I,SAAAoC,GAAApC,SAAAP,GAAAO,SAAAqB,GAAArB,SAAA7J,GAAA6J,SAAA8B,GAAA9B,SAAAgC,GAAAhC,SAAAW,IAAAX,SAAAgB,GAAAhB,SAAAiH,IAAAjH,SAAAmH,IAAAnH,SAAAoH,IAAApH,SAAA6H,IAAA7H,SAAAmI,IAAAnI,SAAA4I,IAAA5I,SAAAkC,IAAAlC,SAAA5J,GAAA4J,SAAAgJ,MAAAA,KAAAhJ,EAAA,GAAA,GAjKjBgJ;AAiKiB;AA7Rd,SAAAT,GAAApL,GAAA;AAAA,SA8M4BA,EAAEE,WAAW6L,SAAU;AAAY;AA9M/D,SAAAtB,GAAAuB,GAAA;AAAA,SA6J4BvM,MAAM7E;AAAS;AA7J3C,SAAA4P,GAAAyB,GAAA;AAAA,SA4J6CxM,MAAM7E;AAAS;AA5J5D,SAAA2P,GAAA2B,GAAA;AAAA,SA4JyBzM,EAAC/G;AAAK;AA5J/B,SAAA4R,GAAA6B,GAAA;AAAA,SA2J2C1M,MAAM7E;AAAS;AA3J1D,SAAAyP,GAAA+B,GAAA;AAAA,SA2JuB3M,EAAC/G;AAAK;AA3J7B,SAAAyQ,GAAAkD,GAAA;AAAA,SAsGiB5M,EAAC2B;AAA+B;AAtGjD,SAAAiG,GAAAiF,GAAAC,GAAA;AAAA,SA8DkBD,IAAIC;AAAC;AA9DvB,SAAApF,GAAA1H,GAAA;AAAA,SA0DgBA,EAACsH;AAAK;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),A=require("react"),O=require("./parse-hMnG_lRV.cjs"),xi=require("./index-Cno4Q0YE.cjs"),ei=require("./numberFormattingFunction-02t-wJta.cjs"),mi=require("./Tooltip-uUdw6wJL.cjs"),It=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ii=require("./customArea-CMF5g-C3.cjs"),di=require("./AxisTitle-sS5bLLR7.cjs"),pi=require("./Axis-DxRV2yMi.cjs"),fi=require("./XTicksAndGridLines-B6CELS7q.cjs"),hi=require("./ReferenceLine-BH0qdf4R.cjs"),yi=require("./YTicksAndGridLines-4pxTRlRK.cjs"),gi=require("./index-B_sAFsEV.cjs"),ji=require("./time-CZd5YLSP.cjs"),vi=require("./linear-BwPAspcq.cjs"),ni=require("./line-DHV4JwCR.cjs"),Ge=require("./step-BZ3C8QFW.cjs"),oi=require("./area-D3Qx7k7K.cjs"),wi=require("./select-Bnfk0lJx.cjs"),Ri=require("./init-DU0ybBc_.cjs"),bi=require("./pointer-Dkq5NV1q.cjs"),Ei=require("./use-in-view-QcfiW0w3.cjs"),S=require("./proxy-BxvUI_9l.cjs"),Oi=require("./GraphFooter.cjs"),Ci=require("./GraphHeader.cjs"),Ai=require("./ColorLegend.cjs"),Pe=require("./Colors.cjs"),Vi=require("./generateRandomString-B5zBiJzS.cjs"),Li=require("./EmptyState-sAEZ_5rU.cjs"),si=require("./GraphContainer-d8A46BK2.cjs"),Si=require("./getNoOfTicks-C_1CFXv_.cjs");function ki(r){const t=s.compilerRuntimeExports.c(217),{data:k,width:ot,height:Nt,lineColors:c,suffix:E,prefix:v,dateFormat:x,showValues:w,noOfXTicks:Tt,rightMargin:qt,leftMargin:V,topMargin:$t,bottomMargin:gt,tooltip:H,highlightAreaSettings:Mt,onSeriesMouseOver:Ft,animate:i,rtl:W,showColorLegendAtTop:Gt,colorDomain:N,diffAreaColors:D,idSuffix:st,strokeWidth:T,showDots:q,refValues:jt,minValue:I,maxValue:vt,annotations:Pt,customHighlightAreaSettings:Ht,yAxisTitle:Y,noOfYTicks:xe,minDate:Wt,maxDate:wt,curveType:Rt,styles:f,classNames:d,precision:b,customLayers:$}=r,bt=A.useRef(null);let X;t[0]!==i.amount||t[1]!==i.once?(X={once:i.once,amount:i.amount},t[0]=i.amount,t[1]=i.once,t[2]=X):X=t[2];const u=Ei.useInView(bt,X),[p,ne]=A.useState(!1);let Et,at;t[3]!==i.duration||t[4]!==p||t[5]!==u?(Et=()=>{if(u&&!p){const o=setTimeout(()=>{ne(!0)},(i.duration+.5)*1e3);return()=>clearTimeout(o)}},at=[u,p,i.duration],t[3]=i.duration,t[4]=p,t[5]=u,t[6]=Et,t[7]=at):(Et=t[6],at=t[7]),A.useEffect(Et,at);const U=Rt==="linear"?ni.curveLinear:Rt==="step"?Ge.curveStep:Rt==="stepAfter"?Ge.stepAfter:Rt==="stepBefore"?Ge.stepBefore:Ge.monotoneX,[L,g]=A.useState(void 0),[h,oe]=A.useState(void 0),[B,Yt]=A.useState(void 0),Ot=Y?V+30:V;let rt;t[8]!==gt||t[9]!==qt||t[10]!==Ot||t[11]!==$t?(rt={top:$t,bottom:gt,left:Ot,right:qt},t[8]=gt,t[9]=qt,t[10]=Ot,t[11]=$t,t[12]=rt):rt=t[12];const y=rt,lt=A.useRef(null);let z;t[13]!==x?(z=o=>({...o,date:O.parse(`${o.date}`,x,new Date)}),t[13]=x,t[14]=z):z=t[14];const n=xi.orderBy(k.map(z),["date"],["asc"]);let ct;if(t[15]!==x||t[16]!==Mt){let o;t[18]!==x?(o=e=>({...e,coordinates:[e.coordinates[0]===null?null:O.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:O.parse(`${e.coordinates[1]}`,x,new Date)]}),t[18]=x,t[19]=o):o=t[19],ct=Mt.map(o),t[15]=x,t[16]=Mt,t[17]=ct}else ct=t[17];const Ct=ct;let ut;if(t[20]!==Ht||t[21]!==x){let o;t[23]!==x?(o=e=>({...e,coordinates:e.coordinates.map((P,Dt)=>Dt%2===0?O.parse(`${P}`,x,new Date):P)}),t[23]=x,t[24]=o):o=t[24],ut=Ht.map(o),t[20]=Ht,t[21]=x,t[22]=ut}else ut=t[22];const se=ut,m=ot-y.left-y.right,j=Nt-y.top-y.bottom,ae=Wt?O.parse(`${Wt}`,x,new Date):n[0].date,Xt=wt?O.parse(`${wt}`,x,new Date):n[n.length-1].date,J=Math.min(...n.map(zi))!==1/0?Math.min(...n.map(Bi))>0?0:Math.min(...n.map(Ui)):0,K=Math.min(...n.map(Xi))!==1/0?Math.min(...n.map(Yi))>0?0:Math.min(...n.map(Wi)):0,M=Math.max(...n.map(Hi))!==1/0?Math.max(...n.map(Pi)):0,Ut=Math.max(...n.map(Gi))!==1/0?Math.max(...n.map(Fi)):0;let Q;t[25]!==J||t[26]!==K||t[27]!==I?(Q=It.checkIfNullOrUndefined(I)?J<K?J:K:I,t[25]=J,t[26]=K,t[27]=I,t[28]=Q):Q=t[28];const R=Q,Z=M>Ut?M:Ut,a=ji.time().domain([ae,Xt]).range([0,m]);let xt;t[29]!==R||t[30]!==I?(xt=It.checkIfNullOrUndefined(I)?R:I,t[29]=R,t[30]=I,t[31]=xt):xt=t[31];let _;t[32]!==Z||t[33]!==vt?(_=It.checkIfNullOrUndefined(vt)?Z>0?Z:0:vt,t[32]=Z,t[33]=vt,t[34]=_):_=t[34];const l=vi.linear().domain([xt,_]).range([j,0]).nice(),mt=ni.line().x(o=>a(o.date)).y(o=>l(o.y1)).curve(U),Bt=ni.line().x(o=>a(o.date)).y(o=>l(o.y2)).curve(U),At=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(o=>l(o.y2)).curve(U),re=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(0).curve(U),le=oi.area().x(o=>a(o.date)).y1(o=>l(o.y2)).y0(0).curve(U),zt=l.ticks(xe),Jt=a.ticks(Tt);A.useEffect(()=>{const o=P=>{const Dt=n[Ri.bisectCenter(n.map(Mi),a.invert(bi.pointer(P)[0]),0)];g(Dt||n[n.length-1]),Ft?.(Dt||n[n.length-1]),Yt(P.clientY),oe(P.clientX)},e=()=>{g(void 0),oe(void 0),Yt(void 0),Ft?.(void 0)};wi.select(lt.current).on("mousemove",o).on("mouseout",e)},[a,n,Ft]);let dt;t[35]===Symbol.for("react.memo_cache_sentinel")?(dt={fill:"none"},t[35]=dt):dt=t[35];let tt;t[36]===Symbol.for("react.memo_cache_sentinel")?(tt={fill:"none"},t[36]=tt):tt=t[36];let pt;t[37]!==i||t[38]!==j||t[39]!==m||t[40]!==Ct||t[41]!==u||t[42]!==a?(pt=s.jsxRuntimeExports.jsx(gi.HighlightArea,{areaSettings:Ct,width:m,height:j,scale:a,animate:i,isInView:u}),t[37]=i,t[38]=j,t[39]=m,t[40]=Ct,t[41]=u,t[42]=a,t[43]=pt):pt=t[43];const et=f?.yAxis?.gridLines,ce=f?.yAxis?.labels;let it;t[44]!==et||t[45]!==ce?(it={gridLines:et,labels:ce},t[44]=et,t[45]=ce,t[46]=it):it=t[46];const ue=d?.yAxis?.gridLines,Vt=d?.yAxis?.labels;let Lt;t[47]!==ue||t[48]!==Vt?(Lt={gridLines:ue,labels:Vt},t[47]=ue,t[48]=Vt,t[49]=Lt):Lt=t[49];const ft=l(R<0?0:R),ht=l(R<0?0:R),St=0-V,kt=m+y.right,F=R<0?0:R;let C;t[50]!==b||t[51]!==v||t[52]!==E||t[53]!==F?(C=ei.numberFormattingFunction(F,"NA",b,v,E),t[50]=b,t[51]=v,t[52]=E,t[53]=F,t[54]=C):C=t[54];const G=0-V,yt=l(R<0?0:R),Kt=Z<0?"1rem":-5;let nt;t[55]!==G||t[56]!==yt||t[57]!==Kt?(nt={x:G,y:yt,dx:0,dy:Kt},t[55]=G,t[56]=yt,t[57]=Kt,t[58]=nt):nt=t[58];const He=d?.xAxis?.axis,We=d?.yAxis?.labels;let Qt;t[59]!==He||t[60]!==We?(Qt={axis:He,label:We},t[59]=He,t[60]=We,t[61]=Qt):Qt=t[61];const Ye=f?.xAxis?.axis,Xe=f?.yAxis?.labels;let Zt;t[62]!==Ye||t[63]!==Xe?(Zt={axis:Ye,label:Xe},t[62]=Ye,t[63]=Xe,t[64]=Zt):Zt=t[64];let me;t[65]!==ft||t[66]!==ht||t[67]!==St||t[68]!==kt||t[69]!==C||t[70]!==nt||t[71]!==Qt||t[72]!==Zt?(me=s.jsxRuntimeExports.jsx(pi.Axis,{y1:ft,y2:ht,x1:St,x2:kt,label:C,labelPos:nt,classNames:Qt,styles:Zt}),t[65]=ft,t[66]=ht,t[67]=St,t[68]=kt,t[69]=C,t[70]=nt,t[71]=Qt,t[72]=Zt,t[73]=me):me=t[73];const Ue=0-V-15,Be=j/2,ze=f?.yAxis?.title,Je=d?.yAxis?.title;let de;t[74]!==Ue||t[75]!==Be||t[76]!==ze||t[77]!==Je||t[78]!==Y?(de=s.jsxRuntimeExports.jsx(di.AxisTitle,{x:Ue,y:Be,style:ze,className:Je,text:Y,rotate90:!0}),t[74]=Ue,t[75]=Be,t[76]=ze,t[77]=Je,t[78]=Y,t[79]=de):de=t[79];let pe;t[80]!==x?(pe=o=>O.format(o,x),t[80]=x,t[81]=pe):pe=t[81];const ai=Jt.map(pe),ri=Jt.map(o=>a(o)),Ke=f?.xAxis?.gridLines,Qe=f?.xAxis?.labels;let fe;t[82]!==Ke||t[83]!==Qe?(fe={gridLines:Ke,labels:Qe},t[82]=Ke,t[83]=Qe,t[84]=fe):fe=t[84];const Ze=d?.xAxis?.gridLines;let _t;t[85]!==Ze?(_t=s.mo("opacity-0",Ze),t[85]=Ze,t[86]=_t):_t=t[86];const _e=d?.xAxis?.labels;let te;t[87]!==_e?(te=s.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",_e),t[87]=_e,t[88]=te):te=t[88];let he;t[89]!==_t||t[90]!==te?(he={gridLines:_t,labels:te},t[89]=_t,t[90]=te,t[91]=he):he=t[91];let ye;t[92]!==$?(ye=$.filter(Ti).map(Ni),t[92]=$,t[93]=ye):ye=t[93];let ge;t[94]!==D[1]?(ge={fill:D[1]},t[94]=D[1],t[95]=ge):ge=t[95];let je;t[96]!==i.duration?(je={opacity:0,transition:{duration:i.duration}},t[96]=i.duration,t[97]=je):je=t[97];let ve;t[98]===Symbol.for("react.memo_cache_sentinel")?(ve={opacity:1},t[98]=ve):ve=t[98];let we;t[99]!==i.duration?(we={initial:ve,whileInView:{opacity:1,transition:{duration:i.duration}}},t[99]=i.duration,t[100]=we):we=t[100];let Re;t[101]!==D[0]?(Re={fill:D[0]},t[101]=D[0],t[102]=Re):Re=t[102];let be;t[103]!==i.duration?(be={opacity:0,transition:{duration:i.duration}},t[103]=i.duration,t[104]=be):be=t[104];let Ee;t[105]===Symbol.for("react.memo_cache_sentinel")?(Ee={opacity:0},t[105]=Ee):Ee=t[105];let Oe;t[106]!==i.duration?(Oe={initial:Ee,whileInView:{opacity:1,transition:{duration:i.duration}}},t[106]=i.duration,t[107]=Oe):Oe=t[107];let Ce;t[108]!==c[0]||t[109]!==T?(Ce={fill:"none",stroke:c[0],strokeWidth:T},t[108]=c[0],t[109]=T,t[110]=Ce):Ce=t[110];let Ae;t[111]!==i.duration?(Ae={opacity:0,transition:{duration:i.duration}},t[111]=i.duration,t[112]=Ae):Ae=t[112];let Ve;t[113]!==c[1]||t[114]!==T?(Ve={fill:"none",stroke:c[1],strokeWidth:T},t[113]=c[1],t[114]=T,t[115]=Ve):Ve=t[115];let Le;t[116]!==i.duration?(Le={opacity:0,transition:{duration:i.duration}},t[116]=i.duration,t[117]=Le):Le=t[117];const li=1,ti=Bt(n)||"";let ee;t[118]!==i.duration?(ee={duration:i.duration},t[118]=i.duration,t[119]=ee):ee=t[119];let Se;t[120]!==ti||t[121]!==ee?(Se={pathLength:li,d:ti,opacity:1,transition:ee},t[120]=ti,t[121]=ee,t[122]=Se):Se=t[122];let ke;t[123]!==i.duration||t[124]!==N||t[125]!==n||t[126]!==p||t[127]!==u||t[128]!==c[0]||t[129]!==c[1]||t[130]!==Gt||t[131]!==a||t[132]!==l?(ke=Gt?null:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[0]},N[0]),s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[1]},N[1])]}),t[123]=i.duration,t[124]=N,t[125]=n,t[126]=p,t[127]=u,t[128]=c[0],t[129]=c[1],t[130]=Gt,t[131]=a,t[132]=l,t[133]=ke):ke=t[133];let De;t[134]!==d?.mouseOverLine||t[135]!==j||t[136]!==L||t[137]!==f?.mouseOverLine||t[138]!==a?(De=L?s.jsxRuntimeExports.jsx("line",{y1:0,y2:j,x1:a(L.date),x2:a(L.date),className:s.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:f?.mouseOverLine}):null,t[134]=d?.mouseOverLine,t[135]=j,t[136]=L,t[137]=f?.mouseOverLine,t[138]=a,t[139]=De):De=t[139];let Ie;if(t[140]!==i.duration||t[141]!==d?.graphObjectValues||t[142]!==n||t[143]!==m||t[144]!==p||t[145]!==u||t[146]!==c[0]||t[147]!==c[1]||t[148]!==b||t[149]!==v||t[150]!==q||t[151]!==w||t[152]!==f?.graphObjectValues||t[153]!==E||t[154]!==a||t[155]!==l){let o;t[157]!==i.duration||t[158]!==d?.graphObjectValues||t[159]!==n.length||t[160]!==m||t[161]!==p||t[162]!==u||t[163]!==c[0]||t[164]!==c[1]||t[165]!==b||t[166]!==v||t[167]!==q||t[168]!==w||t[169]!==f?.graphObjectValues||t[170]!==E||t[171]!==a||t[172]!==l?(o=(e,P)=>s.jsxRuntimeExports.jsxs(S.motion.g,{children:[It.checkIfNullOrUndefined(e.y1)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],transition:{duration:.5,delay:i.duration},cx:a(e.date),cy:l(e.y1)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2<e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],x:a(e.date),y:l(e.y1),transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y1,"NA",b,v,E)}):null]}),It.checkIfNullOrUndefined(e.y2)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y2),fill:c[1]},whileInView:{opacity:1,fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration},cx:a(e.date),cy:l(e.y2)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2>e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y2),fill:c[1]},whileInView:{opacity:1,x:a(e.date),y:l(e.y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y2,"NA",b,v,E)}):null]})]},P),t[157]=i.duration,t[158]=d?.graphObjectValues,t[159]=n.length,t[160]=m,t[161]=p,t[162]=u,t[163]=c[0],t[164]=c[1],t[165]=b,t[166]=v,t[167]=q,t[168]=w,t[169]=f?.graphObjectValues,t[170]=E,t[171]=a,t[172]=l,t[173]=o):o=t[173],Ie=n.map(o),t[140]=i.duration,t[141]=d?.graphObjectValues,t[142]=n,t[143]=m,t[144]=p,t[145]=u,t[146]=c[0],t[147]=c[1],t[148]=b,t[149]=v,t[150]=q,t[151]=w,t[152]=f?.graphObjectValues,t[153]=E,t[154]=a,t[155]=l,t[156]=Ie}else Ie=t[156];let Ne;t[174]!==i||t[175]!==m||t[176]!==u||t[177]!==V||t[178]!==y.right||t[179]!==jt||t[180]!==l?(Ne=jt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:jt.map((o,e)=>s.jsxRuntimeExports.jsx(hi.RefLineY,{text:o.text,color:o.color,y:l(o.value),x1:0-V,x2:m+y.right,classNames:o.classNames,styles:o.styles,animate:i,isInView:u},e))}):null,t[174]=i,t[175]=m,t[176]=u,t[177]=V,t[178]=y.right,t[179]=jt,t[180]=l,t[181]=Ne):Ne=t[181];let ie;if(t[182]!==i||t[183]!==Pt||t[184]!==x||t[185]!==m||t[186]!==u||t[187]!==y.right||t[188]!==W||t[189]!==a||t[190]!==l){let o;t[192]!==i||t[193]!==x||t[194]!==m||t[195]!==u||t[196]!==y.right||t[197]!==W||t[198]!==a||t[199]!==l?(o=(e,P)=>{const Dt=ii.getLineEndPoint({x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?l(e.yCoordinate):0},It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ci=e.showConnector?{y1:Dt.y,x1:Dt.x,y2:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?l(e.yCoordinate):0,cx:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ui={y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):m+y.right-(e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return s.jsxRuntimeExports.jsx(ii.Annotation,{color:e.color,connectorsSettings:ci,labelSettings:ui,text:e.text,classNames:e.classNames,styles:e.styles,animate:i,isInView:u},P)},t[192]=i,t[193]=x,t[194]=m,t[195]=u,t[196]=y.right,t[197]=W,t[198]=a,t[199]=l,t[200]=o):o=t[200],ie=Pt.map(o),t[182]=i,t[183]=Pt,t[184]=x,t[185]=m,t[186]=u,t[187]=y.right,t[188]=W,t[189]=a,t[190]=l,t[191]=ie}else ie=t[191];let Te;t[201]!==ie?(Te=s.jsxRuntimeExports.jsx("g",{children:ie}),t[201]=ie,t[202]=Te):Te=t[202];let qe;t[203]!==$?(qe=$.filter(Ii).map(Di),t[203]=$,t[204]=qe):qe=t[204];let $e;t[205]===Symbol.for("react.memo_cache_sentinel")?($e={fill:"none",pointerEvents:"all"},t[205]=$e):$e=t[205];let Me;t[206]!==lt||t[207]!==j||t[208]!==m?(Me=s.jsxRuntimeExports.jsx("rect",{ref:lt,style:$e,width:m,height:j}),t[206]=lt,t[207]=j,t[208]=m,t[209]=Me):Me=t[209];let Fe;return t[210]!==d?.tooltip||t[211]!==h||t[212]!==B||t[213]!==L||t[214]!==f?.tooltip||t[215]!==H?(Fe=L&&H&&h&&B?s.jsxRuntimeExports.jsx(mi.Tooltip,{data:L,body:H,xPos:h,yPos:B,backgroundStyle:f?.tooltip,className:d?.tooltip}):null,t[210]=d?.tooltip,t[211]=h,t[212]=B,t[213]=L,t[214]=f?.tooltip,t[215]=H,t[216]=Fe):Fe=t[216],s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(S.motion.svg,{width:`${ot}px`,height:`${Nt}px`,viewBox:`0 0 ${ot} ${Nt}`,direction:"ltr",ref:bt,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${y.left},${y.top})`,children:[s.jsxRuntimeExports.jsx("clipPath",{id:`above${st}`,children:s.jsxRuntimeExports.jsx("path",{d:le(n),style:dt})}),s.jsxRuntimeExports.jsx("clipPath",{id:`below${st}`,children:s.jsxRuntimeExports.jsx("path",{d:re(n),style:tt})}),pt,s.jsxRuntimeExports.jsx(ii.CustomArea,{areaSettings:se,scaleX:a,scaleY:l,animate:i,isInView:u}),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(yi.YTicksAndGridLines,{values:zt.filter($i),y:zt.filter(qi).map(o=>l(o)),x1:0-V,x2:m+y.right,styles:it,classNames:Lt,suffix:E,prefix:v,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:b}),me,de]})}),s.jsxRuntimeExports.jsx(fi.XTicksAndGridLines,{values:ai,x:ri,y1:0,y2:j,styles:fe,classNames:he,suffix:E,prefix:v,labelType:"primary",showGridLines:!0,precision:b}),ye,s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#below${st})`,d:At(n)||"",style:ge,exit:je,variants:we,initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#above${st})`,d:At(n)||"",style:Re,exit:be,variants:Oe,initial:"initial",animate:u?"whileInView":"initial"})]}),s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{d:mt(n)||"",style:Ce,exit:Ae,variants:{initial:{pathLength:0,d:mt(n)||"",opacity:1},whileInView:{pathLength:1,d:mt(n)||"",opacity:1,transition:{duration:i.duration}}},initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{style:Ve,exit:Le,variants:{initial:{pathLength:0,d:Bt(n)||"",opacity:1},whileInView:Se},initial:"initial",animate:u?"whileInView":"initial"}),ke,De,Ie]}),Ne,Te,qe,Me]})}),Fe]})}function Di(r){return r.layer}function Ii(r){return r.position==="after"}function Ni(r){return r.layer}function Ti(r){return r.position==="before"}function qi(r){return r!==0}function $i(r){return r!==0}function Mi(r){return r.date}function Fi(r){return r.y2}function Gi(r){return r.y2}function Pi(r){return r.y1}function Hi(r){return r.y1}function Wi(r){return r.y2}function Yi(r){return r.y2}function Xi(r){return r.y2}function Ui(r){return r.y1}function Bi(r){return r.y1}function zi(r){return r.y1}function Ji(r){const t=s.compilerRuntimeExports.c(90),{data:k,graphTitle:ot,suffix:Nt,sources:c,prefix:E,graphDescription:v,height:x,width:w,footNote:Tt,noOfXTicks:qt,dateFormat:V,showValues:$t,padding:gt,lineColors:H,backgroundColor:Mt,leftMargin:Ft,rightMargin:i,topMargin:W,bottomMargin:Gt,tooltip:N,highlightAreaSettings:D,relativeHeight:st,onSeriesMouseOver:T,graphID:q,graphDownload:jt,dataDownload:I,animate:vt,language:Pt,minHeight:Ht,labels:Y,showColorLegendAtTop:xe,colorLegendTitle:Wt,diffAreaColors:wt,strokeWidth:Rt,showDots:f,refValues:d,minValue:b,maxValue:$,annotations:bt,customHighlightAreaSettings:X,theme:u,ariaLabel:p,yAxisTitle:ne,noOfYTicks:Et,minDate:at,maxDate:U,curveType:L,styles:g,classNames:h,precision:oe,customLayers:B}=r,Yt=Nt===void 0?"":Nt,Ot=E===void 0?"":E,rt=qt===void 0?10:qt,y=V===void 0?"yyyy":V,lt=$t===void 0?!1:$t;let z;t[0]!==H?(z=H===void 0?[Pe.Colors.light.categoricalColors.colors[0],Pe.Colors.light.categoricalColors.colors[1]]:H,t[0]=H,t[1]=z):z=t[1];const n=z,ct=Mt===void 0?!1:Mt,Ct=Ft===void 0?30:Ft,ut=i===void 0?50:i,se=W===void 0?20:W,m=Gt===void 0?25:Gt;let j;t[2]!==D?(j=D===void 0?[]:D,t[2]=D,t[3]=j):j=t[3];const ae=j,Xt=jt===void 0?!1:jt,J=I===void 0?!1:I,K=vt===void 0?!1:vt,M=Pt===void 0?"en":Pt,Ut=Ht===void 0?0:Ht,Q=xe===void 0?!1:xe;let R;t[4]!==wt?(R=wt===void 0?[Pe.Colors.alerts.red,Pe.Colors.alerts.darkGreen]:wt,t[4]=wt,t[5]=R):R=t[5];const Z=R,a=Rt===void 0?2:Rt,xt=f===void 0?!0:f;let _;t[6]!==d?(_=d===void 0?[]:d,t[6]=d,t[7]=_):_=t[7];const l=_;let mt;t[8]!==bt?(mt=bt===void 0?[]:bt,t[8]=bt,t[9]=mt):mt=t[9];const Bt=mt;let At;t[10]!==X?(At=X===void 0?[]:X,t[10]=X,t[11]=At):At=t[11];const re=At,le=u===void 0?"light":u,zt=Et===void 0?5:Et,Jt=L===void 0?"curve":L,dt=oe===void 0?2:oe;let tt;t[12]!==B?(tt=B===void 0?[]:B,t[12]=B,t[13]=tt):tt=t[13];const pt=tt,[et,ce]=A.useState(0),[it,ue]=A.useState(0),Vt=A.useRef(null),Lt=A.useRef(null);let ft,ht;t[14]===Symbol.for("react.memo_cache_sentinel")?(ft=()=>{const Kt=new ResizeObserver(nt=>{ce(nt[0].target.clientWidth||620),ue(nt[0].target.clientHeight||480)});return Vt.current&&Kt.observe(Vt.current),()=>Kt.disconnect()},ht=[],t[14]=ft,t[15]=ht):(ft=t[14],ht=t[15]),A.useEffect(ft,ht);const St=h?.graphContainer,kt=g?.graphContainer;let F;t[16]!==h?.description||t[17]!==h?.title||t[18]!==k||t[19]!==J||t[20]!==v||t[21]!==Xt||t[22]!==ot||t[23]!==g?.description||t[24]!==g?.title||t[25]!==w?(F=ot||v||Xt||J?s.jsxRuntimeExports.jsx(Ci.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:ot,graphDescription:v,width:w,graphDownload:Xt?Lt:void 0,dataDownload:J?k.map(tn).filter(_i).length>0?k.map(Zi).filter(Qi):k.filter(Ki):null}):null,t[16]=h?.description,t[17]=h?.title,t[18]=k,t[19]=J,t[20]=v,t[21]=Xt,t[22]=ot,t[23]=g?.description,t[24]=g?.title,t[25]=w,t[26]=F):F=t[26];let C;t[27]!==K||t[28]!==Bt||t[29]!==m||t[30]!==h||t[31]!==Wt||t[32]!==Jt||t[33]!==re||t[34]!==pt||t[35]!==k||t[36]!==y||t[37]!==Z||t[38]!==ae||t[39]!==Y||t[40]!==M||t[41]!==Ct||t[42]!==n||t[43]!==U||t[44]!==$||t[45]!==at||t[46]!==b||t[47]!==rt||t[48]!==zt||t[49]!==T||t[50]!==dt||t[51]!==Ot||t[52]!==l||t[53]!==ut||t[54]!==Q||t[55]!==xt||t[56]!==lt||t[57]!==a||t[58]!==g||t[59]!==Yt||t[60]!==it||t[61]!==et||t[62]!==N||t[63]!==se||t[64]!==ne?(C=k.length===0?s.jsxRuntimeExports.jsx(Li.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Q?s.jsxRuntimeExports.jsx(Ai.ColorLegend,{colorDomain:Y,colorLegendTitle:Wt,colors:n,showNAColor:!1,className:h?.colorLegend}):null,s.jsxRuntimeExports.jsx(si.GraphArea,{ref:Vt,children:et&&it?s.jsxRuntimeExports.jsx(ki,{data:k,lineColors:n,colorDomain:Y,width:et,height:it,suffix:Yt,prefix:Ot,dateFormat:y,showValues:lt,noOfXTicks:rt??Si.getNoOfTicks(et),leftMargin:Ct,rightMargin:ut,topMargin:se,bottomMargin:m,highlightAreaSettings:ae,tooltip:N,onSeriesMouseOver:T,showColorLegendAtTop:Q,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},rtl:M==="he"||M==="ar",diffAreaColors:Z,idSuffix:Vi.generateRandomString(8),strokeWidth:a,showDots:xt,refValues:l,minValue:b,maxValue:$,annotations:Bt,customHighlightAreaSettings:re,yAxisTitle:ne,noOfYTicks:zt,minDate:at,maxDate:U,curveType:Jt,styles:g,classNames:h,precision:dt,customLayers:pt}):null})]}),t[27]=K,t[28]=Bt,t[29]=m,t[30]=h,t[31]=Wt,t[32]=Jt,t[33]=re,t[34]=pt,t[35]=k,t[36]=y,t[37]=Z,t[38]=ae,t[39]=Y,t[40]=M,t[41]=Ct,t[42]=n,t[43]=U,t[44]=$,t[45]=at,t[46]=b,t[47]=rt,t[48]=zt,t[49]=T,t[50]=dt,t[51]=Ot,t[52]=l,t[53]=ut,t[54]=Q,t[55]=xt,t[56]=lt,t[57]=a,t[58]=g,t[59]=Yt,t[60]=it,t[61]=et,t[62]=N,t[63]=se,t[64]=ne,t[65]=C):C=t[65];let G;t[66]!==h?.footnote||t[67]!==h?.source||t[68]!==Tt||t[69]!==c||t[70]!==g?.footnote||t[71]!==g?.source||t[72]!==w?(G=c||Tt?s.jsxRuntimeExports.jsx(Oi.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:c,footNote:Tt,width:w}):null,t[66]=h?.footnote,t[67]=h?.source,t[68]=Tt,t[69]=c,t[70]=g?.footnote,t[71]=g?.source,t[72]=w,t[73]=G):G=t[73];let yt;return t[74]!==p||t[75]!==ct||t[76]!==q||t[77]!==x||t[78]!==M||t[79]!==Ut||t[80]!==gt||t[81]!==st||t[82]!==St||t[83]!==kt||t[84]!==F||t[85]!==C||t[86]!==G||t[87]!==le||t[88]!==w?(yt=s.jsxRuntimeExports.jsxs(si.GraphContainer,{className:St,style:kt,id:q,ref:Lt,"aria-label":p,backgroundColor:ct,theme:le,language:M,minHeight:Ut,width:w,height:x,relativeHeight:st,padding:gt,children:[F,C,G]}),t[74]=p,t[75]=ct,t[76]=q,t[77]=x,t[78]=M,t[79]=Ut,t[80]=gt,t[81]=st,t[82]=St,t[83]=kt,t[84]=F,t[85]=C,t[86]=G,t[87]=le,t[88]=w,t[89]=yt):yt=t[89],yt}function Ki(r){return r!==void 0}function Qi(r){return r!==void 0}function Zi(r){return r.data}function _i(r){return r!==void 0}function tn(r){return r.data}exports.DifferenceLineChart=Ji;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),A=require("react"),O=require("./parse-hMnG_lRV.cjs"),xi=require("./index-Cno4Q0YE.cjs"),ei=require("./numberFormattingFunction-02t-wJta.cjs"),mi=require("./Tooltip-uUdw6wJL.cjs"),It=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ii=require("./customArea-CMF5g-C3.cjs"),di=require("./AxisTitle-sS5bLLR7.cjs"),pi=require("./Axis-DxRV2yMi.cjs"),fi=require("./XTicksAndGridLines-B6CELS7q.cjs"),hi=require("./ReferenceLine-BH0qdf4R.cjs"),yi=require("./YTicksAndGridLines-4pxTRlRK.cjs"),gi=require("./index-B_sAFsEV.cjs"),ji=require("./time-CZd5YLSP.cjs"),vi=require("./linear-BwPAspcq.cjs"),ni=require("./line-DaEMhXmx.cjs"),Ge=require("./step-BZ3C8QFW.cjs"),oi=require("./area-C1gxfNGD.cjs"),wi=require("./select-Bnfk0lJx.cjs"),Ri=require("./init-DU0ybBc_.cjs"),bi=require("./pointer-Dkq5NV1q.cjs"),Ei=require("./use-in-view-QcfiW0w3.cjs"),S=require("./proxy-BxvUI_9l.cjs"),Oi=require("./GraphFooter.cjs"),Ci=require("./GraphHeader.cjs"),Ai=require("./ColorLegend.cjs"),Pe=require("./Colors.cjs"),Vi=require("./generateRandomString-B5zBiJzS.cjs"),Li=require("./EmptyState-sAEZ_5rU.cjs"),si=require("./GraphContainer-d8A46BK2.cjs"),Si=require("./getNoOfTicks-C_1CFXv_.cjs");function ki(r){const t=s.compilerRuntimeExports.c(217),{data:k,width:ot,height:Nt,lineColors:c,suffix:E,prefix:v,dateFormat:x,showValues:w,noOfXTicks:Tt,rightMargin:qt,leftMargin:V,topMargin:$t,bottomMargin:gt,tooltip:H,highlightAreaSettings:Mt,onSeriesMouseOver:Ft,animate:i,rtl:W,showColorLegendAtTop:Gt,colorDomain:N,diffAreaColors:D,idSuffix:st,strokeWidth:T,showDots:q,refValues:jt,minValue:I,maxValue:vt,annotations:Pt,customHighlightAreaSettings:Ht,yAxisTitle:Y,noOfYTicks:xe,minDate:Wt,maxDate:wt,curveType:Rt,styles:f,classNames:d,precision:b,customLayers:$}=r,bt=A.useRef(null);let X;t[0]!==i.amount||t[1]!==i.once?(X={once:i.once,amount:i.amount},t[0]=i.amount,t[1]=i.once,t[2]=X):X=t[2];const u=Ei.useInView(bt,X),[p,ne]=A.useState(!1);let Et,at;t[3]!==i.duration||t[4]!==p||t[5]!==u?(Et=()=>{if(u&&!p){const o=setTimeout(()=>{ne(!0)},(i.duration+.5)*1e3);return()=>clearTimeout(o)}},at=[u,p,i.duration],t[3]=i.duration,t[4]=p,t[5]=u,t[6]=Et,t[7]=at):(Et=t[6],at=t[7]),A.useEffect(Et,at);const U=Rt==="linear"?ni.curveLinear:Rt==="step"?Ge.curveStep:Rt==="stepAfter"?Ge.stepAfter:Rt==="stepBefore"?Ge.stepBefore:Ge.monotoneX,[L,g]=A.useState(void 0),[h,oe]=A.useState(void 0),[B,Yt]=A.useState(void 0),Ot=Y?V+30:V;let rt;t[8]!==gt||t[9]!==qt||t[10]!==Ot||t[11]!==$t?(rt={top:$t,bottom:gt,left:Ot,right:qt},t[8]=gt,t[9]=qt,t[10]=Ot,t[11]=$t,t[12]=rt):rt=t[12];const y=rt,lt=A.useRef(null);let z;t[13]!==x?(z=o=>({...o,date:O.parse(`${o.date}`,x,new Date)}),t[13]=x,t[14]=z):z=t[14];const n=xi.orderBy(k.map(z),["date"],["asc"]);let ct;if(t[15]!==x||t[16]!==Mt){let o;t[18]!==x?(o=e=>({...e,coordinates:[e.coordinates[0]===null?null:O.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:O.parse(`${e.coordinates[1]}`,x,new Date)]}),t[18]=x,t[19]=o):o=t[19],ct=Mt.map(o),t[15]=x,t[16]=Mt,t[17]=ct}else ct=t[17];const Ct=ct;let ut;if(t[20]!==Ht||t[21]!==x){let o;t[23]!==x?(o=e=>({...e,coordinates:e.coordinates.map((P,Dt)=>Dt%2===0?O.parse(`${P}`,x,new Date):P)}),t[23]=x,t[24]=o):o=t[24],ut=Ht.map(o),t[20]=Ht,t[21]=x,t[22]=ut}else ut=t[22];const se=ut,m=ot-y.left-y.right,j=Nt-y.top-y.bottom,ae=Wt?O.parse(`${Wt}`,x,new Date):n[0].date,Xt=wt?O.parse(`${wt}`,x,new Date):n[n.length-1].date,J=Math.min(...n.map(zi))!==1/0?Math.min(...n.map(Bi))>0?0:Math.min(...n.map(Ui)):0,K=Math.min(...n.map(Xi))!==1/0?Math.min(...n.map(Yi))>0?0:Math.min(...n.map(Wi)):0,M=Math.max(...n.map(Hi))!==1/0?Math.max(...n.map(Pi)):0,Ut=Math.max(...n.map(Gi))!==1/0?Math.max(...n.map(Fi)):0;let Q;t[25]!==J||t[26]!==K||t[27]!==I?(Q=It.checkIfNullOrUndefined(I)?J<K?J:K:I,t[25]=J,t[26]=K,t[27]=I,t[28]=Q):Q=t[28];const R=Q,Z=M>Ut?M:Ut,a=ji.time().domain([ae,Xt]).range([0,m]);let xt;t[29]!==R||t[30]!==I?(xt=It.checkIfNullOrUndefined(I)?R:I,t[29]=R,t[30]=I,t[31]=xt):xt=t[31];let _;t[32]!==Z||t[33]!==vt?(_=It.checkIfNullOrUndefined(vt)?Z>0?Z:0:vt,t[32]=Z,t[33]=vt,t[34]=_):_=t[34];const l=vi.linear().domain([xt,_]).range([j,0]).nice(),mt=ni.line().x(o=>a(o.date)).y(o=>l(o.y1)).curve(U),Bt=ni.line().x(o=>a(o.date)).y(o=>l(o.y2)).curve(U),At=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(o=>l(o.y2)).curve(U),re=oi.area().x(o=>a(o.date)).y1(o=>l(o.y1)).y0(0).curve(U),le=oi.area().x(o=>a(o.date)).y1(o=>l(o.y2)).y0(0).curve(U),zt=l.ticks(xe),Jt=a.ticks(Tt);A.useEffect(()=>{const o=P=>{const Dt=n[Ri.bisectCenter(n.map(Mi),a.invert(bi.pointer(P)[0]),0)];g(Dt||n[n.length-1]),Ft?.(Dt||n[n.length-1]),Yt(P.clientY),oe(P.clientX)},e=()=>{g(void 0),oe(void 0),Yt(void 0),Ft?.(void 0)};wi.select(lt.current).on("mousemove",o).on("mouseout",e)},[a,n,Ft]);let dt;t[35]===Symbol.for("react.memo_cache_sentinel")?(dt={fill:"none"},t[35]=dt):dt=t[35];let tt;t[36]===Symbol.for("react.memo_cache_sentinel")?(tt={fill:"none"},t[36]=tt):tt=t[36];let pt;t[37]!==i||t[38]!==j||t[39]!==m||t[40]!==Ct||t[41]!==u||t[42]!==a?(pt=s.jsxRuntimeExports.jsx(gi.HighlightArea,{areaSettings:Ct,width:m,height:j,scale:a,animate:i,isInView:u}),t[37]=i,t[38]=j,t[39]=m,t[40]=Ct,t[41]=u,t[42]=a,t[43]=pt):pt=t[43];const et=f?.yAxis?.gridLines,ce=f?.yAxis?.labels;let it;t[44]!==et||t[45]!==ce?(it={gridLines:et,labels:ce},t[44]=et,t[45]=ce,t[46]=it):it=t[46];const ue=d?.yAxis?.gridLines,Vt=d?.yAxis?.labels;let Lt;t[47]!==ue||t[48]!==Vt?(Lt={gridLines:ue,labels:Vt},t[47]=ue,t[48]=Vt,t[49]=Lt):Lt=t[49];const ft=l(R<0?0:R),ht=l(R<0?0:R),St=0-V,kt=m+y.right,F=R<0?0:R;let C;t[50]!==b||t[51]!==v||t[52]!==E||t[53]!==F?(C=ei.numberFormattingFunction(F,"NA",b,v,E),t[50]=b,t[51]=v,t[52]=E,t[53]=F,t[54]=C):C=t[54];const G=0-V,yt=l(R<0?0:R),Kt=Z<0?"1rem":-5;let nt;t[55]!==G||t[56]!==yt||t[57]!==Kt?(nt={x:G,y:yt,dx:0,dy:Kt},t[55]=G,t[56]=yt,t[57]=Kt,t[58]=nt):nt=t[58];const He=d?.xAxis?.axis,We=d?.yAxis?.labels;let Qt;t[59]!==He||t[60]!==We?(Qt={axis:He,label:We},t[59]=He,t[60]=We,t[61]=Qt):Qt=t[61];const Ye=f?.xAxis?.axis,Xe=f?.yAxis?.labels;let Zt;t[62]!==Ye||t[63]!==Xe?(Zt={axis:Ye,label:Xe},t[62]=Ye,t[63]=Xe,t[64]=Zt):Zt=t[64];let me;t[65]!==ft||t[66]!==ht||t[67]!==St||t[68]!==kt||t[69]!==C||t[70]!==nt||t[71]!==Qt||t[72]!==Zt?(me=s.jsxRuntimeExports.jsx(pi.Axis,{y1:ft,y2:ht,x1:St,x2:kt,label:C,labelPos:nt,classNames:Qt,styles:Zt}),t[65]=ft,t[66]=ht,t[67]=St,t[68]=kt,t[69]=C,t[70]=nt,t[71]=Qt,t[72]=Zt,t[73]=me):me=t[73];const Ue=0-V-15,Be=j/2,ze=f?.yAxis?.title,Je=d?.yAxis?.title;let de;t[74]!==Ue||t[75]!==Be||t[76]!==ze||t[77]!==Je||t[78]!==Y?(de=s.jsxRuntimeExports.jsx(di.AxisTitle,{x:Ue,y:Be,style:ze,className:Je,text:Y,rotate90:!0}),t[74]=Ue,t[75]=Be,t[76]=ze,t[77]=Je,t[78]=Y,t[79]=de):de=t[79];let pe;t[80]!==x?(pe=o=>O.format(o,x),t[80]=x,t[81]=pe):pe=t[81];const ai=Jt.map(pe),ri=Jt.map(o=>a(o)),Ke=f?.xAxis?.gridLines,Qe=f?.xAxis?.labels;let fe;t[82]!==Ke||t[83]!==Qe?(fe={gridLines:Ke,labels:Qe},t[82]=Ke,t[83]=Qe,t[84]=fe):fe=t[84];const Ze=d?.xAxis?.gridLines;let _t;t[85]!==Ze?(_t=s.mo("opacity-0",Ze),t[85]=Ze,t[86]=_t):_t=t[86];const _e=d?.xAxis?.labels;let te;t[87]!==_e?(te=s.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",_e),t[87]=_e,t[88]=te):te=t[88];let he;t[89]!==_t||t[90]!==te?(he={gridLines:_t,labels:te},t[89]=_t,t[90]=te,t[91]=he):he=t[91];let ye;t[92]!==$?(ye=$.filter(Ti).map(Ni),t[92]=$,t[93]=ye):ye=t[93];let ge;t[94]!==D[1]?(ge={fill:D[1]},t[94]=D[1],t[95]=ge):ge=t[95];let je;t[96]!==i.duration?(je={opacity:0,transition:{duration:i.duration}},t[96]=i.duration,t[97]=je):je=t[97];let ve;t[98]===Symbol.for("react.memo_cache_sentinel")?(ve={opacity:1},t[98]=ve):ve=t[98];let we;t[99]!==i.duration?(we={initial:ve,whileInView:{opacity:1,transition:{duration:i.duration}}},t[99]=i.duration,t[100]=we):we=t[100];let Re;t[101]!==D[0]?(Re={fill:D[0]},t[101]=D[0],t[102]=Re):Re=t[102];let be;t[103]!==i.duration?(be={opacity:0,transition:{duration:i.duration}},t[103]=i.duration,t[104]=be):be=t[104];let Ee;t[105]===Symbol.for("react.memo_cache_sentinel")?(Ee={opacity:0},t[105]=Ee):Ee=t[105];let Oe;t[106]!==i.duration?(Oe={initial:Ee,whileInView:{opacity:1,transition:{duration:i.duration}}},t[106]=i.duration,t[107]=Oe):Oe=t[107];let Ce;t[108]!==c[0]||t[109]!==T?(Ce={fill:"none",stroke:c[0],strokeWidth:T},t[108]=c[0],t[109]=T,t[110]=Ce):Ce=t[110];let Ae;t[111]!==i.duration?(Ae={opacity:0,transition:{duration:i.duration}},t[111]=i.duration,t[112]=Ae):Ae=t[112];let Ve;t[113]!==c[1]||t[114]!==T?(Ve={fill:"none",stroke:c[1],strokeWidth:T},t[113]=c[1],t[114]=T,t[115]=Ve):Ve=t[115];let Le;t[116]!==i.duration?(Le={opacity:0,transition:{duration:i.duration}},t[116]=i.duration,t[117]=Le):Le=t[117];const li=1,ti=Bt(n)||"";let ee;t[118]!==i.duration?(ee={duration:i.duration},t[118]=i.duration,t[119]=ee):ee=t[119];let Se;t[120]!==ti||t[121]!==ee?(Se={pathLength:li,d:ti,opacity:1,transition:ee},t[120]=ti,t[121]=ee,t[122]=Se):Se=t[122];let ke;t[123]!==i.duration||t[124]!==N||t[125]!==n||t[126]!==p||t[127]!==u||t[128]!==c[0]||t[129]!==c[1]||t[130]!==Gt||t[131]!==a||t[132]!==l?(ke=Gt?null:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y1),fill:c[0],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[0]},N[0]),s.jsxRuntimeExports.jsx(S.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1]},whileInView:{opacity:1,x:a(n[n.length-1].date),y:l(n[n.length-1].y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:N[1]},N[1])]}),t[123]=i.duration,t[124]=N,t[125]=n,t[126]=p,t[127]=u,t[128]=c[0],t[129]=c[1],t[130]=Gt,t[131]=a,t[132]=l,t[133]=ke):ke=t[133];let De;t[134]!==d?.mouseOverLine||t[135]!==j||t[136]!==L||t[137]!==f?.mouseOverLine||t[138]!==a?(De=L?s.jsxRuntimeExports.jsx("line",{y1:0,y2:j,x1:a(L.date),x2:a(L.date),className:s.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:f?.mouseOverLine}):null,t[134]=d?.mouseOverLine,t[135]=j,t[136]=L,t[137]=f?.mouseOverLine,t[138]=a,t[139]=De):De=t[139];let Ie;if(t[140]!==i.duration||t[141]!==d?.graphObjectValues||t[142]!==n||t[143]!==m||t[144]!==p||t[145]!==u||t[146]!==c[0]||t[147]!==c[1]||t[148]!==b||t[149]!==v||t[150]!==q||t[151]!==w||t[152]!==f?.graphObjectValues||t[153]!==E||t[154]!==a||t[155]!==l){let o;t[157]!==i.duration||t[158]!==d?.graphObjectValues||t[159]!==n.length||t[160]!==m||t[161]!==p||t[162]!==u||t[163]!==c[0]||t[164]!==c[1]||t[165]!==b||t[166]!==v||t[167]!==q||t[168]!==w||t[169]!==f?.graphObjectValues||t[170]!==E||t[171]!==a||t[172]!==l?(o=(e,P)=>s.jsxRuntimeExports.jsxs(S.motion.g,{children:[It.checkIfNullOrUndefined(e.y1)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],transition:{duration:.5,delay:i.duration},cx:a(e.date),cy:l(e.y1)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2<e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y1),fill:c[0]},whileInView:{opacity:1,fill:c[0],x:a(e.date),y:l(e.y1),transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y1,"NA",b,v,E)}):null]}),It.checkIfNullOrUndefined(e.y2)?null:s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[q?s.jsxRuntimeExports.jsx(S.motion.circle,{r:m/n.length<5?0:m/n.length<20?2:4,exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,cx:a(e.date),cy:l(e.y2),fill:c[1]},whileInView:{opacity:1,fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration},cx:a(e.date),cy:l(e.y2)}},initial:"initial",animate:u?"whileInView":"initial"}):null,w?s.jsxRuntimeExports.jsx(S.motion.text,{dy:e.y2>e.y1?-8:"1em",style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:i.duration}},variants:{initial:{opacity:0,x:a(e.date),y:l(e.y2),fill:c[1]},whileInView:{opacity:1,x:a(e.date),y:l(e.y2),fill:c[1],transition:{duration:p?i.duration:.5,delay:p?0:i.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:ei.numberFormattingFunction(e.y2,"NA",b,v,E)}):null]})]},P),t[157]=i.duration,t[158]=d?.graphObjectValues,t[159]=n.length,t[160]=m,t[161]=p,t[162]=u,t[163]=c[0],t[164]=c[1],t[165]=b,t[166]=v,t[167]=q,t[168]=w,t[169]=f?.graphObjectValues,t[170]=E,t[171]=a,t[172]=l,t[173]=o):o=t[173],Ie=n.map(o),t[140]=i.duration,t[141]=d?.graphObjectValues,t[142]=n,t[143]=m,t[144]=p,t[145]=u,t[146]=c[0],t[147]=c[1],t[148]=b,t[149]=v,t[150]=q,t[151]=w,t[152]=f?.graphObjectValues,t[153]=E,t[154]=a,t[155]=l,t[156]=Ie}else Ie=t[156];let Ne;t[174]!==i||t[175]!==m||t[176]!==u||t[177]!==V||t[178]!==y.right||t[179]!==jt||t[180]!==l?(Ne=jt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:jt.map((o,e)=>s.jsxRuntimeExports.jsx(hi.RefLineY,{text:o.text,color:o.color,y:l(o.value),x1:0-V,x2:m+y.right,classNames:o.classNames,styles:o.styles,animate:i,isInView:u},e))}):null,t[174]=i,t[175]=m,t[176]=u,t[177]=V,t[178]=y.right,t[179]=jt,t[180]=l,t[181]=Ne):Ne=t[181];let ie;if(t[182]!==i||t[183]!==Pt||t[184]!==x||t[185]!==m||t[186]!==u||t[187]!==y.right||t[188]!==W||t[189]!==a||t[190]!==l){let o;t[192]!==i||t[193]!==x||t[194]!==m||t[195]!==u||t[196]!==y.right||t[197]!==W||t[198]!==a||t[199]!==l?(o=(e,P)=>{const Dt=ii.getLineEndPoint({x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?l(e.yCoordinate):0},It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ci=e.showConnector?{y1:Dt.y,x1:Dt.x,y2:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?l(e.yCoordinate):0,cx:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:It.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,ui={y:e.yCoordinate?l(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):m+y.right-(e.xCoordinate?a(O.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return s.jsxRuntimeExports.jsx(ii.Annotation,{color:e.color,connectorsSettings:ci,labelSettings:ui,text:e.text,classNames:e.classNames,styles:e.styles,animate:i,isInView:u},P)},t[192]=i,t[193]=x,t[194]=m,t[195]=u,t[196]=y.right,t[197]=W,t[198]=a,t[199]=l,t[200]=o):o=t[200],ie=Pt.map(o),t[182]=i,t[183]=Pt,t[184]=x,t[185]=m,t[186]=u,t[187]=y.right,t[188]=W,t[189]=a,t[190]=l,t[191]=ie}else ie=t[191];let Te;t[201]!==ie?(Te=s.jsxRuntimeExports.jsx("g",{children:ie}),t[201]=ie,t[202]=Te):Te=t[202];let qe;t[203]!==$?(qe=$.filter(Ii).map(Di),t[203]=$,t[204]=qe):qe=t[204];let $e;t[205]===Symbol.for("react.memo_cache_sentinel")?($e={fill:"none",pointerEvents:"all"},t[205]=$e):$e=t[205];let Me;t[206]!==lt||t[207]!==j||t[208]!==m?(Me=s.jsxRuntimeExports.jsx("rect",{ref:lt,style:$e,width:m,height:j}),t[206]=lt,t[207]=j,t[208]=m,t[209]=Me):Me=t[209];let Fe;return t[210]!==d?.tooltip||t[211]!==h||t[212]!==B||t[213]!==L||t[214]!==f?.tooltip||t[215]!==H?(Fe=L&&H&&h&&B?s.jsxRuntimeExports.jsx(mi.Tooltip,{data:L,body:H,xPos:h,yPos:B,backgroundStyle:f?.tooltip,className:d?.tooltip}):null,t[210]=d?.tooltip,t[211]=h,t[212]=B,t[213]=L,t[214]=f?.tooltip,t[215]=H,t[216]=Fe):Fe=t[216],s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(S.motion.svg,{width:`${ot}px`,height:`${Nt}px`,viewBox:`0 0 ${ot} ${Nt}`,direction:"ltr",ref:bt,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${y.left},${y.top})`,children:[s.jsxRuntimeExports.jsx("clipPath",{id:`above${st}`,children:s.jsxRuntimeExports.jsx("path",{d:le(n),style:dt})}),s.jsxRuntimeExports.jsx("clipPath",{id:`below${st}`,children:s.jsxRuntimeExports.jsx("path",{d:re(n),style:tt})}),pt,s.jsxRuntimeExports.jsx(ii.CustomArea,{areaSettings:se,scaleX:a,scaleY:l,animate:i,isInView:u}),s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(yi.YTicksAndGridLines,{values:zt.filter($i),y:zt.filter(qi).map(o=>l(o)),x1:0-V,x2:m+y.right,styles:it,classNames:Lt,suffix:E,prefix:v,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:b}),me,de]})}),s.jsxRuntimeExports.jsx(fi.XTicksAndGridLines,{values:ai,x:ri,y1:0,y2:j,styles:fe,classNames:he,suffix:E,prefix:v,labelType:"primary",showGridLines:!0,precision:b}),ye,s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#below${st})`,d:At(n)||"",style:ge,exit:je,variants:we,initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{clipPath:`url(#above${st})`,d:At(n)||"",style:Re,exit:be,variants:Oe,initial:"initial",animate:u?"whileInView":"initial"})]}),s.jsxRuntimeExports.jsxs("g",{children:[s.jsxRuntimeExports.jsx(S.motion.path,{d:mt(n)||"",style:Ce,exit:Ae,variants:{initial:{pathLength:0,d:mt(n)||"",opacity:1},whileInView:{pathLength:1,d:mt(n)||"",opacity:1,transition:{duration:i.duration}}},initial:"initial",animate:u?"whileInView":"initial"}),s.jsxRuntimeExports.jsx(S.motion.path,{style:Ve,exit:Le,variants:{initial:{pathLength:0,d:Bt(n)||"",opacity:1},whileInView:Se},initial:"initial",animate:u?"whileInView":"initial"}),ke,De,Ie]}),Ne,Te,qe,Me]})}),Fe]})}function Di(r){return r.layer}function Ii(r){return r.position==="after"}function Ni(r){return r.layer}function Ti(r){return r.position==="before"}function qi(r){return r!==0}function $i(r){return r!==0}function Mi(r){return r.date}function Fi(r){return r.y2}function Gi(r){return r.y2}function Pi(r){return r.y1}function Hi(r){return r.y1}function Wi(r){return r.y2}function Yi(r){return r.y2}function Xi(r){return r.y2}function Ui(r){return r.y1}function Bi(r){return r.y1}function zi(r){return r.y1}function Ji(r){const t=s.compilerRuntimeExports.c(90),{data:k,graphTitle:ot,suffix:Nt,sources:c,prefix:E,graphDescription:v,height:x,width:w,footNote:Tt,noOfXTicks:qt,dateFormat:V,showValues:$t,padding:gt,lineColors:H,backgroundColor:Mt,leftMargin:Ft,rightMargin:i,topMargin:W,bottomMargin:Gt,tooltip:N,highlightAreaSettings:D,relativeHeight:st,onSeriesMouseOver:T,graphID:q,graphDownload:jt,dataDownload:I,animate:vt,language:Pt,minHeight:Ht,labels:Y,showColorLegendAtTop:xe,colorLegendTitle:Wt,diffAreaColors:wt,strokeWidth:Rt,showDots:f,refValues:d,minValue:b,maxValue:$,annotations:bt,customHighlightAreaSettings:X,theme:u,ariaLabel:p,yAxisTitle:ne,noOfYTicks:Et,minDate:at,maxDate:U,curveType:L,styles:g,classNames:h,precision:oe,customLayers:B}=r,Yt=Nt===void 0?"":Nt,Ot=E===void 0?"":E,rt=qt===void 0?10:qt,y=V===void 0?"yyyy":V,lt=$t===void 0?!1:$t;let z;t[0]!==H?(z=H===void 0?[Pe.Colors.light.categoricalColors.colors[0],Pe.Colors.light.categoricalColors.colors[1]]:H,t[0]=H,t[1]=z):z=t[1];const n=z,ct=Mt===void 0?!1:Mt,Ct=Ft===void 0?30:Ft,ut=i===void 0?50:i,se=W===void 0?20:W,m=Gt===void 0?25:Gt;let j;t[2]!==D?(j=D===void 0?[]:D,t[2]=D,t[3]=j):j=t[3];const ae=j,Xt=jt===void 0?!1:jt,J=I===void 0?!1:I,K=vt===void 0?!1:vt,M=Pt===void 0?"en":Pt,Ut=Ht===void 0?0:Ht,Q=xe===void 0?!1:xe;let R;t[4]!==wt?(R=wt===void 0?[Pe.Colors.alerts.red,Pe.Colors.alerts.darkGreen]:wt,t[4]=wt,t[5]=R):R=t[5];const Z=R,a=Rt===void 0?2:Rt,xt=f===void 0?!0:f;let _;t[6]!==d?(_=d===void 0?[]:d,t[6]=d,t[7]=_):_=t[7];const l=_;let mt;t[8]!==bt?(mt=bt===void 0?[]:bt,t[8]=bt,t[9]=mt):mt=t[9];const Bt=mt;let At;t[10]!==X?(At=X===void 0?[]:X,t[10]=X,t[11]=At):At=t[11];const re=At,le=u===void 0?"light":u,zt=Et===void 0?5:Et,Jt=L===void 0?"curve":L,dt=oe===void 0?2:oe;let tt;t[12]!==B?(tt=B===void 0?[]:B,t[12]=B,t[13]=tt):tt=t[13];const pt=tt,[et,ce]=A.useState(0),[it,ue]=A.useState(0),Vt=A.useRef(null),Lt=A.useRef(null);let ft,ht;t[14]===Symbol.for("react.memo_cache_sentinel")?(ft=()=>{const Kt=new ResizeObserver(nt=>{ce(nt[0].target.clientWidth||620),ue(nt[0].target.clientHeight||480)});return Vt.current&&Kt.observe(Vt.current),()=>Kt.disconnect()},ht=[],t[14]=ft,t[15]=ht):(ft=t[14],ht=t[15]),A.useEffect(ft,ht);const St=h?.graphContainer,kt=g?.graphContainer;let F;t[16]!==h?.description||t[17]!==h?.title||t[18]!==k||t[19]!==J||t[20]!==v||t[21]!==Xt||t[22]!==ot||t[23]!==g?.description||t[24]!==g?.title||t[25]!==w?(F=ot||v||Xt||J?s.jsxRuntimeExports.jsx(Ci.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:ot,graphDescription:v,width:w,graphDownload:Xt?Lt:void 0,dataDownload:J?k.map(tn).filter(_i).length>0?k.map(Zi).filter(Qi):k.filter(Ki):null}):null,t[16]=h?.description,t[17]=h?.title,t[18]=k,t[19]=J,t[20]=v,t[21]=Xt,t[22]=ot,t[23]=g?.description,t[24]=g?.title,t[25]=w,t[26]=F):F=t[26];let C;t[27]!==K||t[28]!==Bt||t[29]!==m||t[30]!==h||t[31]!==Wt||t[32]!==Jt||t[33]!==re||t[34]!==pt||t[35]!==k||t[36]!==y||t[37]!==Z||t[38]!==ae||t[39]!==Y||t[40]!==M||t[41]!==Ct||t[42]!==n||t[43]!==U||t[44]!==$||t[45]!==at||t[46]!==b||t[47]!==rt||t[48]!==zt||t[49]!==T||t[50]!==dt||t[51]!==Ot||t[52]!==l||t[53]!==ut||t[54]!==Q||t[55]!==xt||t[56]!==lt||t[57]!==a||t[58]!==g||t[59]!==Yt||t[60]!==it||t[61]!==et||t[62]!==N||t[63]!==se||t[64]!==ne?(C=k.length===0?s.jsxRuntimeExports.jsx(Li.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Q?s.jsxRuntimeExports.jsx(Ai.ColorLegend,{colorDomain:Y,colorLegendTitle:Wt,colors:n,showNAColor:!1,className:h?.colorLegend}):null,s.jsxRuntimeExports.jsx(si.GraphArea,{ref:Vt,children:et&&it?s.jsxRuntimeExports.jsx(ki,{data:k,lineColors:n,colorDomain:Y,width:et,height:it,suffix:Yt,prefix:Ot,dateFormat:y,showValues:lt,noOfXTicks:rt??Si.getNoOfTicks(et),leftMargin:Ct,rightMargin:ut,topMargin:se,bottomMargin:m,highlightAreaSettings:ae,tooltip:N,onSeriesMouseOver:T,showColorLegendAtTop:Q,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},rtl:M==="he"||M==="ar",diffAreaColors:Z,idSuffix:Vi.generateRandomString(8),strokeWidth:a,showDots:xt,refValues:l,minValue:b,maxValue:$,annotations:Bt,customHighlightAreaSettings:re,yAxisTitle:ne,noOfYTicks:zt,minDate:at,maxDate:U,curveType:Jt,styles:g,classNames:h,precision:dt,customLayers:pt}):null})]}),t[27]=K,t[28]=Bt,t[29]=m,t[30]=h,t[31]=Wt,t[32]=Jt,t[33]=re,t[34]=pt,t[35]=k,t[36]=y,t[37]=Z,t[38]=ae,t[39]=Y,t[40]=M,t[41]=Ct,t[42]=n,t[43]=U,t[44]=$,t[45]=at,t[46]=b,t[47]=rt,t[48]=zt,t[49]=T,t[50]=dt,t[51]=Ot,t[52]=l,t[53]=ut,t[54]=Q,t[55]=xt,t[56]=lt,t[57]=a,t[58]=g,t[59]=Yt,t[60]=it,t[61]=et,t[62]=N,t[63]=se,t[64]=ne,t[65]=C):C=t[65];let G;t[66]!==h?.footnote||t[67]!==h?.source||t[68]!==Tt||t[69]!==c||t[70]!==g?.footnote||t[71]!==g?.source||t[72]!==w?(G=c||Tt?s.jsxRuntimeExports.jsx(Oi.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:c,footNote:Tt,width:w}):null,t[66]=h?.footnote,t[67]=h?.source,t[68]=Tt,t[69]=c,t[70]=g?.footnote,t[71]=g?.source,t[72]=w,t[73]=G):G=t[73];let yt;return t[74]!==p||t[75]!==ct||t[76]!==q||t[77]!==x||t[78]!==M||t[79]!==Ut||t[80]!==gt||t[81]!==st||t[82]!==St||t[83]!==kt||t[84]!==F||t[85]!==C||t[86]!==G||t[87]!==le||t[88]!==w?(yt=s.jsxRuntimeExports.jsxs(si.GraphContainer,{className:St,style:kt,id:q,ref:Lt,"aria-label":p,backgroundColor:ct,theme:le,language:M,minHeight:Ut,width:w,height:x,relativeHeight:st,padding:gt,children:[F,C,G]}),t[74]=p,t[75]=ct,t[76]=q,t[77]=x,t[78]=M,t[79]=Ut,t[80]=gt,t[81]=st,t[82]=St,t[83]=kt,t[84]=F,t[85]=C,t[86]=G,t[87]=le,t[88]=w,t[89]=yt):yt=t[89],yt}function Ki(r){return r!==void 0}function Qi(r){return r!==void 0}function Zi(r){return r.data}function _i(r){return r!==void 0}function tn(r){return r.data}exports.DifferenceLineChart=Ji;
|
|
2
2
|
//# sourceMappingURL=DifferenceLineChart.cjs.map
|
|
@@ -14,9 +14,9 @@ import { Y as ji } from "./YTicksAndGridLines-Blepl7XF.js";
|
|
|
14
14
|
import { H as Ai } from "./index-SKgJALZg.js";
|
|
15
15
|
import { t as Oi } from "./time-BUL-dwnK.js";
|
|
16
16
|
import { a as Ci } from "./linear-BqltdMeF.js";
|
|
17
|
-
import { l as ai, c as Vi } from "./line-
|
|
17
|
+
import { l as ai, c as Vi } from "./line-DFlZsxI1.js";
|
|
18
18
|
import { c as Di, s as Li, a as Si, m as ki } from "./step-BrDul-H4.js";
|
|
19
|
-
import { a as oi } from "./area-
|
|
19
|
+
import { a as oi } from "./area-B6r7cv2o.js";
|
|
20
20
|
import { s as $i } from "./select-DKy99ogv.js";
|
|
21
21
|
import { a as Ti } from "./init-BhZylTFx.js";
|
|
22
22
|
import { p as Ii } from "./pointer-CWRWOsrb.js";
|
package/dist/DonutChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CHPV5EwG-CTPQjnHt.cjs"),K=require("react"),ne=require("./Typography-DX7PlgQU.cjs"),me=require("./index-Cno4Q0YE.cjs"),xe=require("./Source-DYMJRrsq.cjs"),fe=require("./index-DQA8q5sC.cjs"),ge=require("./Tooltip-uUdw6wJL.cjs"),_=require("./Colors.cjs"),pe=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./DetailsModal-BN0HDFlV.cjs"),T=require("./array-DKbXV8lR.cjs"),ye=require("./GraphFooter.cjs"),ve=require("./GraphHeader.cjs"),je=require("./EmptyState-sAEZ_5rU.cjs"),ue=require("./GraphContainer-d8A46BK2.cjs"),ce=Math.abs,F=Math.atan2,U=Math.cos,Re=Math.max,ae=Math.min,V=Math.sin,Z=Math.sqrt,H=1e-12,ee=Math.PI,re=ee/2,se=2*ee;function be(r){return r>1?0:r<-1?ee:Math.acos(r)}function de(r){return r>=1?re:r<=-1?-re:Math.asin(r)}function Ee(r){return r.innerRadius}function Ae(r){return r.outerRadius}function Ce(r){return r.startAngle}function Me(r){return r.endAngle}function De(r){return r&&r.padAngle}function Ne(r,e,c,R,l,b,d,t){var p=c-r,a=R-e,n=d-l,E=t-b,s=E*p-n*a;if(!(s*s<H))return s=(n*(e-b)-E*(r-l))/s,[r+s*p,e+s*a]}function te(r,e,c,R,l,b,d){var t=r-c,p=e-R,a=(d?b:-b)/Z(t*t+p*p),n=a*p,E=-a*t,s=r+n,i=e+E,y=c+n,g=R+E,q=(s+y)/2,m=(i+g)/2,v=y-s,C=g-i,x=v*v+C*C,j=l-b,A=s*g-y*i,G=(C<0?-1:1)*Z(Re(0,j*j*x-A*A)),P=(A*C-v*G)/x,z=(-A*v-C*G)/x,D=(A*C+v*G)/x,N=(-A*v+C*G)/x,S=P-q,o=z-m,u=D-q,I=N-m;return S*S+o*o>u*u+I*I&&(P=D,z=N),{cx:P,cy:z,x01:-n,y01:-E,x11:P*(l/j-1),y11:z*(l/j-1)}}function Se(){var r=Ee,e=Ae,c=T.constant(0),R=null,l=Ce,b=Me,d=De,t=null,p=T.withPath(a);function a(){var n,E,s=+r.apply(this,arguments),i=+e.apply(this,arguments),y=l.apply(this,arguments)-re,g=b.apply(this,arguments)-re,q=ce(g-y),m=g>y;if(t||(t=n=p()),i<s&&(E=i,i=s,s=E),!(i>H))t.moveTo(0,0);else if(q>se-H)t.moveTo(i*U(y),i*V(y)),t.arc(0,0,i,y,g,!m),s>H&&(t.moveTo(s*U(g),s*V(g)),t.arc(0,0,s,g,y,m));else{var v=y,C=g,x=y,j=g,A=q,G=q,P=d.apply(this,arguments)/2,z=P>H&&(R?+R.apply(this,arguments):Z(s*s+i*i)),D=ae(ce(i-s)/2,+c.apply(this,arguments)),N=D,S=D,o,u;if(z>H){var I=de(z/s*V(P)),W=de(z/i*V(P));(A-=I*2)>H?(I*=m?1:-1,x+=I,j-=I):(A=0,x=j=(y+g)/2),(G-=W*2)>H?(W*=m?1:-1,v+=W,C-=W):(G=0,v=C=(y+g)/2)}var X=i*U(v),w=i*V(v),k=s*U(j),$=s*V(j);if(D>H){var B=i*U(C),Y=i*V(C),L=s*U(x),M=s*V(x),O;if(q<ee)if(O=Ne(X,w,L,M,B,Y,k,$)){var f=X-O[0],J=w-O[1],Q=B-O[0],oe=Y-O[1],ie=1/V(be((f*Q+J*oe)/(Z(f*f+J*J)*Z(Q*Q+oe*oe)))/2),le=Z(O[0]*O[0]+O[1]*O[1]);N=ae(D,(s-le)/(ie-1)),S=ae(D,(i-le)/(ie+1))}else N=S=0}G>H?S>H?(o=te(L,M,X,w,i,S,m),u=te(B,Y,k,$,i,S,m),t.moveTo(o.cx+o.x01,o.cy+o.y01),S<D?t.arc(o.cx,o.cy,S,F(o.y01,o.x01),F(u.y01,u.x01),!m):(t.arc(o.cx,o.cy,S,F(o.y01,o.x01),F(o.y11,o.x11),!m),t.arc(0,0,i,F(o.cy+o.y11,o.cx+o.x11),F(u.cy+u.y11,u.cx+u.x11),!m),t.arc(u.cx,u.cy,S,F(u.y11,u.x11),F(u.y01,u.x01),!m))):(t.moveTo(X,w),t.arc(0,0,i,v,C,!m)):t.moveTo(X,w),!(s>H)||!(A>H)?t.lineTo(k,$):N>H?(o=te(k,$,B,Y,s,-N,m),u=te(X,w,L,M,s,-N,m),t.lineTo(o.cx+o.x01,o.cy+o.y01),N<D?t.arc(o.cx,o.cy,N,F(o.y01,o.x01),F(u.y01,u.x01),!m):(t.arc(o.cx,o.cy,N,F(o.y01,o.x01),F(o.y11,o.x11),!m),t.arc(0,0,s,F(o.cy+o.y11,o.cx+o.x11),F(u.cy+u.y11,u.cx+u.x11),m),t.arc(u.cx,u.cy,N,F(u.y11,u.x11),F(u.y01,u.x01),!m))):t.arc(0,0,s,j,x,m)}if(t.closePath(),n)return t=null,n+""||null}return a.centroid=function(){var n=(+r.apply(this,arguments)+ +e.apply(this,arguments))/2,E=(+l.apply(this,arguments)+ +b.apply(this,arguments))/2-ee/2;return[U(E)*n,V(E)*n]},a.innerRadius=function(n){return arguments.length?(r=typeof n=="function"?n:T.constant(+n),a):r},a.outerRadius=function(n){return arguments.length?(e=typeof n=="function"?n:T.constant(+n),a):e},a.cornerRadius=function(n){return arguments.length?(c=typeof n=="function"?n:T.constant(+n),a):c},a.padRadius=function(n){return arguments.length?(R=n==null?null:typeof n=="function"?n:T.constant(+n),a):R},a.startAngle=function(n){return arguments.length?(l=typeof n=="function"?n:T.constant(+n),a):l},a.endAngle=function(n){return arguments.length?(b=typeof n=="function"?n:T.constant(+n),a):b},a.padAngle=function(n){return arguments.length?(d=typeof n=="function"?n:T.constant(+n),a):d},a.context=function(n){return arguments.length?(t=n??null,a):t},a}function ke(r,e){return e<r?-1:e>r?1:e>=r?0:NaN}function qe(r){return r}function we(){var r=qe,e=ke,c=null,R=T.constant(0),l=T.constant(se),b=T.constant(0);function d(t){var p,a=(t=T.array(t)).length,n,E,s=0,i=new Array(a),y=new Array(a),g=+R.apply(this,arguments),q=Math.min(se,Math.max(-se,l.apply(this,arguments)-g)),m,v=Math.min(Math.abs(q)/a,b.apply(this,arguments)),C=v*(q<0?-1:1),x;for(p=0;p<a;++p)(x=y[i[p]=p]=+r(t[p],p,t))>0&&(s+=x);for(e!=null?i.sort(function(j,A){return e(y[j],y[A])}):c!=null&&i.sort(function(j,A){return c(t[j],t[A])}),p=0,E=s?(q-a*C)/s:0;p<a;++p,g=m)n=i[p],x=y[n],m=g+(x>0?x*E:0)+C,y[n]={data:t[n],index:p,value:x,startAngle:g,endAngle:m,padAngle:v};return y}return d.value=function(t){return arguments.length?(r=typeof t=="function"?t:T.constant(+t),d):r},d.sortValues=function(t){return arguments.length?(e=t,c=null,d):e},d.sort=function(t){return arguments.length?(c=t,e=null,d):c},d.startAngle=function(t){return arguments.length?(R=typeof t=="function"?t:T.constant(+t),d):R},d.endAngle=function(t){return arguments.length?(l=typeof t=="function"?t:T.constant(+t),d):l},d.padAngle=function(t){return arguments.length?(b=typeof t=="function"?t:T.constant(+t),d):b},d}function Oe(r){const e=h.compilerRuntimeExports.c(44),{mainText:c,data:R,radius:l,colors:b,subNote:d,strokeWidth:t,tooltip:p,onSeriesMouseOver:a,onSeriesMouseClick:n,colorDomain:E,resetSelectionOnDoubleClick:s,detailsOnClick:i,styles:y,classNames:g,precision:q}=r,m=we().sort(null).startAngle(0).value(Te),[v,C]=K.useState(void 0),[x,j]=K.useState(void 0),[A,G]=K.useState(void 0),[P,z]=K.useState(void 0),D=`${l*2}px`,N=`${l*2}px`,S=`0 0 ${l*2} ${l*2}`,o="ltr",u="mx-auto",I=`translate(${l} ${l})`;let W;e[0]!==R||e[1]!==c||e[2]!==q||e[3]!==l||e[4]!==t||e[5]!==d?(W=c||d?h.jsxRuntimeExports.jsx("foreignObject",{y:0-(l-t),x:0-(l-t),width:2*(l-t),height:2*(l-t),children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[c?h.jsxRuntimeExports.jsx(ne.v,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof c=="string"?c:R.findIndex(M=>M.label===c.label)!==-1?pe.numberFormattingFunction(R[R.findIndex(M=>M.label===c.label)].size,"NA",q,c.prefix,c.suffix):"NA"}):null,d?h.jsxRuntimeExports.jsx(ne.j,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:d}):typeof c=="string"||!c?null:h.jsxRuntimeExports.jsx(ne.j,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:c.label})]})}):null,e[0]=R,e[1]=c,e[2]=q,e[3]=l,e[4]=t,e[5]=d,e[6]=W):W=e[6];let X;e[7]!==E||e[8]!==b||e[9]!==i||e[10]!==x||e[11]!==v||e[12]!==n||e[13]!==a||e[14]!==l||e[15]!==s||e[16]!==j||e[17]!==t?(X=(M,O)=>h.jsxRuntimeExports.jsx("path",{d:Se()({innerRadius:l-t,outerRadius:l,startAngle:M.startAngle,endAngle:M.endAngle}),style:{fill:E.indexOf(M.data.label)!==-1?b[E.indexOf(M.data.label)%b.length]:_.Colors.gray,opacity:v?v.label===M.data.label?1:.3:1},onMouseEnter:f=>{C(M.data),z(f.clientY),G(f.clientX),a?.(M)},onClick:()=>{(n||i)&&(fe.isEqual(x,M.data)&&s?(j(void 0),n?.(void 0)):(j(M.data),n&&n(M.data)))},onMouseMove:f=>{C(M.data),z(f.clientY),G(f.clientX)},onMouseLeave:()=>{C(void 0),G(void 0),z(void 0),a?.(void 0)}},O),e[7]=E,e[8]=b,e[9]=i,e[10]=x,e[11]=v,e[12]=n,e[13]=a,e[14]=l,e[15]=s,e[16]=j,e[17]=t,e[18]=X):X=e[18];const w=m(R).map(X);let k;e[19]!==I||e[20]!==W||e[21]!==w?(k=h.jsxRuntimeExports.jsxs("g",{transform:I,children:[W,w]}),e[19]=I,e[20]=W,e[21]=w,e[22]=k):k=e[22];let $;e[23]!==D||e[24]!==N||e[25]!==S||e[26]!==k?($=h.jsxRuntimeExports.jsx("svg",{width:D,height:N,viewBox:S,direction:o,className:u,children:k}),e[23]=D,e[24]=N,e[25]=S,e[26]=k,e[27]=$):$=e[27];let B;e[28]!==g?.tooltip||e[29]!==A||e[30]!==P||e[31]!==v||e[32]!==y?.tooltip||e[33]!==p?(B=v&&p&&A&&P?h.jsxRuntimeExports.jsx(ge.Tooltip,{data:v,body:p,xPos:A,yPos:P,backgroundStyle:y?.tooltip,className:g?.tooltip}):null,e[28]=g?.tooltip,e[29]=A,e[30]=P,e[31]=v,e[32]=y?.tooltip,e[33]=p,e[34]=B):B=e[34];let Y;e[35]!==g?.modal||e[36]!==i||e[37]!==x||e[38]!==j?(Y=i&&x!==void 0?h.jsxRuntimeExports.jsx(he.DetailsModal,{body:i,data:x,setData:j,className:g?.modal}):null,e[35]=g?.modal,e[36]=i,e[37]=x,e[38]=j,e[39]=Y):Y=e[39];let L;return e[40]!==$||e[41]!==B||e[42]!==Y?(L=h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[$,B,Y]}),e[40]=$,e[41]=B,e[42]=Y,e[43]=L):L=e[43],L}function Te(r){return r.size}function ze(r){const{mainText:e,graphTitle:c,colors:R=_.Colors.light.categoricalColors.colors,suffix:l="",sources:b,prefix:d="",strokeWidth:t=50,graphDescription:p,subNote:a,footNote:n,radius:E,data:s,showColorScale:i=!0,padding:y,backgroundColor:g=!1,tooltip:q,onSeriesMouseOver:m,graphID:v,onSeriesMouseClick:C,graphDownload:x=!1,dataDownload:j=!1,colorDomain:A,sortData:G,language:P="en",theme:z="light",width:D,height:N,minHeight:S=0,relativeHeight:o,ariaLabel:u,resetSelectionOnDoubleClick:I=!0,colorScaleMaxWidth:W,detailsOnClick:X,styles:w,classNames:k,precision:$=2}=r,[B,Y]=K.useState(0),L=K.useRef(null),M=K.useRef(null);K.useEffect(()=>{const f=new ResizeObserver(J=>{Y((Math.min(J[0].target.clientWidth||620,J[0].target.clientHeight||480,E||1/0)||420)/2)});return L.current&&f.observe(L.current),()=>f.disconnect()},[E]);const O=G?me.orderBy(s,["size"],[G]):s;return h.jsxRuntimeExports.jsxs(ue.GraphContainer,{className:k?.graphContainer,style:w?.graphContainer,id:v,ref:M,"aria-label":u,backgroundColor:g,theme:z,language:P,minHeight:S,width:D,height:N,relativeHeight:o,padding:y,children:[c||p||x||j?h.jsxRuntimeExports.jsx(ve.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:k?.title,description:k?.description},graphTitle:c,graphDescription:p,width:D,graphDownload:x?M:void 0,dataDownload:j?s.map(f=>f.data).filter(f=>f!==void 0).length>0?s.map(f=>f.data).filter(f=>f!==void 0):s.filter(f=>f!==void 0):null}):null,s.length===0?h.jsxRuntimeExports.jsx(je.EmptyState,{}):h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[i?h.jsxRuntimeExports.jsx("div",{className:h.mo("leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap",k?.colorLegend),style:{maxWidth:W},"aria-label":"Color legend",children:O.map((f,J)=>h.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center pb-3",children:[h.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(A||O.map(Q=>Q.label)).indexOf(f.label)!==-1?(R||_.Colors[z].categoricalColors.colors)[(A||O.map(Q=>Q.label)).indexOf(f.label)%(R||_.Colors[z].categoricalColors.colors).length]:_.Colors.gray}}),h.jsxRuntimeExports.jsxs(ne.j,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[f.label,":"," ",h.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:pe.numberFormattingFunction(f.size,"NA",$,d,l)})]})]},J))}):null,h.jsxRuntimeExports.jsx(xe.n,{size:"lg"}),h.jsxRuntimeExports.jsx(ue.GraphArea,{ref:L,children:B?h.jsxRuntimeExports.jsx(Oe,{mainText:e,data:O,colors:R,radius:B,subNote:a,strokeWidth:t,tooltip:q,colorDomain:A||O.map(f=>f.label),onSeriesMouseOver:m,onSeriesMouseClick:C,resetSelectionOnDoubleClick:I,styles:w,detailsOnClick:X,precision:$}):null})]}),b||n?h.jsxRuntimeExports.jsx(ye.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:k?.footnote,source:k?.source},sources:b,footNote:n,width:D}):null]})}exports.DonutChart=ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-CTPQjnHt.cjs"),O=require("react"),ot=require("./Typography-DX7PlgQU.cjs"),xt=require("./index-Cno4Q0YE.cjs"),mt=require("./Source-DYMJRrsq.cjs"),pt=require("./index-DQA8q5sC.cjs"),dt=require("./Tooltip-uUdw6wJL.cjs"),W=require("./Colors.cjs"),ct=require("./numberFormattingFunction-02t-wJta.cjs"),gt=require("./DetailsModal-BN0HDFlV.cjs"),z=require("./array-DMyR1sql.cjs"),ht=require("./use-in-view-QcfiW0w3.cjs"),ft=require("./index-DG2bgAva.cjs"),rt=require("./proxy-BxvUI_9l.cjs"),yt=require("./GraphFooter.cjs"),jt=require("./GraphHeader.cjs"),vt=require("./EmptyState-sAEZ_5rU.cjs"),it=require("./GraphContainer-d8A46BK2.cjs"),bt=Math.PI,st=2*bt;function Et(l,t){return t<l?-1:t>l?1:t>=l?0:NaN}function Ct(l){return l}function Rt(){var l=Ct,t=Et,n=null,c=z.constant(0),r=z.constant(st),m=z.constant(0);function s(e){var a,f=(e=z.array(e)).length,p,R,d=0,g=new Array(f),v=new Array(f),y=+c.apply(this,arguments),A=Math.min(st,Math.max(-st,r.apply(this,arguments)-y)),x,I=Math.min(Math.abs(A)/f,m.apply(this,arguments)),F=I*(A<0?-1:1),h;for(a=0;a<f;++a)(h=v[g[a]=a]=+l(e[a],a,e))>0&&(d+=h);for(t!=null?g.sort(function(M,S){return t(v[M],v[S])}):n!=null&&g.sort(function(M,S){return n(e[M],e[S])}),a=0,R=d?(A-f*F)/d:0;a<f;++a,y=x)p=g[a],h=v[p],x=y+(h>0?h*R:0)+F,v[p]={data:e[p],index:a,value:h,startAngle:y,endAngle:x,padAngle:I};return v}return s.value=function(e){return arguments.length?(l=typeof e=="function"?e:z.constant(+e),s):l},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(c=typeof e=="function"?e:z.constant(+e),s):c},s.endAngle=function(e){return arguments.length?(r=typeof e=="function"?e:z.constant(+e),s):r},s.padAngle=function(e){return arguments.length?(m=typeof e=="function"?e:z.constant(+e),s):m},s}const at=(l,t,n,c)=>({x:l+n*Math.cos(c),y:t+n*Math.sin(c)});function lt(l,t,n,c,r){const m=at(l,t,n,c),s=at(l,t,n,r),e=r-c<=Math.PI?"0":"1";return["M",m.x,m.y,"A",n,n,0,e,1,s.x,s.y].join(" ")}function Mt(l){const t=o.compilerRuntimeExports.c(59),{mainText:n,data:c,radius:r,colors:m,subNote:s,strokeWidth:e,tooltip:a,onSeriesMouseOver:f,onSeriesMouseClick:p,colorDomain:R,resetSelectionOnDoubleClick:d,detailsOnClick:g,styles:v,classNames:y,precision:A,animate:x,trackColor:I}=l,F=O.useRef(null);let h;t[0]!==x.amount||t[1]!==x.once?(h={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=h):h=t[2];const M=ht.useInView(F,h),S=Rt().sort(null).startAngle(0).value(Dt),[j,X]=O.useState(void 0),[b,E]=O.useState(void 0),[G,Y]=O.useState(void 0),[T,J]=O.useState(void 0),K=rt.motion,Q=`${r*2}px`,U=`${r*2}px`,D=`0 0 ${r*2} ${r*2}`,P="ltr",et="mx-auto",$=rt.motion,Z=`translate(${r} ${r})`;let q;t[3]!==c||t[4]!==n||t[5]!==A||t[6]!==r||t[7]!==e||t[8]!==s?(q=n||s?o.jsxRuntimeExports.jsx("foreignObject",{y:0-(r-e),x:0-(r-e),width:2*(r-e),height:2*(r-e),children:o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[n?o.jsxRuntimeExports.jsx(ot.v,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof n=="string"?n:c.findIndex(u=>u.label===n.label)!==-1?ct.numberFormattingFunction(c[c.findIndex(u=>u.label===n.label)].size,"NA",A,n.prefix,n.suffix):"NA"}):null,s?o.jsxRuntimeExports.jsx(ot.j,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:s}):typeof n=="string"||!n?null:o.jsxRuntimeExports.jsx(ot.j,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:n.label})]})}):null,t[3]=c,t[4]=n,t[5]=A,t[6]=r,t[7]=e,t[8]=s,t[9]=q):q=t[9];const _=r-e/2;let N;t[10]!==e||t[11]!==_||t[12]!==I?(N=o.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:_,fill:"none",stroke:I,strokeWidth:e}),t[10]=e,t[11]=_,t[12]=I,t[13]=N):N=t[13];const V=ft.AnimatePresence;let k;t[14]!==x.duration||t[15]!==R||t[16]!==m||t[17]!==g||t[18]!==M||t[19]!==b||t[20]!==j||t[21]!==p||t[22]!==f||t[23]!==r||t[24]!==d||t[25]!==E||t[26]!==e?(k=(u,ut)=>o.jsxRuntimeExports.jsx(rt.motion.path,{variants:{initial:{pathLength:0,d:lt(0,0,r-e/2,u.startAngle-Math.PI/2,u.endAngle-Math.PI/2),opacity:j?j.label===u.data.label?1:.3:1},whileInView:{pathLength:1,d:lt(0,0,r-e/2,u.startAngle-Math.PI/2,u.endAngle-Math.PI/2),opacity:j?j.label===u.data.label?1:.3:1,transition:{duration:x.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:R.indexOf(u.data.label)!==-1?m[R.indexOf(u.data.label)%m.length]:W.Colors.gray,strokeWidth:e,fill:"none"},onMouseEnter:tt=>{X(u.data),J(tt.clientY),Y(tt.clientX),f?.(u)},onClick:()=>{(p||g)&&(pt.isEqual(b,u.data)&&d?(E(void 0),p?.(void 0)):(E(u.data),p&&p(u.data)))},onMouseMove:tt=>{X(u.data),J(tt.clientY),Y(tt.clientX)},onMouseLeave:()=>{X(void 0),Y(void 0),J(void 0),f?.(void 0)}},ut),t[14]=x.duration,t[15]=R,t[16]=m,t[17]=g,t[18]=M,t[19]=b,t[20]=j,t[21]=p,t[22]=f,t[23]=r,t[24]=d,t[25]=E,t[26]=e,t[27]=k):k=t[27];const i=S(c).map(k);let C;t[28]!==V||t[29]!==i?(C=o.jsxRuntimeExports.jsx(V,{children:i}),t[28]=V,t[29]=i,t[30]=C):C=t[30];let w;t[31]!==N||t[32]!==C||t[33]!==$.g||t[34]!==Z||t[35]!==q?(w=o.jsxRuntimeExports.jsxs($.g,{transform:Z,children:[q,N,C]}),t[31]=N,t[32]=C,t[33]=$.g,t[34]=Z,t[35]=q,t[36]=w):w=t[36];let B;t[37]!==K.svg||t[38]!==w||t[39]!==Q||t[40]!==U||t[41]!==D?(B=o.jsxRuntimeExports.jsx(K.svg,{ref:F,width:Q,height:U,viewBox:D,direction:P,className:et,children:w}),t[37]=K.svg,t[38]=w,t[39]=Q,t[40]=U,t[41]=D,t[42]=B):B=t[42];let H;t[43]!==y?.tooltip||t[44]!==G||t[45]!==T||t[46]!==j||t[47]!==v?.tooltip||t[48]!==a?(H=j&&a&&G&&T?o.jsxRuntimeExports.jsx(dt.Tooltip,{data:j,body:a,xPos:G,yPos:T,backgroundStyle:v?.tooltip,className:y?.tooltip}):null,t[43]=y?.tooltip,t[44]=G,t[45]=T,t[46]=j,t[47]=v?.tooltip,t[48]=a,t[49]=H):H=t[49];let L;t[50]!==y?.modal||t[51]!==g||t[52]!==b||t[53]!==E?(L=g&&b!==void 0?o.jsxRuntimeExports.jsx(gt.DetailsModal,{body:g,data:b,setData:E,className:y?.modal}):null,t[50]=y?.modal,t[51]=g,t[52]=b,t[53]=E,t[54]=L):L=t[54];let nt;return t[55]!==B||t[56]!==H||t[57]!==L?(nt=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[B,H,L]}),t[55]=B,t[56]=H,t[57]=L,t[58]=nt):nt=t[58],nt}function Dt(l){return l.size}function Nt(l){const{mainText:t,graphTitle:n,colors:c=W.Colors.light.categoricalColors.colors,suffix:r="",sources:m,prefix:s="",strokeWidth:e=50,graphDescription:a,subNote:f,footNote:p,radius:R,data:d,showColorScale:g=!0,padding:v,backgroundColor:y=!1,tooltip:A,onSeriesMouseOver:x,graphID:I,onSeriesMouseClick:F,graphDownload:h=!1,dataDownload:M=!1,colorDomain:S,sortData:j,language:X="en",theme:b="light",width:E,height:G,minHeight:Y=0,relativeHeight:T,ariaLabel:J,resetSelectionOnDoubleClick:K=!0,colorScaleMaxWidth:Q,detailsOnClick:U,styles:D,classNames:P,precision:et=2,animate:$=!1,trackColor:Z=W.Colors.light.grays["gray-200"]}=l,[q,_]=O.useState(0),N=O.useRef(null),V=O.useRef(null);O.useEffect(()=>{const i=new ResizeObserver(C=>{_((Math.min(C[0].target.clientWidth||620,C[0].target.clientHeight||480,R||1/0)||420)/2)});return N.current&&i.observe(N.current),()=>i.disconnect()},[R]);const k=j?xt.orderBy(d,["size"],[j]):d;return o.jsxRuntimeExports.jsxs(it.GraphContainer,{className:P?.graphContainer,style:D?.graphContainer,id:I,ref:V,"aria-label":J,backgroundColor:y,theme:b,language:X,minHeight:Y,width:E,height:G,relativeHeight:T,padding:v,children:[n||a||h||M?o.jsxRuntimeExports.jsx(jt.GraphHeader,{styles:{title:D?.title,description:D?.description},classNames:{title:P?.title,description:P?.description},graphTitle:n,graphDescription:a,width:E,graphDownload:h?V:void 0,dataDownload:M?d.map(i=>i.data).filter(i=>i!==void 0).length>0?d.map(i=>i.data).filter(i=>i!==void 0):d.filter(i=>i!==void 0):null}):null,d.length===0?o.jsxRuntimeExports.jsx(vt.EmptyState,{}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[g?o.jsxRuntimeExports.jsx("div",{className:o.mo("leading-0 flex mb-0 ml-auto mr-auto justify-center gap-x-3 gap-y-0 flex-wrap",P?.colorLegend),style:{maxWidth:Q},"aria-label":"Color legend",children:k.map((i,C)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center pb-3",children:[o.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(S||k.map(w=>w.label)).indexOf(i.label)!==-1?(c||W.Colors[b].categoricalColors.colors)[(S||k.map(w=>w.label)).indexOf(i.label)%(c||W.Colors[b].categoricalColors.colors).length]:W.Colors.gray}}),o.jsxRuntimeExports.jsxs(ot.j,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[i.label,":"," ",o.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:ct.numberFormattingFunction(i.size,"NA",et,s,r)})]})]},C))}):null,o.jsxRuntimeExports.jsx(mt.n,{size:"lg"}),o.jsxRuntimeExports.jsx(it.GraphArea,{ref:N,children:q?o.jsxRuntimeExports.jsx(Mt,{mainText:t,data:k,colors:c,radius:q,subNote:f,strokeWidth:e,tooltip:A,colorDomain:S||k.map(i=>i.label),onSeriesMouseOver:x,onSeriesMouseClick:F,resetSelectionOnDoubleClick:K,styles:D,detailsOnClick:U,precision:et,animate:$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},trackColor:Z}):null})]}),m||p?o.jsxRuntimeExports.jsx(yt.GraphFooter,{styles:{footnote:D?.footnote,source:D?.source},classNames:{footnote:P?.footnote,source:P?.source},sources:m,footNote:p,width:E}):null]})}exports.DonutChart=Nt;
|
|
2
2
|
//# sourceMappingURL=DonutChart.cjs.map
|