@undp/data-viz 2.3.19 → 2.4.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 (95) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +1360 -1363
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.cjs.map +1 -1
  7. package/dist/BeeSwarmChart.js +302 -305
  8. package/dist/BeeSwarmChart.js.map +1 -1
  9. package/dist/BiVariateChoroplethMap.cjs +1 -1
  10. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  11. package/dist/BiVariateChoroplethMap.js +4 -4
  12. package/dist/BiVariateChoroplethMap.js.map +1 -1
  13. package/dist/BulletChart.cjs +1 -1
  14. package/dist/BulletChart.cjs.map +1 -1
  15. package/dist/BulletChart.js +591 -594
  16. package/dist/BulletChart.js.map +1 -1
  17. package/dist/ChoroplethMap.cjs +1 -1
  18. package/dist/ChoroplethMap.cjs.map +1 -1
  19. package/dist/ChoroplethMap.js +4 -4
  20. package/dist/ChoroplethMap.js.map +1 -1
  21. package/dist/CirclePackingGraph.cjs +1 -1
  22. package/dist/CirclePackingGraph.js +1 -1
  23. package/dist/DotDensityMap.cjs +1 -1
  24. package/dist/DotDensityMap.cjs.map +1 -1
  25. package/dist/DotDensityMap.js +255 -258
  26. package/dist/DotDensityMap.js.map +1 -1
  27. package/dist/DumbbellChart.cjs +1 -1
  28. package/dist/DumbbellChart.cjs.map +1 -1
  29. package/dist/DumbbellChart.js +553 -556
  30. package/dist/DumbbellChart.js.map +1 -1
  31. package/dist/{GraphEl-Dorm_qQE.js → GraphEl-B73N4RIA.js} +2 -2
  32. package/dist/{GraphEl-Dorm_qQE.js.map → GraphEl-B73N4RIA.js.map} +1 -1
  33. package/dist/{GraphEl-D8WRC8-j.cjs → GraphEl-Lt1og0C-.cjs} +2 -2
  34. package/dist/{GraphEl-D8WRC8-j.cjs.map → GraphEl-Lt1og0C-.cjs.map} +1 -1
  35. package/dist/GriddedGraphs.cjs +1 -1
  36. package/dist/GriddedGraphs.js +1 -1
  37. package/dist/Histogram.cjs +1 -1
  38. package/dist/Histogram.js +1 -1
  39. package/dist/HybridMap.cjs +1 -1
  40. package/dist/HybridMap.cjs.map +1 -1
  41. package/dist/HybridMap.js +310 -313
  42. package/dist/HybridMap.js.map +1 -1
  43. package/dist/MultiLineAltChart.cjs +1 -1
  44. package/dist/MultiLineAltChart.cjs.map +1 -1
  45. package/dist/MultiLineAltChart.js +269 -272
  46. package/dist/MultiLineAltChart.js.map +1 -1
  47. package/dist/MultiLineChart.cjs +1 -1
  48. package/dist/MultiLineChart.cjs.map +1 -1
  49. package/dist/MultiLineChart.js +319 -322
  50. package/dist/MultiLineChart.js.map +1 -1
  51. package/dist/RadarChart.cjs +1 -1
  52. package/dist/RadarChart.cjs.map +1 -1
  53. package/dist/RadarChart.js +3 -3
  54. package/dist/RadarChart.js.map +1 -1
  55. package/dist/SankeyChart.cjs +1 -1
  56. package/dist/SankeyChart.cjs.map +1 -1
  57. package/dist/SankeyChart.js +274 -280
  58. package/dist/SankeyChart.js.map +1 -1
  59. package/dist/ScatterPlot.cjs +1 -1
  60. package/dist/ScatterPlot.cjs.map +1 -1
  61. package/dist/ScatterPlot.js +341 -344
  62. package/dist/ScatterPlot.js.map +1 -1
  63. package/dist/SingleGraphDashboard.cjs +1 -1
  64. package/dist/SingleGraphDashboard.js +1 -1
  65. package/dist/SlopeChart.cjs +1 -1
  66. package/dist/SlopeChart.cjs.map +1 -1
  67. package/dist/SlopeChart.js +251 -254
  68. package/dist/SlopeChart.js.map +1 -1
  69. package/dist/StripChart.cjs +1 -1
  70. package/dist/StripChart.cjs.map +1 -1
  71. package/dist/StripChart.js +292 -295
  72. package/dist/StripChart.js.map +1 -1
  73. package/dist/ThreeDGlobe.cjs +1 -1
  74. package/dist/ThreeDGlobe.cjs.map +1 -1
  75. package/dist/ThreeDGlobe.js +3 -3
  76. package/dist/ThreeDGlobe.js.map +1 -1
  77. package/dist/TreeMapGraph.cjs +1 -1
  78. package/dist/TreeMapGraph.cjs.map +1 -1
  79. package/dist/TreeMapGraph.js +196 -199
  80. package/dist/TreeMapGraph.js.map +1 -1
  81. package/dist/WaterfallChart.cjs +1 -1
  82. package/dist/WaterfallChart.cjs.map +1 -1
  83. package/dist/WaterfallChart.js +274 -277
  84. package/dist/WaterfallChart.js.map +1 -1
  85. package/dist/index-B0Awa_de.js +377 -0
  86. package/dist/index-B0Awa_de.js.map +1 -0
  87. package/dist/index-CP8cmNzt.cjs +2 -0
  88. package/dist/index-CP8cmNzt.cjs.map +1 -0
  89. package/dist/index.cjs +1 -1
  90. package/dist/index.js +1 -1
  91. package/package.json +1 -1
  92. package/dist/index-Bdo_HXb_.cjs +0 -2
  93. package/dist/index-Bdo_HXb_.cjs.map +0 -1
  94. package/dist/index-CGrBpeUa.js +0 -380
  95. package/dist/index-CGrBpeUa.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"HybridMap.js","sources":["../node_modules/@undp/design-system-react/dist/Separator.js","../src/Components/Graphs/Maps/HybridMap/Graph.tsx","../src/Components/Graphs/Maps/HybridMap/index.tsx"],"sourcesContent":["import { j as v } from \"./jsx-runtime-tc70JA_2.js\";\nimport { c as N } from \"./compiler-runtime-BNHg76kC.js\";\nimport * as R from \"react\";\nimport g from \"react\";\nimport { P as x } from \"./index-DEx84bLj.js\";\nimport { c as O } from \"./utils-D_Pof5Gy.js\";\nvar h = \"Separator\", f = \"horizontal\", E = [\"horizontal\", \"vertical\"], y = R.forwardRef((i, s) => {\n const { decorative: r, orientation: a = f, ...o } = i, t = P(a) ? a : f, m = r ? { role: \"none\" } : { \"aria-orientation\": t === \"vertical\" ? t : void 0, role: \"separator\" };\n return /* @__PURE__ */ v.jsx(\n x.div,\n {\n \"data-orientation\": t,\n ...m,\n ...o,\n ref: s\n }\n );\n});\ny.displayName = h;\nfunction P(i) {\n return E.includes(i);\n}\nvar u = y;\nconst T = g.forwardRef((i, s) => {\n const r = N.c(14);\n let a, o, t, e;\n r[0] !== i ? ({\n className: a,\n variant: t,\n orientation: e,\n ...o\n } = i, r[0] = i, r[1] = a, r[2] = o, r[3] = t, r[4] = e) : (a = r[1], o = r[2], t = r[3], e = r[4]);\n const m = t === void 0 ? \"dark\" : t, l = e === void 0 ? \"horizontal\" : e, c = l === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\", d = m === \"dark\" ? \"bg-primary-gray-600 dark:bg-primary-gray-200\" : \"bg-primary-gray-400 dark:bg-primary-gray-550\";\n let n;\n r[5] !== a || r[6] !== c || r[7] !== d ? (n = O(c, d, a), r[5] = a, r[6] = c, r[7] = d, r[8] = n) : n = r[8];\n let p;\n return r[9] !== l || r[10] !== o || r[11] !== s || r[12] !== n ? (p = /* @__PURE__ */ v.jsx(u, { ...o, ref: s, orientation: l, className: n }), r[9] = l, r[10] = o, r[11] = s, r[12] = n, r[13] = p) : p = r[13], p;\n});\nT.displayName = u.displayName;\nexport {\n T as Separator\n};\n//# sourceMappingURL=Separator.js.map\n","import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleOrdinal, scaleSqrt, scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { Separator } from '@undp/design-system-react/Separator';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n HybridMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { checkIfNullOrUndefined, numberFormattingFunction } from '@/Utils';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: HybridMapDataType[];\r\n mapData: FeatureCollection;\r\n colorDomain: (string | number)[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n mapColorLegendTitle?: string;\r\n categorical: boolean;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n dotColor: string;\r\n highlightedIds: string[];\r\n mapProperty: string;\r\n dotLegendTitle?: string;\r\n dotBorderColor?: string;\r\n labelColor: string;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n locale: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n mapColorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n categorical,\r\n dotColor,\r\n collapseColorScaleByDefault,\r\n highlightedIds,\r\n mapProperty,\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n locale,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) 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 <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data\r\n .filter(d => d.id)\r\n .map(d => {\r\n const index = formattedMapData.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 if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n className='undp-map-shapes'\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 as string) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\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={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {data\r\n .filter(d => !checkIfNullOrUndefined(d.lat) && !checkIfNullOrUndefined(d.long))\r\n .map(d => {\r\n const labelPosMultiplier =\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0] >\r\n 0.8 * width\r\n ? -1\r\n : 1;\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity:\r\n highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0]\r\n },${(projection([d.long as number, d.lat as number]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x:\r\n labelPosMultiplier *\r\n (!radiusScale ? radius : radiusScale(d.radius || 0)),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x:\r\n labelPosMultiplier *\r\n (!radiusScale ? radius : radiusScale(d.radius || 0)),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: labelPosMultiplier === -1 ? 'end' : 'start',\r\n fill: labelColor || '#000',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={labelPosMultiplier * 4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {dotLegendTitle && dotLegendTitle !== '' ? (\r\n <>\r\n <div className='flex items-center gap-2'>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{ backgroundColor: dotColor }}\r\n />\r\n <P\r\n size='xs'\r\n marginBottom='none'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {dotLegendTitle}\r\n </P>\r\n </div>\r\n <Spacer size='xl' />\r\n <Separator />\r\n <Spacer size='xl' />\r\n </>\r\n ) : null}\r\n {mapColorLegendTitle && mapColorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {mapColorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(\r\n d as number,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n locale,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n HybridMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n ScaleDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { getJenks, getUniqValue } from '@/Utils';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects for dot density map*/\r\n data: HybridMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string[];\r\n /** Domain of colors for the graph for the choropleth map */\r\n colorDomain?: number[] | string[];\r\n /** Title for the legend for the dot density scale */\r\n dotLegendTitle?: string;\r\n /** Title for the color legend for the color scale */\r\n mapColorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Color of the dots in the dot density map */\r\n dotColor?: string;\r\n /** Border color of the dots in the dot density map */\r\n dotBorderColor?: string;\r\n /** Color of the labels */\r\n labelColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Scale for the colors of the choropleth map */\r\n choroplethScaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** 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 /** 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 /** Locale for number formatting. Must matches what `Intl.NumberFormat` expects. */\r\n locale?: string;\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 HybridMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n mapColorLegendTitle,\r\n colorDomain,\r\n choroplethScaleType = 'threshold',\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n dotColor = Colors.primaryColors['blue-600'],\r\n highlightedIds = [],\r\n mapProperty = 'ISO3',\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor = Colors.primaryColors['blue-600'],\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n locale = 'en',\r\n mapOverlay,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n const domain =\r\n colorDomain ||\r\n (choroplethScaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n dotColor={dotColor}\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (choroplethScaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapColorLegendTitle={mapColorLegendTitle}\r\n radius={radius}\r\n categorical={choroplethScaleType === 'categorical'}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n highlightedIds={highlightedIds}\r\n mapProperty={mapProperty}\r\n dotLegendTitle={dotLegendTitle}\r\n dotBorderColor={dotBorderColor}\r\n labelColor={labelColor}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n locale={locale}\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":["h","f","E","y","R","i","s","r","a","o","t","P","m","v","x","u","T","g","N","e","c","d","n","O","p","Graph","props","data","colors","mapData","mapColorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","categorical","dotColor","collapseColorScaleByDefault","highlightedIds","mapProperty","dotLegendTitle","dotBorderColor","labelColor","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","locale","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","length","scaleSqrt","domain","range","nice","colorScale","scaleOrdinal","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","properties","path","indexOf","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","id","index","findIndex","el","color","checkIfNullOrUndefined","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","pointerEvents","lat","long","labelPosMultiplier","label","fillOpacity","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","Spacer","Separator","numberFormattingFunction","ExpandIcon","DetailsModal","modal","Tooltip","HybridMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","choroplethScaleType","t2","t3","t4","padding","t5","t6","t7","t8","t9","relativeHeight","isWorldMap","t10","t11","t12","graphID","t13","graphDownload","t14","dataDownload","t15","showAntarctica","t16","language","t17","minHeight","t18","theme","t19","ariaLabel","t20","t21","t22","t23","t24","t25","timeline","t26","t27","t28","t29","t30","t31","t32","t33","mapOverlay","Colors","light","graphNoData","grays","t34","t35","t36","t37","enabled","autoplay","showOnlyActiveDate","primaryColors","t38","t39","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t40","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","getUniqValue","getJenks","_temp3","t41","t42","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t43","shape","onUpdateShape","useEffectEvent","t44","shape_0","onUpdateOverlayMapShape","t45","fetchAndParseJSON","then","d_2","t46","t47","d_3","t48","t49","t50","t51","speed","interval","setInterval","clearInterval","t52","t53","getSliderMarks","markObj","t54","graphContainer","t55","t56","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t57","Pause","Play","SliderUI","nextValue","nextValue_0","t58","GraphArea","d_9","format","_temp9","sequentialColors","max","_temp0","_temp1","Spinner","t59","footnote","source","GraphFooter","t60","GraphContainer","d_11","d_10","NAME","d_6","d_5","d_4","d_8","d_7","d_1","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAIA,KAAI,aAAaC,KAAI,cAAcC,KAAI,CAAC,cAAc,UAAU,GAAGC,KAAIC,GAAE,WAAW,CAACC,GAAGC,MAAM;AAChG,QAAM,EAAE,YAAYC,GAAG,aAAaC,IAAIP,IAAG,GAAGQ,EAAC,IAAKJ,GAAGK,IAAIC,GAA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B;AAzUd,SAAAN,GAAAQ,GAAA;AAAA,SA4R8ExW,KAAM;AAAI;AA5RxF,SAAA+V,GAAAU,GAAA;AAAA,SA4RqCzW,EAACW;AAAO;AA5R7C,SAAAiV,GAAAhM,GAAA;AAAA,SAwOsDA,EAAEX,YAAiByN,SAAK;AAAY;AAxO1F,SAAAzB,GAAA0B,GAAA;AAAA,SAuL4B3W,MAAM2D;AAAS;AAvL3C,SAAAqR,GAAA4B,GAAA;AAAA,SAsL6C5W,MAAM2D;AAAS;AAtL5D,SAAAoR,GAAA8B,GAAA;AAAA,SAsLyB7W,EAACM;AAAK;AAtL/B,SAAAwU,GAAAgC,GAAA;AAAA,SAqL2C9W,MAAM2D;AAAS;AArL1D,SAAAkR,GAAAkC,GAAA;AAAA,SAqLuB/W,EAACM;AAAK;AArL7B,SAAAyR,GAAAiF,GAAA;AAAA,SAyFiBhX,EAACP;AAA+B;AAzFjD,SAAA2R,GAAAjS,GAAA8X,GAAA;AAAA,SA2EkB9X,IAAI8X;AAAC;AA3EvB,SAAA/F,GAAAlR,GAAA;AAAA,SAuEgBA,EAAC8Q;AAAK;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"HybridMap.js","sources":["../node_modules/@undp/design-system-react/dist/Separator.js","../src/Components/Graphs/Maps/HybridMap/Graph.tsx","../src/Components/Graphs/Maps/HybridMap/index.tsx"],"sourcesContent":["import { j as v } from \"./jsx-runtime-tc70JA_2.js\";\nimport { c as N } from \"./compiler-runtime-BNHg76kC.js\";\nimport * as R from \"react\";\nimport g from \"react\";\nimport { P as x } from \"./index-DEx84bLj.js\";\nimport { c as O } from \"./utils-D_Pof5Gy.js\";\nvar h = \"Separator\", f = \"horizontal\", E = [\"horizontal\", \"vertical\"], y = R.forwardRef((i, s) => {\n const { decorative: r, orientation: a = f, ...o } = i, t = P(a) ? a : f, m = r ? { role: \"none\" } : { \"aria-orientation\": t === \"vertical\" ? t : void 0, role: \"separator\" };\n return /* @__PURE__ */ v.jsx(\n x.div,\n {\n \"data-orientation\": t,\n ...m,\n ...o,\n ref: s\n }\n );\n});\ny.displayName = h;\nfunction P(i) {\n return E.includes(i);\n}\nvar u = y;\nconst T = g.forwardRef((i, s) => {\n const r = N.c(14);\n let a, o, t, e;\n r[0] !== i ? ({\n className: a,\n variant: t,\n orientation: e,\n ...o\n } = i, r[0] = i, r[1] = a, r[2] = o, r[3] = t, r[4] = e) : (a = r[1], o = r[2], t = r[3], e = r[4]);\n const m = t === void 0 ? \"dark\" : t, l = e === void 0 ? \"horizontal\" : e, c = l === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\", d = m === \"dark\" ? \"bg-primary-gray-600 dark:bg-primary-gray-200\" : \"bg-primary-gray-400 dark:bg-primary-gray-550\";\n let n;\n r[5] !== a || r[6] !== c || r[7] !== d ? (n = O(c, d, a), r[5] = a, r[6] = c, r[7] = d, r[8] = n) : n = r[8];\n let p;\n return r[9] !== l || r[10] !== o || r[11] !== s || r[12] !== n ? (p = /* @__PURE__ */ v.jsx(u, { ...o, ref: s, orientation: l, className: n }), r[9] = l, r[10] = o, r[11] = s, r[12] = n, r[13] = p) : p = r[13], p;\n});\nT.displayName = u.displayName;\nexport {\n T as Separator\n};\n//# sourceMappingURL=Separator.js.map\n","import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useMemo, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n geoPath,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleOrdinal, scaleSqrt, scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spacer } from '@undp/design-system-react/Spacer';\r\nimport { Separator } from '@undp/design-system-react/Separator';\r\nimport { FeatureCollection } from 'geojson';\r\nimport rewind from '@turf/rewind';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n HybridMapDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { ExpandIcon, X } from '@/Components/Icons';\r\nimport { checkIfNullOrUndefined, numberFormattingFunction } from '@/Utils';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: HybridMapDataType[];\r\n mapData: FeatureCollection;\r\n colorDomain: (string | number)[];\r\n width: number;\r\n height: number;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n colors: string[];\r\n mapColorLegendTitle?: string;\r\n categorical: boolean;\r\n radius: number;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n showLabels: boolean;\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedDataPoints?: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n maxRadiusValue: number;\r\n collapseColorScaleByDefault?: boolean;\r\n dotColor: string;\r\n highlightedIds?: string[];\r\n mapProperty: string;\r\n dotLegendTitle?: string;\r\n dotBorderColor?: string;\r\n labelColor: string;\r\n projectionRotate: [number, number] | [number, number, number];\r\n rewindCoordinatesInMapData: boolean;\r\n overlayMapData?: FeatureCollection;\r\n overlayMapBorderColor?: string;\r\n overlayMapBorderWidth?: number;\r\n locale: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colors,\r\n mapData,\r\n mapColorLegendTitle,\r\n colorDomain,\r\n radius,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n showLabels,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n maxRadiusValue,\r\n categorical,\r\n dotColor,\r\n collapseColorScaleByDefault,\r\n highlightedIds,\r\n mapProperty,\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor,\r\n projectionRotate,\r\n rewindCoordinatesInMapData,\r\n overlayMapData,\r\n overlayMapBorderColor,\r\n overlayMapBorderWidth,\r\n locale,\r\n } = props;\r\n const formattedMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData) return mapData;\r\n\r\n return rewind(mapData, { reverse: true }) as FeatureCollection;\r\n }, [mapData, rewindCoordinatesInMapData]);\r\n const formattedOverlayMapData = useMemo(() => {\r\n if (!rewindCoordinatesInMapData || !overlayMapData) return overlayMapData;\r\n\r\n return rewind(overlayMapData, { reverse: true }) as FeatureCollection;\r\n }, [overlayMapData, rewindCoordinatesInMapData]);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const radiusScale =\r\n data.filter(d => d.radius === undefined || d.radius === null).length !== data.length\r\n ? scaleSqrt().domain([0, maxRadiusValue]).range([0.25, radius]).nice()\r\n : undefined;\r\n\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n const bounds = bbox(formattedMapData);\r\n\r\n const center = centerOfMass(formattedMapData);\r\n const lonDiff = (bounds[2] - bounds[0]) * 1.15;\r\n const latDiff = (bounds[3] - bounds[1]) * 1.15;\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate(projectionRotate)\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const pathGenerator = geoPath().projection(projection);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {formattedMapData.features.map((d, i: number) => {\r\n if (!d.properties?.[mapProperty]) return null;\r\n const path = pathGenerator(d);\r\n if (!path) 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\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n <path\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n <AnimatePresence>\r\n {data\r\n .filter(d => d.id)\r\n .map(d => {\r\n const index = formattedMapData.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 if (index === -1) return null;\r\n const path = pathGenerator(formattedMapData.features[index]);\r\n if (!path) return null;\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n className='undp-map-shapes'\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\r\n ? highlightedIds.indexOf(d.id as string) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.path\r\n key={`${d.id}`}\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={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n {formattedOverlayMapData?.features.map((d, i: number) => {\r\n const path = pathGenerator(d);\r\n if (!path) return null;\r\n return (\r\n <g key={i}>\r\n <path\r\n d={path}\r\n style={{\r\n stroke: overlayMapBorderColor || mapBorderColor,\r\n strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n fill: 'none',\r\n pointerEvents: 'none',\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n </g>\r\n );\r\n })}\r\n {data\r\n .filter(d => !checkIfNullOrUndefined(d.lat) && !checkIfNullOrUndefined(d.long))\r\n .map(d => {\r\n const labelPosMultiplier =\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0] >\r\n 0.8 * width\r\n ? -1\r\n : 1;\r\n return (\r\n <motion.g\r\n className='undp-map-dots'\r\n key={d.label || `${d.lat}-${d.long}`}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n transform={`translate(${\r\n (projection([d.long as number, d.lat as number]) as [number, number])[0]\r\n },${(projection([d.long as number, d.lat as number]) as [number, number])[1]})`}\r\n >\r\n <motion.circle\r\n cx={0}\r\n cy={0}\r\n variants={{\r\n initial: {\r\n r: 0,\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n },\r\n whileInView: {\r\n r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n fill: dotColor,\r\n stroke: dotBorderColor || dotColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ r: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fillOpacity: 0.8,\r\n vectorEffect: 'non-scaling-stroke',\r\n }}\r\n />\r\n {showLabels && d.label ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x:\r\n labelPosMultiplier *\r\n (!radiusScale ? radius : radiusScale(d.radius || 0)),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x:\r\n labelPosMultiplier *\r\n (!radiusScale ? radius : radiusScale(d.radius || 0)),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n y={0}\r\n className={cn('text-sm', classNames?.graphObjectValues)}\r\n style={{\r\n textAnchor: labelPosMultiplier === -1 ? 'end' : 'start',\r\n fill: labelColor || '#000',\r\n vectorEffect: 'non-scaling-stroke',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={labelPosMultiplier * 4}\r\n dy={5}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {dotLegendTitle && dotLegendTitle !== '' ? (\r\n <>\r\n <div className='flex items-center gap-2'>\r\n <div\r\n className='w-3 h-3 rounded-full'\r\n style={{ backgroundColor: dotColor }}\r\n />\r\n <P\r\n size='xs'\r\n marginBottom='none'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {dotLegendTitle}\r\n </P>\r\n </div>\r\n <Spacer size='xl' />\r\n <Separator />\r\n <Spacer size='xl' />\r\n </>\r\n ) : null}\r\n {mapColorLegendTitle && mapColorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {mapColorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(\r\n d as number,\r\n undefined,\r\n undefined,\r\n undefined,\r\n undefined,\r\n locale,\r\n )}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <ExpandIcon />\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { FeatureCollection } from 'geojson';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n HybridMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ZoomInteractionTypes,\r\n MapProjectionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n ScaleDataType,\r\n MapOverlayDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { getJenks, getUniqValue } from '@/Utils';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects for dot density map*/\r\n data: HybridMapDataType[];\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for the circle */\r\n colors?: string[];\r\n /** Domain of colors for the graph for the choropleth map */\r\n colorDomain?: number[] | string[];\r\n /** Title for the legend for the dot density scale */\r\n dotLegendTitle?: string;\r\n /** Title for the color legend for the color scale */\r\n mapColorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n mapData?: FeatureCollection | string;\r\n /** Detail if any other map needs to be overlayed over the main map */\r\n mapOverlay?: MapOverlayDataType;\r\n /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n rewindCoordinatesInMapData?: boolean;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n projectionRotate?: [number, number] | [number, number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Color of the dots in the dot density map */\r\n dotColor?: string;\r\n /** Border color of the dots in the dot density map */\r\n dotBorderColor?: string;\r\n /** Color of the labels */\r\n labelColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Scale for the colors of the choropleth map */\r\n choroplethScaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** 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 /** 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 /** Locale for number formatting. Must matches what `Intl.NumberFormat` expects. */\r\n locale?: string;\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 HybridMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n mapColorLegendTitle,\r\n colorDomain,\r\n choroplethScaleType = 'threshold',\r\n radius = 5,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n showLabels = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection = 'naturalEarth',\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n maxRadiusValue,\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n dotColor = Colors.primaryColors['blue-600'],\r\n highlightedIds = [],\r\n mapProperty = 'ISO3',\r\n dotLegendTitle,\r\n dotBorderColor,\r\n labelColor = Colors.primaryColors['blue-600'],\r\n projectionRotate = [0, 0],\r\n rewindCoordinatesInMapData = true,\r\n locale = 'en',\r\n mapOverlay,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const [mapShape, setMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const [overlayMapShape, setOverlayMapShape] = useState<FeatureCollection | undefined>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n const domain =\r\n colorDomain ||\r\n (choroplethScaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n\r\n const onUpdateShape = useEffectEvent((shape: FeatureCollection) => {\r\n setMapShape(shape);\r\n });\r\n\r\n const onUpdateOverlayMapShape = useEffectEvent((shape: FeatureCollection | undefined) => {\r\n setOverlayMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n useEffect(() => {\r\n if (!mapOverlay?.mapData) onUpdateOverlayMapShape(undefined);\r\n if (typeof mapOverlay?.mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapOverlay?.mapData);\r\n fetchData.then(d => {\r\n onUpdateOverlayMapShape(d as FeatureCollection);\r\n });\r\n } else {\r\n onUpdateOverlayMapShape(mapOverlay?.mapData);\r\n }\r\n }, [mapOverlay?.mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n dotColor={dotColor}\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? `${d.date}` ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(el => el.properties?.NAME !== 'Antarctica'),\r\n }\r\n }\r\n overlayMapData={overlayMapShape}\r\n overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (choroplethScaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapColorLegendTitle={mapColorLegendTitle}\r\n radius={radius}\r\n categorical={choroplethScaleType === 'categorical'}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showLabels={showLabels}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n highlightedDataPoints={highlightedDataPoints}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n zoomInteraction={zoomInteraction}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n maxRadiusValue={\r\n !checkIfNullOrUndefined(maxRadiusValue)\r\n ? (maxRadiusValue as number)\r\n : Math.max(...data.map(d => d.radius).filter(d => d !== undefined && d !== null))\r\n }\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n highlightedIds={highlightedIds}\r\n mapProperty={mapProperty}\r\n dotLegendTitle={dotLegendTitle}\r\n dotBorderColor={dotBorderColor}\r\n labelColor={labelColor}\r\n projectionRotate={projectionRotate}\r\n rewindCoordinatesInMapData={rewindCoordinatesInMapData}\r\n locale={locale}\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":["h","f","E","y","R","i","s","r","a","o","t","P","m","v","x","u","T","g","N","e","l","c","d","n","O","p","Graph","props","data","colors","mapData","mapColorLegendTitle","colorDomain","radius","height","width","scale","centerPoint","tooltip","showLabels","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedDataPoints","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","maxRadiusValue","categorical","dotColor","collapseColorScaleByDefault","highlightedIds","mapProperty","dotLegendTitle","dotBorderColor","labelColor","projectionRotate","rewindCoordinatesInMapData","overlayMapData","overlayMapBorderColor","overlayMapBorderWidth","locale","formattedMapData","useMemo","rewind","reverse","formattedOverlayMapData","selectedColor","setSelectedColor","useState","undefined","showLegend","setShowLegend","zoomRef","useRef","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","radiusScale","filter","length","scaleSqrt","domain","range","nice","colorScale","scaleOrdinal","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","pathGenerator","geoPath","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","position","map","layer","features","properties","path","indexOf","stroke","strokeWidth","fill","vectorEffect","AnimatePresence","id","index","findIndex","el","color","checkIfNullOrUndefined","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","pointerEvents","lat","long","labelPosMultiplier","label","fillOpacity","cn","graphObjectValues","textAnchor","colorLegend","X","backgroundColor","display","WebkitLineClamp","WebkitBoxOrient","Spacer","Separator","numberFormattingFunction","ExpandIcon","DetailsModal","modal","Tooltip","HybridMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","choroplethScaleType","t2","t3","t4","padding","t5","t6","t7","t8","t9","relativeHeight","isWorldMap","t10","t11","t12","graphID","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","t24","timeline","t25","t26","t27","t28","t29","t30","t31","t32","mapOverlay","Colors","light","graphNoData","grays","t33","t34","t35","enabled","autoplay","showOnlyActiveDate","primaryColors","t36","t37","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t38","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","overlayMapShape","setOverlayMapShape","graphDiv","graphParentDiv","getUniqValue","getJenks","_temp3","t39","t40","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t41","shape","onUpdateShape","useEffectEvent","t42","shape_0","onUpdateOverlayMapShape","t43","fetchAndParseJSON","then","d_2","t44","t45","d_3","t46","t47","t48","t49","speed","interval","setInterval","clearInterval","t50","t51","getSliderMarks","markObj","t52","graphContainer","t53","t54","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t55","Pause","Play","SliderUI","nextValue","nextValue_0","t56","GraphArea","d_9","format","_temp9","sequentialColors","max","_temp0","_temp1","Spinner","t57","footnote","source","GraphFooter","t58","GraphContainer","d_11","d_10","NAME","d_6","d_5","d_4","d_8","d_7","d_1","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAIA,KAAI,aAAaC,KAAI,cAAcC,KAAI,CAAC,cAAc,UAAU,GAAGC,KAAIC,GAAE,WAAW,CAACC,GAAGC,MAAM;AAChG,QAAM,EAAE,YAAYC,GAAG,aAAaC,IAAIP,IAAG,GAAGQ,EAAC,IAAKJ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B,GAAA;AAAA,SAuL4BzW,MAAM2D;AAAS;AAvL3C,SAAAmR,GAAA4B,GAAA;AAAA,SAsL6C1W,MAAM2D;AAAS;AAtL5D,SAAAkR,GAAA8B,GAAA;AAAA,SAsLyB3W,EAACM;AAAK;AAtL/B,SAAAsU,GAAAgC,GAAA;AAAA,SAqL2C5W,MAAM2D;AAAS;AArL1D,SAAAgR,GAAAkC,GAAA;AAAA,SAqLuB7W,EAACM;AAAK;AArL7B,SAAAuR,GAAAiF,GAAA;AAAA,SAyFiB9W,EAACR;AAA+B;AAzFjD,SAAA0R,GAAAhS,GAAA6X,GAAA;AAAA,SA2EkB7X,IAAI6X;AAAC;AA3EvB,SAAA/F,GAAAhR,GAAA;AAAA,SAuEgBA,EAAC4Q;AAAK;","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-D4pAp7u0.cjs"),L=require("react"),C=require("./parse-xYI9yrvL.cjs"),He=require("./index-Cno4Q0YE.cjs"),Ue=require("./numberFormattingFunction-Cn9R7CM9.cjs"),Pe=require("./Tooltip-Hr46paWP.cjs"),j=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),$e=require("./customArea-BAcQ3pBM.cjs"),Be=require("./AxisTitle-DP_evhbe.cjs"),ze=require("./Axis-BTaS9oPQ.cjs"),Je=require("./XTicksAndGridLines-C5DuC5oY.cjs"),Ke=require("./ReferenceLine-CpU4G01Y.cjs"),Qe=require("./YTicksAndGridLines-DFjm8RCc.cjs"),Ze=require("./index-BuhBhuCq.cjs"),B=require("./Colors.cjs"),Se=require("./uniqBy-O05lp2S5.cjs"),Me=require("./init-DU0ybBc_.cjs"),_e=require("./time-CkcKbhwe.cjs"),tn=require("./linear-CgUCbw9F.cjs"),en=require("./delaunay-rcy0HhZi.cjs"),Ge=require("./line-DaEMhXmx.cjs"),qe=require("./step-BZ3C8QFW.cjs"),nn=require("./select-Bnfk0lJx.cjs"),zt=require("./proxy-CqH8m8IQ.cjs"),on=require("./pointer-Dkq5NV1q.cjs"),rn=require("./use-in-view-dnRv_qqF.cjs"),sn=require("./GraphFooter.cjs"),ln=require("./GraphHeader.cjs"),an=require("./EmptyState-CFmiFPHz.cjs"),cn=require("./ColorLegendWithMouseOver.cjs"),We=require("./GraphContainer-Cul9b74X.cjs"),un=require("./getNoOfTicks-C_1CFXv_.cjs");function fn(e,t){return Array.from(t,r=>e[r])}function mn(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[r]=t;if(r&&r.length!==2||t.length>1){const O=Uint32Array.from(e,(D,u)=>u);return t.length>1?(t=t.map(D=>e.map(D)),O.sort((D,u)=>{for(const s of t){const Et=Ve(s[D],s[u]);if(Et)return Et}})):(r=e.map(r),O.sort((D,u)=>Ve(r[D],r[u]))),fn(e,O)}return e.sort(xn(r))}function xn(e=Me.ascending){if(e===Me.ascending)return Ve;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const O=e(t,r);return O||O===0?O:(e(r,r)===0)-(e(t,t)===0)}}function Ve(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function dn(e){const t=i.compilerRuntimeExports.c(129),{data:r,width:O,height:D,lineColors:u,dateFormat:s,noOfXTicks:Et,rightMargin:it,topMargin:Jt,bottomMargin:rt,suffix:H,prefix:g,leftMargin:E,tooltip:At,onSeriesMouseOver:st,refValues:lt,highlightAreaSettings:Kt,minValue:z,maxValue:kt,highlightedLines:U,animate:l,rtl:J,strokeWidth:q,showDots:fe,annotations:Lt,customHighlightAreaSettings:Qt,yAxisTitle:Dt,noOfYTicks:Zt,minDate:Nt,maxDate:_t,curveType:at,styles:w,colorDomain:A,selectedColor:qt,classNames:R,showLabels:Oe,dimmedOpacity:S,precision:G,naLabel:we,customLayers:K,showHighlightedLinesLabels:be,showDateOnHover:te,locale:M}=e,me=L.useRef(null);let ct;t[0]!==l.amount||t[1]!==l.once?(ct={once:l.once,amount:l.amount},t[0]=l.amount,t[1]=l.once,t[2]=ct):ct=t[2];const f=rn.useInView(me,ct),[T,xe]=L.useState(!1);let ut,St;t[3]!==l.duration||t[4]!==T||t[5]!==f?(ut=()=>{if(f&&!T){const n=setTimeout(()=>{xe(!0)},(l.duration+.5)*1e3);return()=>clearTimeout(n)}},St=[f,T,l.duration],t[3]=l.duration,t[4]=T,t[5]=f,t[6]=ut,t[7]=St):(ut=t[6],St=t[7]),L.useEffect(ut,St);const v=at==="linear"?Ge.curveLinear:at==="step"?qe.curveStep:at==="stepAfter"?qe.stepAfter:at==="stepBefore"?qe.stepBefore:qe.monotoneX;let m;t[8]!==s?(m=n=>({...n,date:C.parse(`${n.date}`,s,new Date)}),t[8]=s,t[9]=m):m=t[9];const h=He.orderBy(r.map(m),["date"],["asc"]).filter(Xn),Ce=Se.uniqBy(h,"label",!0);let Q;t[10]!==s?(Q=n=>C.parse(`${n}`,s,new Date),t[10]=s,t[11]=Q):Q=t[11];const ee=mn(Se.uniqBy(r,"date",!0).map(Q),Fn),[x,ft]=L.useState(void 0),[mt,Z]=L.useState(void 0),[xt,_]=L.useState(void 0),Mt=Dt?E+30:E;let dt;t[12]!==rt||t[13]!==it||t[14]!==Mt||t[15]!==Jt?(dt={top:Jt,bottom:rt,left:Mt,right:it},t[12]=rt,t[13]=it,t[14]=Mt,t[15]=Jt,t[16]=dt):dt=t[16];const p=dt,de=L.useRef(null),he=Ce.map(n=>He.orderBy(h.filter(o=>o.label==n),["date"],["asc"]));let ht;if(t[17]!==s||t[18]!==Kt){let n;t[20]!==s?(n=o=>({...o,coordinates:[o.coordinates[0]===null?null:C.parse(`${o.coordinates[0]}`,s,new Date),o.coordinates[1]===null?null:C.parse(`${o.coordinates[1]}`,s,new Date)]}),t[20]=s,t[21]=n):n=t[21],ht=Kt.map(n),t[17]=s,t[18]=Kt,t[19]=ht}else ht=t[19];const Tt=ht;let pt;if(t[22]!==Qt||t[23]!==s){let n;t[25]!==s?(n=o=>({...o,coordinates:o.coordinates.map((y,Bt)=>Bt%2===0?C.parse(`${y}`,s,new Date):y)}),t[25]=s,t[26]=n):n=t[26],pt=Qt.map(n),t[22]=Qt,t[23]=s,t[24]=pt}else pt=t[24];const pe=pt,d=O-p.left-p.right,N=D-p.top-p.bottom,ne=Nt?C.parse(`${Nt}`,s,new Date):ee[0],ge=_t?C.parse(`${_t}`,s,new Date):ee[ee.length-1],b=j.checkIfNullOrUndefined(z)?Math.min(...h.map(Yn).filter(Wn))?Math.min(...h.map(Gn).filter(Un))>0?0:Math.min(...h.map(Hn).filter(Vn)):0:z,tt=Math.max(...h.map($n).filter(In))?Math.max(...h.map(Tn).filter(Mn)):0,c=_e.time().domain([ne,ge]).range([0,d]);let et;t[27]!==b||t[28]!==z?(et=j.checkIfNullOrUndefined(z)?b:z,t[27]=b,t[28]=z,t[29]=et):et=t[29];let nt;t[30]!==tt||t[31]!==kt?(nt=j.checkIfNullOrUndefined(kt)?tt>0?tt:0:kt,t[30]=tt,t[31]=kt,t[32]=nt):nt=t[32];const a=tn.linear().domain([et,nt]).range([N,0]).nice(),ye=en.Delaunay.from(h.filter(Sn),n=>c(n.date),n=>a(n.y)).voronoi([0,0,d<0?0:d,N<0?0:N]),It=Ge.line().x(n=>c(n.date)).y(n=>a(n.y)).curve(v),oe=a.ticks(Zt),$t=c.ticks(Et);L.useEffect(()=>{const n=y=>{const Bt=h[Me.bisectCenter(h.map(qn),c.invert(on.pointer(y)[0]),0)];ft(Bt||h[h.length-1]),_(y.clientY),Z(y.clientX),st?.(Bt||h[h.length-1])},o=()=>{ft(void 0),Z(void 0),_(void 0)};nn.select(de.current).on("mousemove",n).on("mouseout",o),st?.(void 0)},[c,h,st]);let gt;t[33]!==l||t[34]!==N||t[35]!==d||t[36]!==Tt||t[37]!==f||t[38]!==c?(gt=i.jsxRuntimeExports.jsx(Ze.HighlightArea,{areaSettings:Tt,width:d,height:N,scale:c,animate:l,isInView:f}),t[33]=l,t[34]=N,t[35]=d,t[36]=Tt,t[37]=f,t[38]=c,t[39]=gt):gt=t[39];const yt=w?.yAxis?.gridLines,Vt=w?.yAxis?.labels;let k;t[40]!==yt||t[41]!==Vt?(k={gridLines:yt,labels:Vt},t[40]=yt,t[41]=Vt,t[42]=k):k=t[42];const Ht=R?.yAxis?.gridLines,Ut=R?.yAxis?.labels;let vt;t[43]!==Ht||t[44]!==Ut?(vt={gridLines:Ht,labels:Ut},t[43]=Ht,t[44]=Ut,t[45]=vt):vt=t[45];const Gt=a(b<0?0:b),jt=a(b<0?0:b),Wt=0-E,Yt=d+p.right,Ft=b<0?0:b;let W;t[46]!==M||t[47]!==G||t[48]!==g||t[49]!==H||t[50]!==Ft?(W=Ue.numberFormattingFunction(Ft,void 0,G,g,H,M),t[46]=M,t[47]=G,t[48]=g,t[49]=H,t[50]=Ft,t[51]=W):W=t[51];const ot=0-E,ve=a(b<0?0:b),Ot=tt<0?"1em":-5;let wt;t[52]!==ot||t[53]!==ve||t[54]!==Ot?(wt={x:ot,y:ve,dx:0,dy:Ot},t[52]=ot,t[53]=ve,t[54]=Ot,t[55]=wt):wt=t[55];const Xt=R?.xAxis?.axis,je=R?.yAxis?.labels;let Y;t[56]!==Xt||t[57]!==je?(Y={axis:Xt,label:je},t[56]=Xt,t[57]=je,t[58]=Y):Y=t[58];const ie=w?.xAxis?.axis,bt=w?.yAxis?.labels;let I;t[59]!==ie||t[60]!==bt?(I={axis:ie,label:bt},t[59]=ie,t[60]=bt,t[61]=I):I=t[61];let Ct;t[62]!==Gt||t[63]!==jt||t[64]!==Wt||t[65]!==Yt||t[66]!==W||t[67]!==wt||t[68]!==Y||t[69]!==I?(Ct=i.jsxRuntimeExports.jsx(ze.Axis,{y1:Gt,y2:jt,x1:Wt,x2:Yt,label:W,labelPos:wt,classNames:Y,styles:I}),t[62]=Gt,t[63]=jt,t[64]=Wt,t[65]=Yt,t[66]=W,t[67]=wt,t[68]=Y,t[69]=I,t[70]=Ct):Ct=t[70];const Pt=0-E-15,F=N/2,X=w?.yAxis?.title,P=R?.yAxis?.title;let $;t[71]!==Pt||t[72]!==F||t[73]!==X||t[74]!==P||t[75]!==Dt?($=i.jsxRuntimeExports.jsx(Be.AxisTitle,{x:Pt,y:F,style:X,className:P,text:Dt,rotate90:!0}),t[71]=Pt,t[72]=F,t[73]=X,t[74]=P,t[75]=Dt,t[76]=$):$=t[76];let V;t[77]!==s?(V=n=>C.format(n,s),t[77]=s,t[78]=V):V=t[78];const Rt=$t.map(V),re=$t.map(n=>c(n)),se=w?.xAxis?.gridLines,le=w?.xAxis?.labels;let Re;t[79]!==se||t[80]!==le?(Re={gridLines:se,labels:le},t[79]=se,t[80]=le,t[81]=Re):Re=t[81];const Te=R?.xAxis?.gridLines;let ae;t[82]!==Te?(ae=i.mo("opacity-0",Te),t[82]=Te,t[83]=ae):ae=t[83];const Ie=R?.xAxis?.labels;let ce;t[84]!==Ie?(ce=i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",Ie),t[84]=Ie,t[85]=ce):ce=t[85];let Ee;t[86]!==ae||t[87]!==ce?(Ee={gridLines:ae,labels:ce},t[86]=ae,t[87]=ce,t[88]=Ee):Ee=t[88];let Ae;t[89]!==K?(Ae=K.filter(Ln).map(kn),t[89]=K,t[90]=Ae):Ae=t[90];const Ye=h.filter(gn).map((n,o)=>i.jsxRuntimeExports.jsx("g",{children:i.jsxRuntimeExports.jsx("path",{d:ye.renderCell(h.findIndex(y=>y.label===n.label&&y.date===n.date)),opacity:0,onMouseEnter:y=>{ft(n),_(y.clientY),Z(y.clientX),st?.(n)},onMouseMove:y=>{ft(n),_(y.clientY),Z(y.clientX)},onMouseLeave:()=>{ft(void 0),Z(void 0),_(void 0),st?.(void 0)}})},o));let ke;t[91]!==l||t[92]!==d||t[93]!==f||t[94]!==E||t[95]!==p.right||t[96]!==lt||t[97]!==a?(ke=lt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:lt.map((n,o)=>i.jsxRuntimeExports.jsx(Ke.RefLineY,{text:n.text,color:n.color,y:a(n.value),x1:0-E,x2:d+p.right,classNames:n.classNames,styles:n.styles,animate:l,isInView:f},o))}):null,t[91]=l,t[92]=d,t[93]=f,t[94]=E,t[95]=p.right,t[96]=lt,t[97]=a,t[98]=ke):ke=t[98];let ue;if(t[99]!==l||t[100]!==Lt||t[101]!==s||t[102]!==d||t[103]!==f||t[104]!==p.right||t[105]!==J||t[106]!==c||t[107]!==a){let n;t[109]!==l||t[110]!==s||t[111]!==d||t[112]!==f||t[113]!==p.right||t[114]!==J||t[115]!==c||t[116]!==a?(n=(o,y)=>{const Bt=$e.getLineEndPoint({x:o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0),y:o.yCoordinate?a(o.yCoordinate)+(o.yOffset||0)-8:0+(o.yOffset||0)-8},{x:o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date)):0,y:o.yCoordinate?a(o.yCoordinate):0},j.checkIfNullOrUndefined(o.connectorRadius)?3.5:o.connectorRadius),Fe=o.showConnector?{y1:Bt.y,x1:Bt.x,y2:o.yCoordinate?a(o.yCoordinate)+(o.yOffset||0):0+(o.yOffset||0),x2:o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0),cy:o.yCoordinate?a(o.yCoordinate):0,cx:o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date)):0,circleRadius:j.checkIfNullOrUndefined(o.connectorRadius)?3.5:o.connectorRadius,strokeWidth:o.showConnector===!0?2:Math.min(o.showConnector||0,1)}:void 0,Xe={y:o.yCoordinate?a(o.yCoordinate)+(o.yOffset||0)-8:0+(o.yOffset||0)-8,x:J?0:o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0),width:J?o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0):d+p.right-(o.xCoordinate?c(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0)),maxWidth:o.maxWidth,fontWeight:o.fontWeight,align:o.align};return i.jsxRuntimeExports.jsx($e.Annotation,{color:o.color,connectorsSettings:Fe,labelSettings:Xe,text:o.text,classNames:o.classNames,styles:o.styles,animate:l,isInView:f},y)},t[109]=l,t[110]=s,t[111]=d,t[112]=f,t[113]=p.right,t[114]=J,t[115]=c,t[116]=a,t[117]=n):n=t[117],ue=Lt.map(n),t[99]=l,t[100]=Lt,t[101]=s,t[102]=d,t[103]=f,t[104]=p.right,t[105]=J,t[106]=c,t[107]=a,t[108]=ue}else ue=t[108];let Le;t[118]!==ue?(Le=i.jsxRuntimeExports.jsx("g",{children:ue}),t[118]=ue,t[119]=Le):Le=t[119];let De;t[120]!==K?(De=K.filter(pn).map(hn),t[120]=K,t[121]=De):De=t[121];let Ne;return t[122]!==R?.tooltip||t[123]!==mt||t[124]!==xt||t[125]!==x||t[126]!==w?.tooltip||t[127]!==At?(Ne=x&&At&&mt&&xt?i.jsxRuntimeExports.jsx(Pe.Tooltip,{data:x,body:At,xPos:mt,yPos:xt,backgroundStyle:w?.tooltip,className:R?.tooltip}):null,t[122]=R?.tooltip,t[123]=mt,t[124]=xt,t[125]=x,t[126]=w?.tooltip,t[127]=At,t[128]=Ne):Ne=t[128],i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(zt.motion.svg,{width:`${O}px`,height:`${D}px`,viewBox:`0 0 ${O} ${D}`,direction:"ltr",ref:me,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${p.left},${p.top})`,children:[gt,i.jsxRuntimeExports.jsx($e.CustomArea,{areaSettings:pe,scaleX:c,scaleY:a,animate:l,isInView:f}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(Qe.YTicksAndGridLines,{values:oe.filter(Nn),y:oe.filter(Dn).map(n=>a(n)),x1:0-E,x2:d+p.right,styles:k,classNames:vt,suffix:H,prefix:g,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:G,locale:M}),Ct,$]}),i.jsxRuntimeExports.jsx("g",{children:i.jsxRuntimeExports.jsx(Je.XTicksAndGridLines,{values:Rt,x:re,y1:0,y2:N,styles:Re,classNames:Ee,suffix:H,prefix:g,labelType:"primary",showGridLines:!0,precision:G,locale:M})}),Ae,i.jsxRuntimeExports.jsxs(zt.motion.g,{children:[he.map(n=>i.jsxRuntimeExports.jsxs(zt.motion.g,{exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{opacity:x?n[0].label===x.label?1:S:qt?n[0].color&&u[A.indexOf(n[0].color)]===qt?1:S:U.length!==0?U.indexOf(n[0].label)!==-1?1:S:1},whileInView:{opacity:x?n[0].label===x.label?1:S:qt?n[0].color&&u[A.indexOf(n[0].color)]===qt?1:S:U.length!==0?U.indexOf(n[0].label)!==-1?1:S:1,transition:{duration:l.duration}}},initial:"initial",animate:f?"whileInView":"initial",children:[i.jsxRuntimeExports.jsx(zt.motion.path,{d:It(n.filter(An))||"",style:{fill:"none",strokeWidth:x?n[0].label===x.label?q+Math.max(2,.5*q):q:U.length!==0&&U.indexOf(n[0].label)!==-1?q+Math.max(2,.5*q):q},exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{pathLength:0,d:It(n.filter(En))||"",opacity:1,stroke:r.filter(Rn).length===0?u[0]:n[0].color?u[A.indexOf(n[0].color)]:B.Colors.gray},whileInView:{pathLength:1,d:It(n.filter(Cn))||"",opacity:1,stroke:r.filter(bn).length===0?u[0]:n[0].color?u[A.indexOf(n[0].color)]:B.Colors.gray,transition:{duration:l.duration}}},initial:"initial",animate:f?"whileInView":"initial"}),n.map((o,y)=>i.jsxRuntimeExports.jsx(zt.motion.g,{children:j.checkIfNullOrUndefined(o.y)?null:i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:fe?i.jsxRuntimeExports.jsx(zt.motion.circle,{r:d/n.length<5?0:d/n.length<20?2:4,exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{opacity:0,fill:r.filter(wn).length===0?u[0]:n[0].color?u[A.indexOf(n[0].color)]:B.Colors.gray,cx:c(o.date),cy:a(o.y)},whileInView:{opacity:1,fill:r.filter(On).length===0?u[0]:n[0].color?u[A.indexOf(n[0].color)]:B.Colors.gray,transition:{duration:T?l.duration:.5,delay:T?0:l.duration},cx:c(o.date),cy:a(o.y)}},initial:"initial",animate:f?"whileInView":"initial"}):null})},y)),(U.indexOf(n[0].label)!==-1&&be||x?.label===n[0].label)&&Oe?i.jsxRuntimeExports.jsx(zt.motion.text,{className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{opacity:0,fill:r.filter(jn).length===0?u[0]:n[0].color?u[A.indexOf(n[0].color)]:B.Colors.gray,x:c(n[n.length-1].date),y:a(n[n.length-1].y)},whileInView:{opacity:1,fill:r.filter(vn).length===0?u[0]:n[0].color?u[A.indexOf(n[0].color)]:B.Colors.gray,x:c(n[n.length-1].date),y:a(n[n.length-1].y),transition:{duration:T?l.duration:.5,delay:T?0:l.duration}}},initial:"initial",animate:f?"whileInView":"initial",children:n[0].label}):null]},n[0].label)),x?i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("text",{y:a(x.y)-8,x:c(x.date),className:i.mo("graph-value text-sm font-bold",R?.graphObjectValues),style:{fill:r.filter(yn).length===0?u[0]:x.color?u[A.indexOf(x.color)]:B.Colors.gray,textAnchor:"middle",...w?.graphObjectValues||{}},children:Ue.numberFormattingFunction(x.y,we,G,g,H,M)}),te&&i.jsxRuntimeExports.jsx("text",{y:a(x.y)+20,x:c(x.date),className:i.mo("graph-value text-sm fill-primary-gray-500 dark:fill-primary-gray-400",R?.graphObjectValues),style:{textAnchor:"middle",...w?.graphObjectValues||{}},children:C.format(new Date(x.date),s||"yyyy")})]}):null]}),Ye,ke,Le,De]})}),Ne]})}function hn(e){return e.layer}function pn(e){return e.position==="after"}function gn(e){return!j.checkIfNullOrUndefined(e.y)}function yn(e){return e.color}function vn(e){return e.color}function jn(e){return e.color}function On(e){return e.color}function wn(e){return e.color}function bn(e){return e.color}function Cn(e){return!j.checkIfNullOrUndefined(e.y)}function Rn(e){return e.color}function En(e){return!j.checkIfNullOrUndefined(e.y)}function An(e){return!j.checkIfNullOrUndefined(e.y)}function kn(e){return e.layer}function Ln(e){return e.position==="before"}function Dn(e){return e!==0}function Nn(e){return e!==0}function qn(e){return e.date}function Sn(e){return!j.checkIfNullOrUndefined(e.date)&&!j.checkIfNullOrUndefined(e.y)}function Mn(e){return!j.checkIfNullOrUndefined(e)}function Tn(e){return e.y}function In(e){return!j.checkIfNullOrUndefined(e)}function $n(e){return e.y}function Vn(e){return!j.checkIfNullOrUndefined(e)}function Hn(e){return e.y}function Un(e){return!j.checkIfNullOrUndefined(e)}function Gn(e){return e.y}function Wn(e){return!j.checkIfNullOrUndefined(e)}function Yn(e){return e.y}function Fn(e,t){return Me.ascending(e,t)}function Xn(e){return!j.checkIfNullOrUndefined(e.y)}function Pn(e){const t=i.compilerRuntimeExports.c(109),{data:r,graphTitle:O,showNAColor:D,colors:u,colorDomain:s,suffix:Et,sources:it,prefix:Jt,graphDescription:rt,height:H,width:g,footNote:E,noOfXTicks:At,dateFormat:st,padding:lt,backgroundColor:Kt,leftMargin:z,rightMargin:kt,topMargin:U,bottomMargin:l,showColorScale:J,tooltip:q,relativeHeight:fe,onSeriesMouseOver:Lt,showLabels:Qt,showHighlightedLinesLabels:Dt,refValues:Zt,highlightAreaSettings:Nt,graphID:_t,minValue:at,maxValue:w,highlightedLines:A,graphDownload:qt,dataDownload:R,animate:Oe,language:S,colorLegendTitle:G,minHeight:we,strokeWidth:K,showDots:be,annotations:te,customHighlightAreaSettings:M,theme:me,ariaLabel:ct,yAxisTitle:f,noOfYTicks:T,minDate:xe,maxDate:ut,curveType:St,styles:v,classNames:m,dimmedOpacity:h,precision:Ce,customLayers:Q,naLabel:ee,showDateOnHover:x,locale:ft}=e,mt=D===void 0?!0:D,Z=Et===void 0?"":Et,xt=Jt===void 0?"":Jt,_=At===void 0?10:At,Mt=st===void 0?"yyyy":st,dt=Kt===void 0?!1:Kt,p=z===void 0?30:z,de=kt===void 0?50:kt,he=U===void 0?20:U,ht=l===void 0?25:l,Tt=J===void 0?!0:J,pt=Qt===void 0?!0:Qt,pe=Dt===void 0?!1:Dt;let d;t[0]!==Zt?(d=Zt===void 0?[]:Zt,t[0]=Zt,t[1]=d):d=t[1];const N=d;let ne;t[2]!==Nt?(ne=Nt===void 0?[]:Nt,t[2]=Nt,t[3]=ne):ne=t[3];const ge=ne;let b;t[4]!==A?(b=A===void 0?[]:A,t[4]=A,t[5]=b):b=t[5];const tt=b,c=qt===void 0?!1:qt,et=R===void 0?!1:R,nt=Oe===void 0?!1:Oe,a=S===void 0?"en":S,ye=we===void 0?0:we,It=K===void 0?2:K,oe=be===void 0?!0:be;let $t;t[6]!==te?($t=te===void 0?[]:te,t[6]=te,t[7]=$t):$t=t[7];const gt=$t;let yt;t[8]!==M?(yt=M===void 0?[]:M,t[8]=M,t[9]=yt):yt=t[9];const Vt=yt,k=me===void 0?"light":me,Ht=T===void 0?5:T,Ut=St===void 0?"curve":St,vt=h===void 0?.3:h,Gt=Ce===void 0?2:Ce;let jt;t[10]!==Q?(jt=Q===void 0?[]:Q,t[10]=Q,t[11]=jt):jt=t[11];const Wt=jt,Yt=ee===void 0?"NA":ee,Ft=x===void 0?!1:x,W=ft===void 0?"en":ft,[ot,ve]=L.useState(0),[Ot,wt]=L.useState(0),[Xt,je]=L.useState(void 0),Y=L.useRef(null),ie=L.useRef(null);let bt,I;t[12]===Symbol.for("react.memo_cache_sentinel")?(bt=()=>{const se=new ResizeObserver(le=>{ve(le[0].target.clientWidth||620),wt(le[0].target.clientHeight||480)});return Y.current&&se.observe(Y.current),()=>se.disconnect()},I=[],t[12]=bt,t[13]=I):(bt=t[12],I=t[13]),L.useEffect(bt,I);const Ct=m?.graphContainer,Pt=v?.graphContainer;let F;t[14]!==m?.description||t[15]!==m?.title||t[16]!==r||t[17]!==et||t[18]!==rt||t[19]!==c||t[20]!==O||t[21]!==v?.description||t[22]!==v?.title||t[23]!==g?(F=O||rt||c||et?i.jsxRuntimeExports.jsx(ln.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:m?.title,description:m?.description},graphTitle:O,graphDescription:rt,width:g,graphDownload:c?ie:void 0,dataDownload:et?r.map(to).filter(_n).length>0?r.map(Zn).filter(Qn):r.filter(Kn):null}):null,t[14]=m?.description,t[15]=m?.title,t[16]=r,t[17]=et,t[18]=rt,t[19]=c,t[20]=O,t[21]=v?.description,t[22]=v?.title,t[23]=g,t[24]=F):F=t[24];let X;t[25]!==m?.colorLegend||t[26]!==s||t[27]!==G||t[28]!==u||t[29]!==r||t[30]!==Tt||t[31]!==mt||t[32]!==k||t[33]!==g?(X=Tt&&r.filter(Jn).length!==0&&r.length>0?i.jsxRuntimeExports.jsx(cn.ColorLegendWithMouseOver,{width:g,colorLegendTitle:G,colors:u||B.Colors[k].categoricalColors.colors,colorDomain:s||Se.uniqBy(r,"color",!0),setSelectedColor:je,showNAColor:mt,className:m?.colorLegend}):null,t[25]=m?.colorLegend,t[26]=s,t[27]=G,t[28]=u,t[29]=r,t[30]=Tt,t[31]=mt,t[32]=k,t[33]=g,t[34]=X):X=t[34];let P;t[35]!==r.length?(P=r.length===0&&i.jsxRuntimeExports.jsx(an.EmptyState,{}),t[35]=r.length,t[36]=P):P=t[36];let $;t[37]!==nt||t[38]!==gt||t[39]!==ht||t[40]!==m||t[41]!==s||t[42]!==u||t[43]!==Ut||t[44]!==Vt||t[45]!==Wt||t[46]!==r||t[47]!==Mt||t[48]!==vt||t[49]!==ge||t[50]!==tt||t[51]!==a||t[52]!==p||t[53]!==W||t[54]!==ut||t[55]!==w||t[56]!==xe||t[57]!==at||t[58]!==Yt||t[59]!==_||t[60]!==Ht||t[61]!==Lt||t[62]!==Gt||t[63]!==xt||t[64]!==N||t[65]!==de||t[66]!==Xt||t[67]!==Ft||t[68]!==oe||t[69]!==pe||t[70]!==pt||t[71]!==It||t[72]!==v||t[73]!==Z||t[74]!==Ot||t[75]!==ot||t[76]!==k||t[77]!==q||t[78]!==he||t[79]!==f?($=ot&&Ot&&r.length>0?i.jsxRuntimeExports.jsx(dn,{data:r,lineColors:r.filter(zn).length===0?u?[u]:[B.Colors.primaryColors["blue-600"]]:u||B.Colors[k].categoricalColors.colors,width:ot,height:Ot,dateFormat:Mt,noOfXTicks:_??un.getNoOfTicks(ot),leftMargin:p,rightMargin:de,topMargin:he,bottomMargin:ht,tooltip:q,onSeriesMouseOver:Lt,suffix:Z,prefix:xt,highlightAreaSettings:ge,refValues:N,minValue:at,maxValue:w,highlightedLines:tt,showHighlightedLinesLabels:pe,animate:nt===!0?{duration:.5,once:!0,amount:.5}:nt||{duration:0,once:!0,amount:0},rtl:a==="he"||a==="ar",strokeWidth:It,showDots:oe,annotations:gt,customHighlightAreaSettings:Vt,yAxisTitle:f,noOfYTicks:Ht,minDate:xe,maxDate:ut,curveType:Ut,styles:v,classNames:m,selectedColor:Xt,showLabels:pt,colorDomain:r.filter(Bn).length===0?[]:s||Se.uniqBy(r,"color",!0),dimmedOpacity:vt,precision:Gt,customLayers:Wt,naLabel:Yt,showDateOnHover:Ft,locale:W}):null,t[37]=nt,t[38]=gt,t[39]=ht,t[40]=m,t[41]=s,t[42]=u,t[43]=Ut,t[44]=Vt,t[45]=Wt,t[46]=r,t[47]=Mt,t[48]=vt,t[49]=ge,t[50]=tt,t[51]=a,t[52]=p,t[53]=W,t[54]=ut,t[55]=w,t[56]=xe,t[57]=at,t[58]=Yt,t[59]=_,t[60]=Ht,t[61]=Lt,t[62]=Gt,t[63]=xt,t[64]=N,t[65]=de,t[66]=Xt,t[67]=Ft,t[68]=oe,t[69]=pe,t[70]=pt,t[71]=It,t[72]=v,t[73]=Z,t[74]=Ot,t[75]=ot,t[76]=k,t[77]=q,t[78]=he,t[79]=f,t[80]=$):$=t[80];let V;t[81]!==P||t[82]!==$?(V=i.jsxRuntimeExports.jsxs(We.GraphArea,{ref:Y,children:[P,$]}),t[81]=P,t[82]=$,t[83]=V):V=t[83];let Rt;t[84]!==m?.footnote||t[85]!==m?.source||t[86]!==E||t[87]!==it||t[88]!==v?.footnote||t[89]!==v?.source||t[90]!==g?(Rt=it||E?i.jsxRuntimeExports.jsx(sn.GraphFooter,{styles:{footnote:v?.footnote,source:v?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:it,footNote:E,width:g}):null,t[84]=m?.footnote,t[85]=m?.source,t[86]=E,t[87]=it,t[88]=v?.footnote,t[89]=v?.source,t[90]=g,t[91]=Rt):Rt=t[91];let re;return t[92]!==ct||t[93]!==dt||t[94]!==_t||t[95]!==H||t[96]!==a||t[97]!==ye||t[98]!==lt||t[99]!==fe||t[100]!==Ct||t[101]!==Pt||t[102]!==F||t[103]!==X||t[104]!==V||t[105]!==Rt||t[106]!==k||t[107]!==g?(re=i.jsxRuntimeExports.jsxs(We.GraphContainer,{className:Ct,style:Pt,id:_t,ref:ie,"aria-label":ct,backgroundColor:dt,theme:k,language:a,minHeight:ye,width:g,height:H,relativeHeight:fe,padding:lt,children:[F,X,V,Rt]}),t[92]=ct,t[93]=dt,t[94]=_t,t[95]=H,t[96]=a,t[97]=ye,t[98]=lt,t[99]=fe,t[100]=Ct,t[101]=Pt,t[102]=F,t[103]=X,t[104]=V,t[105]=Rt,t[106]=k,t[107]=g,t[108]=re):re=t[108],re}function Bn(e){return e.color}function zn(e){return e.color}function Jn(e){return e.color}function Kn(e){return e!==void 0}function Qn(e){return e!==void 0}function Zn(e){return e.data}function _n(e){return e!==void 0}function to(e){return e.data}exports.MultiLineAltChart=Pn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-D4pAp7u0.cjs"),A=require("react"),C=require("./parse-xYI9yrvL.cjs"),He=require("./index-Cno4Q0YE.cjs"),Ue=require("./numberFormattingFunction-Cn9R7CM9.cjs"),Pe=require("./Tooltip-Hr46paWP.cjs"),j=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),$e=require("./customArea-BAcQ3pBM.cjs"),Be=require("./AxisTitle-DP_evhbe.cjs"),ze=require("./Axis-BTaS9oPQ.cjs"),Je=require("./XTicksAndGridLines-C5DuC5oY.cjs"),Ke=require("./ReferenceLine-CpU4G01Y.cjs"),Qe=require("./YTicksAndGridLines-DFjm8RCc.cjs"),Ze=require("./index-BuhBhuCq.cjs"),J=require("./Colors.cjs"),Ne=require("./uniqBy-O05lp2S5.cjs"),qe=require("./init-DU0ybBc_.cjs"),_e=require("./time-CkcKbhwe.cjs"),tn=require("./linear-CgUCbw9F.cjs"),en=require("./delaunay-rcy0HhZi.cjs"),Ge=require("./line-DaEMhXmx.cjs"),De=require("./step-BZ3C8QFW.cjs"),nn=require("./select-Bnfk0lJx.cjs"),zt=require("./proxy-CqH8m8IQ.cjs"),on=require("./pointer-Dkq5NV1q.cjs"),rn=require("./use-in-view-dnRv_qqF.cjs"),sn=require("./GraphFooter.cjs"),ln=require("./GraphHeader.cjs"),an=require("./EmptyState-CFmiFPHz.cjs"),cn=require("./ColorLegendWithMouseOver.cjs"),We=require("./GraphContainer-Cul9b74X.cjs"),un=require("./getNoOfTicks-C_1CFXv_.cjs");function fn(e,t){return Array.from(t,r=>e[r])}function mn(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[r]=t;if(r&&r.length!==2||t.length>1){const O=Uint32Array.from(e,(k,c)=>c);return t.length>1?(t=t.map(k=>e.map(k)),O.sort((k,c)=>{for(const s of t){const Et=Ve(s[k],s[c]);if(Et)return Et}})):(r=e.map(r),O.sort((k,c)=>Ve(r[k],r[c]))),fn(e,O)}return e.sort(xn(r))}function xn(e=qe.ascending){if(e===qe.ascending)return Ve;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const O=e(t,r);return O||O===0?O:(e(r,r)===0)-(e(t,t)===0)}}function Ve(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function dn(e){const t=i.compilerRuntimeExports.c(129),{data:r,width:O,height:k,lineColors:c,dateFormat:s,noOfXTicks:Et,rightMargin:rt,topMargin:Jt,bottomMargin:st,suffix:U,prefix:g,leftMargin:E,tooltip:At,onSeriesMouseOver:lt,refValues:at,highlightAreaSettings:Kt,minValue:K,maxValue:kt,highlightedLines:G,animate:l,rtl:Q,strokeWidth:S,showDots:ae,annotations:Lt,customHighlightAreaSettings:Qt,yAxisTitle:Dt,noOfYTicks:Zt,minDate:Nt,maxDate:_t,curveType:ct,styles:w,colorDomain:L,selectedColor:qt,classNames:R,showLabels:ge,dimmedOpacity:M,precision:W,naLabel:ye,customLayers:Z,showHighlightedLinesLabels:ve,showDateOnHover:te,locale:T}=e,ce=A.useRef(null);let ut;t[0]!==l.amount||t[1]!==l.once?(ut={once:l.once,amount:l.amount},t[0]=l.amount,t[1]=l.once,t[2]=ut):ut=t[2];const f=rn.useInView(ce,ut),[I,ue]=A.useState(!1);let ft,St;t[3]!==l.duration||t[4]!==I||t[5]!==f?(ft=()=>{if(f&&!I){const n=setTimeout(()=>{ue(!0)},(l.duration+.5)*1e3);return()=>clearTimeout(n)}},St=[f,I,l.duration],t[3]=l.duration,t[4]=I,t[5]=f,t[6]=ft,t[7]=St):(ft=t[6],St=t[7]),A.useEffect(ft,St);const v=ct==="linear"?Ge.curveLinear:ct==="step"?De.curveStep:ct==="stepAfter"?De.stepAfter:ct==="stepBefore"?De.stepBefore:De.monotoneX;let m;t[8]!==s?(m=n=>({...n,date:C.parse(`${n.date}`,s,new Date)}),t[8]=s,t[9]=m):m=t[9];const p=He.orderBy(r.map(m),["date"],["asc"]).filter(Xn),je=Ne.uniqBy(p,"label",!0);let _;t[10]!==s?(_=n=>C.parse(`${n}`,s,new Date),t[10]=s,t[11]=_):_=t[11];const ee=mn(Ne.uniqBy(r,"date",!0).map(_),Fn),[x,mt]=A.useState(void 0),[xt,tt]=A.useState(void 0),[dt,et]=A.useState(void 0),Mt=Dt?E+30:E;let pt;t[12]!==st||t[13]!==rt||t[14]!==Mt||t[15]!==Jt?(pt={top:Jt,bottom:st,left:Mt,right:rt},t[12]=st,t[13]=rt,t[14]=Mt,t[15]=Jt,t[16]=pt):pt=t[16];const h=pt,fe=A.useRef(null),me=je.map(n=>He.orderBy(p.filter(o=>o.label==n),["date"],["asc"]));let ht;if(t[17]!==s||t[18]!==Kt){let n;t[20]!==s?(n=o=>({...o,coordinates:[o.coordinates[0]===null?null:C.parse(`${o.coordinates[0]}`,s,new Date),o.coordinates[1]===null?null:C.parse(`${o.coordinates[1]}`,s,new Date)]}),t[20]=s,t[21]=n):n=t[21],ht=Kt.map(n),t[17]=s,t[18]=Kt,t[19]=ht}else ht=t[19];const Tt=ht;let gt;if(t[22]!==Qt||t[23]!==s){let n;t[25]!==s?(n=o=>({...o,coordinates:o.coordinates.map((y,Bt)=>Bt%2===0?C.parse(`${y}`,s,new Date):y)}),t[25]=s,t[26]=n):n=t[26],gt=Qt.map(n),t[22]=Qt,t[23]=s,t[24]=gt}else gt=t[24];const xe=gt,d=O-h.left-h.right,N=k-h.top-h.bottom,ne=Nt?C.parse(`${Nt}`,s,new Date):ee[0],de=_t?C.parse(`${_t}`,s,new Date):ee[ee.length-1],b=j.checkIfNullOrUndefined(K)?Math.min(...p.map(Yn).filter(Wn))?Math.min(...p.map(Gn).filter(Un))>0?0:Math.min(...p.map(Hn).filter(Vn)):0:K,Y=Math.max(...p.map($n).filter(In))?Math.max(...p.map(Tn).filter(Mn)):0,a=_e.time().domain([ne,de]).range([0,d]);let q;t[27]!==b||t[28]!==K?(q=j.checkIfNullOrUndefined(K)?b:K,t[27]=b,t[28]=K,t[29]=q):q=t[29];let yt;t[30]!==Y||t[31]!==kt?(yt=j.checkIfNullOrUndefined(kt)?Y>0?Y:0:kt,t[30]=Y,t[31]=kt,t[32]=yt):yt=t[32];const u=tn.linear().domain([q,yt]).range([N,0]).nice(),pe=en.Delaunay.from(p.filter(Sn),n=>a(n.date),n=>u(n.y)).voronoi([0,0,d<0?0:d,N<0?0:N]),vt=Ge.line().x(n=>a(n.date)).y(n=>u(n.y)).curve(v),oe=u.ticks(Zt),It=a.ticks(Et);A.useEffect(()=>{const n=y=>{const Bt=p[qe.bisectCenter(p.map(qn),a.invert(on.pointer(y)[0]),0)];mt(Bt||p[p.length-1]),et(y.clientY),tt(y.clientX),lt?.(Bt||p[p.length-1])},o=()=>{mt(void 0),tt(void 0),et(void 0)};nn.select(fe.current).on("mousemove",n).on("mouseout",o),lt?.(void 0)},[a,p,lt]);let jt;t[33]!==l||t[34]!==N||t[35]!==d||t[36]!==Tt||t[37]!==f||t[38]!==a?(jt=i.jsxRuntimeExports.jsx(Ze.HighlightArea,{areaSettings:Tt,width:d,height:N,scale:a,animate:l,isInView:f}),t[33]=l,t[34]=N,t[35]=d,t[36]=Tt,t[37]=f,t[38]=a,t[39]=jt):jt=t[39];const D=w?.yAxis?.gridLines,$t=w?.yAxis?.labels;let Ot;t[40]!==D||t[41]!==$t?(Ot={gridLines:D,labels:$t},t[40]=D,t[41]=$t,t[42]=Ot):Ot=t[42];const Vt=R?.yAxis?.gridLines,Ht=R?.yAxis?.labels;let nt;t[43]!==Vt||t[44]!==Ht?(nt={gridLines:Vt,labels:Ht},t[43]=Vt,t[44]=Ht,t[45]=nt):nt=t[45];const Ut=u(b<0?0:b),Gt=u(b<0?0:b),Wt=0-E,Yt=d+h.right,ot=b<0?0:b;let wt;t[46]!==T||t[47]!==W||t[48]!==g||t[49]!==U||t[50]!==ot?(wt=Ue.numberFormattingFunction(ot,void 0,W,g,U,T),t[46]=T,t[47]=W,t[48]=g,t[49]=U,t[50]=ot,t[51]=wt):wt=t[51];const bt=0-E,he=u(b<0?0:b),Ft=Y<0?"1em":-5;let Ct;t[52]!==bt||t[53]!==he||t[54]!==Ft?(Ct={x:bt,y:he,dx:0,dy:Ft},t[52]=bt,t[53]=he,t[54]=Ft,t[55]=Ct):Ct=t[55];const Xt=R?.xAxis?.axis,ie=R?.yAxis?.labels;let $;t[56]!==Xt||t[57]!==ie?($={axis:Xt,label:ie},t[56]=Xt,t[57]=ie,t[58]=$):$=t[58];const Rt=w?.xAxis?.axis,Pt=w?.yAxis?.labels;let F;t[59]!==Rt||t[60]!==Pt?(F={axis:Rt,label:Pt},t[59]=Rt,t[60]=Pt,t[61]=F):F=t[61];let V;t[62]!==Ut||t[63]!==Gt||t[64]!==Wt||t[65]!==Yt||t[66]!==wt||t[67]!==Ct||t[68]!==$||t[69]!==F?(V=i.jsxRuntimeExports.jsx(ze.Axis,{y1:Ut,y2:Gt,x1:Wt,x2:Yt,label:wt,labelPos:Ct,classNames:$,styles:F}),t[62]=Ut,t[63]=Gt,t[64]=Wt,t[65]=Yt,t[66]=wt,t[67]=Ct,t[68]=$,t[69]=F,t[70]=V):V=t[70];const X=0-E-15,P=N/2,B=w?.yAxis?.title,z=R?.yAxis?.title;let H;t[71]!==X||t[72]!==P||t[73]!==B||t[74]!==z||t[75]!==Dt?(H=i.jsxRuntimeExports.jsx(Be.AxisTitle,{x:X,y:P,style:B,className:z,text:Dt,rotate90:!0}),t[71]=X,t[72]=P,t[73]=B,t[74]=z,t[75]=Dt,t[76]=H):H=t[76];let it;t[77]!==s?(it=n=>C.format(n,s),t[77]=s,t[78]=it):it=t[78];const Oe=It.map(it),we=It.map(n=>a(n)),Se=w?.xAxis?.gridLines,Me=w?.xAxis?.labels;let be;t[79]!==Se||t[80]!==Me?(be={gridLines:Se,labels:Me},t[79]=Se,t[80]=Me,t[81]=be):be=t[81];const Te=R?.xAxis?.gridLines;let re;t[82]!==Te?(re=i.mo("opacity-0",Te),t[82]=Te,t[83]=re):re=t[83];const Ie=R?.xAxis?.labels;let se;t[84]!==Ie?(se=i.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",Ie),t[84]=Ie,t[85]=se):se=t[85];let Ce;t[86]!==re||t[87]!==se?(Ce={gridLines:re,labels:se},t[86]=re,t[87]=se,t[88]=Ce):Ce=t[88];let Re;t[89]!==Z?(Re=Z.filter(Ln).map(kn),t[89]=Z,t[90]=Re):Re=t[90];const Ye=p.filter(gn).map((n,o)=>i.jsxRuntimeExports.jsx("g",{children:i.jsxRuntimeExports.jsx("path",{d:pe.renderCell(p.findIndex(y=>y.label===n.label&&y.date===n.date)),opacity:0,onMouseEnter:y=>{mt(n),et(y.clientY),tt(y.clientX),lt?.(n)},onMouseMove:y=>{mt(n),et(y.clientY),tt(y.clientX)},onMouseLeave:()=>{mt(void 0),tt(void 0),et(void 0),lt?.(void 0)}})},o));let Ee;t[91]!==l||t[92]!==d||t[93]!==f||t[94]!==E||t[95]!==h.right||t[96]!==at||t[97]!==u?(Ee=at?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:at.map((n,o)=>i.jsxRuntimeExports.jsx(Ke.RefLineY,{text:n.text,color:n.color,y:u(n.value),x1:0-E,x2:d+h.right,classNames:n.classNames,styles:n.styles,animate:l,isInView:f},o))}):null,t[91]=l,t[92]=d,t[93]=f,t[94]=E,t[95]=h.right,t[96]=at,t[97]=u,t[98]=Ee):Ee=t[98];let le;if(t[99]!==l||t[100]!==Lt||t[101]!==s||t[102]!==d||t[103]!==f||t[104]!==h.right||t[105]!==Q||t[106]!==a||t[107]!==u){let n;t[109]!==l||t[110]!==s||t[111]!==d||t[112]!==f||t[113]!==h.right||t[114]!==Q||t[115]!==a||t[116]!==u?(n=(o,y)=>{const Bt=$e.getLineEndPoint({x:o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0),y:o.yCoordinate?u(o.yCoordinate)+(o.yOffset||0)-8:0+(o.yOffset||0)-8},{x:o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date)):0,y:o.yCoordinate?u(o.yCoordinate):0},j.checkIfNullOrUndefined(o.connectorRadius)?3.5:o.connectorRadius),Fe=o.showConnector?{y1:Bt.y,x1:Bt.x,y2:o.yCoordinate?u(o.yCoordinate)+(o.yOffset||0):0+(o.yOffset||0),x2:o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0),cy:o.yCoordinate?u(o.yCoordinate):0,cx:o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date)):0,circleRadius:j.checkIfNullOrUndefined(o.connectorRadius)?3.5:o.connectorRadius,strokeWidth:o.showConnector===!0?2:Math.min(o.showConnector||0,1)}:void 0,Xe={y:o.yCoordinate?u(o.yCoordinate)+(o.yOffset||0)-8:0+(o.yOffset||0)-8,x:Q?0:o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0),width:Q?o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0):d+h.right-(o.xCoordinate?a(C.parse(`${o.xCoordinate}`,s,new Date))+(o.xOffset||0):0+(o.xOffset||0)),maxWidth:o.maxWidth,fontWeight:o.fontWeight,align:o.align};return i.jsxRuntimeExports.jsx($e.Annotation,{color:o.color,connectorsSettings:Fe,labelSettings:Xe,text:o.text,classNames:o.classNames,styles:o.styles,animate:l,isInView:f},y)},t[109]=l,t[110]=s,t[111]=d,t[112]=f,t[113]=h.right,t[114]=Q,t[115]=a,t[116]=u,t[117]=n):n=t[117],le=Lt.map(n),t[99]=l,t[100]=Lt,t[101]=s,t[102]=d,t[103]=f,t[104]=h.right,t[105]=Q,t[106]=a,t[107]=u,t[108]=le}else le=t[108];let Ae;t[118]!==le?(Ae=i.jsxRuntimeExports.jsx("g",{children:le}),t[118]=le,t[119]=Ae):Ae=t[119];let ke;t[120]!==Z?(ke=Z.filter(hn).map(pn),t[120]=Z,t[121]=ke):ke=t[121];let Le;return t[122]!==R?.tooltip||t[123]!==xt||t[124]!==dt||t[125]!==x||t[126]!==w?.tooltip||t[127]!==At?(Le=x&&At&&xt&&dt?i.jsxRuntimeExports.jsx(Pe.Tooltip,{data:x,body:At,xPos:xt,yPos:dt,backgroundStyle:w?.tooltip,className:R?.tooltip}):null,t[122]=R?.tooltip,t[123]=xt,t[124]=dt,t[125]=x,t[126]=w?.tooltip,t[127]=At,t[128]=Le):Le=t[128],i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(zt.motion.svg,{width:`${O}px`,height:`${k}px`,viewBox:`0 0 ${O} ${k}`,direction:"ltr",ref:ce,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[jt,i.jsxRuntimeExports.jsx($e.CustomArea,{areaSettings:xe,scaleX:a,scaleY:u,animate:l,isInView:f}),i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx(Qe.YTicksAndGridLines,{values:oe.filter(Nn),y:oe.filter(Dn).map(n=>u(n)),x1:0-E,x2:d+h.right,styles:Ot,classNames:nt,suffix:U,prefix:g,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:W,locale:T}),V,H]}),i.jsxRuntimeExports.jsx("g",{children:i.jsxRuntimeExports.jsx(Je.XTicksAndGridLines,{values:Oe,x:we,y1:0,y2:N,styles:be,classNames:Ce,suffix:U,prefix:g,labelType:"primary",showGridLines:!0,precision:W,locale:T})}),Re,i.jsxRuntimeExports.jsxs(zt.motion.g,{children:[me.map(n=>i.jsxRuntimeExports.jsxs(zt.motion.g,{exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{opacity:x?n[0].label===x.label?1:M:qt?n[0].color&&c[L.indexOf(n[0].color)]===qt?1:M:G?G.indexOf(n[0].label)!==-1?1:M:1},whileInView:{opacity:x?n[0].label===x.label?1:M:qt?n[0].color&&c[L.indexOf(n[0].color)]===qt?1:M:G?G.indexOf(n[0].label)!==-1?1:M:1,transition:{duration:l.duration}}},initial:"initial",animate:f?"whileInView":"initial",children:[i.jsxRuntimeExports.jsx(zt.motion.path,{d:vt(n.filter(An))||"",style:{fill:"none",strokeWidth:x?n[0].label===x.label?S+Math.max(2,.5*S):S:G&&G.indexOf(n[0].label)!==-1?S+Math.max(2,.5*S):S},exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{pathLength:0,d:vt(n.filter(En))||"",opacity:1,stroke:r.filter(Rn).length===0?c[0]:n[0].color?c[L.indexOf(n[0].color)]:J.Colors.gray},whileInView:{pathLength:1,d:vt(n.filter(Cn))||"",opacity:1,stroke:r.filter(bn).length===0?c[0]:n[0].color?c[L.indexOf(n[0].color)]:J.Colors.gray,transition:{duration:l.duration}}},initial:"initial",animate:f?"whileInView":"initial"}),n.map((o,y)=>i.jsxRuntimeExports.jsx(zt.motion.g,{children:j.checkIfNullOrUndefined(o.y)?null:i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:ae?i.jsxRuntimeExports.jsx(zt.motion.circle,{r:d/n.length<5?0:d/n.length<20?2:4,exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{opacity:0,fill:r.filter(wn).length===0?c[0]:n[0].color?c[L.indexOf(n[0].color)]:J.Colors.gray,cx:a(o.date),cy:u(o.y)},whileInView:{opacity:1,fill:r.filter(On).length===0?c[0]:n[0].color?c[L.indexOf(n[0].color)]:J.Colors.gray,transition:{duration:I?l.duration:.5,delay:I?0:l.duration},cx:a(o.date),cy:u(o.y)}},initial:"initial",animate:f?"whileInView":"initial"}):null})},y)),((G||[]).indexOf(n[0].label)!==-1&&ve||x?.label===n[0].label)&&ge?i.jsxRuntimeExports.jsx(zt.motion.text,{className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:l.duration}},variants:{initial:{opacity:0,fill:r.filter(jn).length===0?c[0]:n[0].color?c[L.indexOf(n[0].color)]:J.Colors.gray,x:a(n[n.length-1].date),y:u(n[n.length-1].y)},whileInView:{opacity:1,fill:r.filter(vn).length===0?c[0]:n[0].color?c[L.indexOf(n[0].color)]:J.Colors.gray,x:a(n[n.length-1].date),y:u(n[n.length-1].y),transition:{duration:I?l.duration:.5,delay:I?0:l.duration}}},initial:"initial",animate:f?"whileInView":"initial",children:n[0].label}):null]},n[0].label)),x?i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx("text",{y:u(x.y)-8,x:a(x.date),className:i.mo("graph-value text-sm font-bold",R?.graphObjectValues),style:{fill:r.filter(yn).length===0?c[0]:x.color?c[L.indexOf(x.color)]:J.Colors.gray,textAnchor:"middle",...w?.graphObjectValues||{}},children:Ue.numberFormattingFunction(x.y,ye,W,g,U,T)}),te&&i.jsxRuntimeExports.jsx("text",{y:u(x.y)+20,x:a(x.date),className:i.mo("graph-value text-sm fill-primary-gray-500 dark:fill-primary-gray-400",R?.graphObjectValues),style:{textAnchor:"middle",...w?.graphObjectValues||{}},children:C.format(new Date(x.date),s||"yyyy")})]}):null]}),Ye,Ee,Ae,ke]})}),Le]})}function pn(e){return e.layer}function hn(e){return e.position==="after"}function gn(e){return!j.checkIfNullOrUndefined(e.y)}function yn(e){return e.color}function vn(e){return e.color}function jn(e){return e.color}function On(e){return e.color}function wn(e){return e.color}function bn(e){return e.color}function Cn(e){return!j.checkIfNullOrUndefined(e.y)}function Rn(e){return e.color}function En(e){return!j.checkIfNullOrUndefined(e.y)}function An(e){return!j.checkIfNullOrUndefined(e.y)}function kn(e){return e.layer}function Ln(e){return e.position==="before"}function Dn(e){return e!==0}function Nn(e){return e!==0}function qn(e){return e.date}function Sn(e){return!j.checkIfNullOrUndefined(e.date)&&!j.checkIfNullOrUndefined(e.y)}function Mn(e){return!j.checkIfNullOrUndefined(e)}function Tn(e){return e.y}function In(e){return!j.checkIfNullOrUndefined(e)}function $n(e){return e.y}function Vn(e){return!j.checkIfNullOrUndefined(e)}function Hn(e){return e.y}function Un(e){return!j.checkIfNullOrUndefined(e)}function Gn(e){return e.y}function Wn(e){return!j.checkIfNullOrUndefined(e)}function Yn(e){return e.y}function Fn(e,t){return qe.ascending(e,t)}function Xn(e){return!j.checkIfNullOrUndefined(e.y)}function Pn(e){const t=i.compilerRuntimeExports.c(107),{data:r,graphTitle:O,showNAColor:k,colors:c,colorDomain:s,suffix:Et,sources:rt,prefix:Jt,graphDescription:st,height:U,width:g,footNote:E,noOfXTicks:At,dateFormat:lt,padding:at,backgroundColor:Kt,leftMargin:K,rightMargin:kt,topMargin:G,bottomMargin:l,showColorScale:Q,tooltip:S,relativeHeight:ae,onSeriesMouseOver:Lt,showLabels:Qt,showHighlightedLinesLabels:Dt,refValues:Zt,highlightAreaSettings:Nt,graphID:_t,minValue:ct,maxValue:w,highlightedLines:L,graphDownload:qt,dataDownload:R,animate:ge,language:M,colorLegendTitle:W,minHeight:ye,strokeWidth:Z,showDots:ve,annotations:te,customHighlightAreaSettings:T,theme:ce,ariaLabel:ut,yAxisTitle:f,noOfYTicks:I,minDate:ue,maxDate:ft,curveType:St,styles:v,classNames:m,dimmedOpacity:p,precision:je,customLayers:_,naLabel:ee,showDateOnHover:x,locale:mt}=e,xt=k===void 0?!0:k,tt=Et===void 0?"":Et,dt=Jt===void 0?"":Jt,et=At===void 0?10:At,Mt=lt===void 0?"yyyy":lt,pt=Kt===void 0?!1:Kt,h=K===void 0?30:K,fe=kt===void 0?50:kt,me=G===void 0?20:G,ht=l===void 0?25:l,Tt=Q===void 0?!0:Q,gt=Qt===void 0?!0:Qt,xe=Dt===void 0?!1:Dt;let d;t[0]!==Zt?(d=Zt===void 0?[]:Zt,t[0]=Zt,t[1]=d):d=t[1];const N=d;let ne;t[2]!==Nt?(ne=Nt===void 0?[]:Nt,t[2]=Nt,t[3]=ne):ne=t[3];const de=ne,b=qt===void 0?!1:qt,Y=R===void 0?!1:R,a=ge===void 0?!1:ge,q=M===void 0?"en":M,yt=ye===void 0?0:ye,u=Z===void 0?2:Z,pe=ve===void 0?!0:ve;let vt;t[4]!==te?(vt=te===void 0?[]:te,t[4]=te,t[5]=vt):vt=t[5];const oe=vt;let It;t[6]!==T?(It=T===void 0?[]:T,t[6]=T,t[7]=It):It=t[7];const jt=It,D=ce===void 0?"light":ce,$t=I===void 0?5:I,Ot=St===void 0?"curve":St,Vt=p===void 0?.3:p,Ht=je===void 0?2:je;let nt;t[8]!==_?(nt=_===void 0?[]:_,t[8]=_,t[9]=nt):nt=t[9];const Ut=nt,Gt=ee===void 0?"NA":ee,Wt=x===void 0?!1:x,Yt=mt===void 0?"en":mt,[ot,wt]=A.useState(0),[bt,he]=A.useState(0),[Ft,Ct]=A.useState(void 0),Xt=A.useRef(null),ie=A.useRef(null);let $,Rt;t[10]===Symbol.for("react.memo_cache_sentinel")?($=()=>{const Oe=new ResizeObserver(we=>{wt(we[0].target.clientWidth||620),he(we[0].target.clientHeight||480)});return Xt.current&&Oe.observe(Xt.current),()=>Oe.disconnect()},Rt=[],t[10]=$,t[11]=Rt):($=t[10],Rt=t[11]),A.useEffect($,Rt);const Pt=m?.graphContainer,F=v?.graphContainer;let V;t[12]!==m?.description||t[13]!==m?.title||t[14]!==r||t[15]!==Y||t[16]!==st||t[17]!==b||t[18]!==O||t[19]!==v?.description||t[20]!==v?.title||t[21]!==g?(V=O||st||b||Y?i.jsxRuntimeExports.jsx(ln.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:m?.title,description:m?.description},graphTitle:O,graphDescription:st,width:g,graphDownload:b?ie:void 0,dataDownload:Y?r.map(to).filter(_n).length>0?r.map(Zn).filter(Qn):r.filter(Kn):null}):null,t[12]=m?.description,t[13]=m?.title,t[14]=r,t[15]=Y,t[16]=st,t[17]=b,t[18]=O,t[19]=v?.description,t[20]=v?.title,t[21]=g,t[22]=V):V=t[22];let X;t[23]!==m?.colorLegend||t[24]!==s||t[25]!==W||t[26]!==c||t[27]!==r||t[28]!==Tt||t[29]!==xt||t[30]!==D||t[31]!==g?(X=Tt&&r.filter(Jn).length!==0&&r.length>0?i.jsxRuntimeExports.jsx(cn.ColorLegendWithMouseOver,{width:g,colorLegendTitle:W,colors:c||J.Colors[D].categoricalColors.colors,colorDomain:s||Ne.uniqBy(r,"color",!0),setSelectedColor:Ct,showNAColor:xt,className:m?.colorLegend}):null,t[23]=m?.colorLegend,t[24]=s,t[25]=W,t[26]=c,t[27]=r,t[28]=Tt,t[29]=xt,t[30]=D,t[31]=g,t[32]=X):X=t[32];let P;t[33]!==r.length?(P=r.length===0&&i.jsxRuntimeExports.jsx(an.EmptyState,{}),t[33]=r.length,t[34]=P):P=t[34];let B;t[35]!==a||t[36]!==oe||t[37]!==ht||t[38]!==m||t[39]!==s||t[40]!==c||t[41]!==Ot||t[42]!==jt||t[43]!==Ut||t[44]!==r||t[45]!==Mt||t[46]!==Vt||t[47]!==de||t[48]!==L||t[49]!==q||t[50]!==h||t[51]!==Yt||t[52]!==ft||t[53]!==w||t[54]!==ue||t[55]!==ct||t[56]!==Gt||t[57]!==et||t[58]!==$t||t[59]!==Lt||t[60]!==Ht||t[61]!==dt||t[62]!==N||t[63]!==fe||t[64]!==Ft||t[65]!==Wt||t[66]!==pe||t[67]!==xe||t[68]!==gt||t[69]!==u||t[70]!==v||t[71]!==tt||t[72]!==bt||t[73]!==ot||t[74]!==D||t[75]!==S||t[76]!==me||t[77]!==f?(B=ot&&bt&&r.length>0?i.jsxRuntimeExports.jsx(dn,{data:r,lineColors:r.filter(zn).length===0?c?[c]:[J.Colors.primaryColors["blue-600"]]:c||J.Colors[D].categoricalColors.colors,width:ot,height:bt,dateFormat:Mt,noOfXTicks:et??un.getNoOfTicks(ot),leftMargin:h,rightMargin:fe,topMargin:me,bottomMargin:ht,tooltip:S,onSeriesMouseOver:Lt,suffix:tt,prefix:dt,highlightAreaSettings:de,refValues:N,minValue:ct,maxValue:w,highlightedLines:L,showHighlightedLinesLabels:xe,animate:a===!0?{duration:.5,once:!0,amount:.5}:a||{duration:0,once:!0,amount:0},rtl:q==="he"||q==="ar",strokeWidth:u,showDots:pe,annotations:oe,customHighlightAreaSettings:jt,yAxisTitle:f,noOfYTicks:$t,minDate:ue,maxDate:ft,curveType:Ot,styles:v,classNames:m,selectedColor:Ft,showLabels:gt,colorDomain:r.filter(Bn).length===0?[]:s||Ne.uniqBy(r,"color",!0),dimmedOpacity:Vt,precision:Ht,customLayers:Ut,naLabel:Gt,showDateOnHover:Wt,locale:Yt}):null,t[35]=a,t[36]=oe,t[37]=ht,t[38]=m,t[39]=s,t[40]=c,t[41]=Ot,t[42]=jt,t[43]=Ut,t[44]=r,t[45]=Mt,t[46]=Vt,t[47]=de,t[48]=L,t[49]=q,t[50]=h,t[51]=Yt,t[52]=ft,t[53]=w,t[54]=ue,t[55]=ct,t[56]=Gt,t[57]=et,t[58]=$t,t[59]=Lt,t[60]=Ht,t[61]=dt,t[62]=N,t[63]=fe,t[64]=Ft,t[65]=Wt,t[66]=pe,t[67]=xe,t[68]=gt,t[69]=u,t[70]=v,t[71]=tt,t[72]=bt,t[73]=ot,t[74]=D,t[75]=S,t[76]=me,t[77]=f,t[78]=B):B=t[78];let z;t[79]!==P||t[80]!==B?(z=i.jsxRuntimeExports.jsxs(We.GraphArea,{ref:Xt,children:[P,B]}),t[79]=P,t[80]=B,t[81]=z):z=t[81];let H;t[82]!==m?.footnote||t[83]!==m?.source||t[84]!==E||t[85]!==rt||t[86]!==v?.footnote||t[87]!==v?.source||t[88]!==g?(H=rt||E?i.jsxRuntimeExports.jsx(sn.GraphFooter,{styles:{footnote:v?.footnote,source:v?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:rt,footNote:E,width:g}):null,t[82]=m?.footnote,t[83]=m?.source,t[84]=E,t[85]=rt,t[86]=v?.footnote,t[87]=v?.source,t[88]=g,t[89]=H):H=t[89];let it;return t[90]!==ut||t[91]!==pt||t[92]!==_t||t[93]!==U||t[94]!==q||t[95]!==yt||t[96]!==at||t[97]!==ae||t[98]!==Pt||t[99]!==F||t[100]!==V||t[101]!==X||t[102]!==z||t[103]!==H||t[104]!==D||t[105]!==g?(it=i.jsxRuntimeExports.jsxs(We.GraphContainer,{className:Pt,style:F,id:_t,ref:ie,"aria-label":ut,backgroundColor:pt,theme:D,language:q,minHeight:yt,width:g,height:U,relativeHeight:ae,padding:at,children:[V,X,z,H]}),t[90]=ut,t[91]=pt,t[92]=_t,t[93]=U,t[94]=q,t[95]=yt,t[96]=at,t[97]=ae,t[98]=Pt,t[99]=F,t[100]=V,t[101]=X,t[102]=z,t[103]=H,t[104]=D,t[105]=g,t[106]=it):it=t[106],it}function Bn(e){return e.color}function zn(e){return e.color}function Jn(e){return e.color}function Kn(e){return e!==void 0}function Qn(e){return e!==void 0}function Zn(e){return e.data}function _n(e){return e!==void 0}function to(e){return e.data}exports.MultiLineAltChart=Pn;
2
2
  //# sourceMappingURL=MultiLineAltChart.cjs.map