@undp/data-viz 2.0.8 → 2.1.0

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.
Files changed (215) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.d.ts +2 -0
  3. package/dist/AreaChart.js +1 -1
  4. package/dist/BarGraph.cjs +1 -1
  5. package/dist/BarGraph.cjs.map +1 -1
  6. package/dist/BarGraph.d.ts +2 -0
  7. package/dist/BarGraph.js +1188 -1213
  8. package/dist/BarGraph.js.map +1 -1
  9. package/dist/BasicStatCard.d.ts +2 -0
  10. package/dist/BeeSwarmChart.cjs +1 -1
  11. package/dist/BeeSwarmChart.cjs.map +1 -1
  12. package/dist/BeeSwarmChart.d.ts +2 -0
  13. package/dist/BeeSwarmChart.js +258 -267
  14. package/dist/BeeSwarmChart.js.map +1 -1
  15. package/dist/BiVariateChoroplethMap.cjs +1 -1
  16. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  17. package/dist/BiVariateChoroplethMap.d.ts +2 -0
  18. package/dist/BiVariateChoroplethMap.js +126 -131
  19. package/dist/BiVariateChoroplethMap.js.map +1 -1
  20. package/dist/BulletChart.cjs +1 -1
  21. package/dist/BulletChart.cjs.map +1 -1
  22. package/dist/BulletChart.d.ts +2 -0
  23. package/dist/BulletChart.js +404 -413
  24. package/dist/BulletChart.js.map +1 -1
  25. package/dist/ButterflyChart.cjs +1 -1
  26. package/dist/ButterflyChart.cjs.map +1 -1
  27. package/dist/ButterflyChart.d.ts +2 -0
  28. package/dist/ButterflyChart.js +179 -184
  29. package/dist/ButterflyChart.js.map +1 -1
  30. package/dist/ChoroplethMap.cjs +1 -1
  31. package/dist/ChoroplethMap.cjs.map +1 -1
  32. package/dist/ChoroplethMap.d.ts +2 -0
  33. package/dist/ChoroplethMap.js +268 -273
  34. package/dist/ChoroplethMap.js.map +1 -1
  35. package/dist/CirclePackingGraph.cjs +1 -1
  36. package/dist/CirclePackingGraph.d.ts +2 -0
  37. package/dist/CirclePackingGraph.js +1 -1
  38. package/dist/DataCards.cjs +1 -1
  39. package/dist/DataCards.d.ts +2 -0
  40. package/dist/DataCards.js +2 -2
  41. package/dist/DataTable.d.ts +2 -0
  42. package/dist/DetailsModal-0Ry5nXiC.js +32 -0
  43. package/dist/DetailsModal-0Ry5nXiC.js.map +1 -0
  44. package/dist/DetailsModal-BN0HDFlV.cjs +2 -0
  45. package/dist/DetailsModal-BN0HDFlV.cjs.map +1 -0
  46. package/dist/DifferenceLineChart.cjs +1 -1
  47. package/dist/DifferenceLineChart.d.ts +2 -0
  48. package/dist/DifferenceLineChart.js +1 -1
  49. package/dist/DonutChart.cjs +1 -1
  50. package/dist/DonutChart.cjs.map +1 -1
  51. package/dist/DonutChart.d.ts +2 -0
  52. package/dist/DonutChart.js +185 -190
  53. package/dist/DonutChart.js.map +1 -1
  54. package/dist/DotDensityMap.cjs +1 -1
  55. package/dist/DotDensityMap.cjs.map +1 -1
  56. package/dist/DotDensityMap.d.ts +2 -0
  57. package/dist/DotDensityMap.js +198 -203
  58. package/dist/DotDensityMap.js.map +1 -1
  59. package/dist/DualAxisLineChart.cjs +1 -1
  60. package/dist/DualAxisLineChart.d.ts +2 -0
  61. package/dist/DualAxisLineChart.js +1 -1
  62. package/dist/DumbbellChart.cjs +1 -1
  63. package/dist/DumbbellChart.cjs.map +1 -1
  64. package/dist/DumbbellChart.d.ts +2 -0
  65. package/dist/DumbbellChart.js +364 -373
  66. package/dist/DumbbellChart.js.map +1 -1
  67. package/dist/GeoHubCompareMaps.d.ts +2 -0
  68. package/dist/GeoHubMap.d.ts +2 -0
  69. package/dist/GeoHubMapWithLayerSelection.d.ts +2 -0
  70. package/dist/{GraphEl-BcKU0bG1.cjs → GraphEl-B16EYkko.cjs} +2 -2
  71. package/dist/{GraphEl-BcKU0bG1.cjs.map → GraphEl-B16EYkko.cjs.map} +1 -1
  72. package/dist/{GraphEl-CGq1EWRn.js → GraphEl-ebgfxefq.js} +3 -3
  73. package/dist/{GraphEl-CGq1EWRn.js.map → GraphEl-ebgfxefq.js.map} +1 -1
  74. package/dist/GriddedGraphs.cjs +1 -1
  75. package/dist/GriddedGraphs.cjs.map +1 -1
  76. package/dist/GriddedGraphs.d.ts +3 -0
  77. package/dist/GriddedGraphs.js +158 -146
  78. package/dist/GriddedGraphs.js.map +1 -1
  79. package/dist/GriddedGraphsFromConfig.d.ts +3 -0
  80. package/dist/HeatMap.cjs +1 -1
  81. package/dist/HeatMap.cjs.map +1 -1
  82. package/dist/HeatMap.d.ts +2 -0
  83. package/dist/HeatMap.js +111 -116
  84. package/dist/HeatMap.js.map +1 -1
  85. package/dist/Histogram.cjs +1 -1
  86. package/dist/Histogram.d.ts +2 -0
  87. package/dist/Histogram.js +1 -1
  88. package/dist/HybridMap.cjs +1 -1
  89. package/dist/HybridMap.cjs.map +1 -1
  90. package/dist/HybridMap.d.ts +2 -0
  91. package/dist/HybridMap.js +202 -207
  92. package/dist/HybridMap.js.map +1 -1
  93. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  94. package/dist/LineChartWithConfidenceInterval.d.ts +2 -0
  95. package/dist/LineChartWithConfidenceInterval.js +1 -1
  96. package/dist/{Modal-DGcuAHyK.js → Modal-bMQA6bL_.js} +5 -5
  97. package/dist/{Modal-DGcuAHyK.js.map → Modal-bMQA6bL_.js.map} +1 -1
  98. package/dist/MultiGraphDashboard.cjs +1 -1
  99. package/dist/MultiGraphDashboard.cjs.map +1 -1
  100. package/dist/MultiGraphDashboard.d.ts +3 -0
  101. package/dist/MultiGraphDashboard.js +90 -85
  102. package/dist/MultiGraphDashboard.js.map +1 -1
  103. package/dist/MultiGraphDashboardFromConfig.d.ts +3 -0
  104. package/dist/MultiGraphDashboardWideToLongFormat.d.ts +2 -0
  105. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  106. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +2 -0
  107. package/dist/MultiLineAltChart.cjs +1 -1
  108. package/dist/MultiLineAltChart.d.ts +2 -0
  109. package/dist/MultiLineAltChart.js +1 -1
  110. package/dist/MultiLineChart.cjs +1 -1
  111. package/dist/MultiLineChart.d.ts +2 -0
  112. package/dist/MultiLineChart.js +1 -1
  113. package/dist/ParetoChart.cjs +1 -1
  114. package/dist/ParetoChart.cjs.map +1 -1
  115. package/dist/ParetoChart.d.ts +2 -0
  116. package/dist/ParetoChart.js +187 -192
  117. package/dist/ParetoChart.js.map +1 -1
  118. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  119. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs.map +1 -1
  120. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +3 -0
  121. package/dist/PerformanceIntensiveMultiGraphDashboard.js +76 -72
  122. package/dist/PerformanceIntensiveMultiGraphDashboard.js.map +1 -1
  123. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +3 -0
  124. package/dist/PerformanceIntensiveScrollStory.d.ts +2 -0
  125. package/dist/RadarChart.cjs +1 -1
  126. package/dist/RadarChart.cjs.map +1 -1
  127. package/dist/RadarChart.d.ts +2 -0
  128. package/dist/RadarChart.js +158 -163
  129. package/dist/RadarChart.js.map +1 -1
  130. package/dist/SankeyChart.cjs +1 -1
  131. package/dist/SankeyChart.cjs.map +1 -1
  132. package/dist/SankeyChart.d.ts +2 -0
  133. package/dist/SankeyChart.js +172 -177
  134. package/dist/SankeyChart.js.map +1 -1
  135. package/dist/ScatterPlot.cjs +1 -1
  136. package/dist/ScatterPlot.cjs.map +1 -1
  137. package/dist/ScatterPlot.d.ts +2 -0
  138. package/dist/ScatterPlot.js +222 -227
  139. package/dist/ScatterPlot.js.map +1 -1
  140. package/dist/ScrollStory.d.ts +2 -0
  141. package/dist/SimpleLineChart.cjs +1 -1
  142. package/dist/SimpleLineChart.d.ts +2 -0
  143. package/dist/SimpleLineChart.js +1 -1
  144. package/dist/SingleGraphDashboard.cjs +1 -1
  145. package/dist/SingleGraphDashboard.cjs.map +1 -1
  146. package/dist/SingleGraphDashboard.d.ts +3 -0
  147. package/dist/SingleGraphDashboard.js +131 -128
  148. package/dist/SingleGraphDashboard.js.map +1 -1
  149. package/dist/SingleGraphDashboardFromConfig.d.ts +3 -0
  150. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +2 -0
  151. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +2 -0
  152. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  153. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  154. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +3 -0
  155. package/dist/SingleGraphDashboardThreeDGraphs.js +145 -141
  156. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  157. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +3 -0
  158. package/dist/SlopeChart.cjs +1 -1
  159. package/dist/SlopeChart.cjs.map +1 -1
  160. package/dist/SlopeChart.d.ts +2 -0
  161. package/dist/SlopeChart.js +182 -187
  162. package/dist/SlopeChart.js.map +1 -1
  163. package/dist/SparkLine.cjs +1 -1
  164. package/dist/SparkLine.d.ts +2 -0
  165. package/dist/SparkLine.js +1 -1
  166. package/dist/StatCardFromData.d.ts +2 -0
  167. package/dist/StripChart.cjs +1 -1
  168. package/dist/StripChart.cjs.map +1 -1
  169. package/dist/StripChart.d.ts +2 -0
  170. package/dist/StripChart.js +249 -258
  171. package/dist/StripChart.js.map +1 -1
  172. package/dist/ThreeDGlobe.cjs +1 -1
  173. package/dist/ThreeDGlobe.cjs.map +1 -1
  174. package/dist/ThreeDGlobe.d.ts +2 -0
  175. package/dist/ThreeDGlobe.js +142 -147
  176. package/dist/ThreeDGlobe.js.map +1 -1
  177. package/dist/Tooltip-Dj5eVppQ.js +45 -0
  178. package/dist/Tooltip-Dj5eVppQ.js.map +1 -0
  179. package/dist/Tooltip-uUdw6wJL.cjs +2 -0
  180. package/dist/Tooltip-uUdw6wJL.cjs.map +1 -0
  181. package/dist/TreeMapGraph.cjs +1 -1
  182. package/dist/TreeMapGraph.cjs.map +1 -1
  183. package/dist/TreeMapGraph.d.ts +2 -0
  184. package/dist/TreeMapGraph.js +159 -164
  185. package/dist/TreeMapGraph.js.map +1 -1
  186. package/dist/Types.d.ts +3 -0
  187. package/dist/UnitChart.d.ts +2 -0
  188. package/dist/{checkIfMultiple-Y9iKaV_u.js → checkIfMultiple-CIRtG0KE.js} +2 -2
  189. package/dist/{checkIfMultiple-Y9iKaV_u.js.map → checkIfMultiple-CIRtG0KE.js.map} +1 -1
  190. package/dist/getUniqValue-DsqSii6M.js +11 -0
  191. package/dist/getUniqValue-DsqSii6M.js.map +1 -0
  192. package/dist/getUniqValue-NX8DgwND.cjs +2 -0
  193. package/dist/getUniqValue-NX8DgwND.cjs.map +1 -0
  194. package/dist/index-BBV4tAeA.js +330 -0
  195. package/dist/index-BBV4tAeA.js.map +1 -0
  196. package/dist/index-CF5hnGvG.cjs +2 -0
  197. package/dist/index-CF5hnGvG.cjs.map +1 -0
  198. package/dist/index.cjs +1 -1
  199. package/dist/index.d.ts +3 -0
  200. package/dist/index.js +2 -2
  201. package/dist/utils.cjs +1 -1
  202. package/dist/utils.js +1 -1
  203. package/package.json +1 -1
  204. package/dist/Tooltip-4dJo4_AF.cjs +0 -2
  205. package/dist/Tooltip-4dJo4_AF.cjs.map +0 -1
  206. package/dist/Tooltip-CwWUegPB.js +0 -43
  207. package/dist/Tooltip-CwWUegPB.js.map +0 -1
  208. package/dist/getUniqValue-BKHCm3zE.js +0 -11
  209. package/dist/getUniqValue-BKHCm3zE.js.map +0 -1
  210. package/dist/getUniqValue-RViz8tTw.cjs +0 -2
  211. package/dist/getUniqValue-RViz8tTw.cjs.map +0 -1
  212. package/dist/index-B2LQV7Tk.js +0 -335
  213. package/dist/index-B2LQV7Tk.js.map +0 -1
  214. package/dist/index-xRHRLDIp.cjs +0 -2
  215. package/dist/index-xRHRLDIp.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(data, 'date', true).map(d =>\r\n parse(`${d}`, timeline.dateFormat || 'yyyy', new Date()).getTime(),\r\n ),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","Modal","__html","string2HTML","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","dateFormat","Date","getTime","_temp","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","t31","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t32","shape","onUpdateShape","useEffectEvent","t33","fetchAndParseJSON","then","d_0","t34","interval","setInterval","speed","clearInterval","markObj","getSliderMarks","console","error","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t38","Pause","Play","SliderUI","nextValue","nextValue_0","t39","GraphArea","d_6","date","format","_temp7","getJenks","_temp8","_temp9","Spinner","t40","footnote","source","GraphFooter","t41","GraphContainer","d_8","d_7","NAME","d_3","d_2","d_1","d_5","d_4","a","b","ascending"],"mappings":";;;;;;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,SAqJuB3M,EAACvH;AAAK;AArJ7B,SAAAsP,GAAA6E,GAAAC,GAAA;AAAA,SA4DOC,GAAUF,GAAGC,CAAC;AAAC;"}
1
+ {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(data, 'date', true).map(d =>\r\n parse(`${d}`, timeline.dateFormat || 'yyyy', new Date()).getTime(),\r\n ),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","dateFormat","Date","getTime","_temp","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","t31","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t32","shape","onUpdateShape","useEffectEvent","t33","fetchAndParseJSON","then","d_0","t34","interval","setInterval","speed","clearInterval","markObj","getSliderMarks","console","error","t35","graphContainer","t36","t37","description","title","GraphHeader","_temp2","_temp3","_temp4","_temp5","_temp6","t38","Pause","Play","SliderUI","nextValue","nextValue_0","t39","GraphArea","d_6","date","format","_temp7","getJenks","_temp8","_temp9","Spinner","t40","footnote","source","GraphFooter","t41","GraphContainer","d_8","d_7","NAME","d_3","d_2","d_1","d_5","d_4","a","b","ascending"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA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IAAAA;AAAAA,IAuBAS;AAAAA,IA6BDM;AAAAA,IAwFCU;AAAAA,EAAAA,GAYH,GAAiBtI,QAAAsC,GAAAtC,QAAAe,IAAAf,QAAAsB,GAAAtB,QAAAvK,GAAAuK,QAAAgC,GAAAhC,QAAAkC,GAAAlC,QAAAY,IAAAZ,QAAAkB,GAAAlB,QAAA0G,IAAA1G,QAAA4G,IAAA5G,QAAA6G,IAAA7G,QAAAsH,IAAAtH,QAAA4H,IAAA5H,QAAAsI,IAAAtI,QAAAoC,IAAApC,QAAAxK,GAAAwK,SAAA0I,MAAAA,KAAA1I,EAAA,GAAA,GAvKjB0I;AAuKiB;AA7Rd,SAAAN,GAAAQ,GAAA;AAAA,SAsNuBnM,EAAC2B;AAA+B;AAtNvD,SAAA+J,GAAAU,GAAA;AAAA,SA+MuBpM,EAACyB;AAA+B;AA/MvD,SAAA+J,GAAAlL,GAAA;AAAA,SAwM4BA,EAAEE,WAAW6L,SAAU;AAAY;AAxM/D,SAAAzB,GAAA0B,GAAA;AAAA,SAuJ4BtM,MAAMpF;AAAS;AAvJ3C,SAAA+P,GAAA4B,GAAA;AAAA,SAsJ6CvM,MAAMpF;AAAS;AAtJ5D,SAAA8P,GAAA8B,GAAA;AAAA,SAsJyBxM,EAACvH;AAAK;AAtJ/B,SAAAgS,GAAAgC,GAAA;AAAA,SAqJ2CzM,MAAMpF;AAAS;AArJ1D,SAAA4P,GAAAkC,GAAA;AAAA,SAqJuB1M,EAACvH;AAAK;AArJ7B,SAAAqP,GAAA6E,GAAAC,GAAA;AAAA,SA4DOC,GAAUF,GAAGC,CAAC;AAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),ut=require("react"),qe=require("./index-Cno4Q0YE.cjs"),Ae=require("./index-DQA8q5sC.cjs"),Re=require("./Modal-JW_IExO3.cjs"),pe=require("./index-CSNtgibC.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),ke=require("./Tooltip-4dJo4_AF.cjs"),p=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Oe=require("./string2HTML-CPGr_I5E.cjs"),Ve=require("./Axis-DxRV2yMi.cjs"),Ne=require("./AxisTitle-sS5bLLR7.cjs"),Te=require("./XAxesLabels-Bt5NZBmX.cjs"),Ee=require("./ReferenceLine-BH0qdf4R.cjs"),$e=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Se=require("./XTicksAndGridLines-B6CELS7q.cjs"),De=require("./YAxesLabels-DesLesUP.cjs"),Ie=require("./linear-BwPAspcq.cjs"),Ce=require("./band-VYfcZeJ2.cjs"),ze=require("./use-in-view-QcfiW0w3.cjs"),yt=require("./proxy-BxvUI_9l.cjs"),Le=require("./index-DG2bgAva.cjs"),we=require("./Colors.cjs"),Fe=require("./EmptyState-sAEZ_5rU.cjs"),Me=require("./GraphContainer-d8A46BK2.cjs"),Ue=require("./GraphFooter.cjs"),Be=require("./GraphHeader.cjs"),Pe=require("./ColorLegend.cjs");function He(e){const t=s.compilerRuntimeExports.c(155),{data:n,width:bt,height:Jt,barColor:$t,suffix:vt,prefix:O,barPadding:St,showLabels:Dt,showValues:Kt,showTicks:ie,truncateBy:Qt,leftMargin:ne,rightMargin:Ft,topMargin:Zt,bottomMargin:re,tooltip:ct,onSeriesMouseOver:xt,refValues:wt,maxValue:g,minValue:mt,highlightedDataPoints:Z,onSeriesMouseClick:st,labelOrder:F,maxBarThickness:Ut,minBarThickness:jt,resetSelectionOnDoubleClick:Bt,detailsOnClick:V,barAxisTitle:M,valueColor:_,noOfTicks:Mt,styles:m,classNames:a,targetStyle:h,targetColor:U,qualitativeRangeColors:tt,measureBarWidthFactor:d,animate:o,dimmedOpacity:c,precision:at,customLayers:et,naLabel:N,targetLineThickness:_t}=e,B=ne===void 0?20:ne,Pt=Ft===void 0?20:Ft,se=Zt===void 0?20:Zt,Ht=re===void 0?25:re,ue=ut.useRef(null);let ae;t[0]!==o.amount||t[1]!==o.once?(ae={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=ae):ae=t[2];const E=ze.useInView(ue,ae),P=M?B+30:B;let Gt;t[3]!==Ht||t[4]!==Pt||t[5]!==P||t[6]!==se?(Gt={top:se,bottom:Ht,left:P,right:Pt},t[3]=Ht,t[4]=Pt,t[5]=P,t[6]=se,t[7]=Gt):Gt=t[7];const f=Gt,[I,le]=ut.useState(void 0),[C,ht]=ut.useState(void 0),[At,te]=ut.useState(void 0),[ee,Xt]=ut.useState(void 0),x=bt-f.left-f.right,Rt=Jt-f.top-f.bottom;let it;t[8]!==n?(it=Math.max(...n.filter(di).map(fi))<0?0:Math.max(...n.filter(hi).map(mi)),t[8]=n,t[9]=it):it=t[9];const kt=it;let Ot;t[10]!==n?(Ot=Math.max(...n.filter(xi).map(ci))<0?0:Math.max(...n.filter(ui).map(ri)),t[10]=n,t[11]=Ot):Ot=t[11];const Vt=Ot;let Nt;t[12]!==n?(Nt=Math.max(...n.map(li)),t[12]=n,t[13]=Nt):Nt=t[13];const Et=Nt;let It;t[14]!==kt||t[15]!==g||t[16]!==Et||t[17]!==Vt?(It=p.checkIfNullOrUndefined(g)?Math.max(...[kt,Vt,Et].filter(Number.isFinite))<0?0:Math.max(...[kt,Vt,Et].filter(Number.isFinite)):g,t[14]=kt,t[15]=g,t[16]=Et,t[17]=Vt,t[18]=It):It=t[18];const Ct=It;let Yt;t[19]!==n?(Yt=Math.min(...n.filter(ai).map(si))>=0?0:Math.min(...n.filter(ni).map(ii)),t[19]=n,t[20]=Yt):Yt=t[20];const zt=Yt;let Lt;t[21]!==n?(Lt=Math.min(...n.filter(ei).map(ti))>=0?0:Math.min(...n.filter(_e).map(Ze)),t[21]=n,t[22]=Lt):Lt=t[22];const ft=Lt;let qt;t[23]!==zt||t[24]!==mt||t[25]!==ft?(qt=p.checkIfNullOrUndefined(mt)?Math.min(...[zt,ft].filter(Number.isFinite))>=0?0:Math.min(...[zt,ft].filter(Number.isFinite)):mt,t[23]=zt,t[24]=mt,t[25]=ft,t[26]=qt):qt=t[26];const b=qt;let z,L,H,G,q,X,Y,v,A,R,T,$,w,j;if(t[27]!==o||t[28]!==M||t[29]!==$t||t[30]!==St||t[31]!==a?.graphObjectValues||t[32]!==a?.xAxis?.axis||t[33]!==a?.xAxis?.labels||t[34]!==a?.yAxis?.gridLines||t[35]!==a?.yAxis?.labels||t[36]!==a?.yAxis?.title||t[37]!==et||t[38]!==n||t[39]!==V||t[40]!==c||t[41]!==Rt||t[42]!==x||t[43]!==Jt||t[44]!==Z||t[45]!==E||t[46]!==F||t[47]!==B||t[48]!==f.bottom||t[49]!==f.left||t[50]!==f.right||t[51]!==f.top||t[52]!==Ut||t[53]!==d||t[54]!==jt||t[55]!==C||t[56]!==N||t[57]!==Mt||t[58]!==st||t[59]!==xt||t[60]!==at||t[61]!==O||t[62]!==tt||t[63]!==wt||t[64]!==Bt||t[65]!==Dt||t[66]!==ie||t[67]!==Kt||t[68]!==m?.graphObjectValues||t[69]!==m?.xAxis?.axis||t[70]!==m?.xAxis?.labels||t[71]!==m?.yAxis?.gridLines||t[72]!==m?.yAxis?.labels||t[73]!==m?.yAxis?.title||t[74]!==vt||t[75]!==U||t[76]!==_t||t[77]!==h||t[78]!==Qt||t[79]!==_||t[80]!==bt||t[81]!==Ct||t[82]!==b){const u=Ie.linear().domain([b,Ct]).range([Rt,0]).nice();let Tt;t[97]!==F?(Tt=(l,oe)=>({...l,id:F?`${l.label}`:`${oe}`}),t[97]=F,t[98]=Tt):Tt=t[98];const me=n.map(Tt),r=F||me.map(Qe),k=Ce.band().domain(r).range([0,jt?Math.max(x,jt*r.length):Ut?Math.min(x,Ut*r.length):x]).paddingInner(St),D=u.ticks(Mt);L=yt.motion.svg,R=`${bt}px`,T=`${Jt}px`,$=`0 0 ${bt} ${Jt}`,w="ltr",j=ue,q=`translate(${f.left},${f.top})`;const he=u(b<0?0:b),ce=u(b<0?0:b),dt=b<0?0:b;let ot;t[99]!==N||t[100]!==at||t[101]!==O||t[102]!==vt||t[103]!==dt?(ot=je.numberFormattingFunction(dt,N,at,O,vt),t[99]=N,t[100]=at,t[101]=O,t[102]=vt,t[103]=dt,t[104]=ot):ot=t[104];const pt=a?.xAxis?.axis,Wt=a?.yAxis?.labels;let y;t[105]!==pt||t[106]!==Wt?(y={axis:pt,label:Wt},t[105]=pt,t[106]=Wt,t[107]=y):y=t[107];const gt=m?.xAxis?.axis,fe=m?.yAxis?.labels;let i;t[108]!==gt||t[109]!==fe?(i={axis:gt,label:fe},t[108]=gt,t[109]=fe,t[110]=i):i=t[110],X=s.jsxRuntimeExports.jsx(Ve.Axis,{y1:he,y2:ce,x1:0-B,x2:x+f.right,label:ot,labelPos:{x:0-B,dx:0,dy:Ct<0?"1em":-5,y:u(b<0?0:b)},classNames:y,styles:i}),Y=ie?s.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:D.filter(Ke),y:D.filter(Je).map(l=>u(l)),x1:0-B,x2:x+f.right,styles:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:vt,prefix:O,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:at}):null;const rt=0-B-15,xe=Rt/2,ge=m?.yAxis?.title,ye=a?.yAxis?.title;t[111]!==M||t[112]!==rt||t[113]!==xe||t[114]!==ge||t[115]!==ye?(v=s.jsxRuntimeExports.jsx(Ne.AxisTitle,{x:rt,y:xe,style:ge,className:ye,text:M,rotate90:!0}),t[111]=M,t[112]=rt,t[113]=xe,t[114]=ge,t[115]=ye,t[116]=v):v=t[116],t[117]!==et?(A=et.filter(We).map(Ye),t[117]=et,t[118]=A):A=t[118],z=Le.AnimatePresence,H=me.map(l=>p.checkIfNullOrUndefined(k(l.id))?null:s.jsxRuntimeExports.jsxs(yt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:oe=>{le(l),Xt(oe.clientY),te(oe.clientX),xt?.(l)},onClick:()=>{(st||V)&&(Ae.isEqual(C,l)&&Bt?(ht(void 0),st?.(void 0)):(ht(l),st?.(l)))},onMouseMove:oe=>{le(l),Xt(oe.clientY),te(oe.clientX)},onMouseLeave:()=>{le(void 0),te(void 0),Xt(void 0),xt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:k(`${l.id}`),y:0,opacity:Z.length!==0?Z.indexOf(l.label)!==-1?.85:c:.85},whileInView:{x:k(`${l.id}`),y:0,opacity:Z.length!==0?Z.indexOf(l.label)!==-1?.85:c:.85,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:[l.qualitativeRange?l.qualitativeRange.map((oe,de)=>s.jsxRuntimeExports.jsx(yt.motion.rect,{x:0,exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0),fill:tt[de]},whileInView:{height:Math.abs(u(pe.sum(l.qualitativeRange.filter((be,ve)=>ve<=de&&be)))-u(pe.sum(l.qualitativeRange.filter((be,ve)=>ve<de&&be)))),y:u(pe.sum(l.qualitativeRange.filter((be,ve)=>ve<=de&&be))),fill:tt[de],transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",width:k.bandwidth()},de)):null,l.target&&h==="background"?s.jsxRuntimeExports.jsx(yt.motion.rect,{x:0,width:k.bandwidth(),exit:{height:0,y:u(0),fill:U,transition:{duration:o.duration}},variants:{initial:{height:0,fill:U,y:u(0)},whileInView:{height:Math.abs(u(l.target)-u(0)),fill:U,y:l.target>0?u(l.target):u(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,l.size?s.jsxRuntimeExports.jsx(yt.motion.rect,{x:k.bandwidth()*((1-d)/2),width:k.bandwidth()*d,style:{fill:$t},exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.size)-u(0)),y:l.size>0?u(l.size):u(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,l.target&&h==="line"?s.jsxRuntimeExports.jsx(yt.motion.rect,{x:0,width:k.bandwidth(),exit:{y:u(0),opacity:0,fill:U,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:U},whileInView:{y:u(l.target)-_t/2,opacity:1,fill:U,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",height:_t}):null,Dt?s.jsxRuntimeExports.jsx(Te.XAxesLabels,{value:`${l.label}`.length<Qt?`${l.label}`:`${`${l.label}`.substring(0,Qt)}...`,y:(l.size||0)<0?0:u(0)+5,x:0,width:k.bandwidth(),height:(l.size||0)<0?u(0)-5:f.bottom,style:m?.xAxis?.labels,className:a?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:o,isInView:E}):null,Kt?s.jsxRuntimeExports.jsx(yt.motion.text,{x:k.bandwidth()/2,style:{textAnchor:"middle",...m?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!_&&$t.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",a?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:_||$t},whileInView:{y:u(l.size||0),opacity:1,fill:_||$t,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:je.numberFormattingFunction(l.size,N,at,O,vt)}):null]},l.label)),G=wt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:wt.map((l,oe)=>s.jsxRuntimeExports.jsx(Ee.RefLineY,{text:l.text,color:l.color,y:u(l.value),x1:0-B,x2:x+f.right,classNames:l.classNames,styles:l.styles,animate:o,isInView:E},oe))}):null,t[27]=o,t[28]=M,t[29]=$t,t[30]=St,t[31]=a?.graphObjectValues,t[32]=a?.xAxis?.axis,t[33]=a?.xAxis?.labels,t[34]=a?.yAxis?.gridLines,t[35]=a?.yAxis?.labels,t[36]=a?.yAxis?.title,t[37]=et,t[38]=n,t[39]=V,t[40]=c,t[41]=Rt,t[42]=x,t[43]=Jt,t[44]=Z,t[45]=E,t[46]=F,t[47]=B,t[48]=f.bottom,t[49]=f.left,t[50]=f.right,t[51]=f.top,t[52]=Ut,t[53]=d,t[54]=jt,t[55]=C,t[56]=N,t[57]=Mt,t[58]=st,t[59]=xt,t[60]=at,t[61]=O,t[62]=tt,t[63]=wt,t[64]=Bt,t[65]=Dt,t[66]=ie,t[67]=Kt,t[68]=m?.graphObjectValues,t[69]=m?.xAxis?.axis,t[70]=m?.xAxis?.labels,t[71]=m?.yAxis?.gridLines,t[72]=m?.yAxis?.labels,t[73]=m?.yAxis?.title,t[74]=vt,t[75]=U,t[76]=_t,t[77]=h,t[78]=Qt,t[79]=_,t[80]=bt,t[81]=Ct,t[82]=b,t[83]=z,t[84]=L,t[85]=H,t[86]=G,t[87]=q,t[88]=X,t[89]=Y,t[90]=v,t[91]=A,t[92]=R,t[93]=T,t[94]=$,t[95]=w,t[96]=j}else z=t[83],L=t[84],H=t[85],G=t[86],q=t[87],X=t[88],Y=t[89],v=t[90],A=t[91],R=t[92],T=t[93],$=t[94],w=t[95],j=t[96];let W;t[119]!==z||t[120]!==H||t[121]!==G?(W=s.jsxRuntimeExports.jsxs(z,{children:[H,G]}),t[119]=z,t[120]=H,t[121]=G,t[122]=W):W=t[122];let J;t[123]!==et?(J=et.filter(Xe).map(Ge),t[123]=et,t[124]=J):J=t[124];let K;t[125]!==q||t[126]!==X||t[127]!==Y||t[128]!==v||t[129]!==A||t[130]!==W||t[131]!==J?(K=s.jsxRuntimeExports.jsxs("g",{transform:q,children:[X,Y,v,A,W,J]}),t[125]=q,t[126]=X,t[127]=Y,t[128]=v,t[129]=A,t[130]=W,t[131]=J,t[132]=K):K=t[132];let Q;t[133]!==L||t[134]!==R||t[135]!==T||t[136]!==$||t[137]!==w||t[138]!==j||t[139]!==K?(Q=s.jsxRuntimeExports.jsx(L,{width:R,height:T,viewBox:$,direction:w,ref:j,children:K}),t[133]=L,t[134]=R,t[135]=T,t[136]=$,t[137]=w,t[138]=j,t[139]=K,t[140]=Q):Q=t[140];let S;t[141]!==a?.tooltip||t[142]!==At||t[143]!==ee||t[144]!==I||t[145]!==m?.tooltip||t[146]!==ct?(S=I&&ct&&At&&ee?s.jsxRuntimeExports.jsx(ke.Tooltip,{data:I,body:ct,xPos:At,yPos:ee,backgroundStyle:m?.tooltip,className:a?.tooltip}):null,t[141]=a?.tooltip,t[142]=At,t[143]=ee,t[144]=I,t[145]=m?.tooltip,t[146]=ct,t[147]=S):S=t[147];let lt;t[148]!==V||t[149]!==C?(lt=V&&C!==void 0?s.jsxRuntimeExports.jsx(Re.le,{open:C!==void 0,onClose:()=>{ht(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof V=="string"?{__html:Oe.string2HTML(V,C)}:void 0,children:typeof V=="function"?V(C):null})}):null,t[148]=V,t[149]=C,t[150]=lt):lt=t[150];let nt;return t[151]!==Q||t[152]!==S||t[153]!==lt?(nt=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Q,S,lt]}),t[151]=Q,t[152]=S,t[153]=lt,t[154]=nt):nt=t[154],nt}function Ge(e){return e.layer}function Xe(e){return e.position==="after"}function Ye(e){return e.layer}function We(e){return e.position==="before"}function Je(e){return e!==0}function Ke(e){return e!==0}function Qe(e){return`${e.id}`}function Ze(e){return e.target}function _e(e){return!p.checkIfNullOrUndefined(e.target)}function ti(e){return e.target}function ei(e){return!p.checkIfNullOrUndefined(e.target)}function ii(e){return e.size}function ni(e){return!p.checkIfNullOrUndefined(e.size)}function si(e){return e.size}function ai(e){return!p.checkIfNullOrUndefined(e.size)}function li(e){return pe.sum((e.qualitativeRange||[]).filter(oi))||0}function oi(e){return!p.checkIfNullOrUndefined(e)}function ri(e){return e.target}function ui(e){return!p.checkIfNullOrUndefined(e.size)}function ci(e){return e.target}function xi(e){return!p.checkIfNullOrUndefined(e.target)}function mi(e){return e.size}function hi(e){return!p.checkIfNullOrUndefined(e.size)}function fi(e){return e.size}function di(e){return!p.checkIfNullOrUndefined(e.size)}function pi(e){const t=s.compilerRuntimeExports.c(147),{data:n,topMargin:bt,bottomMargin:Jt,leftMargin:$t,rightMargin:vt,barColor:O,suffix:St,prefix:Dt,barPadding:Kt,showValues:ie,showTicks:Qt,truncateBy:ne,width:Ft,height:Zt,showLabels:re,tooltip:ct,onSeriesMouseOver:xt,refValues:wt,highlightedDataPoints:g,maxValue:mt,minValue:Z,onSeriesMouseClick:st,labelOrder:F,rtl:Ut,maxBarThickness:jt,minBarThickness:Bt,resetSelectionOnDoubleClick:V,detailsOnClick:M,barAxisTitle:_,valueColor:Mt,noOfTicks:m,styles:a,classNames:h,targetStyle:U,targetColor:tt,qualitativeRangeColors:d,measureBarWidthFactor:o,animate:c,dimmedOpacity:at,precision:et,customLayers:N,naLabel:_t,targetLineThickness:B}=e,Pt=bt===void 0?25:bt,se=Jt===void 0?10:Jt,Ht=$t===void 0?100:$t,ue=vt===void 0?40:vt,ae=ut.useRef(null);let E;t[0]!==c.amount||t[1]!==c.once?(E={once:c.once,amount:c.amount},t[0]=c.amount,t[1]=c.once,t[2]=E):E=t[2];const P=ze.useInView(ae,E),[Gt,f]=ut.useState(void 0),[I,le]=ut.useState(void 0),[C,ht]=ut.useState(void 0),[At,te]=ut.useState(void 0),ee=_?Pt+25:Pt;let Xt;t[3]!==se||t[4]!==Ht||t[5]!==ue||t[6]!==ee?(Xt={top:ee,bottom:se,left:Ht,right:ue},t[3]=se,t[4]=Ht,t[5]=ue,t[6]=ee,t[7]=Xt):Xt=t[7];const x=Xt,Rt=Ft-x.left-x.right,it=Zt-x.top-x.bottom;let kt;t[8]!==n?(kt=Math.max(...n.filter(Ui).map(Fi))<0?0:Math.max(...n.filter(Di).map(Si)),t[8]=n,t[9]=kt):kt=t[9];const Ot=kt;let Vt;t[10]!==n?(Vt=Math.max(...n.filter($i).map(Ti))<0?0:Math.max(...n.filter(qi).map(Li)),t[10]=n,t[11]=Vt):Vt=t[11];const Nt=Vt;let Et;t[12]!==n?(Et=Math.max(...n.map(Ci)),t[12]=n,t[13]=Et):Et=t[13];const It=Et;let Ct;t[14]!==Ot||t[15]!==mt||t[16]!==It||t[17]!==Nt?(Ct=p.checkIfNullOrUndefined(mt)?Math.max(...[Ot,Nt,It].filter(Number.isFinite))<0?0:Math.max(...[Ot,Nt,It].filter(Number.isFinite)):mt,t[14]=Ot,t[15]=mt,t[16]=It,t[17]=Nt,t[18]=Ct):Ct=t[18];const Yt=Ct;let zt;t[19]!==n?(zt=Math.min(...n.filter(Ii).map(Ei))>=0?0:Math.min(...n.filter(Ni).map(Vi)),t[19]=n,t[20]=zt):zt=t[20];const Lt=zt;let ft;t[21]!==n?(ft=Math.min(...n.filter(Oi).map(ki))>=0?0:Math.min(...n.filter(Ri).map(Ai)),t[21]=n,t[22]=ft):ft=t[22];const qt=ft;let b;t[23]!==Lt||t[24]!==Z||t[25]!==qt?(b=p.checkIfNullOrUndefined(Z)?Math.min(...[Lt,qt].filter(Number.isFinite))>=0?0:Math.min(...[Lt,qt].filter(Number.isFinite)):Z,t[23]=Lt,t[24]=Z,t[25]=qt,t[26]=b):b=t[26];const z=b;let L,H,G,q,X,Y,v,A,R,T,$,w,j,W;if(t[27]!==c||t[28]!==_||t[29]!==O||t[30]!==Kt||t[31]!==h?.graphObjectValues||t[32]!==h?.xAxis?.gridLines||t[33]!==h?.xAxis?.labels||t[34]!==h?.xAxis?.title||t[35]!==h?.yAxis?.axis||t[36]!==h?.yAxis?.labels||t[37]!==N||t[38]!==n||t[39]!==M||t[40]!==at||t[41]!==it||t[42]!==Rt||t[43]!==Zt||t[44]!==g||t[45]!==P||t[46]!==F||t[47]!==x.bottom||t[48]!==x.left||t[49]!==x.top||t[50]!==jt||t[51]!==o||t[52]!==Bt||t[53]!==I||t[54]!==_t||t[55]!==m||t[56]!==st||t[57]!==xt||t[58]!==et||t[59]!==Dt||t[60]!==d||t[61]!==wt||t[62]!==V||t[63]!==Ut||t[64]!==re||t[65]!==Qt||t[66]!==ie||t[67]!==a?.graphObjectValues||t[68]!==a?.xAxis?.gridLines||t[69]!==a?.xAxis?.labels||t[70]!==a?.xAxis?.title||t[71]!==a?.yAxis?.axis||t[72]!==a?.yAxis?.labels||t[73]!==St||t[74]!==tt||t[75]!==B||t[76]!==U||t[77]!==Pt||t[78]!==ne||t[79]!==Mt||t[80]!==Ft||t[81]!==Yt||t[82]!==z){let Tt;t[97]!==F?(Tt=(i,rt)=>({...i,id:F?`${i.label}`:`${rt}`}),t[97]=F,t[98]=Tt):Tt=t[98];const me=n.map(Tt),r=Ie.linear().domain([z,Yt]).range([0,Rt]).nice(),k=F||me.map(Mi),D=Ce.band().domain(k).range([0,Bt?Math.max(it,Bt*k.length):jt?Math.min(it,jt*k.length):it]).paddingInner(Kt),he=r.ticks(m);H=yt.motion.svg,T=`${Ft}px`,$=`${Zt}px`,w=`0 0 ${Ft} ${Zt}`,j="ltr",W=ae,X=`translate(${x.left},${x.top})`,Y=Qt?s.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:he.filter(ji),x:he.filter(wi).map(i=>r(i)),y1:0-Pt,y2:it+x.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},suffix:St,prefix:Dt,labelType:"secondary",showGridLines:!0,precision:et}):null;const ce=Rt/2,dt=0-x.top+15,ot=a?.xAxis?.title,pt=h?.xAxis?.title;t[99]!==_||t[100]!==ce||t[101]!==dt||t[102]!==ot||t[103]!==pt?(v=s.jsxRuntimeExports.jsx(Ne.AxisTitle,{x:ce,y:dt,style:ot,className:pt,text:_}),t[99]=_,t[100]=ce,t[101]=dt,t[102]=ot,t[103]=pt,t[104]=v):v=t[104];const Wt=h?.yAxis?.axis;let y;t[105]!==Wt?(y={axis:Wt},t[105]=Wt,t[106]=y):y=t[106];const gt=a?.yAxis?.axis;let fe;t[107]!==gt?(fe={axis:gt},t[107]=gt,t[108]=fe):fe=t[108],A=s.jsxRuntimeExports.jsx(Ve.Axis,{x1:r(z<0?0:z),x2:r(z<0?0:z),y1:-2.5,y2:it+x.bottom,classNames:y,styles:fe}),t[109]!==N?(R=N.filter(vi).map(bi),t[109]=N,t[110]=R):R=t[110],L=Le.AnimatePresence,G=me.map(i=>p.checkIfNullOrUndefined(D(i.id))?null:s.jsxRuntimeExports.jsxs(yt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:rt=>{f(i),te(rt.clientY),ht(rt.clientX),xt?.(i)},onClick:()=>{(st||M)&&(Ae.isEqual(I,i)&&V?(le(void 0),st?.(void 0)):(le(i),st?.(i)))},onMouseMove:rt=>{f(i),te(rt.clientY),ht(rt.clientX)},onMouseLeave:()=>{f(void 0),ht(void 0),te(void 0),xt?.(void 0)},exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{x:0,y:D(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:at:.85},whileInView:{x:0,y:D(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:at:.85,transition:{duration:c.duration}}},initial:"initial",animate:P?"whileInView":"initial",children:[i.qualitativeRange?i.qualitativeRange.map((rt,xe)=>s.jsxRuntimeExports.jsx(yt.motion.rect,{exit:{width:0,x:r(0),transition:{duration:c.duration}},variants:{initial:{x:r(0),width:0,fill:d[xe]},whileInView:{x:r(xe===0?0:pe.sum(i.qualitativeRange.filter((ge,ye)=>ye<xe&&ge))),width:r(rt),fill:d[xe],transition:{duration:c.duration}}},initial:"initial",animate:P?"whileInView":"initial",y:0,height:D.bandwidth()},xe)):null,i.target&&U==="background"?s.jsxRuntimeExports.jsx(yt.motion.rect,{y:0,x:i.target>=0?r(0):r(i.target),height:D.bandwidth(),exit:{width:0,x:r(0),fill:tt,transition:{duration:c.duration}},variants:{initial:{x:r(0),fill:tt,width:0},whileInView:{x:i.target>=0?r(0):r(i.target),fill:tt,width:i.target>=0?r(i.target)-r(0):r(0)-r(i.target),transition:{duration:c.duration}}},initial:"initial",animate:P?"whileInView":"initial"}):null,i.size?s.jsxRuntimeExports.jsx(yt.motion.rect,{y:D.bandwidth()*((1-o)/2),style:{fill:O},height:D.bandwidth()*o,exit:{width:0,x:r(0),transition:{duration:c.duration}},variants:{initial:{x:r(0),width:0},whileInView:{x:i.size>=0?r(0):r(i.size),width:i.size>=0?r(i.size)-r(0):r(0)-r(i.size),transition:{duration:c.duration}}},initial:"initial",animate:P?"whileInView":"initial"}):null,i.target&&U==="line"?s.jsxRuntimeExports.jsx(yt.motion.rect,{y:0,height:D.bandwidth(),width:B,exit:{opacity:0,x:r(0),fill:tt,transition:{duration:c.duration}},variants:{initial:{x:r(0),opacity:0,fill:tt},whileInView:{x:r(i.target)-B/2,opacity:1,fill:tt,transition:{duration:c.duration}}},initial:"initial",animate:P?"whileInView":"initial"}):null,re?s.jsxRuntimeExports.jsx(De.YAxesLabels,{value:`${i.label}`.length<ne?`${i.label}`:`${`${i.label}`.substring(0,ne)}...`,y:0,x:(i.size||0)<0?r(0):0-x.left,width:(i.size||0)<0?Ft-r(0):r(0)+x.left,height:D.bandwidth(),alignment:i.size&&i.size<0?"left":"right",style:a?.yAxis?.labels,className:h?.yAxis?.labels,animate:c,isInView:P}):null,ie?s.jsxRuntimeExports.jsx(yt.motion.text,{y:D.bandwidth()/2,style:{textAnchor:i.size&&i.size<0?"end":"start",...a?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!Mt&&O.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",h?.graphObjectValues),dx:i.size&&i.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{x:r(0),opacity:0,fill:Mt||O},whileInView:{x:i.size?r(i.size):r(0),opacity:1,fill:Mt||O,transition:{duration:c.duration}}},initial:"initial",animate:P?"whileInView":"initial",children:je.numberFormattingFunction(i.size,_t,et,Dt,St)}):null]},i.label)),q=wt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:wt.map((i,rt)=>s.jsxRuntimeExports.jsx(Ee.RefLineX,{text:i.text,color:i.color,x:r(i.value),y1:0-x.top,y2:it+x.bottom,textSide:r(i.value)>Rt*.75||Ut?"left":"right",classNames:i.classNames,styles:i.styles,animate:c,isInView:P},rt))}):null,t[27]=c,t[28]=_,t[29]=O,t[30]=Kt,t[31]=h?.graphObjectValues,t[32]=h?.xAxis?.gridLines,t[33]=h?.xAxis?.labels,t[34]=h?.xAxis?.title,t[35]=h?.yAxis?.axis,t[36]=h?.yAxis?.labels,t[37]=N,t[38]=n,t[39]=M,t[40]=at,t[41]=it,t[42]=Rt,t[43]=Zt,t[44]=g,t[45]=P,t[46]=F,t[47]=x.bottom,t[48]=x.left,t[49]=x.top,t[50]=jt,t[51]=o,t[52]=Bt,t[53]=I,t[54]=_t,t[55]=m,t[56]=st,t[57]=xt,t[58]=et,t[59]=Dt,t[60]=d,t[61]=wt,t[62]=V,t[63]=Ut,t[64]=re,t[65]=Qt,t[66]=ie,t[67]=a?.graphObjectValues,t[68]=a?.xAxis?.gridLines,t[69]=a?.xAxis?.labels,t[70]=a?.xAxis?.title,t[71]=a?.yAxis?.axis,t[72]=a?.yAxis?.labels,t[73]=St,t[74]=tt,t[75]=B,t[76]=U,t[77]=Pt,t[78]=ne,t[79]=Mt,t[80]=Ft,t[81]=Yt,t[82]=z,t[83]=L,t[84]=H,t[85]=G,t[86]=q,t[87]=X,t[88]=Y,t[89]=v,t[90]=A,t[91]=R,t[92]=T,t[93]=$,t[94]=w,t[95]=j,t[96]=W}else L=t[83],H=t[84],G=t[85],q=t[86],X=t[87],Y=t[88],v=t[89],A=t[90],R=t[91],T=t[92],$=t[93],w=t[94],j=t[95],W=t[96];let J;t[111]!==L||t[112]!==G||t[113]!==q?(J=s.jsxRuntimeExports.jsxs(L,{children:[G,q]}),t[111]=L,t[112]=G,t[113]=q,t[114]=J):J=t[114];let K;t[115]!==N?(K=N.filter(yi).map(gi),t[115]=N,t[116]=K):K=t[116];let Q;t[117]!==X||t[118]!==Y||t[119]!==v||t[120]!==A||t[121]!==R||t[122]!==J||t[123]!==K?(Q=s.jsxRuntimeExports.jsxs("g",{transform:X,children:[Y,v,A,R,J,K]}),t[117]=X,t[118]=Y,t[119]=v,t[120]=A,t[121]=R,t[122]=J,t[123]=K,t[124]=Q):Q=t[124];let S;t[125]!==H||t[126]!==T||t[127]!==$||t[128]!==w||t[129]!==j||t[130]!==W||t[131]!==Q?(S=s.jsxRuntimeExports.jsx(H,{width:T,height:$,viewBox:w,direction:j,ref:W,children:Q}),t[125]=H,t[126]=T,t[127]=$,t[128]=w,t[129]=j,t[130]=W,t[131]=Q,t[132]=S):S=t[132];let lt;t[133]!==h?.tooltip||t[134]!==C||t[135]!==At||t[136]!==Gt||t[137]!==a?.tooltip||t[138]!==ct?(lt=Gt&&ct&&C&&At?s.jsxRuntimeExports.jsx(ke.Tooltip,{data:Gt,body:ct,xPos:C,yPos:At,backgroundStyle:a?.tooltip,className:h?.tooltip}):null,t[133]=h?.tooltip,t[134]=C,t[135]=At,t[136]=Gt,t[137]=a?.tooltip,t[138]=ct,t[139]=lt):lt=t[139];let nt;t[140]!==M||t[141]!==I?(nt=M&&I!==void 0?s.jsxRuntimeExports.jsx(Re.le,{open:I!==void 0,onClose:()=>{le(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof M=="string"?{__html:Oe.string2HTML(M,I)}:void 0,children:typeof M=="function"?M(I):null})}):null,t[140]=M,t[141]=I,t[142]=nt):nt=t[142];let u;return t[143]!==S||t[144]!==lt||t[145]!==nt?(u=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[S,lt,nt]}),t[143]=S,t[144]=lt,t[145]=nt,t[146]=u):u=t[146],u}function gi(e){return e.layer}function yi(e){return e.position==="after"}function bi(e){return e.layer}function vi(e){return e.position==="before"}function wi(e){return e!==0}function ji(e){return e!==0}function Mi(e){return`${e.id}`}function Ai(e){return e.target}function Ri(e){return!p.checkIfNullOrUndefined(e.target)}function ki(e){return e.target}function Oi(e){return!p.checkIfNullOrUndefined(e.target)}function Vi(e){return e.size}function Ni(e){return!p.checkIfNullOrUndefined(e.size)}function Ei(e){return e.size}function Ii(e){return!p.checkIfNullOrUndefined(e.size)}function Ci(e){return pe.sum((e.qualitativeRange||[]).filter(zi))||0}function zi(e){return!p.checkIfNullOrUndefined(e)}function Li(e){return e.target}function qi(e){return!p.checkIfNullOrUndefined(e.target)}function Ti(e){return e.target}function $i(e){return!p.checkIfNullOrUndefined(e.target)}function Si(e){return e.size}function Di(e){return!p.checkIfNullOrUndefined(e.size)}function Fi(e){return e.size}function Ui(e){return!p.checkIfNullOrUndefined(e.size)}function Bi(e){const t=s.compilerRuntimeExports.c(95),{data:n,graphTitle:bt,barColor:Jt,barPadding:$t,showTicks:vt,leftMargin:O,rightMargin:St,topMargin:Dt,bottomMargin:Kt,truncateBy:ie,showLabels:Qt,showValues:ne,backgroundColor:Ft,suffix:Zt,prefix:re,sources:ct,graphDescription:xt,height:wt,width:g,footNote:mt,colorDomain:Z,colorLegendTitle:st,padding:F,relativeHeight:Ut,tooltip:jt,onSeriesMouseOver:Bt,refValues:V,showColorScale:M,graphID:_,maxValue:Mt,minValue:m,highlightedDataPoints:a,onSeriesMouseClick:h,valueColor:U,orientation:tt,styles:d,classNames:o,qualitativeRangeColors:c,targetColor:at,filterNA:et,targetStyle:N,measureBarWidthFactor:_t,animate:B,dimmedOpacity:Pt,precision:se,customLayers:Ht,naLabel:ue,graphDownload:ae,dataDownload:E,language:P,theme:Gt,sortData:f,labelOrder:I,minHeight:le,maxBarThickness:C,maxNumberOfBars:ht,minBarThickness:At,ariaLabel:te,resetSelectionOnDoubleClick:ee,detailsOnClick:Xt,barAxisTitle:x,noOfTicks:Rt,targetLineThickness:it}=e,kt=Jt===void 0?we.Colors.primaryColors["blue-600"]:Jt,Ot=$t===void 0?.25:$t,Vt=vt===void 0?!0:vt,Nt=ie===void 0?999:ie,Et=Qt===void 0?!0:Qt,It=ne===void 0?!0:ne,Ct=Ft===void 0?!1:Ft,Yt=Zt===void 0?"":Zt,zt=re===void 0?"":re,Lt=M===void 0?!0:M;let ft;t[0]!==a?(ft=a===void 0?[]:a,t[0]=a,t[1]=ft):ft=t[1];const qt=ft,b=tt===void 0?"vertical":tt,z=at===void 0?we.Colors.light.grays["gray-700"]:at,L=et===void 0?!0:et,H=N===void 0?"line":N,G=_t===void 0?.4:_t,q=B===void 0?!1:B,X=Pt===void 0?.3:Pt,Y=se===void 0?2:se;let v;t[2]!==Ht?(v=Ht===void 0?[]:Ht,t[2]=Ht,t[3]=v):v=t[3];const A=v,R=ue===void 0?"NA":ue,T=ae===void 0?!1:ae,$=E===void 0?!1:E,w=P===void 0?"en":P,j=Gt===void 0?"light":Gt,W=le===void 0?0:le,J=ee===void 0?!0:ee,K=Rt===void 0?5:Rt,Q=it===void 0?2:it,[S,lt]=ut.useState(0),[nt,u]=ut.useState(0),Tt=ut.useRef(null),me=ut.useRef(null),r=b==="horizontal"?pi:He;let k,D;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{const y=new ResizeObserver(gt=>{lt(gt[0].target.clientWidth||620),u(gt[0].target.clientHeight||480)});return Tt.current&&y.observe(Tt.current),()=>y.disconnect()},D=[],t[4]=k,t[5]=D):(k=t[4],D=t[5]),ut.useEffect(k,D);const he=o?.graphContainer,ce=d?.graphContainer;let dt;t[6]!==o?.description||t[7]!==o?.title||t[8]!==n||t[9]!==$||t[10]!==xt||t[11]!==T||t[12]!==bt||t[13]!==d?.description||t[14]!==d?.title||t[15]!==g?(dt=bt||xt||T||$?s.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:o?.title,description:o?.description},graphTitle:bt,graphDescription:xt,width:g,graphDownload:T?me:void 0,dataDownload:$?n.map(Wi).filter(Yi).length>0?n.map(Xi).filter(Gi):n.filter(Hi):null}):null,t[6]=o?.description,t[7]=o?.title,t[8]=n,t[9]=$,t[10]=xt,t[11]=T,t[12]=bt,t[13]=d?.description,t[14]=d?.title,t[15]=g,t[16]=dt):dt=t[16];let ot;t[17]!==r||t[18]!==q||t[19]!==x||t[20]!==kt||t[21]!==Ot||t[22]!==Kt||t[23]!==o||t[24]!==Z||t[25]!==st||t[26]!==A||t[27]!==n||t[28]!==Xt||t[29]!==X||t[30]!==L||t[31]!==qt||t[32]!==I||t[33]!==w||t[34]!==O||t[35]!==C||t[36]!==ht||t[37]!==Mt||t[38]!==G||t[39]!==At||t[40]!==m||t[41]!==R||t[42]!==K||t[43]!==h||t[44]!==Bt||t[45]!==b||t[46]!==Y||t[47]!==zt||t[48]!==c||t[49]!==V||t[50]!==J||t[51]!==St||t[52]!==Lt||t[53]!==Et||t[54]!==Vt||t[55]!==It||t[56]!==f||t[57]!==d||t[58]!==Yt||t[59]!==nt||t[60]!==S||t[61]!==z||t[62]!==Q||t[63]!==H||t[64]!==j||t[65]!==jt||t[66]!==Dt||t[67]!==Nt||t[68]!==U||t[69]!==g?(ot=n.length===0?s.jsxRuntimeExports.jsx(Fe.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Lt&&n.filter(Pi).length!==0&&Z?s.jsxRuntimeExports.jsx(Pe.ColorLegend,{width:g,colorLegendTitle:st,colors:c||we.Colors[j].sequentialColors.positiveColorsx10,colorDomain:Z,showNAColor:!1,className:o?.colorLegend}):null,s.jsxRuntimeExports.jsx(Me.GraphArea,{ref:Tt,children:S&&nt?s.jsxRuntimeExports.jsx(r,{data:f?qe.orderBy(n.filter(y=>L?!p.checkIfNullOrUndefined(y.size):y),[y=>y.size===void 0?f==="asc"?(b==="horizontal"?1:-1)*(1/0):(b==="horizontal"?-1:1)*(1/0):y.size],[f]).filter((y,gt)=>ht?gt<ht:!0):n.filter(y=>L?!p.checkIfNullOrUndefined(y.size):y).filter((y,gt)=>ht?gt<ht:!0),barColor:kt,targetColor:z,width:S,refValues:V,height:nt,suffix:Yt,prefix:zt,barPadding:Ot,showLabels:Et,showValues:It,showTicks:Vt,truncateBy:Nt,leftMargin:O,rightMargin:St,qualitativeRangeColors:c||we.Colors[j].sequentialColors.positiveColorsx10,topMargin:Dt,bottomMargin:Kt,tooltip:jt,onSeriesMouseOver:Bt,maxValue:Mt,minValue:m,highlightedDataPoints:qt,onSeriesMouseClick:h,labelOrder:I,maxBarThickness:C,minBarThickness:At,resetSelectionOnDoubleClick:J,detailsOnClick:Xt,barAxisTitle:x,noOfTicks:K,valueColor:U,styles:d,classNames:o,targetStyle:H,dimmedOpacity:X,measureBarWidthFactor:G,animate:q===!0?{duration:.5,once:!0,amount:.5}:q||{duration:0,once:!0,amount:0},precision:Y,customLayers:A,naLabel:R,targetLineThickness:Q,rtl:w==="ar"||w==="he"}):null})]}),t[17]=r,t[18]=q,t[19]=x,t[20]=kt,t[21]=Ot,t[22]=Kt,t[23]=o,t[24]=Z,t[25]=st,t[26]=A,t[27]=n,t[28]=Xt,t[29]=X,t[30]=L,t[31]=qt,t[32]=I,t[33]=w,t[34]=O,t[35]=C,t[36]=ht,t[37]=Mt,t[38]=G,t[39]=At,t[40]=m,t[41]=R,t[42]=K,t[43]=h,t[44]=Bt,t[45]=b,t[46]=Y,t[47]=zt,t[48]=c,t[49]=V,t[50]=J,t[51]=St,t[52]=Lt,t[53]=Et,t[54]=Vt,t[55]=It,t[56]=f,t[57]=d,t[58]=Yt,t[59]=nt,t[60]=S,t[61]=z,t[62]=Q,t[63]=H,t[64]=j,t[65]=jt,t[66]=Dt,t[67]=Nt,t[68]=U,t[69]=g,t[70]=ot):ot=t[70];let pt;t[71]!==o?.footnote||t[72]!==o?.source||t[73]!==mt||t[74]!==ct||t[75]!==d?.footnote||t[76]!==d?.source||t[77]!==g?(pt=ct||mt?s.jsxRuntimeExports.jsx(Ue.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:ct,footNote:mt,width:g}):null,t[71]=o?.footnote,t[72]=o?.source,t[73]=mt,t[74]=ct,t[75]=d?.footnote,t[76]=d?.source,t[77]=g,t[78]=pt):pt=t[78];let Wt;return t[79]!==te||t[80]!==Ct||t[81]!==_||t[82]!==wt||t[83]!==w||t[84]!==W||t[85]!==F||t[86]!==Ut||t[87]!==he||t[88]!==ce||t[89]!==dt||t[90]!==ot||t[91]!==pt||t[92]!==j||t[93]!==g?(Wt=s.jsxRuntimeExports.jsxs(Me.GraphContainer,{className:he,style:ce,id:_,ref:me,"aria-label":te,backgroundColor:Ct,theme:j,language:w,minHeight:W,width:g,height:wt,relativeHeight:Ut,padding:F,children:[dt,ot,pt]}),t[79]=te,t[80]=Ct,t[81]=_,t[82]=wt,t[83]=w,t[84]=W,t[85]=F,t[86]=Ut,t[87]=he,t[88]=ce,t[89]=dt,t[90]=ot,t[91]=pt,t[92]=j,t[93]=g,t[94]=Wt):Wt=t[94],Wt}function Pi(e){return e.qualitativeRange}function Hi(e){return e!==void 0}function Gi(e){return e!==void 0}function Xi(e){return e.data}function Yi(e){return e!==void 0}function Wi(e){return e.data}exports.BulletChart=Bi;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),ut=require("react"),Le=require("./index-Cno4Q0YE.cjs"),Ae=require("./index-DQA8q5sC.cjs"),pe=require("./index-CSNtgibC.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),Re=require("./Tooltip-uUdw6wJL.cjs"),p=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ke=require("./Axis-DxRV2yMi.cjs"),Oe=require("./AxisTitle-sS5bLLR7.cjs"),qe=require("./XAxesLabels-Bt5NZBmX.cjs"),Ve=require("./ReferenceLine-BH0qdf4R.cjs"),Te=require("./YTicksAndGridLines-4pxTRlRK.cjs"),$e=require("./XTicksAndGridLines-B6CELS7q.cjs"),Se=require("./YAxesLabels-DesLesUP.cjs"),Ne=require("./DetailsModal-BN0HDFlV.cjs"),Ee=require("./linear-BwPAspcq.cjs"),Ie=require("./band-VYfcZeJ2.cjs"),ze=require("./use-in-view-QcfiW0w3.cjs"),bt=require("./proxy-BxvUI_9l.cjs"),Ce=require("./index-DG2bgAva.cjs"),we=require("./Colors.cjs"),De=require("./EmptyState-sAEZ_5rU.cjs"),Me=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./GraphFooter.cjs"),Ue=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs");function Pe(e){const t=s.compilerRuntimeExports.c(156),{data:n,width:yt,height:Jt,barColor:$t,suffix:vt,prefix:k,barPadding:St,showLabels:Dt,showValues:Kt,showTicks:ie,truncateBy:Qt,leftMargin:ne,rightMargin:Ft,topMargin:Zt,bottomMargin:re,tooltip:ct,onSeriesMouseOver:xt,refValues:wt,maxValue:g,minValue:mt,highlightedDataPoints:J,onSeriesMouseClick:nt,labelOrder:T,maxBarThickness:Ut,minBarThickness:jt,resetSelectionOnDoubleClick:Bt,detailsOnClick:st,barAxisTitle:$,valueColor:K,noOfTicks:Mt,styles:f,classNames:a,targetStyle:c,targetColor:S,qualitativeRangeColors:Q,measureBarWidthFactor:h,animate:o,dimmedOpacity:x,precision:at,customLayers:Z,naLabel:O,targetLineThickness:_t}=e,D=ne===void 0?20:ne,Pt=Ft===void 0?20:Ft,se=Zt===void 0?20:Zt,Gt=re===void 0?25:re,ue=ut.useRef(null);let ae;t[0]!==o.amount||t[1]!==o.once?(ae={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=ae):ae=t[2];const V=ze.useInView(ue,ae),F=$?D+30:D;let Xt;t[3]!==Gt||t[4]!==Pt||t[5]!==F||t[6]!==se?(Xt={top:se,bottom:Gt,left:F,right:Pt},t[3]=Gt,t[4]=Pt,t[5]=F,t[6]=se,t[7]=Xt):Xt=t[7];const d=Xt,[_,le]=ut.useState(void 0),[tt,ft]=ut.useState(void 0),[At,te]=ut.useState(void 0),[ee,Yt]=ut.useState(void 0),m=yt-d.left-d.right,Rt=Jt-d.top-d.bottom;let et;t[8]!==n?(et=Math.max(...n.filter(di).map(fi))<0?0:Math.max(...n.filter(mi).map(xi)),t[8]=n,t[9]=et):et=t[9];const kt=et;let Ot;t[10]!==n?(Ot=Math.max(...n.filter(ci).map(ui))<0?0:Math.max(...n.filter(ri).map(oi)),t[10]=n,t[11]=Ot):Ot=t[11];const Vt=Ot;let Nt;t[12]!==n?(Nt=Math.max(...n.map(ai)),t[12]=n,t[13]=Nt):Nt=t[13];const Et=Nt;let It;t[14]!==kt||t[15]!==g||t[16]!==Et||t[17]!==Vt?(It=p.checkIfNullOrUndefined(g)?Math.max(...[kt,Vt,Et].filter(Number.isFinite))<0?0:Math.max(...[kt,Vt,Et].filter(Number.isFinite)):g,t[14]=kt,t[15]=g,t[16]=Et,t[17]=Vt,t[18]=It):It=t[18];const zt=It;let Ht;t[19]!==n?(Ht=Math.min(...n.filter(si).map(ni))>=0?0:Math.min(...n.filter(ii).map(ei)),t[19]=n,t[20]=Ht):Ht=t[20];const Ct=Ht;let Lt;t[21]!==n?(Lt=Math.min(...n.filter(ti).map(_e))>=0?0:Math.min(...n.filter(Ze).map(Qe)),t[21]=n,t[22]=Lt):Lt=t[22];const dt=Lt;let qt;t[23]!==Ct||t[24]!==mt||t[25]!==dt?(qt=p.checkIfNullOrUndefined(mt)?Math.min(...[Ct,dt].filter(Number.isFinite))>=0?0:Math.min(...[Ct,dt].filter(Number.isFinite)):mt,t[23]=Ct,t[24]=mt,t[25]=dt,t[26]=qt):qt=t[26];const y=qt;let N,E,U,B,I,P,G,v,M,A,z,C,w,j;if(t[27]!==o||t[28]!==$||t[29]!==$t||t[30]!==St||t[31]!==a?.graphObjectValues||t[32]!==a?.xAxis?.axis||t[33]!==a?.xAxis?.labels||t[34]!==a?.yAxis?.gridLines||t[35]!==a?.yAxis?.labels||t[36]!==a?.yAxis?.title||t[37]!==Z||t[38]!==n||t[39]!==st||t[40]!==x||t[41]!==Rt||t[42]!==m||t[43]!==Jt||t[44]!==J||t[45]!==V||t[46]!==T||t[47]!==D||t[48]!==d.bottom||t[49]!==d.left||t[50]!==d.right||t[51]!==d.top||t[52]!==Ut||t[53]!==h||t[54]!==jt||t[55]!==tt||t[56]!==O||t[57]!==Mt||t[58]!==nt||t[59]!==xt||t[60]!==at||t[61]!==k||t[62]!==Q||t[63]!==wt||t[64]!==Bt||t[65]!==Dt||t[66]!==ie||t[67]!==Kt||t[68]!==f?.graphObjectValues||t[69]!==f?.xAxis?.axis||t[70]!==f?.xAxis?.labels||t[71]!==f?.yAxis?.gridLines||t[72]!==f?.yAxis?.labels||t[73]!==f?.yAxis?.title||t[74]!==vt||t[75]!==S||t[76]!==_t||t[77]!==c||t[78]!==Qt||t[79]!==K||t[80]!==yt||t[81]!==zt||t[82]!==y){const u=Ee.linear().domain([y,zt]).range([Rt,0]).nice();let Tt;t[97]!==T?(Tt=(l,oe)=>({...l,id:T?`${l.label}`:`${oe}`}),t[97]=T,t[98]=Tt):Tt=t[98];const me=n.map(Tt),r=T||me.map(Ke),R=Ie.band().domain(r).range([0,jt?Math.max(m,jt*r.length):Ut?Math.min(m,Ut*r.length):m]).paddingInner(St),q=u.ticks(Mt);E=bt.motion.svg,A=`${yt}px`,z=`${Jt}px`,C=`0 0 ${yt} ${Jt}`,w="ltr",j=ue,I=`translate(${d.left},${d.top})`;const fe=u(y<0?0:y),ce=u(y<0?0:y),ht=y<0?0:y;let ot;t[99]!==O||t[100]!==at||t[101]!==k||t[102]!==vt||t[103]!==ht?(ot=je.numberFormattingFunction(ht,O,at,k,vt),t[99]=O,t[100]=at,t[101]=k,t[102]=vt,t[103]=ht,t[104]=ot):ot=t[104];const pt=a?.xAxis?.axis,Wt=a?.yAxis?.labels;let b;t[105]!==pt||t[106]!==Wt?(b={axis:pt,label:Wt},t[105]=pt,t[106]=Wt,t[107]=b):b=t[107];const gt=f?.xAxis?.axis,de=f?.yAxis?.labels;let i;t[108]!==gt||t[109]!==de?(i={axis:gt,label:de},t[108]=gt,t[109]=de,t[110]=i):i=t[110],P=s.jsxRuntimeExports.jsx(ke.Axis,{y1:fe,y2:ce,x1:0-D,x2:m+d.right,label:ot,labelPos:{x:0-D,dx:0,dy:zt<0?"1em":-5,y:u(y<0?0:y)},classNames:b,styles:i}),G=ie?s.jsxRuntimeExports.jsx(Te.YTicksAndGridLines,{values:q.filter(Je),y:q.filter(We).map(l=>u(l)),x1:0-D,x2:m+d.right,styles:{gridLines:f?.yAxis?.gridLines,labels:f?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:vt,prefix:k,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:at}):null;const rt=0-D-15,xe=Rt/2,ge=f?.yAxis?.title,be=a?.yAxis?.title;t[111]!==$||t[112]!==rt||t[113]!==xe||t[114]!==ge||t[115]!==be?(v=s.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:rt,y:xe,style:ge,className:be,text:$,rotate90:!0}),t[111]=$,t[112]=rt,t[113]=xe,t[114]=ge,t[115]=be,t[116]=v):v=t[116],t[117]!==Z?(M=Z.filter(He).map(Ye),t[117]=Z,t[118]=M):M=t[118],N=Ce.AnimatePresence,U=me.map(l=>p.checkIfNullOrUndefined(R(l.id))?null:s.jsxRuntimeExports.jsxs(bt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:oe=>{le(l),Yt(oe.clientY),te(oe.clientX),xt?.(l)},onClick:()=>{(nt||st)&&(Ae.isEqual(tt,l)&&Bt?(ft(void 0),nt?.(void 0)):(ft(l),nt?.(l)))},onMouseMove:oe=>{le(l),Yt(oe.clientY),te(oe.clientX)},onMouseLeave:()=>{le(void 0),te(void 0),Yt(void 0),xt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:R(`${l.id}`),y:0,opacity:J.length!==0?J.indexOf(l.label)!==-1?.85:x:.85},whileInView:{x:R(`${l.id}`),y:0,opacity:J.length!==0?J.indexOf(l.label)!==-1?.85:x:.85,transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",children:[l.qualitativeRange?l.qualitativeRange.map((oe,he)=>s.jsxRuntimeExports.jsx(bt.motion.rect,{x:0,exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0),fill:Q[he]},whileInView:{height:Math.abs(u(pe.sum(l.qualitativeRange.filter((ye,ve)=>ve<=he&&ye)))-u(pe.sum(l.qualitativeRange.filter((ye,ve)=>ve<he&&ye)))),y:u(pe.sum(l.qualitativeRange.filter((ye,ve)=>ve<=he&&ye))),fill:Q[he],transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",width:R.bandwidth()},he)):null,l.target&&c==="background"?s.jsxRuntimeExports.jsx(bt.motion.rect,{x:0,width:R.bandwidth(),exit:{height:0,y:u(0),fill:S,transition:{duration:o.duration}},variants:{initial:{height:0,fill:S,y:u(0)},whileInView:{height:Math.abs(u(l.target)-u(0)),fill:S,y:l.target>0?u(l.target):u(0),transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial"}):null,l.size?s.jsxRuntimeExports.jsx(bt.motion.rect,{x:R.bandwidth()*((1-h)/2),width:R.bandwidth()*h,style:{fill:$t},exit:{height:0,y:u(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.size)-u(0)),y:l.size>0?u(l.size):u(0),transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial"}):null,l.target&&c==="line"?s.jsxRuntimeExports.jsx(bt.motion.rect,{x:0,width:R.bandwidth(),exit:{y:u(0),opacity:0,fill:S,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:S},whileInView:{y:u(l.target)-_t/2,opacity:1,fill:S,transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",height:_t}):null,Dt?s.jsxRuntimeExports.jsx(qe.XAxesLabels,{value:`${l.label}`.length<Qt?`${l.label}`:`${`${l.label}`.substring(0,Qt)}...`,y:(l.size||0)<0?0:u(0)+5,x:0,width:R.bandwidth(),height:(l.size||0)<0?u(0)-5:d.bottom,style:f?.xAxis?.labels,className:a?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:o,isInView:V}):null,Kt?s.jsxRuntimeExports.jsx(bt.motion.text,{x:R.bandwidth()/2,style:{textAnchor:"middle",...f?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!K&&$t.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",a?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:u(0),opacity:0,fill:K||$t},whileInView:{y:u(l.size||0),opacity:1,fill:K||$t,transition:{duration:o.duration}}},initial:"initial",animate:V?"whileInView":"initial",children:je.numberFormattingFunction(l.size,O,at,k,vt)}):null]},l.label)),B=wt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:wt.map((l,oe)=>s.jsxRuntimeExports.jsx(Ve.RefLineY,{text:l.text,color:l.color,y:u(l.value),x1:0-D,x2:m+d.right,classNames:l.classNames,styles:l.styles,animate:o,isInView:V},oe))}):null,t[27]=o,t[28]=$,t[29]=$t,t[30]=St,t[31]=a?.graphObjectValues,t[32]=a?.xAxis?.axis,t[33]=a?.xAxis?.labels,t[34]=a?.yAxis?.gridLines,t[35]=a?.yAxis?.labels,t[36]=a?.yAxis?.title,t[37]=Z,t[38]=n,t[39]=st,t[40]=x,t[41]=Rt,t[42]=m,t[43]=Jt,t[44]=J,t[45]=V,t[46]=T,t[47]=D,t[48]=d.bottom,t[49]=d.left,t[50]=d.right,t[51]=d.top,t[52]=Ut,t[53]=h,t[54]=jt,t[55]=tt,t[56]=O,t[57]=Mt,t[58]=nt,t[59]=xt,t[60]=at,t[61]=k,t[62]=Q,t[63]=wt,t[64]=Bt,t[65]=Dt,t[66]=ie,t[67]=Kt,t[68]=f?.graphObjectValues,t[69]=f?.xAxis?.axis,t[70]=f?.xAxis?.labels,t[71]=f?.yAxis?.gridLines,t[72]=f?.yAxis?.labels,t[73]=f?.yAxis?.title,t[74]=vt,t[75]=S,t[76]=_t,t[77]=c,t[78]=Qt,t[79]=K,t[80]=yt,t[81]=zt,t[82]=y,t[83]=N,t[84]=E,t[85]=U,t[86]=B,t[87]=I,t[88]=P,t[89]=G,t[90]=v,t[91]=M,t[92]=A,t[93]=z,t[94]=C,t[95]=w,t[96]=j}else N=t[83],E=t[84],U=t[85],B=t[86],I=t[87],P=t[88],G=t[89],v=t[90],M=t[91],A=t[92],z=t[93],C=t[94],w=t[95],j=t[96];let X;t[119]!==N||t[120]!==U||t[121]!==B?(X=s.jsxRuntimeExports.jsxs(N,{children:[U,B]}),t[119]=N,t[120]=U,t[121]=B,t[122]=X):X=t[122];let Y;t[123]!==Z?(Y=Z.filter(Xe).map(Ge),t[123]=Z,t[124]=Y):Y=t[124];let H;t[125]!==I||t[126]!==P||t[127]!==G||t[128]!==v||t[129]!==M||t[130]!==X||t[131]!==Y?(H=s.jsxRuntimeExports.jsxs("g",{transform:I,children:[P,G,v,M,X,Y]}),t[125]=I,t[126]=P,t[127]=G,t[128]=v,t[129]=M,t[130]=X,t[131]=Y,t[132]=H):H=t[132];let W;t[133]!==E||t[134]!==A||t[135]!==z||t[136]!==C||t[137]!==w||t[138]!==j||t[139]!==H?(W=s.jsxRuntimeExports.jsx(E,{width:A,height:z,viewBox:C,direction:w,ref:j,children:H}),t[133]=E,t[134]=A,t[135]=z,t[136]=C,t[137]=w,t[138]=j,t[139]=H,t[140]=W):W=t[140];let L;t[141]!==a?.tooltip||t[142]!==At||t[143]!==ee||t[144]!==_||t[145]!==f?.tooltip||t[146]!==ct?(L=_&&ct&&At&&ee?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:_,body:ct,xPos:At,yPos:ee,backgroundStyle:f?.tooltip,className:a?.tooltip}):null,t[141]=a?.tooltip,t[142]=At,t[143]=ee,t[144]=_,t[145]=f?.tooltip,t[146]=ct,t[147]=L):L=t[147];let lt;t[148]!==a?.modal||t[149]!==st||t[150]!==tt?(lt=st&&tt!==void 0?s.jsxRuntimeExports.jsx(Ne.DetailsModal,{body:st,data:tt,setData:ft,className:a?.modal}):null,t[148]=a?.modal,t[149]=st,t[150]=tt,t[151]=lt):lt=t[151];let it;return t[152]!==W||t[153]!==L||t[154]!==lt?(it=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[W,L,lt]}),t[152]=W,t[153]=L,t[154]=lt,t[155]=it):it=t[155],it}function Ge(e){return e.layer}function Xe(e){return e.position==="after"}function Ye(e){return e.layer}function He(e){return e.position==="before"}function We(e){return e!==0}function Je(e){return e!==0}function Ke(e){return`${e.id}`}function Qe(e){return e.target}function Ze(e){return!p.checkIfNullOrUndefined(e.target)}function _e(e){return e.target}function ti(e){return!p.checkIfNullOrUndefined(e.target)}function ei(e){return e.size}function ii(e){return!p.checkIfNullOrUndefined(e.size)}function ni(e){return e.size}function si(e){return!p.checkIfNullOrUndefined(e.size)}function ai(e){return pe.sum((e.qualitativeRange||[]).filter(li))||0}function li(e){return!p.checkIfNullOrUndefined(e)}function oi(e){return e.target}function ri(e){return!p.checkIfNullOrUndefined(e.size)}function ui(e){return e.target}function ci(e){return!p.checkIfNullOrUndefined(e.target)}function xi(e){return e.size}function mi(e){return!p.checkIfNullOrUndefined(e.size)}function fi(e){return e.size}function di(e){return!p.checkIfNullOrUndefined(e.size)}function hi(e){const t=s.compilerRuntimeExports.c(148),{data:n,topMargin:yt,bottomMargin:Jt,leftMargin:$t,rightMargin:vt,barColor:k,suffix:St,prefix:Dt,barPadding:Kt,showValues:ie,showTicks:Qt,truncateBy:ne,width:Ft,height:Zt,showLabels:re,tooltip:ct,onSeriesMouseOver:xt,refValues:wt,highlightedDataPoints:g,maxValue:mt,minValue:J,onSeriesMouseClick:nt,labelOrder:T,rtl:Ut,maxBarThickness:jt,minBarThickness:Bt,resetSelectionOnDoubleClick:st,detailsOnClick:$,barAxisTitle:K,valueColor:Mt,noOfTicks:f,styles:a,classNames:c,targetStyle:S,targetColor:Q,qualitativeRangeColors:h,measureBarWidthFactor:o,animate:x,dimmedOpacity:at,precision:Z,customLayers:O,naLabel:_t,targetLineThickness:D}=e,Pt=yt===void 0?25:yt,se=Jt===void 0?10:Jt,Gt=$t===void 0?100:$t,ue=vt===void 0?40:vt,ae=ut.useRef(null);let V;t[0]!==x.amount||t[1]!==x.once?(V={once:x.once,amount:x.amount},t[0]=x.amount,t[1]=x.once,t[2]=V):V=t[2];const F=ze.useInView(ae,V),[Xt,d]=ut.useState(void 0),[_,le]=ut.useState(void 0),[tt,ft]=ut.useState(void 0),[At,te]=ut.useState(void 0),ee=K?Pt+25:Pt;let Yt;t[3]!==se||t[4]!==Gt||t[5]!==ue||t[6]!==ee?(Yt={top:ee,bottom:se,left:Gt,right:ue},t[3]=se,t[4]=Gt,t[5]=ue,t[6]=ee,t[7]=Yt):Yt=t[7];const m=Yt,Rt=Ft-m.left-m.right,et=Zt-m.top-m.bottom;let kt;t[8]!==n?(kt=Math.max(...n.filter(Fi).map(Di))<0?0:Math.max(...n.filter(Si).map($i)),t[8]=n,t[9]=kt):kt=t[9];const Ot=kt;let Vt;t[10]!==n?(Vt=Math.max(...n.filter(Ti).map(qi))<0?0:Math.max(...n.filter(Li).map(Ci)),t[10]=n,t[11]=Vt):Vt=t[11];const Nt=Vt;let Et;t[12]!==n?(Et=Math.max(...n.map(Ii)),t[12]=n,t[13]=Et):Et=t[13];const It=Et;let zt;t[14]!==Ot||t[15]!==mt||t[16]!==It||t[17]!==Nt?(zt=p.checkIfNullOrUndefined(mt)?Math.max(...[Ot,Nt,It].filter(Number.isFinite))<0?0:Math.max(...[Ot,Nt,It].filter(Number.isFinite)):mt,t[14]=Ot,t[15]=mt,t[16]=It,t[17]=Nt,t[18]=zt):zt=t[18];const Ht=zt;let Ct;t[19]!==n?(Ct=Math.min(...n.filter(Ei).map(Ni))>=0?0:Math.min(...n.filter(Vi).map(Oi)),t[19]=n,t[20]=Ct):Ct=t[20];const Lt=Ct;let dt;t[21]!==n?(dt=Math.min(...n.filter(ki).map(Ri))>=0?0:Math.min(...n.filter(Ai).map(Mi)),t[21]=n,t[22]=dt):dt=t[22];const qt=dt;let y;t[23]!==Lt||t[24]!==J||t[25]!==qt?(y=p.checkIfNullOrUndefined(J)?Math.min(...[Lt,qt].filter(Number.isFinite))>=0?0:Math.min(...[Lt,qt].filter(Number.isFinite)):J,t[23]=Lt,t[24]=J,t[25]=qt,t[26]=y):y=t[26];const N=y;let E,U,B,I,P,G,v,M,A,z,C,w,j,X;if(t[27]!==x||t[28]!==K||t[29]!==k||t[30]!==Kt||t[31]!==c?.graphObjectValues||t[32]!==c?.xAxis?.gridLines||t[33]!==c?.xAxis?.labels||t[34]!==c?.xAxis?.title||t[35]!==c?.yAxis?.axis||t[36]!==c?.yAxis?.labels||t[37]!==O||t[38]!==n||t[39]!==$||t[40]!==at||t[41]!==et||t[42]!==Rt||t[43]!==Zt||t[44]!==g||t[45]!==F||t[46]!==T||t[47]!==m.bottom||t[48]!==m.left||t[49]!==m.top||t[50]!==jt||t[51]!==o||t[52]!==Bt||t[53]!==_||t[54]!==_t||t[55]!==f||t[56]!==nt||t[57]!==xt||t[58]!==Z||t[59]!==Dt||t[60]!==h||t[61]!==wt||t[62]!==st||t[63]!==Ut||t[64]!==re||t[65]!==Qt||t[66]!==ie||t[67]!==a?.graphObjectValues||t[68]!==a?.xAxis?.gridLines||t[69]!==a?.xAxis?.labels||t[70]!==a?.xAxis?.title||t[71]!==a?.yAxis?.axis||t[72]!==a?.yAxis?.labels||t[73]!==St||t[74]!==Q||t[75]!==D||t[76]!==S||t[77]!==Pt||t[78]!==ne||t[79]!==Mt||t[80]!==Ft||t[81]!==Ht||t[82]!==N){let Tt;t[97]!==T?(Tt=(i,rt)=>({...i,id:T?`${i.label}`:`${rt}`}),t[97]=T,t[98]=Tt):Tt=t[98];const me=n.map(Tt),r=Ee.linear().domain([N,Ht]).range([0,Rt]).nice(),R=T||me.map(ji),q=Ie.band().domain(R).range([0,Bt?Math.max(et,Bt*R.length):jt?Math.min(et,jt*R.length):et]).paddingInner(Kt),fe=r.ticks(f);U=bt.motion.svg,z=`${Ft}px`,C=`${Zt}px`,w=`0 0 ${Ft} ${Zt}`,j="ltr",X=ae,P=`translate(${m.left},${m.top})`,G=Qt?s.jsxRuntimeExports.jsx($e.XTicksAndGridLines,{values:fe.filter(wi),x:fe.filter(vi).map(i=>r(i)),y1:0-Pt,y2:et+m.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},suffix:St,prefix:Dt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const ce=Rt/2,ht=0-m.top+15,ot=a?.xAxis?.title,pt=c?.xAxis?.title;t[99]!==K||t[100]!==ce||t[101]!==ht||t[102]!==ot||t[103]!==pt?(v=s.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:ce,y:ht,style:ot,className:pt,text:K}),t[99]=K,t[100]=ce,t[101]=ht,t[102]=ot,t[103]=pt,t[104]=v):v=t[104];const Wt=c?.yAxis?.axis;let b;t[105]!==Wt?(b={axis:Wt},t[105]=Wt,t[106]=b):b=t[106];const gt=a?.yAxis?.axis;let de;t[107]!==gt?(de={axis:gt},t[107]=gt,t[108]=de):de=t[108],M=s.jsxRuntimeExports.jsx(ke.Axis,{x1:r(N<0?0:N),x2:r(N<0?0:N),y1:-2.5,y2:et+m.bottom,classNames:b,styles:de}),t[109]!==O?(A=O.filter(yi).map(bi),t[109]=O,t[110]=A):A=t[110],E=Ce.AnimatePresence,B=me.map(i=>p.checkIfNullOrUndefined(q(i.id))?null:s.jsxRuntimeExports.jsxs(bt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:rt=>{d(i),te(rt.clientY),ft(rt.clientX),xt?.(i)},onClick:()=>{(nt||$)&&(Ae.isEqual(_,i)&&st?(le(void 0),nt?.(void 0)):(le(i),nt?.(i)))},onMouseMove:rt=>{d(i),te(rt.clientY),ft(rt.clientX)},onMouseLeave:()=>{d(void 0),ft(void 0),te(void 0),xt?.(void 0)},exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:0,y:q(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:at:.85},whileInView:{x:0,y:q(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:at:.85,transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:[i.qualitativeRange?i.qualitativeRange.map((rt,xe)=>s.jsxRuntimeExports.jsx(bt.motion.rect,{exit:{width:0,x:r(0),transition:{duration:x.duration}},variants:{initial:{x:r(0),width:0,fill:h[xe]},whileInView:{x:r(xe===0?0:pe.sum(i.qualitativeRange.filter((ge,be)=>be<xe&&ge))),width:r(rt),fill:h[xe],transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial",y:0,height:q.bandwidth()},xe)):null,i.target&&S==="background"?s.jsxRuntimeExports.jsx(bt.motion.rect,{y:0,x:i.target>=0?r(0):r(i.target),height:q.bandwidth(),exit:{width:0,x:r(0),fill:Q,transition:{duration:x.duration}},variants:{initial:{x:r(0),fill:Q,width:0},whileInView:{x:i.target>=0?r(0):r(i.target),fill:Q,width:i.target>=0?r(i.target)-r(0):r(0)-r(i.target),transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.size?s.jsxRuntimeExports.jsx(bt.motion.rect,{y:q.bandwidth()*((1-o)/2),style:{fill:k},height:q.bandwidth()*o,exit:{width:0,x:r(0),transition:{duration:x.duration}},variants:{initial:{x:r(0),width:0},whileInView:{x:i.size>=0?r(0):r(i.size),width:i.size>=0?r(i.size)-r(0):r(0)-r(i.size),transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.target&&S==="line"?s.jsxRuntimeExports.jsx(bt.motion.rect,{y:0,height:q.bandwidth(),width:D,exit:{opacity:0,x:r(0),fill:Q,transition:{duration:x.duration}},variants:{initial:{x:r(0),opacity:0,fill:Q},whileInView:{x:r(i.target)-D/2,opacity:1,fill:Q,transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,re?s.jsxRuntimeExports.jsx(Se.YAxesLabels,{value:`${i.label}`.length<ne?`${i.label}`:`${`${i.label}`.substring(0,ne)}...`,y:0,x:(i.size||0)<0?r(0):0-m.left,width:(i.size||0)<0?Ft-r(0):r(0)+m.left,height:q.bandwidth(),alignment:i.size&&i.size<0?"left":"right",style:a?.yAxis?.labels,className:c?.yAxis?.labels,animate:x,isInView:F}):null,ie?s.jsxRuntimeExports.jsx(bt.motion.text,{y:q.bandwidth()/2,style:{textAnchor:i.size&&i.size<0?"end":"start",...a?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!Mt&&k.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",c?.graphObjectValues),dx:i.size&&i.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:x.duration}},variants:{initial:{x:r(0),opacity:0,fill:Mt||k},whileInView:{x:i.size?r(i.size):r(0),opacity:1,fill:Mt||k,transition:{duration:x.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:je.numberFormattingFunction(i.size,_t,Z,Dt,St)}):null]},i.label)),I=wt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:wt.map((i,rt)=>s.jsxRuntimeExports.jsx(Ve.RefLineX,{text:i.text,color:i.color,x:r(i.value),y1:0-m.top,y2:et+m.bottom,textSide:r(i.value)>Rt*.75||Ut?"left":"right",classNames:i.classNames,styles:i.styles,animate:x,isInView:F},rt))}):null,t[27]=x,t[28]=K,t[29]=k,t[30]=Kt,t[31]=c?.graphObjectValues,t[32]=c?.xAxis?.gridLines,t[33]=c?.xAxis?.labels,t[34]=c?.xAxis?.title,t[35]=c?.yAxis?.axis,t[36]=c?.yAxis?.labels,t[37]=O,t[38]=n,t[39]=$,t[40]=at,t[41]=et,t[42]=Rt,t[43]=Zt,t[44]=g,t[45]=F,t[46]=T,t[47]=m.bottom,t[48]=m.left,t[49]=m.top,t[50]=jt,t[51]=o,t[52]=Bt,t[53]=_,t[54]=_t,t[55]=f,t[56]=nt,t[57]=xt,t[58]=Z,t[59]=Dt,t[60]=h,t[61]=wt,t[62]=st,t[63]=Ut,t[64]=re,t[65]=Qt,t[66]=ie,t[67]=a?.graphObjectValues,t[68]=a?.xAxis?.gridLines,t[69]=a?.xAxis?.labels,t[70]=a?.xAxis?.title,t[71]=a?.yAxis?.axis,t[72]=a?.yAxis?.labels,t[73]=St,t[74]=Q,t[75]=D,t[76]=S,t[77]=Pt,t[78]=ne,t[79]=Mt,t[80]=Ft,t[81]=Ht,t[82]=N,t[83]=E,t[84]=U,t[85]=B,t[86]=I,t[87]=P,t[88]=G,t[89]=v,t[90]=M,t[91]=A,t[92]=z,t[93]=C,t[94]=w,t[95]=j,t[96]=X}else E=t[83],U=t[84],B=t[85],I=t[86],P=t[87],G=t[88],v=t[89],M=t[90],A=t[91],z=t[92],C=t[93],w=t[94],j=t[95],X=t[96];let Y;t[111]!==E||t[112]!==B||t[113]!==I?(Y=s.jsxRuntimeExports.jsxs(E,{children:[B,I]}),t[111]=E,t[112]=B,t[113]=I,t[114]=Y):Y=t[114];let H;t[115]!==O?(H=O.filter(gi).map(pi),t[115]=O,t[116]=H):H=t[116];let W;t[117]!==P||t[118]!==G||t[119]!==v||t[120]!==M||t[121]!==A||t[122]!==Y||t[123]!==H?(W=s.jsxRuntimeExports.jsxs("g",{transform:P,children:[G,v,M,A,Y,H]}),t[117]=P,t[118]=G,t[119]=v,t[120]=M,t[121]=A,t[122]=Y,t[123]=H,t[124]=W):W=t[124];let L;t[125]!==U||t[126]!==z||t[127]!==C||t[128]!==w||t[129]!==j||t[130]!==X||t[131]!==W?(L=s.jsxRuntimeExports.jsx(U,{width:z,height:C,viewBox:w,direction:j,ref:X,children:W}),t[125]=U,t[126]=z,t[127]=C,t[128]=w,t[129]=j,t[130]=X,t[131]=W,t[132]=L):L=t[132];let lt;t[133]!==c?.tooltip||t[134]!==tt||t[135]!==At||t[136]!==Xt||t[137]!==a?.tooltip||t[138]!==ct?(lt=Xt&&ct&&tt&&At?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:Xt,body:ct,xPos:tt,yPos:At,backgroundStyle:a?.tooltip,className:c?.tooltip}):null,t[133]=c?.tooltip,t[134]=tt,t[135]=At,t[136]=Xt,t[137]=a?.tooltip,t[138]=ct,t[139]=lt):lt=t[139];let it;t[140]!==c?.modal||t[141]!==$||t[142]!==_?(it=$&&_!==void 0?s.jsxRuntimeExports.jsx(Ne.DetailsModal,{body:$,data:_,setData:le,className:c?.modal}):null,t[140]=c?.modal,t[141]=$,t[142]=_,t[143]=it):it=t[143];let u;return t[144]!==L||t[145]!==lt||t[146]!==it?(u=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[L,lt,it]}),t[144]=L,t[145]=lt,t[146]=it,t[147]=u):u=t[147],u}function pi(e){return e.layer}function gi(e){return e.position==="after"}function bi(e){return e.layer}function yi(e){return e.position==="before"}function vi(e){return e!==0}function wi(e){return e!==0}function ji(e){return`${e.id}`}function Mi(e){return e.target}function Ai(e){return!p.checkIfNullOrUndefined(e.target)}function Ri(e){return e.target}function ki(e){return!p.checkIfNullOrUndefined(e.target)}function Oi(e){return e.size}function Vi(e){return!p.checkIfNullOrUndefined(e.size)}function Ni(e){return e.size}function Ei(e){return!p.checkIfNullOrUndefined(e.size)}function Ii(e){return pe.sum((e.qualitativeRange||[]).filter(zi))||0}function zi(e){return!p.checkIfNullOrUndefined(e)}function Ci(e){return e.target}function Li(e){return!p.checkIfNullOrUndefined(e.target)}function qi(e){return e.target}function Ti(e){return!p.checkIfNullOrUndefined(e.target)}function $i(e){return e.size}function Si(e){return!p.checkIfNullOrUndefined(e.size)}function Di(e){return e.size}function Fi(e){return!p.checkIfNullOrUndefined(e.size)}function Ui(e){const t=s.compilerRuntimeExports.c(95),{data:n,graphTitle:yt,barColor:Jt,barPadding:$t,showTicks:vt,leftMargin:k,rightMargin:St,topMargin:Dt,bottomMargin:Kt,truncateBy:ie,showLabels:Qt,showValues:ne,backgroundColor:Ft,suffix:Zt,prefix:re,sources:ct,graphDescription:xt,height:wt,width:g,footNote:mt,colorDomain:J,colorLegendTitle:nt,padding:T,relativeHeight:Ut,tooltip:jt,onSeriesMouseOver:Bt,refValues:st,showColorScale:$,graphID:K,maxValue:Mt,minValue:f,highlightedDataPoints:a,onSeriesMouseClick:c,valueColor:S,orientation:Q,styles:h,classNames:o,qualitativeRangeColors:x,targetColor:at,filterNA:Z,targetStyle:O,measureBarWidthFactor:_t,animate:D,dimmedOpacity:Pt,precision:se,customLayers:Gt,naLabel:ue,graphDownload:ae,dataDownload:V,language:F,theme:Xt,sortData:d,labelOrder:_,minHeight:le,maxBarThickness:tt,maxNumberOfBars:ft,minBarThickness:At,ariaLabel:te,resetSelectionOnDoubleClick:ee,detailsOnClick:Yt,barAxisTitle:m,noOfTicks:Rt,targetLineThickness:et}=e,kt=Jt===void 0?we.Colors.primaryColors["blue-600"]:Jt,Ot=$t===void 0?.25:$t,Vt=vt===void 0?!0:vt,Nt=ie===void 0?999:ie,Et=Qt===void 0?!0:Qt,It=ne===void 0?!0:ne,zt=Ft===void 0?!1:Ft,Ht=Zt===void 0?"":Zt,Ct=re===void 0?"":re,Lt=$===void 0?!0:$;let dt;t[0]!==a?(dt=a===void 0?[]:a,t[0]=a,t[1]=dt):dt=t[1];const qt=dt,y=Q===void 0?"vertical":Q,N=at===void 0?we.Colors.light.grays["gray-700"]:at,E=Z===void 0?!0:Z,U=O===void 0?"line":O,B=_t===void 0?.4:_t,I=D===void 0?!1:D,P=Pt===void 0?.3:Pt,G=se===void 0?2:se;let v;t[2]!==Gt?(v=Gt===void 0?[]:Gt,t[2]=Gt,t[3]=v):v=t[3];const M=v,A=ue===void 0?"NA":ue,z=ae===void 0?!1:ae,C=V===void 0?!1:V,w=F===void 0?"en":F,j=Xt===void 0?"light":Xt,X=le===void 0?0:le,Y=ee===void 0?!0:ee,H=Rt===void 0?5:Rt,W=et===void 0?2:et,[L,lt]=ut.useState(0),[it,u]=ut.useState(0),Tt=ut.useRef(null),me=ut.useRef(null),r=y==="horizontal"?hi:Pe;let R,q;t[4]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{const b=new ResizeObserver(gt=>{lt(gt[0].target.clientWidth||620),u(gt[0].target.clientHeight||480)});return Tt.current&&b.observe(Tt.current),()=>b.disconnect()},q=[],t[4]=R,t[5]=q):(R=t[4],q=t[5]),ut.useEffect(R,q);const fe=o?.graphContainer,ce=h?.graphContainer;let ht;t[6]!==o?.description||t[7]!==o?.title||t[8]!==n||t[9]!==C||t[10]!==xt||t[11]!==z||t[12]!==yt||t[13]!==h?.description||t[14]!==h?.title||t[15]!==g?(ht=yt||xt||z||C?s.jsxRuntimeExports.jsx(Ue.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:o?.title,description:o?.description},graphTitle:yt,graphDescription:xt,width:g,graphDownload:z?me:void 0,dataDownload:C?n.map(Hi).filter(Yi).length>0?n.map(Xi).filter(Gi):n.filter(Pi):null}):null,t[6]=o?.description,t[7]=o?.title,t[8]=n,t[9]=C,t[10]=xt,t[11]=z,t[12]=yt,t[13]=h?.description,t[14]=h?.title,t[15]=g,t[16]=ht):ht=t[16];let ot;t[17]!==r||t[18]!==I||t[19]!==m||t[20]!==kt||t[21]!==Ot||t[22]!==Kt||t[23]!==o||t[24]!==J||t[25]!==nt||t[26]!==M||t[27]!==n||t[28]!==Yt||t[29]!==P||t[30]!==E||t[31]!==qt||t[32]!==_||t[33]!==w||t[34]!==k||t[35]!==tt||t[36]!==ft||t[37]!==Mt||t[38]!==B||t[39]!==At||t[40]!==f||t[41]!==A||t[42]!==H||t[43]!==c||t[44]!==Bt||t[45]!==y||t[46]!==G||t[47]!==Ct||t[48]!==x||t[49]!==st||t[50]!==Y||t[51]!==St||t[52]!==Lt||t[53]!==Et||t[54]!==Vt||t[55]!==It||t[56]!==d||t[57]!==h||t[58]!==Ht||t[59]!==it||t[60]!==L||t[61]!==N||t[62]!==W||t[63]!==U||t[64]!==j||t[65]!==jt||t[66]!==Dt||t[67]!==Nt||t[68]!==S||t[69]!==g?(ot=n.length===0?s.jsxRuntimeExports.jsx(De.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Lt&&n.filter(Bi).length!==0&&J?s.jsxRuntimeExports.jsx(Be.ColorLegend,{width:g,colorLegendTitle:nt,colors:x||we.Colors[j].sequentialColors.positiveColorsx10,colorDomain:J,showNAColor:!1,className:o?.colorLegend}):null,s.jsxRuntimeExports.jsx(Me.GraphArea,{ref:Tt,children:L&&it?s.jsxRuntimeExports.jsx(r,{data:d?Le.orderBy(n.filter(b=>E?!p.checkIfNullOrUndefined(b.size):b),[b=>b.size===void 0?d==="asc"?(y==="horizontal"?1:-1)*(1/0):(y==="horizontal"?-1:1)*(1/0):b.size],[d]).filter((b,gt)=>ft?gt<ft:!0):n.filter(b=>E?!p.checkIfNullOrUndefined(b.size):b).filter((b,gt)=>ft?gt<ft:!0),barColor:kt,targetColor:N,width:L,refValues:st,height:it,suffix:Ht,prefix:Ct,barPadding:Ot,showLabels:Et,showValues:It,showTicks:Vt,truncateBy:Nt,leftMargin:k,rightMargin:St,qualitativeRangeColors:x||we.Colors[j].sequentialColors.positiveColorsx10,topMargin:Dt,bottomMargin:Kt,tooltip:jt,onSeriesMouseOver:Bt,maxValue:Mt,minValue:f,highlightedDataPoints:qt,onSeriesMouseClick:c,labelOrder:_,maxBarThickness:tt,minBarThickness:At,resetSelectionOnDoubleClick:Y,detailsOnClick:Yt,barAxisTitle:m,noOfTicks:H,valueColor:S,styles:h,classNames:o,targetStyle:U,dimmedOpacity:P,measureBarWidthFactor:B,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},precision:G,customLayers:M,naLabel:A,targetLineThickness:W,rtl:w==="ar"||w==="he"}):null})]}),t[17]=r,t[18]=I,t[19]=m,t[20]=kt,t[21]=Ot,t[22]=Kt,t[23]=o,t[24]=J,t[25]=nt,t[26]=M,t[27]=n,t[28]=Yt,t[29]=P,t[30]=E,t[31]=qt,t[32]=_,t[33]=w,t[34]=k,t[35]=tt,t[36]=ft,t[37]=Mt,t[38]=B,t[39]=At,t[40]=f,t[41]=A,t[42]=H,t[43]=c,t[44]=Bt,t[45]=y,t[46]=G,t[47]=Ct,t[48]=x,t[49]=st,t[50]=Y,t[51]=St,t[52]=Lt,t[53]=Et,t[54]=Vt,t[55]=It,t[56]=d,t[57]=h,t[58]=Ht,t[59]=it,t[60]=L,t[61]=N,t[62]=W,t[63]=U,t[64]=j,t[65]=jt,t[66]=Dt,t[67]=Nt,t[68]=S,t[69]=g,t[70]=ot):ot=t[70];let pt;t[71]!==o?.footnote||t[72]!==o?.source||t[73]!==mt||t[74]!==ct||t[75]!==h?.footnote||t[76]!==h?.source||t[77]!==g?(pt=ct||mt?s.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:ct,footNote:mt,width:g}):null,t[71]=o?.footnote,t[72]=o?.source,t[73]=mt,t[74]=ct,t[75]=h?.footnote,t[76]=h?.source,t[77]=g,t[78]=pt):pt=t[78];let Wt;return t[79]!==te||t[80]!==zt||t[81]!==K||t[82]!==wt||t[83]!==w||t[84]!==X||t[85]!==T||t[86]!==Ut||t[87]!==fe||t[88]!==ce||t[89]!==ht||t[90]!==ot||t[91]!==pt||t[92]!==j||t[93]!==g?(Wt=s.jsxRuntimeExports.jsxs(Me.GraphContainer,{className:fe,style:ce,id:K,ref:me,"aria-label":te,backgroundColor:zt,theme:j,language:w,minHeight:X,width:g,height:wt,relativeHeight:Ut,padding:T,children:[ht,ot,pt]}),t[79]=te,t[80]=zt,t[81]=K,t[82]=wt,t[83]=w,t[84]=X,t[85]=T,t[86]=Ut,t[87]=fe,t[88]=ce,t[89]=ht,t[90]=ot,t[91]=pt,t[92]=j,t[93]=g,t[94]=Wt):Wt=t[94],Wt}function Bi(e){return e.qualitativeRange}function Pi(e){return e!==void 0}function Gi(e){return e!==void 0}function Xi(e){return e.data}function Yi(e){return e!==void 0}function Hi(e){return e.data}exports.BulletChart=Ui;
2
2
  //# sourceMappingURL=BulletChart.cjs.map