@undp/data-viz 2.4.1 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.d.ts +11 -9
- package/dist/AreaChart.js +320 -322
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.d.ts +15 -25
- package/dist/BarGraph.js +1694 -1694
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.cjs.map +1 -1
- package/dist/BasicStatCard.d.ts +13 -9
- package/dist/BasicStatCard.js +79 -81
- package/dist/BasicStatCard.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.d.ts +11 -9
- package/dist/BeeSwarmChart.js +335 -336
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +13 -3
- package/dist/BiVariateChoroplethMap.js +309 -304
- 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 -5
- package/dist/BulletChart.js +560 -559
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.d.ts +11 -9
- package/dist/ButterflyChart.js +348 -350
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +11 -3
- package/dist/ChoroplethMap.js +314 -311
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.d.ts +11 -9
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DataCards.cjs +1 -1
- package/dist/DataCards.d.ts +1 -1
- package/dist/DataCards.js +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.d.ts +4 -5
- package/dist/DataTable.js +114 -116
- package/dist/DataTable.js.map +1 -1
- package/dist/{DetailsModal-jmmKRMRM.cjs → DetailsModal-Du8Fr1QD.cjs} +2 -2
- package/dist/{DetailsModal-jmmKRMRM.cjs.map → DetailsModal-Du8Fr1QD.cjs.map} +1 -1
- package/dist/{DetailsModal-B2XBWR7w.js → DetailsModal-GqEbGHY2.js} +2 -2
- package/dist/{DetailsModal-B2XBWR7w.js.map → DetailsModal-GqEbGHY2.js.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.d.ts +11 -9
- package/dist/DifferenceLineChart.js +502 -504
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.d.ts +14 -9
- package/dist/DonutChart.js +174 -179
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +1 -1
- package/dist/DotDensityMap.js +270 -267
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.d.ts +13 -9
- package/dist/DualAxisLineChart.js +341 -351
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.d.ts +11 -9
- package/dist/DumbbellChart.js +592 -593
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.d.ts +1 -1
- package/dist/GeoHubCompareMaps.js +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.d.ts +1 -1
- package/dist/GeoHubMap.js +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.d.ts +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +1 -1
- package/dist/GraphEl-BgkDbq50.cjs +2 -0
- package/dist/GraphEl-BgkDbq50.cjs.map +1 -0
- package/dist/GraphEl-Ch0uAeZw.js +1830 -0
- package/dist/GraphEl-Ch0uAeZw.js.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +29 -16
- package/dist/GriddedGraphs.js +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +29 -16
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.d.ts +11 -9
- package/dist/HeatMap.js +203 -205
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.cjs.map +1 -1
- package/dist/Histogram.d.ts +11 -5
- package/dist/Histogram.js +88 -89
- package/dist/Histogram.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.d.ts +11 -3
- package/dist/HybridMap.js +339 -336
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.d.ts +11 -9
- package/dist/LineChartWithConfidenceInterval.js +393 -395
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +1 -1
- package/dist/MultiGraphDashboard.d.ts +29 -16
- package/dist/MultiGraphDashboardFromConfig.d.ts +29 -16
- package/dist/MultiGraphDashboardWideToLongFormat.d.ts +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.d.ts +11 -9
- package/dist/MultiLineAltChart.js +411 -413
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.d.ts +11 -9
- package/dist/MultiLineChart.js +438 -440
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.d.ts +13 -13
- package/dist/ParetoChart.js +347 -355
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +29 -16
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +29 -16
- package/dist/PerformanceIntensiveScrollStory.d.ts +29 -16
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.d.ts +11 -5
- package/dist/RadarChart.js +213 -213
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.d.ts +11 -9
- package/dist/SankeyChart.js +448 -450
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.d.ts +15 -13
- package/dist/ScatterPlot.js +477 -483
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.d.ts +29 -16
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.d.ts +11 -9
- package/dist/SimpleLineChart.js +362 -364
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +29 -16
- package/dist/SingleGraphDashboard.js +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +29 -16
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +29 -16
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +29 -16
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +29 -16
- package/dist/SingleGraphDashboardThreeDGraphs.js +40 -39
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +29 -16
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.d.ts +1 -1
- package/dist/SlopeChart.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.d.ts +1 -1
- package/dist/SparkLine.js +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.cjs.map +1 -1
- package/dist/StatCardFromData.d.ts +11 -9
- package/dist/StatCardFromData.js +113 -116
- package/dist/StatCardFromData.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.d.ts +11 -9
- package/dist/StripChart.js +434 -435
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +11 -3
- package/dist/ThreeDGlobe.js +143 -143
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +1 -1
- package/dist/{Tooltip-Bj-s__cI.js → Tooltip-3EYDVa3w.js} +2 -2
- package/dist/{Tooltip-Bj-s__cI.js.map → Tooltip-3EYDVa3w.js.map} +1 -1
- package/dist/{Tooltip-Hr46paWP.cjs → Tooltip-C9F3uYG0.cjs} +2 -2
- package/dist/{Tooltip-Hr46paWP.cjs.map → Tooltip-C9F3uYG0.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.d.ts +11 -9
- package/dist/TreeMapGraph.js +369 -371
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +29 -16
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.d.ts +11 -5
- package/dist/UnitChart.js +118 -119
- package/dist/UnitChart.js.map +1 -1
- package/dist/WaterfallChart.cjs +1 -1
- package/dist/WaterfallChart.cjs.map +1 -1
- package/dist/WaterfallChart.d.ts +11 -9
- package/dist/WaterfallChart.js +306 -308
- package/dist/WaterfallChart.js.map +1 -1
- package/dist/XTicksAndGridLines-B4UhDVyU.cjs +2 -0
- package/dist/XTicksAndGridLines-B4UhDVyU.cjs.map +1 -0
- package/dist/XTicksAndGridLines-CkYwVshF.js +40 -0
- package/dist/XTicksAndGridLines-CkYwVshF.js.map +1 -0
- package/dist/YTicksAndGridLines-BbujwxOB.js +40 -0
- package/dist/YTicksAndGridLines-BbujwxOB.js.map +1 -0
- package/dist/YTicksAndGridLines-sT3zdCs6.cjs +2 -0
- package/dist/YTicksAndGridLines-sT3zdCs6.cjs.map +1 -0
- package/dist/{imageDownload-Diofs_vY.js → imageDownload-BYsNEtMS.js} +11 -11
- package/dist/{imageDownload-Diofs_vY.js.map → imageDownload-BYsNEtMS.js.map} +1 -1
- package/dist/{imageDownload-61q6jyJW.cjs → imageDownload-CkMwA7Cw.cjs} +4 -4
- package/dist/{imageDownload-61q6jyJW.cjs.map → imageDownload-CkMwA7Cw.cjs.map} +1 -1
- package/dist/index-BPyj_6hG.js +375 -0
- package/dist/index-BPyj_6hG.js.map +1 -0
- package/dist/index-DuLvdHo2.cjs +2 -0
- package/dist/index-DuLvdHo2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +108 -245
- package/dist/index.js +3 -3
- package/dist/numberFormattingFunction-BUUV_luR.js +28 -0
- package/dist/numberFormattingFunction-BUUV_luR.js.map +1 -0
- package/dist/numberFormattingFunction-u2iNHL_c.cjs +2 -0
- package/dist/numberFormattingFunction-u2iNHL_c.cjs.map +1 -0
- package/dist/{string2HTML-ZoGd08P_.cjs → string2HTML-30nfIm8R.cjs} +2 -2
- package/dist/{string2HTML-ZoGd08P_.cjs.map → string2HTML-30nfIm8R.cjs.map} +1 -1
- package/dist/{string2HTML-BrFperRM.js → string2HTML-DL-pInUB.js} +2 -2
- package/dist/{string2HTML-BrFperRM.js.map → string2HTML-DL-pInUB.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +2 -2
- package/package.json +2 -2
- package/dist/GraphEl-B73N4RIA.js +0 -1906
- package/dist/GraphEl-B73N4RIA.js.map +0 -1
- package/dist/GraphEl-Lt1og0C-.cjs +0 -2
- package/dist/GraphEl-Lt1og0C-.cjs.map +0 -1
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs +0 -2
- package/dist/XTicksAndGridLines-C5DuC5oY.cjs.map +0 -1
- package/dist/XTicksAndGridLines-gdbGX2rm.js +0 -39
- package/dist/XTicksAndGridLines-gdbGX2rm.js.map +0 -1
- package/dist/YTicksAndGridLines-CsNSq9W9.js +0 -39
- package/dist/YTicksAndGridLines-CsNSq9W9.js.map +0 -1
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs +0 -2
- package/dist/YTicksAndGridLines-DFjm8RCc.cjs.map +0 -1
- package/dist/index-B0Awa_de.js +0 -377
- package/dist/index-B0Awa_de.js.map +0 -1
- package/dist/index-CP8cmNzt.cjs +0 -2
- package/dist/index-CP8cmNzt.cjs.map +0 -1
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs +0 -2
- package/dist/numberFormattingFunction-Cn9R7CM9.cjs.map +0 -1
- package/dist/numberFormattingFunction-DqMf_v1m.js +0 -28
- package/dist/numberFormattingFunction-DqMf_v1m.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DotDensityMap.js","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n\r\n mapData: FeatureCollection;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints?: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\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(projectionRotate)\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(projectionRotate)\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(projectionRotate)\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(projectionRotate)\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(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <path\r\n d={path}\r\n key={i}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n );\r\n })}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\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 /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(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\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(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 useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n 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(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","path","stroke","strokeWidth","fill","vectorEffect","pointerEvents","AnimatePresence","color","el","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","ExpandIcon","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","graphDownload","t12","dataDownload","t13","showAntarctica","t14","language","t15","minHeight","t16","theme","t17","ariaLabel","t18","t19","t20","t21","t22","t23","timeline","t24","t25","t26","mapOverlay","light","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","t30","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","shape_0","onUpdateOverlayMapShape","t35","fetchAndParseJSON","then","d_1","t36","t37","d_2","t38","t39","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","d_10","d_9","el_1","el_0","properties","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC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M,EAAED;AAAM;AArOjC,SAAAkL,GAAAmB,GAAA;AAAA,SA4NyBpM,EAAED;AAAM;AA5NjC,SAAAiL,GAAAhL,GAAA;AAAA,SAwNsDA,EAAEqM,YAAiBC,SAAK;AAAY;AAxN1F,SAAAjC,GAAAkC,GAAA;AAAA,SAwK4BhR,MAAMrB;AAAS;AAxK3C,SAAAkQ,GAAAoC,GAAA;AAAA,SAuK6CjR,MAAMrB;AAAS;AAvK5D,SAAAiQ,GAAAsC,GAAA;AAAA,SAuKyBlR,EAAClE;AAAK;AAvK/B,SAAA6S,GAAAwC,GAAA;AAAA,SAsK2CnR,MAAMrB;AAAS;AAtK1D,SAAA+P,GAAA0C,GAAA;AAAA,SAsKuBpR,EAAClE;AAAK;AAtK7B,SAAAsP,GAAAiG,GAAAC,GAAA;AAAA,SAmEkBD,IAAIC;AAAC;AAnEvB,SAAApG,GAAAlL,GAAA;AAAA,SA+DgBA,EAAC8K;AAAK;"}
|
|
1
|
+
{"version":3,"file":"DotDensityMap.js","sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { RefObject, useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport rewind from '@turf/rewind';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n DotDensityMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { ImageDownloadButton } from '@/Components/Actions/ImageDownloadButton';\r\n\r\ninterface Props {\r\n data: DotDensityMapDataType[];\r\n\r\n mapData: FeatureCollection;\r\n colorDomain: string[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints?: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n graphDownload?: RefObject<HTMLDivElement | null>;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n collapseColorScaleByDefault,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n graphDownload,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\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(projectionRotate)\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(projectionRotate)\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(projectionRotate)\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(projectionRotate)\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(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <path\r\n d={path}\r\n key={i}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n );\r\n })}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const color =\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)];\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long, d.lat]) as [number, number])[0]\r\n },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n transition: { duration: animate.duration },\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: 'start',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {data.filter(el => el.color).length === 0 || showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <p\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </p>\r\n ) : null}\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\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 undp-viz-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 {graphDownload && (\r\n <div className='absolute right-4 top-4 flex flex-col image-download-button'>\r\n <ImageDownloadButton nodeID={graphDownload} buttonSmall />\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n DotDensityMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DotDensityMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\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 /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorLegendTitle,\r\n colorDomain,\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n mapOverlay,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(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\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(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 useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || 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 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}` ===\r\n 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(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colors","mapData","colorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","collapseColorScaleByDefault","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","graphDownload","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","d","length","scaleSqrt","domain","range","nice","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","i","path","stroke","strokeWidth","fill","vectorEffect","pointerEvents","AnimatePresence","color","el","indexOf","Colors","gray","initial","opacity","whileInView","label","transition","duration","event","clientY","clientX","isEqual","long","lat","r","fillOpacity","x","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","P","ExpandIcon","ImageDownloadButton","DetailsModal","modal","Tooltip","DotDensityMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","t2","t3","padding","t4","t5","t6","t7","t8","relativeHeight","isWorldMap","t9","t10","t11","graphID","t12","dataDownload","t13","showAntarctica","t14","language","t15","minHeight","t16","theme","t17","ariaLabel","t18","t19","t20","t21","t22","t23","timeline","t24","t25","t26","mapOverlay","light","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","t30","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","index","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","shape_0","onUpdateOverlayMapShape","t35","fetchAndParseJSON","then","d_1","t36","t37","d_2","t38","t39","t40","t41","speed","interval","setInterval","clearInterval","t42","t43","getSliderMarks","markObj","t44","graphContainer","t45","t46","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t47","Pause","Play","SliderUI","nextValue","nextValue_0","t48","GraphArea","d_8","format","_temp8","_temp9","uniqBy","_temp0","primaryColors","categoricalColors","checkIfNullOrUndefined","max","_temp1","_temp10","Spinner","t49","footnote","source","GraphFooter","t50","GraphContainer","d_10","d_9","el_1","el_0","properties","NAME","d_5","d_4","d_3","d_7","d_6","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmFO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,gBAAAA;AAAAA,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D,SAAA+P,GAAA0C,GAAA;AAAA,SAqKuBpR,EAACnE;AAAK;AArK7B,SAAAuP,GAAAiG,GAAAC,GAAA;AAAA,SAmEkBD,IAAIC;AAAC;AAnEvB,SAAApG,GAAAlL,GAAA;AAAA,SA+DgBA,EAAC8K;AAAK;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-D4pAp7u0.cjs"),R=require("react"),Wt=require("./parse-xYI9yrvL.cjs"),Ne=require("./index-Cno4Q0YE.cjs"),pe=require("./numberFormattingFunction-Cn9R7CM9.cjs"),Le=require("./Tooltip-Hr46paWP.cjs"),S=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Oe=require("./XTicksAndGridLines-C5DuC5oY.cjs"),je=require("./Axis-BTaS9oPQ.cjs"),Ee=require("./AxisTitle-DP_evhbe.cjs"),Ie=require("./index-BuhBhuCq.cjs"),Se=require("./time-CkcKbhwe.cjs"),Re=require("./linear-CgUCbw9F.cjs"),Ae=require("./line-DaEMhXmx.cjs"),de=require("./step-BZ3C8QFW.cjs"),De=require("./select-Bnfk0lJx.cjs"),dt=require("./proxy-CqH8m8IQ.cjs"),qe=require("./init-DU0ybBc_.cjs"),Me=require("./pointer-Dkq5NV1q.cjs"),Te=require("./use-in-view-dnRv_qqF.cjs"),Ce=require("./GraphFooter.cjs"),Ve=require("./GraphHeader.cjs"),$e=require("./ColorLegend.cjs"),be=require("./Colors.cjs"),Fe=require("./EmptyState-CFmiFPHz.cjs"),ke=require("./GraphContainer-Cul9b74X.cjs"),Pe=require("./getNoOfTicks-C_1CFXv_.cjs");function Ge(e){const t=n.compilerRuntimeExports.c(117),{data:v,width:J,height:K,lineColors:o,labels:j,sameAxes:A,dateFormat:f,showValues:Ot,noOfXTicks:ee,rightMargin:ie,leftMargin:Xt,topMargin:Q,bottomMargin:It,tooltip:ht,highlightAreaSettings:St,onSeriesMouseOver:Dt,animate:s,strokeWidth:F,showDots:D,noOfYTicks:yt,lineSuffixes:P,linePrefixes:Z,minDate:gt,maxDate:qt,curveType:_,styles:a,classNames:c,precision:tt,customLayers:G,showAxisLabels:H,locale:et,naLabel:Yt}=e,Bt=R.useRef(null);let vt;t[0]!==s.amount||t[1]!==s.once?(vt={once:s.once,amount:s.amount},t[0]=s.amount,t[1]=s.once,t[2]=vt):vt=t[2];const d=Te.useInView(Bt,vt),[y,zt]=R.useState(!1);let jt,it;t[3]!==s.duration||t[4]!==y||t[5]!==d?(jt=()=>{if(d&&!y){const i=setTimeout(()=>{zt(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(i)}},it=[d,y,s.duration],t[3]=s.duration,t[4]=y,t[5]=d,t[6]=jt,t[7]=it):(jt=t[6],it=t[7]),R.useEffect(jt,it);const Mt=_==="linear"?Ae.curveLinear:_==="step"?de.curveStep:_==="stepAfter"?de.stepAfter:_==="stepBefore"?de.stepBefore:de.monotoneX,[q,p]=R.useState(void 0),[u,Jt]=R.useState(void 0),[U,Kt]=R.useState(void 0),Tt=Xt+50,Ct=ie+65;let nt;t[8]!==It||t[9]!==Tt||t[10]!==Ct||t[11]!==Q?(nt={top:Q,bottom:It,left:Tt,right:Ct},t[8]=It,t[9]=Tt,t[10]=Ct,t[11]=Q,t[12]=nt):nt=t[12];const h=nt,W=R.useRef(null);let k;t[13]!==f?(k=i=>({...i,date:Wt.parse(`${i.date}`,f,new Date)}),t[13]=f,t[14]=k):k=t[14];const r=Ne.orderBy(v.map(k),["date"],["asc"]);let st;if(t[15]!==f||t[16]!==St){let i;t[18]!==f?(i=E=>({...E,coordinates:[E.coordinates[0]===null?null:Wt.parse(`${E.coordinates[0]}`,f,new Date),E.coordinates[1]===null?null:Wt.parse(`${E.coordinates[1]}`,f,new Date)]}),t[18]=f,t[19]=i):i=t[19],st=St.map(i),t[15]=f,t[16]=St,t[17]=st}else st=t[17];const At=st,x=J-h.left-h.right,l=K-h.top-h.bottom,Qt=gt?Wt.parse(`${gt}`,f,new Date):r[0].date,Vt=qt?Wt.parse(`${qt}`,f,new Date):r[r.length-1].date,wt=Math.min(...r.map(vi).filter(gi))!==1/0?Math.min(...r.map(yi).filter(hi))>0?0:Math.min(...r.map(di).filter(pi)):0,ot=Math.min(...r.map(fi).filter(mi))!==1/0?Math.min(...r.map(xi).filter(ui))>0?0:Math.min(...r.map(ci).filter(ai)):0,rt=Math.max(...r.map(li).filter(ri))!==1/0?Math.max(...r.map(oi).filter(si)):0,X=Math.max(...r.map(ni).filter(ii))!==1/0?Math.max(...r.map(ei).filter(ti)):0,$t=wt<ot?wt:ot,Y=rt>X?rt:X,m=Se.time().domain([Qt,Vt]).range([0,x]),b=Re.linear().domain([A?$t:wt,A?Y>0?Y:0:rt>0?rt:0]).range([l,0]).nice(),g=Re.linear().domain([A?$t:ot,A?Y>0?Y:0:X>0?X:0]).range([l,0]).nice(),Ft=Ae.line().defined(_e).x(i=>m(i.date)).y(i=>b(i.y1)).curve(Mt),Et=Ae.line().defined(Ze).x(i=>m(i.date)).y(i=>g(i.y2)).curve(Mt),Zt=b.ticks(yt),_t=g.ticks(yt),Pt=m.ticks(ee);R.useEffect(()=>{const i=ve=>{const we=r[qe.bisectCenter(r.map(Qe),m.invert(Me.pointer(ve)[0]),0)];p(we||r[r.length-1]),Dt?.(we||r[r.length-1]),Kt(ve.clientY),Jt(ve.clientX)},E=()=>{p(void 0),Jt(void 0),Kt(void 0),Dt?.(void 0)};De.select(W.current).on("mousemove",i).on("mouseout",E)},[m,r,Dt]);let lt;t[20]!==s||t[21]!==l||t[22]!==x||t[23]!==At||t[24]!==d||t[25]!==m?(lt=n.jsxRuntimeExports.jsx(Ie.HighlightArea,{areaSettings:At,width:x,height:l,scale:m,animate:s,isInView:d}),t[20]=s,t[21]=l,t[22]=x,t[23]=At,t[24]=d,t[25]=m,t[26]=lt):lt=t[26];const Rt=c?.xAxis?.axis;let M;t[27]!==Rt?(M={axis:Rt},t[27]=Rt,t[28]=M):M=t[28];let N;t[29]!==a?.xAxis?.axis?(N=a?.xAxis?.axis||{},t[29]=a?.xAxis?.axis,t[30]=N):N=t[30];let T;t[31]!==o[0]||t[32]!==N?(T={axis:{stroke:o[0],...N}},t[31]=o[0],t[32]=N,t[33]=T):T=t[33];let at;t[34]!==l||t[35]!==M||t[36]!==T?(at=n.jsxRuntimeExports.jsx(je.Axis,{y1:0,y2:l,x1:-15,x2:-15,classNames:M,styles:T}),t[34]=l,t[35]=M,t[36]=T,t[37]=at):at=t[37];let ct;t[38]!==c?.yAxis?.title||t[39]!==l||t[40]!==j||t[41]!==o[0]||t[42]!==h.left||t[43]!==H||t[44]!==a?.yAxis?.title?(ct=H?n.jsxRuntimeExports.jsx(Ee.AxisTitle,{x:10-h.left,y:l/2,style:{fill:o[0],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:j[0].length>100?`${j[0].substring(0,100)}...`:j[0],rotate90:!0}):null,t[38]=c?.yAxis?.title,t[39]=l,t[40]=j,t[41]=o[0],t[42]=h.left,t[43]=H,t[44]=a?.yAxis?.title,t[45]=ct):ct=t[45];const bt=x+15,B=x+15,te=c?.xAxis?.axis;let L;t[46]!==te?(L={axis:te},t[46]=te,t[47]=L):L=t[47];let ut;t[48]!==a?.xAxis?.axis?(ut=a?.xAxis?.axis||{},t[48]=a?.xAxis?.axis,t[49]=ut):ut=t[49];let C;t[50]!==o[1]||t[51]!==ut?(C={axis:{stroke:o[1],...ut}},t[50]=o[1],t[51]=ut,t[52]=C):C=t[52];let kt;t[53]!==l||t[54]!==bt||t[55]!==B||t[56]!==L||t[57]!==C?(kt=n.jsxRuntimeExports.jsx(je.Axis,{y1:0,y2:l,x1:bt,x2:B,classNames:L,styles:C}),t[53]=l,t[54]=bt,t[55]=B,t[56]=L,t[57]=C,t[58]=kt):kt=t[58];let z;t[59]!==c?.yAxis?.title||t[60]!==l||t[61]!==x||t[62]!==j||t[63]!==o[1]||t[64]!==h.right||t[65]!==H||t[66]!==a?.yAxis?.title?(z=H?n.jsxRuntimeExports.jsx(Ee.AxisTitle,{x:x+h.right-15,y:l/2,style:{fill:o[1],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:j[1].length>100?`${j[1].substring(0,100)}...`:j[1],rotate90:!0}):null,t[59]=c?.yAxis?.title,t[60]=l,t[61]=x,t[62]=j,t[63]=o[1],t[64]=h.right,t[65]=H,t[66]=a?.yAxis?.title,t[67]=z):z=t[67];const xt=x+15,Nt=c?.xAxis?.axis;let V;t[68]!==Nt?(V={axis:Nt},t[68]=Nt,t[69]=V):V=t[69];const $=a?.xAxis?.axis;let w;t[70]!==$?(w={axis:$},t[70]=$,t[71]=w):w=t[71];let O;t[72]!==l||t[73]!==xt||t[74]!==V||t[75]!==w?(O=n.jsxRuntimeExports.jsx(je.Axis,{y1:l,y2:l,x1:-15,x2:xt,classNames:V,styles:w}),t[72]=l,t[73]=xt,t[74]=V,t[75]=w,t[76]=O):O=t[76];let I;t[77]!==f?(I=i=>Wt.format(i,f),t[77]=f,t[78]=I):I=t[78];const mt=Pt.map(I),ft=Pt.map(i=>m(i)),pt=a?.xAxis?.gridLines,Gt=a?.xAxis?.labels;let Lt;t[79]!==pt||t[80]!==Gt?(Lt={gridLines:pt,labels:Gt},t[79]=pt,t[80]=Gt,t[81]=Lt):Lt=t[81];const he=c?.xAxis?.gridLines;let Ht;t[82]!==he?(Ht=n.mo("opacity-0",he),t[82]=he,t[83]=Ht):Ht=t[83];const ye=c?.xAxis?.labels;let Ut;t[84]!==ye?(Ut=n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",ye),t[84]=ye,t[85]=Ut):Ut=t[85];let ne;t[86]!==Ht||t[87]!==Ut?(ne={gridLines:Ht,labels:Ut},t[86]=Ht,t[87]=Ut,t[88]=ne):ne=t[88];let se;t[89]!==G?(se=G.filter(Ke).map(Je),t[89]=G,t[90]=se):se=t[90];let oe;t[91]!==o[0]||t[92]!==F?(oe={stroke:o[0],strokeWidth:F,fill:"none"},t[91]=o[0],t[92]=F,t[93]=oe):oe=t[93];let re;t[94]!==s.duration?(re={opacity:0,transition:{duration:s.duration}},t[94]=s.duration,t[95]=re):re=t[95];let le;t[96]!==o[1]||t[97]!==F?(le={stroke:o[1],strokeWidth:F,fill:"none"},t[96]=o[1],t[97]=F,t[98]=le):le=t[98];let ae;t[99]!==s.duration?(ae={opacity:0,transition:{duration:s.duration}},t[99]=s.duration,t[100]=ae):ae=t[100];const ge=r.map((i,E)=>n.jsxRuntimeExports.jsxs(dt.motion.g,{children:[S.checkIfNullOrUndefined(i.y1)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[D?n.jsxRuntimeExports.jsx(dt.motion.circle,{r:x/r.length<5?0:x/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:m(i.date),cy:b(i.y1),fill:o[0]},whileInView:{opacity:1,fill:o[0],transition:{duration:y?s.duration:.5,delay:y?0:s.duration},cx:m(i.date),cy:b(i.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Ot?n.jsxRuntimeExports.jsx(dt.motion.text,{dy:S.checkIfNullOrUndefined(i.y2)||i.y2<i.y1?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-1 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:m(i.date),y:g(i.y1),fill:o[0]},whileInView:{opacity:1,x:m(i.date),fill:o[0],y:g(i.y1),transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:pe.numberFormattingFunction(i.y1,Yt,tt,Z[0],P[0],et)}):null]}),S.checkIfNullOrUndefined(i.y2)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[D?n.jsxRuntimeExports.jsx(dt.motion.circle,{r:x/r.length<5?0:x/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:m(i.date),cy:g(i.y2),fill:o[1]},whileInView:{opacity:1,transition:{duration:y?s.duration:.5,delay:y?0:s.duration},fill:o[1],cx:m(i.date),cy:g(i.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,Ot?n.jsxRuntimeExports.jsx(dt.motion.text,{dy:S.checkIfNullOrUndefined(i.y1)||i.y1<i.y2?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-2 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:m(i.date),y:g(i.y2),fill:o[1]},whileInView:{opacity:1,x:m(i.date),y:g(i.y2),fill:o[1],transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:pe.numberFormattingFunction(i.y2,Yt,tt,Z[1],P[1],et)}):null]})]},E));let ce;t[101]!==ge?(ce=n.jsxRuntimeExports.jsx("g",{children:ge}),t[101]=ge,t[102]=ce):ce=t[102];let ue;t[103]!==G?(ue=G.filter(Ue).map(He),t[103]=G,t[104]=ue):ue=t[104];let xe;t[105]===Symbol.for("react.memo_cache_sentinel")?(xe={fill:"none",pointerEvents:"all"},t[105]=xe):xe=t[105];let me;t[106]!==W||t[107]!==l||t[108]!==x?(me=n.jsxRuntimeExports.jsx("rect",{ref:W,style:xe,width:x,height:l}),t[106]=W,t[107]=l,t[108]=x,t[109]=me):me=t[109];let fe;return t[110]!==c?.tooltip||t[111]!==u||t[112]!==U||t[113]!==q||t[114]!==a?.tooltip||t[115]!==ht?(fe=q&&ht&&u&&U?n.jsxRuntimeExports.jsx(Le.Tooltip,{data:q,body:ht,xPos:u,yPos:U,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[110]=c?.tooltip,t[111]=u,t[112]=U,t[113]=q,t[114]=a?.tooltip,t[115]=ht,t[116]=fe):fe=t[116],n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(dt.motion.svg,{width:`${J}px`,height:`${K}px`,viewBox:`0 0 ${J} ${K}`,direction:"ltr",ref:Bt,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[lt,n.jsxRuntimeExports.jsxs("g",{children:[Zt.map((i,E)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:b(i),y2:b(i),x1:-15,x2:-20,style:{stroke:o[0],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:-25,y:b(i),dy:"0.33em",className:n.mo("text-xs",c?.yAxis?.labels),style:{textAnchor:"end",fill:o[0],...a?.yAxis?.labels||{}},children:pe.numberFormattingFunction(i,void 0,tt,Z[0],P[0],et)})]},E)),at,ct]}),n.jsxRuntimeExports.jsxs("g",{children:[_t.map((i,E)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:g(i),y2:g(i),x1:x+15,x2:x+20,style:{stroke:o[1],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:x+25,y:g(i),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o[1],...a?.yAxis?.labels||{}},className:n.mo("text-xs",c?.yAxis?.labels),children:pe.numberFormattingFunction(i,void 0,tt,Z[1],P[1],et)})]},E)),kt,z]}),n.jsxRuntimeExports.jsxs("g",{children:[O,n.jsxRuntimeExports.jsx(Oe.XTicksAndGridLines,{values:mt,x:ft,y1:0,y2:l,styles:Lt,classNames:ne,labelType:"primary",showGridLines:!0,precision:tt,locale:et})]}),se,n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx(dt.motion.path,{style:oe,exit:re,variants:{initial:{pathLength:0,d:Ft(r.filter(ze))||"",opacity:1},whileInView:{pathLength:1,d:Ft(r.filter(Be))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),n.jsxRuntimeExports.jsx(dt.motion.path,{d:Et(r.filter(Ye))||"",style:le,exit:ae,variants:{initial:{pathLength:0,d:Et(r.filter(Xe))||"",opacity:1},whileInView:{pathLength:1,d:Et(r.filter(We))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),q?n.jsxRuntimeExports.jsx("line",{y1:0,y2:l,x1:m(q.date),x2:m(q.date),className:n.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",c?.mouseOverLine),style:a?.mouseOverLine}):null]}),ce,ue,me]})}),fe]})}function He(e){return e.layer}function Ue(e){return e.position==="after"}function We(e){return!S.checkIfNullOrUndefined(e.y2)}function Xe(e){return!S.checkIfNullOrUndefined(e.y2)}function Ye(e){return!S.checkIfNullOrUndefined(e.y2)}function Be(e){return!S.checkIfNullOrUndefined(e.y1)}function ze(e){return!S.checkIfNullOrUndefined(e.y1)}function Je(e){return e.layer}function Ke(e){return e.position==="before"}function Qe(e){return e.date}function Ze(e){return!S.checkIfNullOrUndefined(e.y2)}function _e(e){return!S.checkIfNullOrUndefined(e.y1)}function ti(e){return e!=null}function ei(e){return e.y2}function ii(e){return e!=null}function ni(e){return e.y2}function si(e){return e!=null}function oi(e){return e.y1}function ri(e){return e!=null}function li(e){return e.y1}function ai(e){return e!=null}function ci(e){return e.y2}function ui(e){return e!=null}function xi(e){return e.y2}function mi(e){return e!=null}function fi(e){return e.y2}function pi(e){return e!=null}function di(e){return e.y1}function hi(e){return e!=null}function yi(e){return e.y2}function gi(e){return e!=null}function vi(e){return e.y1}function ji(e){const t=n.compilerRuntimeExports.c(92),{data:v,graphTitle:J,sources:K,graphDescription:o,height:j,width:A,footNote:f,noOfXTicks:Ot,dateFormat:ee,showValues:ie,padding:Xt,lineColors:Q,sameAxes:It,backgroundColor:ht,leftMargin:St,rightMargin:Dt,topMargin:s,bottomMargin:F,labels:D,lineSuffixes:yt,linePrefixes:P,tooltip:Z,highlightAreaSettings:gt,relativeHeight:qt,onSeriesMouseOver:_,graphID:a,graphDownload:c,dataDownload:tt,animate:G,strokeWidth:H,showDots:et,language:Yt,showColorScale:Bt,minHeight:vt,colorLegendTitle:d,theme:y,ariaLabel:zt,noOfYTicks:jt,maxDate:it,minDate:Mt,curveType:q,styles:p,classNames:u,precision:Jt,customLayers:U,showAxisLabels:Kt,locale:Tt,naLabel:Ct}=e,nt=ee===void 0?"yyyy":ee,h=ie===void 0?!1:ie;let W;t[0]!==Q?(W=Q===void 0?[be.Colors.light.categoricalColors.colors[0],be.Colors.light.categoricalColors.colors[1]]:Q,t[0]=Q,t[1]=W):W=t[1];const k=W,r=It===void 0?!1:It,st=ht===void 0?!1:ht,At=St===void 0?80:St,x=Dt===void 0?80:Dt,l=s===void 0?20:s,Qt=F===void 0?25:F;let Vt;t[2]!==yt?(Vt=yt===void 0?["",""]:yt,t[2]=yt,t[3]=Vt):Vt=t[3];const wt=Vt;let ot;t[4]!==P?(ot=P===void 0?["",""]:P,t[4]=P,t[5]=ot):ot=t[5];const rt=ot;let X;t[6]!==gt?(X=gt===void 0?[]:gt,t[6]=gt,t[7]=X):X=t[7];const $t=X,Y=c===void 0?!1:c,m=tt===void 0?!1:tt,b=G===void 0?!1:G,g=H===void 0?2:H,Ft=et===void 0?!0:et,Et=Yt===void 0?"en":Yt,Zt=Bt===void 0?!0:Bt,_t=vt===void 0?0:vt,Pt=y===void 0?"light":y,lt=jt===void 0?5:jt,Rt=q===void 0?"curve":q,M=Jt===void 0?2:Jt;let N;t[8]!==U?(N=U===void 0?[]:U,t[8]=U,t[9]=N):N=t[9];const T=N,at=Kt===void 0?!0:Kt,ct=Tt===void 0?"en":Tt,bt=Ct===void 0?"NA":Ct,[B,te]=R.useState(0),[L,ut]=R.useState(0),C=R.useRef(null),kt=R.useRef(null);let z,xt;t[10]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{const Gt=new ResizeObserver(Lt=>{te(Lt[0].target.clientWidth||620),ut(Lt[0].target.clientHeight||480)});return C.current&&Gt.observe(C.current),()=>Gt.disconnect()},xt=[],t[10]=z,t[11]=xt):(z=t[10],xt=t[11]),R.useEffect(z,xt);const Nt=u?.graphContainer,V=p?.graphContainer;let $;t[12]!==u?.description||t[13]!==u?.title||t[14]!==v||t[15]!==m||t[16]!==o||t[17]!==Y||t[18]!==J||t[19]!==p?.description||t[20]!==p?.title||t[21]!==A?($=J||o||Y||m?n.jsxRuntimeExports.jsx(Ve.GraphHeader,{styles:{title:p?.title,description:p?.description},classNames:{title:u?.title,description:u?.description},graphTitle:J,graphDescription:o,width:A,graphDownload:Y?kt:void 0,dataDownload:m?v.map(bi).filter(Ri).length>0?v.map(Ei).filter(wi):v.filter(Ai):null}):null,t[12]=u?.description,t[13]=u?.title,t[14]=v,t[15]=m,t[16]=o,t[17]=Y,t[18]=J,t[19]=p?.description,t[20]=p?.title,t[21]=A,t[22]=$):$=t[22];let w;t[23]!==u?.colorLegend||t[24]!==d||t[25]!==D||t[26]!==k||t[27]!==Zt?(w=Zt&&D.length>0?n.jsxRuntimeExports.jsx($e.ColorLegend,{colorDomain:D,colorLegendTitle:d,colors:k,showNAColor:!1,className:u?.colorLegend}):null,t[23]=u?.colorLegend,t[24]=d,t[25]=D,t[26]=k,t[27]=Zt,t[28]=w):w=t[28];let O;t[29]!==v.length?(O=v.length===0&&n.jsxRuntimeExports.jsx(Fe.EmptyState,{}),t[29]=v.length,t[30]=O):O=t[30];let I;t[31]!==b||t[32]!==Qt||t[33]!==u||t[34]!==Rt||t[35]!==T||t[36]!==v||t[37]!==nt||t[38]!==$t||t[39]!==D||t[40]!==At||t[41]!==k||t[42]!==rt||t[43]!==wt||t[44]!==ct||t[45]!==it||t[46]!==Mt||t[47]!==bt||t[48]!==Ot||t[49]!==lt||t[50]!==_||t[51]!==M||t[52]!==x||t[53]!==r||t[54]!==at||t[55]!==Ft||t[56]!==h||t[57]!==g||t[58]!==p||t[59]!==L||t[60]!==B||t[61]!==Z||t[62]!==l?(I=B&&L&&v.length>0?n.jsxRuntimeExports.jsx(Ge,{data:v,sameAxes:r,lineColors:k,width:B,height:L,dateFormat:nt,showValues:h,noOfXTicks:Ot??Pe.getNoOfTicks(B),leftMargin:At,rightMargin:x,topMargin:l,bottomMargin:Qt,labels:D,highlightAreaSettings:$t,tooltip:Z,onSeriesMouseOver:_,animate:b===!0?{duration:.5,once:!0,amount:.5}:b||{duration:0,once:!0,amount:0},strokeWidth:g,showDots:Ft,noOfYTicks:lt,lineSuffixes:wt,linePrefixes:rt,minDate:Mt,maxDate:it,curveType:Rt,styles:p,classNames:u,precision:M,customLayers:T,showAxisLabels:at,locale:ct,naLabel:bt}):null,t[31]=b,t[32]=Qt,t[33]=u,t[34]=Rt,t[35]=T,t[36]=v,t[37]=nt,t[38]=$t,t[39]=D,t[40]=At,t[41]=k,t[42]=rt,t[43]=wt,t[44]=ct,t[45]=it,t[46]=Mt,t[47]=bt,t[48]=Ot,t[49]=lt,t[50]=_,t[51]=M,t[52]=x,t[53]=r,t[54]=at,t[55]=Ft,t[56]=h,t[57]=g,t[58]=p,t[59]=L,t[60]=B,t[61]=Z,t[62]=l,t[63]=I):I=t[63];let mt;t[64]!==O||t[65]!==I?(mt=n.jsxRuntimeExports.jsxs(ke.GraphArea,{ref:C,children:[O,I]}),t[64]=O,t[65]=I,t[66]=mt):mt=t[66];let ft;t[67]!==u?.footnote||t[68]!==u?.source||t[69]!==f||t[70]!==K||t[71]!==p?.footnote||t[72]!==p?.source||t[73]!==A?(ft=K||f?n.jsxRuntimeExports.jsx(Ce.GraphFooter,{styles:{footnote:p?.footnote,source:p?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:K,footNote:f,width:A}):null,t[67]=u?.footnote,t[68]=u?.source,t[69]=f,t[70]=K,t[71]=p?.footnote,t[72]=p?.source,t[73]=A,t[74]=ft):ft=t[74];let pt;return t[75]!==zt||t[76]!==st||t[77]!==a||t[78]!==j||t[79]!==Et||t[80]!==_t||t[81]!==Xt||t[82]!==qt||t[83]!==Nt||t[84]!==V||t[85]!==$||t[86]!==w||t[87]!==mt||t[88]!==ft||t[89]!==Pt||t[90]!==A?(pt=n.jsxRuntimeExports.jsxs(ke.GraphContainer,{className:Nt,style:V,id:a,ref:kt,"aria-label":zt,backgroundColor:st,theme:Pt,language:Et,minHeight:_t,width:A,height:j,relativeHeight:qt,padding:Xt,children:[$,w,mt,ft]}),t[75]=zt,t[76]=st,t[77]=a,t[78]=j,t[79]=Et,t[80]=_t,t[81]=Xt,t[82]=qt,t[83]=Nt,t[84]=V,t[85]=$,t[86]=w,t[87]=mt,t[88]=ft,t[89]=Pt,t[90]=A,t[91]=pt):pt=t[91],pt}function Ai(e){return e!==void 0}function wi(e){return e!==void 0}function Ei(e){return e.data}function Ri(e){return e!==void 0}function bi(e){return e.data}exports.DualAxisLineChart=ji;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-D4pAp7u0.cjs"),N=require("react"),Ft=require("./parse-xYI9yrvL.cjs"),Re=require("./index-Cno4Q0YE.cjs"),ae=require("./numberFormattingFunction-u2iNHL_c.cjs"),ke=require("./Tooltip-C9F3uYG0.cjs"),T=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ne=require("./XTicksAndGridLines-B4UhDVyU.cjs"),he=require("./Axis-BTaS9oPQ.cjs"),ve=require("./AxisTitle-DP_evhbe.cjs"),Le=require("./index-BuhBhuCq.cjs"),Oe=require("./time-CkcKbhwe.cjs"),je=require("./linear-CgUCbw9F.cjs"),ye=require("./line-DaEMhXmx.cjs"),ce=require("./step-BZ3C8QFW.cjs"),De=require("./select-Bnfk0lJx.cjs"),ct=require("./proxy-CqH8m8IQ.cjs"),Ie=require("./init-DU0ybBc_.cjs"),qe=require("./pointer-Dkq5NV1q.cjs"),Me=require("./use-in-view-dnRv_qqF.cjs"),Se=require("./GraphFooter.cjs"),Te=require("./GraphHeader.cjs"),Ce=require("./ColorLegend.cjs"),Ae=require("./Colors.cjs"),Ve=require("./EmptyState-CFmiFPHz.cjs"),we=require("./GraphContainer-Cul9b74X.cjs"),$e=require("./getNoOfTicks-C_1CFXv_.cjs");function Fe(e){const t=n.compilerRuntimeExports.c(117),{data:v,width:B,height:z,lineColors:o,labels:j,sameAxes:A,dateFormat:p,showValues:At,noOfXTicks:Zt,rightMargin:Bt,leftMargin:Gt,topMargin:J,bottomMargin:wt,tooltip:ut,highlightAreaSettings:bt,onSeriesMouseOver:Et,animate:s,strokeWidth:H,showDots:C,noOfYTicks:Rt,leftLineNumberDisplayOptions:w,rightLineNumberDisplayOptions:b,minDate:xt,maxDate:kt,curveType:K,styles:a,classNames:c,customLayers:U,showAxisLabels:P,naLabel:Ht}=e,Ut=N.useRef(null);let mt;t[0]!==s.amount||t[1]!==s.once?(mt={once:s.once,amount:s.amount},t[0]=s.amount,t[1]=s.once,t[2]=mt):mt=t[2];const d=Me.useInView(Ut,mt),[y,Pt]=N.useState(!1);let pt,Q;t[3]!==s.duration||t[4]!==y||t[5]!==d?(pt=()=>{if(d&&!y){const i=setTimeout(()=>{Pt(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(i)}},Q=[d,y,s.duration],t[3]=s.duration,t[4]=y,t[5]=d,t[6]=pt,t[7]=Q):(pt=t[6],Q=t[7]),N.useEffect(pt,Q);const Wt=K==="linear"?ye.curveLinear:K==="step"?ce.curveStep:K==="stepAfter"?ce.stepAfter:K==="stepBefore"?ce.stepBefore:ce.monotoneX,[O,Nt]=N.useState(void 0),[ft,f]=N.useState(void 0),[u,dt]=N.useState(void 0),Lt=Gt+50,Ot=Bt+65;let _;t[8]!==wt||t[9]!==Lt||t[10]!==Ot||t[11]!==J?(_={top:J,bottom:wt,left:Lt,right:Ot},t[8]=wt,t[9]=Lt,t[10]=Ot,t[11]=J,t[12]=_):_=t[12];const h=_,W=N.useRef(null);let D;t[13]!==p?(D=i=>({...i,date:Ft.parse(`${i.date}`,p,new Date)}),t[13]=p,t[14]=D):D=t[14];const r=Re.orderBy(v.map(D),["date"],["asc"]);let tt;if(t[15]!==p||t[16]!==bt){let i;t[18]!==p?(i=k=>({...k,coordinates:[k.coordinates[0]===null?null:Ft.parse(`${k.coordinates[0]}`,p,new Date),k.coordinates[1]===null?null:Ft.parse(`${k.coordinates[1]}`,p,new Date)]}),t[18]=p,t[19]=i):i=t[19],tt=bt.map(i),t[15]=p,t[16]=bt,t[17]=tt}else tt=t[17];const ht=tt,x=B-h.left-h.right,l=z-h.top-h.bottom,Xt=xt?Ft.parse(`${xt}`,p,new Date):r[0].date,Dt=kt?Ft.parse(`${kt}`,p,new Date):r[r.length-1].date,yt=Math.min(...r.map(yi).filter(hi))!==1/0?Math.min(...r.map(di).filter(fi))>0?0:Math.min(...r.map(pi).filter(mi)):0,et=Math.min(...r.map(xi).filter(ui))!==1/0?Math.min(...r.map(ci).filter(ai))>0?0:Math.min(...r.map(li).filter(ri)):0,X=Math.max(...r.map(oi).filter(si))!==1/0?Math.max(...r.map(ni).filter(ii)):0,Y=Math.max(...r.map(ei).filter(ti))!==1/0?Math.max(...r.map(_e).filter(Qe)):0,It=yt<et?yt:et,it=X>Y?X:Y,m=Oe.time().domain([Xt,Dt]).range([0,x]),I=je.linear().domain([A?It:yt,A?it>0?it:0:X>0?X:0]).range([l,0]).nice(),g=je.linear().domain([A?It:et,A?it>0?it:0:Y>0?Y:0]).range([l,0]).nice(),qt=ye.line().defined(Ke).x(i=>m(i.date)).y(i=>I(i.y1)).curve(Wt),gt=ye.line().defined(Je).x(i=>m(i.date)).y(i=>g(i.y2)).curve(Wt),Yt=I.ticks(Rt),Mt=g.ticks(Rt),St=m.ticks(Zt);N.useEffect(()=>{const i=de=>{const ge=r[Ie.bisectCenter(r.map(ze),m.invert(qe.pointer(de)[0]),0)];Nt(ge||r[r.length-1]),Et?.(ge||r[r.length-1]),dt(de.clientY),f(de.clientX)},k=()=>{Nt(void 0),f(void 0),dt(void 0),Et?.(void 0)};De.select(W.current).on("mousemove",i).on("mouseout",k)},[m,r,Et]);let nt;t[20]!==s||t[21]!==l||t[22]!==x||t[23]!==ht||t[24]!==d||t[25]!==m?(nt=n.jsxRuntimeExports.jsx(Le.HighlightArea,{areaSettings:ht,width:x,height:l,scale:m,animate:s,isInView:d}),t[20]=s,t[21]=l,t[22]=x,t[23]=ht,t[24]=d,t[25]=m,t[26]=nt):nt=t[26];const vt=c?.xAxis?.axis;let L;t[27]!==vt?(L={axis:vt},t[27]=vt,t[28]=L):L=t[28];let st;t[29]!==a?.xAxis?.axis?(st=a?.xAxis?.axis||{},t[29]=a?.xAxis?.axis,t[30]=st):st=t[30];let q;t[31]!==o[0]||t[32]!==st?(q={axis:{stroke:o[0],...st}},t[31]=o[0],t[32]=st,t[33]=q):q=t[33];let Tt;t[34]!==l||t[35]!==L||t[36]!==q?(Tt=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:-15,x2:-15,classNames:L,styles:q}),t[34]=l,t[35]=L,t[36]=q,t[37]=Tt):Tt=t[37];let ot;t[38]!==c?.yAxis?.title||t[39]!==l||t[40]!==j||t[41]!==o[0]||t[42]!==h.left||t[43]!==P||t[44]!==a?.yAxis?.title?(ot=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:10-h.left,y:l/2,style:{fill:o[0],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:j[0].length>100?`${j[0].substring(0,100)}...`:j[0],rotate90:!0}):null,t[38]=c?.yAxis?.title,t[39]=l,t[40]=j,t[41]=o[0],t[42]=h.left,t[43]=P,t[44]=a?.yAxis?.title,t[45]=ot):ot=t[45];const Ct=x+15,rt=x+15,lt=c?.xAxis?.axis;let V;t[46]!==lt?(V={axis:lt},t[46]=lt,t[47]=V):V=t[47];let $;t[48]!==a?.xAxis?.axis?($=a?.xAxis?.axis||{},t[48]=a?.xAxis?.axis,t[49]=$):$=t[49];let E;t[50]!==o[1]||t[51]!==$?(E={axis:{stroke:o[1],...$}},t[50]=o[1],t[51]=$,t[52]=E):E=t[52];let M;t[53]!==l||t[54]!==Ct||t[55]!==rt||t[56]!==V||t[57]!==E?(M=n.jsxRuntimeExports.jsx(he.Axis,{y1:0,y2:l,x1:Ct,x2:rt,classNames:V,styles:E}),t[53]=l,t[54]=Ct,t[55]=rt,t[56]=V,t[57]=E,t[58]=M):M=t[58];let S;t[59]!==c?.yAxis?.title||t[60]!==l||t[61]!==x||t[62]!==j||t[63]!==o[1]||t[64]!==h.right||t[65]!==P||t[66]!==a?.yAxis?.title?(S=P?n.jsxRuntimeExports.jsx(ve.AxisTitle,{x:x+h.right-15,y:l/2,style:{fill:o[1],...a?.yAxis?.title||{}},className:c?.yAxis?.title,text:j[1].length>100?`${j[1].substring(0,100)}...`:j[1],rotate90:!0}):null,t[59]=c?.yAxis?.title,t[60]=l,t[61]=x,t[62]=j,t[63]=o[1],t[64]=h.right,t[65]=P,t[66]=a?.yAxis?.title,t[67]=S):S=t[67];const F=x+15,G=c?.xAxis?.axis;let R;t[68]!==G?(R={axis:G},t[68]=G,t[69]=R):R=t[69];const at=a?.xAxis?.axis;let Z;t[70]!==at?(Z={axis:at},t[70]=at,t[71]=Z):Z=t[71];let jt;t[72]!==l||t[73]!==F||t[74]!==R||t[75]!==Z?(jt=n.jsxRuntimeExports.jsx(he.Axis,{y1:l,y2:l,x1:-15,x2:F,classNames:R,styles:Z}),t[72]=l,t[73]=F,t[74]=R,t[75]=Z,t[76]=jt):jt=t[76];let zt;t[77]!==p?(zt=i=>Ft.format(i,p),t[77]=p,t[78]=zt):zt=t[78];const be=St.map(zt),Ee=St.map(i=>m(i)),ue=a?.xAxis?.gridLines,xe=a?.xAxis?.labels;let Jt;t[79]!==ue||t[80]!==xe?(Jt={gridLines:ue,labels:xe},t[79]=ue,t[80]=xe,t[81]=Jt):Jt=t[81];const me=c?.xAxis?.gridLines;let Vt;t[82]!==me?(Vt=n.mo("opacity-0",me),t[82]=me,t[83]=Vt):Vt=t[83];const pe=c?.xAxis?.labels;let $t;t[84]!==pe?($t=n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",pe),t[84]=pe,t[85]=$t):$t=t[85];let Kt;t[86]!==Vt||t[87]!==$t?(Kt={gridLines:Vt,labels:$t},t[86]=Vt,t[87]=$t,t[88]=Kt):Kt=t[88];let Qt;t[89]!==U?(Qt=U.filter(Be).map(Ze),t[89]=U,t[90]=Qt):Qt=t[90];let _t;t[91]!==o[0]||t[92]!==H?(_t={stroke:o[0],strokeWidth:H,fill:"none"},t[91]=o[0],t[92]=H,t[93]=_t):_t=t[93];let te;t[94]!==s.duration?(te={opacity:0,transition:{duration:s.duration}},t[94]=s.duration,t[95]=te):te=t[95];let ee;t[96]!==o[1]||t[97]!==H?(ee={stroke:o[1],strokeWidth:H,fill:"none"},t[96]=o[1],t[97]=H,t[98]=ee):ee=t[98];let ie;t[99]!==s.duration?(ie={opacity:0,transition:{duration:s.duration}},t[99]=s.duration,t[100]=ie):ie=t[100];const fe=r.map((i,k)=>n.jsxRuntimeExports.jsxs(ct.motion.g,{children:[T.checkIfNullOrUndefined(i.y1)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[C?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:x/r.length<5?0:x/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:m(i.date),cy:I(i.y1),fill:o[0]},whileInView:{opacity:1,fill:o[0],transition:{duration:y?s.duration:.5,delay:y?0:s.duration},cx:m(i.date),cy:I(i.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,At?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:T.checkIfNullOrUndefined(i.y2)||i.y2<i.y1?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-1 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:m(i.date),y:g(i.y1),fill:o[0]},whileInView:{opacity:1,x:m(i.date),fill:o[0],y:g(i.y1),transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y1,Ht,w?.precision??2,w?.prefix,w?.suffix,w?.locale,w?.padZeros)}):null]}),T.checkIfNullOrUndefined(i.y2)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[C?n.jsxRuntimeExports.jsx(ct.motion.circle,{r:x/r.length<5?0:x/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:m(i.date),cy:g(i.y2),fill:o[1]},whileInView:{opacity:1,transition:{duration:y?s.duration:.5,delay:y?0:s.duration},fill:o[1],cx:m(i.date),cy:g(i.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,At?n.jsxRuntimeExports.jsx(ct.motion.text,{dy:T.checkIfNullOrUndefined(i.y1)||i.y1<i.y2?-8:"1em",style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:n.mo("graph-value graph-value-line-2 text-xs font-bold",c?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:m(i.date),y:g(i.y2),fill:o[1]},whileInView:{opacity:1,x:m(i.date),y:g(i.y2),fill:o[1],transition:{duration:y?s.duration:.5,delay:y?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(i.y2,Ht,b?.precision??2,b?.prefix,b?.suffix,b?.locale,b?.padZeros)}):null]})]},k));let ne;t[101]!==fe?(ne=n.jsxRuntimeExports.jsx("g",{children:fe}),t[101]=fe,t[102]=ne):ne=t[102];let se;t[103]!==U?(se=U.filter(He).map(Ge),t[103]=U,t[104]=se):se=t[104];let oe;t[105]===Symbol.for("react.memo_cache_sentinel")?(oe={fill:"none",pointerEvents:"all"},t[105]=oe):oe=t[105];let re;t[106]!==W||t[107]!==l||t[108]!==x?(re=n.jsxRuntimeExports.jsx("rect",{ref:W,style:oe,width:x,height:l}),t[106]=W,t[107]=l,t[108]=x,t[109]=re):re=t[109];let le;return t[110]!==c?.tooltip||t[111]!==ft||t[112]!==u||t[113]!==O||t[114]!==a?.tooltip||t[115]!==ut?(le=O&&ut&&ft&&u?n.jsxRuntimeExports.jsx(ke.Tooltip,{data:O,body:ut,xPos:ft,yPos:u,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[110]=c?.tooltip,t[111]=ft,t[112]=u,t[113]=O,t[114]=a?.tooltip,t[115]=ut,t[116]=le):le=t[116],n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(ct.motion.svg,{width:`${B}px`,height:`${z}px`,viewBox:`0 0 ${B} ${z}`,direction:"ltr",ref:Ut,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[nt,n.jsxRuntimeExports.jsxs("g",{children:[Yt.map((i,k)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:I(i),y2:I(i),x1:-15,x2:-20,style:{stroke:o[0],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:-25,y:I(i),dy:"0.33em",className:n.mo("text-xs",c?.yAxis?.labels),style:{textAnchor:"end",fill:o[0],...a?.yAxis?.labels||{}},children:ae.numberFormattingFunction(i,void 0,w?.precision,w?.prefix,w?.suffix,w?.locale,w?.padZeros)})]},k)),Tt,ot]}),n.jsxRuntimeExports.jsxs("g",{children:[Mt.map((i,k)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{y1:g(i),y2:g(i),x1:x+15,x2:x+20,style:{stroke:o[1],strokeWidth:1,...a?.yAxis?.gridLines||{}},className:c?.yAxis?.gridLines}),n.jsxRuntimeExports.jsx("text",{x:x+25,y:g(i),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o[1],...a?.yAxis?.labels||{}},className:n.mo("text-xs",c?.yAxis?.labels),children:ae.numberFormattingFunction(i,void 0,b?.precision,b?.prefix,b?.suffix,b?.locale,b?.padZeros)})]},k)),M,S]}),n.jsxRuntimeExports.jsxs("g",{children:[jt,n.jsxRuntimeExports.jsx(Ne.XTicksAndGridLines,{values:be,x:Ee,y1:0,y2:l,styles:Jt,classNames:Kt,labelType:"primary",showGridLines:!0,padZeros:!1})]}),Qt,n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx(ct.motion.path,{style:_t,exit:te,variants:{initial:{pathLength:0,d:qt(r.filter(Ye))||"",opacity:1},whileInView:{pathLength:1,d:qt(r.filter(Xe))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),n.jsxRuntimeExports.jsx(ct.motion.path,{d:gt(r.filter(We))||"",style:ee,exit:ie,variants:{initial:{pathLength:0,d:gt(r.filter(Pe))||"",opacity:1},whileInView:{pathLength:1,d:gt(r.filter(Ue))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),O?n.jsxRuntimeExports.jsx("line",{y1:0,y2:l,x1:m(O.date),x2:m(O.date),className:n.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",c?.mouseOverLine),style:a?.mouseOverLine}):null]}),ne,se,re]})}),le]})}function Ge(e){return e.layer}function He(e){return e.position==="after"}function Ue(e){return!T.checkIfNullOrUndefined(e.y2)}function Pe(e){return!T.checkIfNullOrUndefined(e.y2)}function We(e){return!T.checkIfNullOrUndefined(e.y2)}function Xe(e){return!T.checkIfNullOrUndefined(e.y1)}function Ye(e){return!T.checkIfNullOrUndefined(e.y1)}function Ze(e){return e.layer}function Be(e){return e.position==="before"}function ze(e){return e.date}function Je(e){return!T.checkIfNullOrUndefined(e.y2)}function Ke(e){return!T.checkIfNullOrUndefined(e.y1)}function Qe(e){return e!=null}function _e(e){return e.y2}function ti(e){return e!=null}function ei(e){return e.y2}function ii(e){return e!=null}function ni(e){return e.y1}function si(e){return e!=null}function oi(e){return e.y1}function ri(e){return e!=null}function li(e){return e.y2}function ai(e){return e!=null}function ci(e){return e.y2}function ui(e){return e!=null}function xi(e){return e.y2}function mi(e){return e!=null}function pi(e){return e.y1}function fi(e){return e!=null}function di(e){return e.y2}function hi(e){return e!=null}function yi(e){return e.y1}function gi(e){const t=n.compilerRuntimeExports.c(86),{data:v,graphTitle:B,sources:z,graphDescription:o,height:j,width:A,footNote:p,noOfXTicks:At,dateFormat:Zt,showValues:Bt,padding:Gt,lineColors:J,sameAxes:wt,backgroundColor:ut,leftMargin:bt,rightMargin:Et,topMargin:s,bottomMargin:H,labels:C,rightLineNumberDisplayOptions:Rt,leftLineNumberDisplayOptions:w,tooltip:b,highlightAreaSettings:xt,relativeHeight:kt,onSeriesMouseOver:K,graphID:a,graphDownload:c,dataDownload:U,animate:P,strokeWidth:Ht,showDots:Ut,language:mt,showColorScale:d,minHeight:y,colorLegendTitle:Pt,theme:pt,ariaLabel:Q,noOfYTicks:Wt,maxDate:O,minDate:Nt,curveType:ft,styles:f,classNames:u,customLayers:dt,showAxisLabels:Lt,naLabel:Ot}=e,_=Zt===void 0?"yyyy":Zt,h=Bt===void 0?!1:Bt;let W;t[0]!==J?(W=J===void 0?[Ae.Colors.light.categoricalColors.colors[0],Ae.Colors.light.categoricalColors.colors[1]]:J,t[0]=J,t[1]=W):W=t[1];const D=W,r=wt===void 0?!1:wt,tt=ut===void 0?!1:ut,ht=bt===void 0?80:bt,x=Et===void 0?80:Et,l=s===void 0?20:s,Xt=H===void 0?25:H;let Dt;t[2]!==xt?(Dt=xt===void 0?[]:xt,t[2]=xt,t[3]=Dt):Dt=t[3];const yt=Dt,et=c===void 0?!1:c,X=U===void 0?!1:U,Y=P===void 0?!1:P,It=Ht===void 0?2:Ht,it=Ut===void 0?!0:Ut,m=mt===void 0?"en":mt,I=d===void 0?!0:d,g=y===void 0?0:y,qt=pt===void 0?"light":pt,gt=Wt===void 0?5:Wt,Yt=ft===void 0?"curve":ft;let Mt;t[4]!==dt?(Mt=dt===void 0?[]:dt,t[4]=dt,t[5]=Mt):Mt=t[5];const St=Mt,nt=Lt===void 0?!0:Lt,vt=Ot===void 0?"NA":Ot,[L,st]=N.useState(0),[q,Tt]=N.useState(0),ot=N.useRef(null),Ct=N.useRef(null);let rt,lt;t[6]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{const Z=new ResizeObserver(jt=>{st(jt[0].target.clientWidth||620),Tt(jt[0].target.clientHeight||480)});return ot.current&&Z.observe(ot.current),()=>Z.disconnect()},lt=[],t[6]=rt,t[7]=lt):(rt=t[6],lt=t[7]),N.useEffect(rt,lt);const V=u?.graphContainer,$=f?.graphContainer;let E;t[8]!==u?.description||t[9]!==u?.title||t[10]!==v||t[11]!==X||t[12]!==o||t[13]!==et||t[14]!==B||t[15]!==f?.description||t[16]!==f?.title||t[17]!==A?(E=B||o||et||X?n.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:u?.title,description:u?.description},graphTitle:B,graphDescription:o,width:A,graphDownload:et?Ct:void 0,dataDownload:X?v.map(bi).filter(wi).length>0?v.map(Ai).filter(ji):v.filter(vi):null}):null,t[8]=u?.description,t[9]=u?.title,t[10]=v,t[11]=X,t[12]=o,t[13]=et,t[14]=B,t[15]=f?.description,t[16]=f?.title,t[17]=A,t[18]=E):E=t[18];let M;t[19]!==u?.colorLegend||t[20]!==Pt||t[21]!==C||t[22]!==D||t[23]!==I?(M=I&&C.length>0?n.jsxRuntimeExports.jsx(Ce.ColorLegend,{colorDomain:C,colorLegendTitle:Pt,colors:D,showNAColor:!1,className:u?.colorLegend}):null,t[19]=u?.colorLegend,t[20]=Pt,t[21]=C,t[22]=D,t[23]=I,t[24]=M):M=t[24];let S;t[25]!==v.length?(S=v.length===0&&n.jsxRuntimeExports.jsx(Ve.EmptyState,{}),t[25]=v.length,t[26]=S):S=t[26];let F;t[27]!==Y||t[28]!==Xt||t[29]!==u||t[30]!==Yt||t[31]!==St||t[32]!==v||t[33]!==_||t[34]!==yt||t[35]!==C||t[36]!==w||t[37]!==ht||t[38]!==D||t[39]!==O||t[40]!==Nt||t[41]!==vt||t[42]!==At||t[43]!==gt||t[44]!==K||t[45]!==Rt||t[46]!==x||t[47]!==r||t[48]!==nt||t[49]!==it||t[50]!==h||t[51]!==It||t[52]!==f||t[53]!==q||t[54]!==L||t[55]!==b||t[56]!==l?(F=L&&q&&v.length>0?n.jsxRuntimeExports.jsx(Fe,{data:v,sameAxes:r,lineColors:D,width:L,height:q,dateFormat:_,showValues:h,noOfXTicks:At??$e.getNoOfTicks(L),leftMargin:ht,rightMargin:x,topMargin:l,bottomMargin:Xt,labels:C,highlightAreaSettings:yt,tooltip:b,onSeriesMouseOver:K,animate:Y===!0?{duration:.5,once:!0,amount:.5}:Y||{duration:0,once:!0,amount:0},strokeWidth:It,showDots:it,noOfYTicks:gt,leftLineNumberDisplayOptions:w,rightLineNumberDisplayOptions:Rt,minDate:Nt,maxDate:O,curveType:Yt,styles:f,classNames:u,customLayers:St,showAxisLabels:nt,naLabel:vt}):null,t[27]=Y,t[28]=Xt,t[29]=u,t[30]=Yt,t[31]=St,t[32]=v,t[33]=_,t[34]=yt,t[35]=C,t[36]=w,t[37]=ht,t[38]=D,t[39]=O,t[40]=Nt,t[41]=vt,t[42]=At,t[43]=gt,t[44]=K,t[45]=Rt,t[46]=x,t[47]=r,t[48]=nt,t[49]=it,t[50]=h,t[51]=It,t[52]=f,t[53]=q,t[54]=L,t[55]=b,t[56]=l,t[57]=F):F=t[57];let G;t[58]!==S||t[59]!==F?(G=n.jsxRuntimeExports.jsxs(we.GraphArea,{ref:ot,children:[S,F]}),t[58]=S,t[59]=F,t[60]=G):G=t[60];let R;t[61]!==u?.footnote||t[62]!==u?.source||t[63]!==p||t[64]!==z||t[65]!==f?.footnote||t[66]!==f?.source||t[67]!==A?(R=z||p?n.jsxRuntimeExports.jsx(Se.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:u?.footnote,source:u?.source},sources:z,footNote:p,width:A}):null,t[61]=u?.footnote,t[62]=u?.source,t[63]=p,t[64]=z,t[65]=f?.footnote,t[66]=f?.source,t[67]=A,t[68]=R):R=t[68];let at;return t[69]!==Q||t[70]!==tt||t[71]!==a||t[72]!==j||t[73]!==m||t[74]!==g||t[75]!==Gt||t[76]!==kt||t[77]!==V||t[78]!==$||t[79]!==E||t[80]!==M||t[81]!==G||t[82]!==R||t[83]!==qt||t[84]!==A?(at=n.jsxRuntimeExports.jsxs(we.GraphContainer,{className:V,style:$,id:a,ref:Ct,"aria-label":Q,backgroundColor:tt,theme:qt,language:m,minHeight:g,width:A,height:j,relativeHeight:kt,padding:Gt,children:[E,M,G,R]}),t[69]=Q,t[70]=tt,t[71]=a,t[72]=j,t[73]=m,t[74]=g,t[75]=Gt,t[76]=kt,t[77]=V,t[78]=$,t[79]=E,t[80]=M,t[81]=G,t[82]=R,t[83]=qt,t[84]=A,t[85]=at):at=t[85],at}function vi(e){return e!==void 0}function ji(e){return e!==void 0}function Ai(e){return e.data}function wi(e){return e!==void 0}function bi(e){return e.data}exports.DualAxisLineChart=gi;
|
|
2
2
|
//# sourceMappingURL=DualAxisLineChart.cjs.map
|