{"version":3,"file":"DotDensityMap-BZ3SYm2t.cjs","names":[],"sources":["../src/Components/Graphs/Maps/DotDensityMap/Graph.tsx","../src/Components/Graphs/Maps/DotDensityMap/index.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { geoPath } from 'd3-geo';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport isEqual from 'fast-deep-equal';\r\nimport type { FeatureCollection } from 'geojson';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { type RefObject, useRef, useState } from 'react';\r\nimport { CsvDownloadButton } from '@/Components/Actions/CsvDownloadButton';\r\nimport { ImageDownloadButton } from '@/Components/Actions/ImageDownloadButton';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport {\r\n  LegendCollapseButton,\r\n  LegendExpandButton,\r\n} from '@/Components/Elements/LegendExpandControls';\r\nimport { MapZoomButton } from '@/Components/Elements/MapZoomButton';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { useMapProjection } from '@/hooks/useMapProjection';\r\nimport { useMapZoom } from '@/hooks/useMapZoom';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  DotDensityMapDataType,\r\n  MapProjectionTypes,\r\n  StyleObject,\r\n  ZoomInteractionTypes,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n  data: DotDensityMapDataType[];\r\n\r\n  mapData: FeatureCollection;\r\n  colorDomain: string[];\r\n  mapBorderData?: FeatureCollection;\r\n  width: number;\r\n  height: number;\r\n  scale: number;\r\n  centerPoint?: [number, number];\r\n  colors: string[];\r\n  colorLegendTitle?: string;\r\n  radius: number;\r\n  mapBorderWidth: number;\r\n  mapNoDataColor: string;\r\n  showLabels: boolean;\r\n  mapBorderColor: string;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  showColorScale: boolean;\r\n  zoomScaleExtend: [number, number];\r\n  zoomTranslateExtend?: [[number, number], [number, number]];\r\n  highlightedDataPoints?: (string | number)[];\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  resetSelectionOnDoubleClick: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  zoomInteraction: ZoomInteractionTypes;\r\n  mapProjection: MapProjectionTypes;\r\n  animate: AnimateDataType;\r\n  dimmedOpacity: number;\r\n  customLayers: CustomLayerDataType[];\r\n  maxRadiusValue: number;\r\n  collapseColorScaleByDefault?: boolean;\r\n  projectionRotate: [number, number] | [number, number, number];\r\n  overlayMapData?: FeatureCollection;\r\n  overlayMapBorderColor?: string;\r\n  overlayMapBorderWidth?: number;\r\n  graphDownload?: RefObject<HTMLDivElement | null>;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  dataDownload: any;\r\n  showUNBorder: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n  const {\r\n    data,\r\n    colors,\r\n    mapData,\r\n    colorLegendTitle,\r\n    colorDomain,\r\n    radius,\r\n    height,\r\n    width,\r\n    scale,\r\n    centerPoint,\r\n    tooltip,\r\n    showLabels,\r\n    mapBorderWidth,\r\n    mapBorderColor,\r\n    mapNoDataColor,\r\n    onSeriesMouseOver,\r\n    showColorScale,\r\n    zoomScaleExtend,\r\n    zoomTranslateExtend,\r\n    highlightedDataPoints,\r\n    onSeriesMouseClick,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    styles,\r\n    classNames,\r\n    mapProjection,\r\n    zoomInteraction,\r\n    animate,\r\n    dimmedOpacity,\r\n    customLayers,\r\n    maxRadiusValue,\r\n    collapseColorScaleByDefault,\r\n    projectionRotate,\r\n    overlayMapData,\r\n    overlayMapBorderColor,\r\n    overlayMapBorderWidth,\r\n    graphDownload,\r\n    dataDownload,\r\n    mapBorderData,\r\n    showUNBorder,\r\n  } = props;\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\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 mapG = useRef<SVGGElement>(null);\r\n\r\n  const { handleZoom } = useMapZoom({\r\n    mapSvg,\r\n    mapG,\r\n    width,\r\n    height,\r\n    zoomInteraction,\r\n    zoomScaleExtend,\r\n    zoomTranslateExtend,\r\n  });\r\n\r\n  const { projection } = useMapProjection({\r\n    mapData,\r\n    width,\r\n    height,\r\n    mapProjection,\r\n    scale,\r\n    centerPoint,\r\n    projectionRotate,\r\n  });\r\n  const isInView = useInView(mapSvg, {\r\n    once: animate.once,\r\n    amount: animate.amount,\r\n  });\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 pathGenerator = geoPath().projection(projection);\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            {mapData.features.map((d, i: number) => {\r\n              const path = pathGenerator(d);\r\n              if (!path) return null;\r\n              return (\r\n                <path\r\n                  d={path}\r\n                  // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n                  key={i}\r\n                  style={{\r\n                    fill: mapNoDataColor,\r\n                    vectorEffect: 'non-scaling-stroke',\r\n                  }}\r\n                />\r\n              );\r\n            })}\r\n            {showUNBorder &&\r\n              (mapBorderData || mapData)?.features.map((d, i: number) => {\r\n                const path = pathGenerator(d);\r\n                if (!path) return null;\r\n                return (\r\n                  <motion.g\r\n                    // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n                    key={i}\r\n                  >\r\n                    <path\r\n                      d={path}\r\n                      style={{\r\n                        stroke: mapBorderColor,\r\n                        strokeWidth:\r\n                          d.properties?.bdytyp === 3 || d.properties?.bdytyp === 4\r\n                            ? Math.max(1, mapBorderWidth)\r\n                            : mapBorderWidth,\r\n                        fill: 'none',\r\n                        vectorEffect: 'non-scaling-stroke',\r\n                        strokeDasharray:\r\n                          d.properties?.bdytyp === 3\r\n                            ? '3 3'\r\n                            : d.properties?.bdytyp === 4\r\n                              ? '2 2'\r\n                              : undefined,\r\n                      }}\r\n                    />\r\n                  </motion.g>\r\n                );\r\n              })}\r\n            {overlayMapData?.features.map((d, i: number) => {\r\n              const path = pathGenerator(d);\r\n              if (!path) return null;\r\n              return (\r\n                // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n                <g key={i}>\r\n                  <path\r\n                    d={path}\r\n                    style={{\r\n                      stroke: overlayMapBorderColor || mapBorderColor,\r\n                      strokeWidth: overlayMapBorderWidth || mapBorderWidth + 1,\r\n                      fill: 'none',\r\n                      pointerEvents: 'none',\r\n                      vectorEffect: 'non-scaling-stroke',\r\n                    }}\r\n                  />\r\n                </g>\r\n              );\r\n            })}\r\n            <AnimatePresence>\r\n              {data.map((d) => {\r\n                const color =\r\n                  data.filter((el) => el.color).length === 0\r\n                    ? colors[0]\r\n                    : !d.color\r\n                      ? Colors.gray\r\n                      : colors[colorDomain.indexOf(`${d.color}`)];\r\n                return (\r\n                  <motion.g\r\n                    className='undp-map-dots'\r\n                    key={d.label || `${d.lat}-${d.long}`}\r\n                    variants={{\r\n                      initial: { opacity: 0 },\r\n                      whileInView: {\r\n                        opacity: selectedColor\r\n                          ? selectedColor === color\r\n                            ? 1\r\n                            : dimmedOpacity\r\n                          : highlightedDataPoints\r\n                            ? highlightedDataPoints.indexOf(d.label || '') !== -1\r\n                              ? 1\r\n                              : dimmedOpacity\r\n                            : 1,\r\n                        transition: { duration: animate.duration },\r\n                      },\r\n                    }}\r\n                    initial='initial'\r\n                    animate={isInView ? 'whileInView' : 'initial'}\r\n                    exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                    onMouseEnter={(event) => {\r\n                      setMouseOverData(d);\r\n                      setEventY(event.clientY);\r\n                      setEventX(event.clientX);\r\n                      onSeriesMouseOver?.(d);\r\n                    }}\r\n                    onMouseMove={(event) => {\r\n                      setMouseOverData(d);\r\n                      setEventY(event.clientY);\r\n                      setEventX(event.clientX);\r\n                    }}\r\n                    onMouseLeave={() => {\r\n                      setMouseOverData(undefined);\r\n                      setEventX(undefined);\r\n                      setEventY(undefined);\r\n                      onSeriesMouseOver?.(undefined);\r\n                    }}\r\n                    onClick={() => {\r\n                      if (onSeriesMouseClick || detailsOnClick) {\r\n                        if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n                          setMouseClickData(undefined);\r\n                          onSeriesMouseClick?.(undefined);\r\n                        } else {\r\n                          setMouseClickData(d);\r\n                          onSeriesMouseClick?.(d);\r\n                        }\r\n                      }\r\n                    }}\r\n                    transform={`translate(${\r\n                      (projection([d.long, d.lat]) as [number, number])[0]\r\n                    },${(projection([d.long, d.lat]) as [number, number])[1]})`}\r\n                  >\r\n                    <motion.circle\r\n                      cx={0}\r\n                      cy={0}\r\n                      variants={{\r\n                        initial: {\r\n                          r: 0,\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? colors[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : colors[colorDomain.indexOf(`${d.color}`)],\r\n                          stroke:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? colors[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : colors[colorDomain.indexOf(`${d.color}`)],\r\n                        },\r\n                        whileInView: {\r\n                          r: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? colors[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : colors[colorDomain.indexOf(`${d.color}`)],\r\n                          stroke:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? colors[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : colors[colorDomain.indexOf(`${d.color}`)],\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      exit={{ r: 0, transition: { duration: animate.duration } }}\r\n                      style={{\r\n                        fillOpacity: 0.8,\r\n                        vectorEffect: 'non-scaling-stroke',\r\n                      }}\r\n                    />\r\n                    {showLabels && d.label ? (\r\n                      <motion.text\r\n                        variants={{\r\n                          initial: {\r\n                            opacity: 0,\r\n                            x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n                            fill:\r\n                              data.filter((el) => el.color).length === 0\r\n                                ? colors[0]\r\n                                : !d.color\r\n                                  ? Colors.gray\r\n                                  : colors[colorDomain.indexOf(`${d.color}`)],\r\n                          },\r\n                          whileInView: {\r\n                            opacity: 1,\r\n                            x: !radiusScale ? radius : radiusScale(d.radius || 0),\r\n                            transition: { duration: animate.duration },\r\n                            fill:\r\n                              data.filter((el) => el.color).length === 0\r\n                                ? colors[0]\r\n                                : !d.color\r\n                                  ? Colors.gray\r\n                                  : colors[colorDomain.indexOf(`${d.color}`)],\r\n                          },\r\n                        }}\r\n                        initial='initial'\r\n                        animate={isInView ? 'whileInView' : 'initial'}\r\n                        exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        y={0}\r\n                        className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                        style={{\r\n                          textAnchor: 'start',\r\n                          vectorEffect: 'non-scaling-stroke',\r\n                          ...(styles?.graphObjectValues || {}),\r\n                        }}\r\n                        dx={4}\r\n                        dy={5}\r\n                      >\r\n                        {d.label}\r\n                      </motion.text>\r\n                    ) : null}\r\n                  </motion.g>\r\n                );\r\n              })}\r\n            </AnimatePresence>\r\n            {customLayers.filter((d) => d.position === 'after').map((d) => d.layer)}\r\n          </g>\r\n        </motion.svg>\r\n        {data.filter((el) => el.color).length === 0 || showColorScale === false ? null : (\r\n          <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n            {showLegend ? (\r\n              <>\r\n                <LegendCollapseButton setExpanded={setShowLegend} />\r\n                <div className='p-2' style={{ backgroundColor: 'rgba(240,240,240, 0.7)' }}>\r\n                  {colorLegendTitle && colorLegendTitle !== '' ? (\r\n                    <p\r\n                      className='p-0 leading-normal overflow-hidden text-content-primary'\r\n                      style={{\r\n                        display: '-webkit-box',\r\n                        WebkitLineClamp: '1',\r\n                        WebkitBoxOrient: 'vertical',\r\n                      }}\r\n                    >\r\n                      {colorLegendTitle}\r\n                    </p>\r\n                  ) : null}\r\n                  <div className='flex flex-col gap-3'>\r\n                    {colorDomain.map((d, i) => (\r\n                      // biome-ignore lint/a11y/noStaticElementInteractions: interaction for color legend\r\n                      <div\r\n                        // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\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                        onFocus={() => {\r\n                          setSelectedColor(colors[i % colors.length]);\r\n                        }}\r\n                        onMouseLeave={() => {\r\n                          setSelectedColor(undefined);\r\n                        }}\r\n                      >\r\n                        <div\r\n                          className='w-2 h-2 rounded-full'\r\n                          style={{ backgroundColor: colors[i % colors.length] }}\r\n                        />\r\n                        <P size='sm' marginBottom='none' leading='none'>\r\n                          {d}\r\n                        </P>\r\n                      </div>\r\n                    ))}\r\n                  </div>\r\n                </div>\r\n              </>\r\n            ) : (\r\n              <LegendExpandButton setExpanded={setShowLegend} />\r\n            )}\r\n          </div>\r\n        )}\r\n        {zoomInteraction === 'button' && <MapZoomButton handleZoom={handleZoom} />}\r\n        {(graphDownload || dataDownload) && (\r\n          <div className='absolute right-4 top-4 flex flex-col image-download-button gap-2'>\r\n            {graphDownload && (\r\n              <ImageDownloadButton nodeID={graphDownload} buttonSmall className='p-1' />\r\n            )}\r\n            {dataDownload && dataDownload.length > 0 && (\r\n              <CsvDownloadButton\r\n                csvData={dataDownload}\r\n                buttonSmall\r\n                headers={Object.keys(dataDownload[0]).map((d) => ({\r\n                  label: d,\r\n                  key: d,\r\n                }))}\r\n                className='p-1'\r\n              />\r\n            )}\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 { Spinner } from '@undp/design-system-react/Spinner';\r\nimport type { FeatureCollection } from 'geojson';\r\nimport { useRef } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Timeline } from '@/Components/Elements/Timeline';\r\nimport { useElementSize } from '@/hooks/useElementSize';\r\nimport { useMapShapeData } from '@/hooks/useMapShapeData';\r\nimport { useTimeline } from '@/hooks/useTimeline';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  DotDensityMapDataType,\r\n  Languages,\r\n  MapOverlayDataType,\r\n  MapProjectionTypes,\r\n  SourcesDataType,\r\n  StyleObject,\r\n  TimelineDataType,\r\n  ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { Graph } from './Graph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: DotDensityMapDataType[];\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** Color or array of colors for the circle */\r\n  colors?: string | string[];\r\n  /** Domain of colors for the graph */\r\n  colorDomain?: string[];\r\n  /** Title for the color legend */\r\n  colorLegendTitle?: string;\r\n  /** Color for the areas where data is no available */\r\n  mapNoDataColor?: string;\r\n  /** Background color of the graph */\r\n  backgroundColor?: string | boolean;\r\n  /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n  styles?: StyleObject;\r\n  /** Custom class names */\r\n  classNames?: ClassNameObject;\r\n\r\n  // Size and Spacing\r\n  /** Width of the graph */\r\n  width?: number;\r\n  /** Height of the graph */\r\n  height?: number;\r\n  /** Minimum height of the graph */\r\n  minHeight?: number;\r\n  /** Relative height scaling factor. This overwrites the height props */\r\n  relativeHeight?: number;\r\n  /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n  padding?: string;\r\n\r\n  // Graph Parameters\r\n  /** Maximum radius of the circle */\r\n  radius?: number;\r\n  /** Map data as an object in geoJson format or a url for geoJson */\r\n  mapData?: FeatureCollection | string;\r\n  /** Detail if any other map needs to be overlayed over the main map */\r\n  mapOverlay?: MapOverlayDataType;\r\n  /** Defines if the coordinates in the map data should be rewinded or not. Try to change this is the visualization shows countries as holes instead of shapes. */\r\n  rewindCoordinatesInMapData?: boolean;\r\n  /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n  scale?: number;\r\n  /** Center point of the map */\r\n  centerPoint?: [number, number];\r\n  /** Controls the rotation of the map projection, in degrees, applied before rendering. Useful for shifting the antimeridian to focus the map on different regions */\r\n  projectionRotate?: [number, number] | [number, number, number];\r\n  /** Defines the zoom mode for the map */\r\n  zoomInteraction?: ZoomInteractionTypes;\r\n  /** Stroke width of the regions in the map */\r\n  mapBorderWidth?: number;\r\n  /** Stroke color of the regions in the map */\r\n  mapBorderColor?: string;\r\n  /** Toggle if the UN border are shown. */\r\n  showUNBorder?: boolean;\r\n  /** Toggle if the coastal border is shown. Only applicable if default world map is used */\r\n  showCostalBorder?: boolean;\r\n  /** Toggle if the map is a world map */\r\n  isWorldMap?: boolean;\r\n  /** Map projection type */\r\n  mapProjection?: MapProjectionTypes;\r\n  /** Extend of the allowed zoom in the map */\r\n  zoomScaleExtend?: [number, number];\r\n  /** Extend of the allowed panning in the map */\r\n  zoomTranslateExtend?: [[number, number], [number, number]];\r\n  /** Toggle visibility of labels */\r\n  showLabels?: boolean;\r\n  /** Maximum value mapped to the radius chart */\r\n  maxRadiusValue?: number;\r\n  /** Data points to highlight. Use the label value from data to highlight the data point */\r\n  highlightedDataPoints?: (string | number)[];\r\n  /** Defines the opacity of the non-highlighted data */\r\n  dimmedOpacity?: number;\r\n  /** Toggles if the graph animates in when loaded.  */\r\n  animate?: boolean | AnimateDataType;\r\n  /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n  showColorScale?: boolean;\r\n  /** Toggle if color scale is collapsed by default. */\r\n  collapseColorScaleByDefault?: boolean;\r\n  /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n  customLayers?: CustomLayerDataType[];\r\n  /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n  timeline?: TimelineDataType;\r\n  /** Enable graph download option as png */\r\n  graphDownload?: boolean;\r\n  /** Enable data download option as a csv */\r\n  dataDownload?: boolean;\r\n  /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n  resetSelectionOnDoubleClick?: boolean;\r\n\r\n  // Interactions and Callbacks\r\n  /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  /** Callback for mouse click event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n\r\n  // Configuration and Options\r\n  /** Language setting  */\r\n  language?: Languages;\r\n  /** Color theme */\r\n  theme?: 'light' | 'dark';\r\n  /** Unique ID for the graph */\r\n  graphID?: string;\r\n}\r\n\r\nexport function DotDensityMap(props: Props) {\r\n  const {\r\n    data,\r\n    mapData,\r\n    graphTitle,\r\n    colors,\r\n    sources,\r\n    graphDescription,\r\n    height,\r\n    width,\r\n    footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n    colorLegendTitle,\r\n    colorDomain,\r\n    radius = 5,\r\n    scale = 0.95,\r\n    centerPoint,\r\n    padding,\r\n    mapBorderWidth = 0.5,\r\n    mapNoDataColor = Colors.light.graphNoData,\r\n    backgroundColor = false,\r\n    showLabels = false,\r\n    mapBorderColor = Colors.light.grays['gray-500'],\r\n    tooltip,\r\n    relativeHeight,\r\n    onSeriesMouseOver,\r\n    isWorldMap = true,\r\n    showColorScale = true,\r\n    zoomScaleExtend = [0.8, 6],\r\n    zoomTranslateExtend,\r\n    graphID,\r\n    highlightedDataPoints,\r\n    onSeriesMouseClick,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    language = 'en',\r\n    minHeight = 0,\r\n    theme = 'light',\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick = true,\r\n    detailsOnClick,\r\n    styles,\r\n    classNames,\r\n    mapProjection,\r\n    zoomInteraction = 'button',\r\n    animate = false,\r\n    dimmedOpacity = 0.3,\r\n    customLayers = [],\r\n    maxRadiusValue,\r\n    timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n    collapseColorScaleByDefault,\r\n    projectionRotate = [-10, 0],\r\n    rewindCoordinatesInMapData = true,\r\n    mapOverlay,\r\n    showCostalBorder = false,\r\n    showUNBorder,\r\n  } = props;\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\r\n  const { uniqDatesSorted, index, setIndex, play, setPlay, markObj, activeDate } = useTimeline(\r\n    data,\r\n    timeline,\r\n  );\r\n  const { mapShape, mapBorderShape, overlayMapShape } = useMapShapeData(\r\n    mapData,\r\n    mapOverlay?.mapData,\r\n    rewindCoordinatesInMapData,\r\n    showCostalBorder,\r\n    showUNBorder,\r\n  );\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\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 ? (\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        />\r\n      ) : null}\r\n      {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n        <Timeline\r\n          play={play}\r\n          setPlay={setPlay}\r\n          uniqDatesSorted={uniqDatesSorted}\r\n          markObj={markObj}\r\n          index={index}\r\n          setIndex={setIndex}\r\n          color={timeline.color}\r\n        />\r\n      ) : null}\r\n      <GraphArea ref={graphDiv}>\r\n        {svgWidth && svgHeight && mapShape && (mapBorderShape || !mapData) ? (\r\n          <Graph\r\n            data={data.filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))}\r\n            mapData={mapShape}\r\n            mapBorderData={\r\n              mapBorderShape\r\n                ? {\r\n                    ...mapBorderShape,\r\n                    features: mapBorderShape.features.filter(\r\n                      (el) => el.properties?.iso3cd !== 'ATA',\r\n                    ),\r\n                  }\r\n                : mapBorderShape\r\n            }\r\n            colorDomain={\r\n              data.filter((el) => el.color).length === 0\r\n                ? []\r\n                : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n            }\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            scale={scale}\r\n            centerPoint={centerPoint}\r\n            colors={\r\n              data.filter((el) => el.color).length === 0\r\n                ? colors\r\n                  ? [colors as string]\r\n                  : [Colors.primaryColors['blue-600']]\r\n                : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n            }\r\n            colorLegendTitle={colorLegendTitle}\r\n            radius={radius}\r\n            overlayMapData={overlayMapShape}\r\n            overlayMapBorderColor={mapOverlay?.mapBorderColor}\r\n            overlayMapBorderWidth={mapOverlay?.mapBorderWidth}\r\n            mapBorderWidth={mapBorderWidth}\r\n            mapNoDataColor={mapNoDataColor}\r\n            mapBorderColor={mapBorderColor}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            showLabels={showLabels}\r\n            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(\r\n                    ...data.map((d) => d.radius).filter((d) => d !== undefined && d !== null),\r\n                  )\r\n            }\r\n            collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n            projectionRotate={projectionRotate}\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            showUNBorder={showUNBorder ?? true}\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"],"mappings":"87BA+EA,SAAgB,GAAM,EAAc,CAClC,GAAM,CACJ,OACA,SACA,UACA,mBACA,cACA,SACA,SACA,QACA,SACA,eACA,UACA,cACA,iBACA,iBACA,kBACA,qBACA,kBACA,mBACA,sBACA,yBACA,qBACA,+BACA,iBACA,UACA,aACA,iBACA,mBACA,UACA,gBACA,eACA,iBACA,8BACA,oBACA,kBACA,yBACA,wBACA,gBACA,eACA,iBACA,gBACE,EACE,CAAC,EAAe,IAAA,EAAA,EAAA,UAAiD,IAAA,EAAS,EAE1E,CAAC,EAAY,IAAA,EAAA,EAAA,UACjB,IAAgC,IAAA,GAAY,EAAE,EAAQ,KAAO,CAAC,CAChE,EAGM,CAAC,EAAgB,IAAA,EAAA,EAAA,UAAmC,IAAA,EAAS,EAE7D,CAAC,EAAe,IAAA,EAAA,EAAA,UAAkC,IAAA,EAAS,EAC3D,CAAC,GAAQ,IAAA,EAAA,EAAA,UAA0C,IAAA,EAAS,EAC5D,CAAC,EAAQ,IAAA,EAAA,EAAA,UAA0C,IAAA,EAAS,EAC5D,GAAA,EAAA,EAAA,QAA+B,IAAI,EACnC,GAAA,EAAA,EAAA,QAA2B,IAAI,EAE/B,C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