{"version":3,"file":"StackedAreaChart-BqeRoB34.cjs","names":[],"sources":["../src/Components/Graphs/StackedAreaChart/Graph.tsx","../src/Components/Graphs/StackedAreaChart/index.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { pointer, select } from 'd3-selection';\r\nimport {\r\n  area,\r\n  curveLinear,\r\n  curveMonotoneX,\r\n  curveStep,\r\n  curveStepAfter,\r\n  curveStepBefore,\r\n} from 'd3-shape';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport orderBy from 'lodash.orderby';\r\nimport sum from 'lodash.sum';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport { Annotation } from '@/Components/Elements/Annotations';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\nimport { CustomArea } from '@/Components/Elements/HighlightArea/customArea';\r\nimport { RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport type {\r\n  AnimateDataType,\r\n  AnnotationSettingsDataType,\r\n  ClassNameObject,\r\n  CurveTypes,\r\n  CustomHighlightAreaSettingsDataType,\r\n  CustomLayerDataType,\r\n  HighlightAreaSettingsDataType,\r\n  MultiLineChartDataType,\r\n  PadZerosTypes,\r\n  ReferenceDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getGraphDimensions } from '@/Utils/getGraphDimensions';\r\nimport { getLineEndPoint } from '@/Utils/getLineEndPoint';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\n\r\ninterface Props {\r\n  data: MultiLineChartDataType[];\r\n  colors: string[];\r\n  width: number;\r\n  height: number;\r\n  dateFormat: string;\r\n  noOfXTicks: number;\r\n  rightMargin: number;\r\n  leftMargin: number;\r\n  topMargin: number;\r\n  bottomMargin: number;\r\n  yAxisTitle?: 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  refValues?: ReferenceDataType[];\r\n  highlightAreaSettings: HighlightAreaSettingsDataType[];\r\n  maxValue?: number;\r\n  minValue?: number;\r\n  rtl: boolean;\r\n  annotations: AnnotationSettingsDataType[];\r\n  customHighlightAreaSettings: CustomHighlightAreaSettingsDataType[];\r\n  noOfYTicks: number;\r\n  prefix: string;\r\n  suffix: string;\r\n  curveType: CurveTypes;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  precision: number;\r\n  customLayers: CustomLayerDataType[];\r\n  animate: AnimateDataType;\r\n  locale: string;\r\n  padZeros: PadZerosTypes;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n  const {\r\n    data,\r\n    width,\r\n    height,\r\n    colors,\r\n    dateFormat,\r\n    noOfXTicks,\r\n    rightMargin,\r\n    leftMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    yAxisTitle,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    highlightAreaSettings,\r\n    refValues,\r\n    minValue,\r\n    maxValue,\r\n    rtl,\r\n    annotations,\r\n    customHighlightAreaSettings,\r\n    noOfYTicks,\r\n    prefix,\r\n    suffix,\r\n    curveType,\r\n    styles,\r\n    classNames,\r\n    precision,\r\n    customLayers,\r\n    animate,\r\n    locale,\r\n    padZeros,\r\n  } = props;\r\n  const svgRef = useRef(null);\r\n  const isInView = useInView(svgRef, {\r\n    once: animate.once,\r\n    amount: animate.amount,\r\n  });\r\n  const curve =\r\n    curveType === 'linear'\r\n      ? curveLinear\r\n      : curveType === 'step'\r\n        ? curveStep\r\n        : curveType === 'stepAfter'\r\n          ? curveStepAfter\r\n          : curveType === 'stepBefore'\r\n            ? curveStepBefore\r\n            : curveMonotoneX;\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 margin = {\r\n    top: topMargin,\r\n    bottom: bottomMargin,\r\n    left: yAxisTitle ? leftMargin + 30 : leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  const MouseoverRectRef = useRef(null);\r\n  const dataFormatted = orderBy(\r\n    data.map((d) => ({\r\n      ...d,\r\n      date: parse(`${d.date}`, dateFormat, new Date()),\r\n    })),\r\n    ['date'],\r\n    ['asc'],\r\n  );\r\n  const highlightAreaSettingsFormatted = highlightAreaSettings.map((d) => ({\r\n    ...d,\r\n    coordinates: [\r\n      d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n      d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n    ],\r\n  }));\r\n  const customHighlightAreaSettingsFormatted = customHighlightAreaSettings.map((d) => ({\r\n    ...d,\r\n    coordinates: d.coordinates.map((el, j) =>\r\n      j % 2 === 0 ? parse(`${el}`, dateFormat, new Date()) : (el as number),\r\n    ),\r\n  }));\r\n  const dataArray = dataFormatted[0].y.map((_d, i) => {\r\n    return dataFormatted.map((el) => ({\r\n      date: el.date,\r\n      y0: i === 0 ? 0 : sum(el.y.filter((_element, k) => k < i)),\r\n      y1: sum(el.y.filter((_element, k) => k <= i)),\r\n    }));\r\n  });\r\n  const { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n  const minYear = dataFormatted[0].date;\r\n  const maxYear = dataFormatted[dataFormatted.length - 1].date;\r\n  const minParam = checkIfNullOrUndefined(minValue) ? 0 : (minValue as number);\r\n  const maxParam: number = checkIfNullOrUndefined(maxValue)\r\n    ? Math.max(...data.map((d) => sum(d.y) || 0))\r\n    : (maxValue as number);\r\n\r\n  const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n  const y = scaleLinear().domain([minParam, maxParam]).range([graphHeight, 0]).nice();\r\n\r\n  const areaShape = area()\r\n    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n    .x((d: any) => x(d.date))\r\n    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n    .y0((d: any) => y(d.y0))\r\n    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n    .y1((d: any) => y(d.y1))\r\n    .curve(curve);\r\n  const yTicks = y.ticks(noOfYTicks);\r\n  const xTicks = x.ticks(noOfXTicks);\r\n  useEffect(() => {\r\n    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n    const mousemove = (event: any) => {\r\n      const selectedData =\r\n        dataFormatted[\r\n          bisectCenter(\r\n            dataFormatted.map((d) => d.date),\r\n            x.invert(pointer(event)[0]),\r\n            0,\r\n          )\r\n        ];\r\n      setMouseOverData(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n      onSeriesMouseOver?.(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n      setEventY(event.clientY);\r\n      setEventX(event.clientX);\r\n    };\r\n    const mouseout = () => {\r\n      setMouseOverData(undefined);\r\n      setEventX(undefined);\r\n      setEventY(undefined);\r\n      onSeriesMouseOver?.(undefined);\r\n    };\r\n    select(MouseoverRectRef.current).on('mousemove', mousemove).on('mouseout', mouseout);\r\n    onSeriesMouseOver?.(undefined);\r\n  }, [x, dataFormatted, onSeriesMouseOver]);\r\n  return (\r\n    <>\r\n      <motion.svg\r\n        width={`${width}px`}\r\n        height={`${height}px`}\r\n        viewBox={`0 0 ${width} ${height}`}\r\n        direction='ltr'\r\n        ref={svgRef}\r\n      >\r\n        <AnimatePresence>\r\n          <motion.g transform={`translate(${margin.left},${margin.top})`}>\r\n            <HighlightArea\r\n              areaSettings={highlightAreaSettingsFormatted}\r\n              width={graphWidth}\r\n              height={graphHeight}\r\n              scale={x}\r\n              animate={animate}\r\n              isInView={isInView}\r\n            />\r\n            <CustomArea\r\n              animate={animate}\r\n              areaSettings={customHighlightAreaSettingsFormatted}\r\n              scaleX={x}\r\n              scaleY={y}\r\n              isInView={isInView}\r\n            />\r\n            <g>\r\n              <YTicksAndGridLines\r\n                values={yTicks.filter((d) => d !== 0)}\r\n                y={yTicks.filter((d) => d !== 0).map((d) => y(d))}\r\n                x1={0 - leftMargin}\r\n                x2={graphWidth + margin.right}\r\n                styles={{\r\n                  gridLines: styles?.yAxis?.gridLines,\r\n                  labels: styles?.yAxis?.labels,\r\n                }}\r\n                classNames={{\r\n                  gridLines: classNames?.yAxis?.gridLines,\r\n                  labels: classNames?.yAxis?.labels,\r\n                }}\r\n                suffix={suffix}\r\n                prefix={prefix}\r\n                labelType='secondary'\r\n                showGridLines\r\n                labelPos='vertical'\r\n                precision={precision}\r\n                locale={locale}\r\n                padZeros={padZeros}\r\n              />\r\n              <Axis\r\n                y1={y(minParam < 0 ? 0 : minParam)}\r\n                y2={y(minParam < 0 ? 0 : minParam)}\r\n                x1={0 - leftMargin}\r\n                x2={graphWidth + margin.right}\r\n                label={numberFormattingFunction(\r\n                  minParam < 0 ? 0 : minParam,\r\n                  undefined,\r\n                  precision,\r\n                  prefix,\r\n                  suffix,\r\n                  locale,\r\n                  padZeros,\r\n                )}\r\n                labelPos={{\r\n                  x: 0 - leftMargin,\r\n                  dx: 0,\r\n                  dy: maxParam < 0 ? '1em' : -5,\r\n                  y: y(minParam < 0 ? 0 : minParam),\r\n                }}\r\n                classNames={{\r\n                  axis: classNames?.xAxis?.axis,\r\n                  label: classNames?.yAxis?.labels,\r\n                }}\r\n                styles={{\r\n                  axis: styles?.xAxis?.axis,\r\n                  label: styles?.yAxis?.labels,\r\n                }}\r\n              />\r\n              <AxisTitle\r\n                x={0 - leftMargin - 15}\r\n                y={graphHeight / 2}\r\n                style={styles?.yAxis?.title}\r\n                className={classNames?.yAxis?.title}\r\n                text={yAxisTitle}\r\n                rotate90\r\n              />\r\n            </g>\r\n            <XTicksAndGridLines\r\n              values={xTicks.map((d) => format(d, dateFormat))}\r\n              x={xTicks.map((d) => x(d))}\r\n              y1={0}\r\n              y2={graphHeight}\r\n              styles={{\r\n                gridLines: styles?.xAxis?.gridLines,\r\n                labels: styles?.xAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: cn('opacity-0', classNames?.xAxis?.gridLines),\r\n                labels: cn(\r\n                  'fill-content-primary xs:max-[360px]:hidden text-[8px] sm:text-[9px] md:text-2xs lg:text-xs',\r\n                  classNames?.xAxis?.labels,\r\n                ),\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='primary'\r\n              showGridLines\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n            {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n            <motion.g>\r\n              {dataArray.map((d, i) => {\r\n                return (\r\n                  <motion.path\r\n                    // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n                    key={i}\r\n                    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                    d={areaShape(d as any) as string}\r\n                    exit={{\r\n                      opacity: 0,\r\n                      transition: { duration: animate.duration },\r\n                    }}\r\n                    variants={{\r\n                      initial: {\r\n                        d: areaShape(\r\n                          // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                          d.map((el) => ({ ...el, y0: 0, y1: 0 })) as any,\r\n                        ) as string as string,\r\n                        opacity: 0,\r\n                      },\r\n                      whileInView: {\r\n                        // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n                        d: areaShape(d as any) as string,\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                    style={{\r\n                      fill: colors[i],\r\n                      opacity: 0.8,\r\n                    }}\r\n                  />\r\n                );\r\n              })}\r\n              {mouseOverData ? (\r\n                <line\r\n                  y1={0}\r\n                  y2={graphHeight}\r\n                  x1={x(mouseOverData.date)}\r\n                  x2={x(mouseOverData.date)}\r\n                  className={cn('undp-tick-line stroke-foreground', classNames?.mouseOverLine)}\r\n                  style={styles?.mouseOverLine}\r\n                />\r\n              ) : null}\r\n            </motion.g>\r\n            {refValues?.map((el) => (\r\n              <RefLineY\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                y={y(el.value as number)}\r\n                x1={0 - leftMargin}\r\n                x2={graphWidth + margin.right}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n            <g>\r\n              {annotations.map((d) => {\r\n                const endPoints = getLineEndPoint(\r\n                  {\r\n                    x: d.xCoordinate\r\n                      ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n                      : 0 + (d.xOffset || 0),\r\n                    y: d.yCoordinate\r\n                      ? y(d.yCoordinate as number) + (d.yOffset || 0) - 8\r\n                      : 0 + (d.yOffset || 0) - 8,\r\n                  },\r\n                  {\r\n                    x: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 0,\r\n                    y: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n                  },\r\n                  checkIfNullOrUndefined(d.connectorRadius) ? 3.5 : (d.connectorRadius as number),\r\n                );\r\n                const connectorSettings = d.showConnector\r\n                  ? {\r\n                      y1: endPoints.y,\r\n                      x1: endPoints.x,\r\n                      y2: d.yCoordinate\r\n                        ? y(d.yCoordinate as number) + (d.yOffset || 0)\r\n                        : 0 + (d.yOffset || 0),\r\n                      x2: d.xCoordinate\r\n                        ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n                        : 0 + (d.xOffset || 0),\r\n                      cx: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 0,\r\n                      cy: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n                      circleRadius: checkIfNullOrUndefined(d.connectorRadius)\r\n                        ? 3.5\r\n                        : (d.connectorRadius as number),\r\n                      strokeWidth: d.showConnector === true ? 2 : Math.min(d.showConnector || 0, 1),\r\n                    }\r\n                  : undefined;\r\n                const labelSettings = {\r\n                  y: d.yCoordinate\r\n                    ? y(d.yCoordinate as number) + (d.yOffset || 0) - 8\r\n                    : 0 + (d.yOffset || 0) - 8,\r\n                  x: rtl\r\n                    ? 0\r\n                    : d.xCoordinate\r\n                      ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n                      : 0 + (d.xOffset || 0),\r\n                  width: rtl\r\n                    ? d.xCoordinate\r\n                      ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n                      : 0 + (d.xOffset || 0)\r\n                    : graphWidth +\r\n                      margin.right -\r\n                      (d.xCoordinate\r\n                        ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n                        : 0 + (d.xOffset || 0)),\r\n                  maxWidth: d.maxWidth,\r\n                  fontWeight: d.fontWeight,\r\n                  align: d.align,\r\n                };\r\n                return (\r\n                  <Annotation\r\n                    key={d.text}\r\n                    color={d.color}\r\n                    connectorsSettings={connectorSettings}\r\n                    labelSettings={labelSettings}\r\n                    text={d.text}\r\n                    classNames={d.classNames}\r\n                    styles={d.styles}\r\n                    animate={animate}\r\n                    isInView={isInView}\r\n                  />\r\n                );\r\n              })}\r\n            </g>\r\n            {customLayers.filter((d) => d.position === 'after').map((d) => d.layer)}\r\n            <rect\r\n              ref={MouseoverRectRef}\r\n              style={{\r\n                fill: 'none',\r\n                pointerEvents: 'all',\r\n              }}\r\n              width={graphWidth}\r\n              height={graphHeight}\r\n            />\r\n          </motion.g>\r\n        </AnimatePresence>\r\n      </motion.svg>\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 { useRef } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { useElementSize } from '@/hooks/useElementSize';\r\nimport type {\r\n  AnimateDataType,\r\n  AnnotationSettingsDataType,\r\n  AreaChartDataType,\r\n  ClassNameObject,\r\n  CurveTypes,\r\n  CustomHighlightAreaSettingsDataType,\r\n  CustomLayerDataType,\r\n  HighlightAreaSettingsDataType,\r\n  Languages,\r\n  NumberFormatOptions,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { Graph } from './Graph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: AreaChartDataType[];\r\n\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** array of colors for different lines and areas */\r\n  colors?: 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  /** 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  /** Left margin of the graph */\r\n  leftMargin?: number;\r\n  /** Right margin of the graph */\r\n  rightMargin?: number;\r\n  /** Top margin of the graph */\r\n  topMargin?: number;\r\n  /** Bottom margin of the graph */\r\n  bottomMargin?: number;\r\n\r\n  // Values and Ticks\r\n  /** Maximum value for the chart */\r\n  maxValue?: number;\r\n  /** Minimum value for the chart */\r\n  minValue?: number;\r\n  /** Reference values for comparison */\r\n  refValues?: ReferenceDataType[];\r\n  /** No. of ticks on the x-axis  */\r\n  noOfXTicks?: number;\r\n  /** No. of ticks on the y-axis  */\r\n  noOfYTicks?: number;\r\n\r\n  // Graph Parameters\r\n  /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format)  */\r\n  dateFormat?: string;\r\n  /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n  showColorScale?: boolean;\r\n  /** Title for the Y-axis */\r\n  yAxisTitle?: string;\r\n  /** Annotations on the chart */\r\n  annotations?: AnnotationSettingsDataType[];\r\n  /** Highlighted area(square) on the chart  */\r\n  highlightAreaSettings?: HighlightAreaSettingsDataType[];\r\n  /** Highlighted area(custom shape) on the chart  */\r\n  customHighlightAreaSettings?: CustomHighlightAreaSettingsDataType[];\r\n  /** Curve type for the line */\r\n  curveType?: CurveTypes;\r\n  /** Configuration options for controlling number formatting, localization, prefixes/suffixes, precision, and zero padding. */\r\n  numberDisplayOptions?: NumberFormatOptions;\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  /** Toggles if the graph animates in when loaded.  */\r\n  animate?: boolean | AnimateDataType;\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\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  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_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 AreaChart(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors = Colors.light.categoricalColors.colors,\r\n    sources,\r\n    graphDescription,\r\n    height,\r\n    width,\r\n    footNote,\r\n    noOfXTicks = 10,\r\n    dateFormat = 'yyyy',\r\n    colorDomain,\r\n    padding,\r\n    backgroundColor = false,\r\n    colorLegendTitle,\r\n    leftMargin = 50,\r\n    rightMargin = 20,\r\n    topMargin = 20,\r\n    bottomMargin = 25,\r\n    highlightAreaSettings = [],\r\n    tooltip,\r\n    relativeHeight,\r\n    onSeriesMouseOver,\r\n    refValues = [],\r\n    graphID,\r\n    minValue,\r\n    maxValue,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    showColorScale = true,\r\n    language = 'en',\r\n    minHeight = 0,\r\n    annotations = [],\r\n    customHighlightAreaSettings = [],\r\n    theme = 'light',\r\n    ariaLabel,\r\n    yAxisTitle,\r\n    noOfYTicks = 5,\r\n    curveType = 'curve',\r\n    styles,\r\n    classNames,\r\n    customLayers = [],\r\n    animate = false,\r\n    numberDisplayOptions,\r\n  } = props;\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\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 || 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      {showColorScale !== false && data.length > 0 ? (\r\n        <ColorLegend\r\n          colorDomain={colorDomain}\r\n          colors={colors}\r\n          colorLegendTitle={colorLegendTitle}\r\n          showNAColor={false}\r\n          className={classNames?.colorLegend}\r\n        />\r\n      ) : null}\r\n      <GraphArea ref={graphDiv}>\r\n        {data.length === 0 && <EmptyState />}\r\n        {svgWidth && svgHeight && data.length > 0 ? (\r\n          <Graph\r\n            data={data}\r\n            colors={colors}\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            dateFormat={dateFormat}\r\n            noOfXTicks={noOfXTicks}\r\n            leftMargin={leftMargin}\r\n            rightMargin={rightMargin}\r\n            topMargin={topMargin}\r\n            bottomMargin={bottomMargin}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            highlightAreaSettings={highlightAreaSettings}\r\n            refValues={refValues}\r\n            minValue={minValue}\r\n            maxValue={maxValue}\r\n            rtl={language === 'he' || language === 'ar'}\r\n            annotations={annotations}\r\n            customHighlightAreaSettings={customHighlightAreaSettings}\r\n            yAxisTitle={yAxisTitle}\r\n            noOfYTicks={noOfYTicks}\r\n            curveType={curveType}\r\n            styles={styles}\r\n            classNames={classNames}\r\n            customLayers={customLayers}\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            locale={numberDisplayOptions?.locale || 'en'}\r\n            padZeros={numberDisplayOptions?.padZeros || 'none'}\r\n            suffix={numberDisplayOptions?.suffix || ''}\r\n            prefix={numberDisplayOptions?.prefix || ''}\r\n            precision={numberDisplayOptions?.precision ?? 2}\r\n          />\r\n        ) : null}\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":"u1CAiFA,SAAgB,GAAM,EAAc,CAClC,GAAM,CACJ,OACA,QACA,SACA,UACA,aACA,aACA,cACA,aACA,aACA,eACA,aACA,UACA,oBACA,yBACA,aACA,WACA,WACA,MACA,eACA,+BACA,aACA,SACA,SACA,YACA,SACA,aACA,YACA,eACA,UACA,SACA,YACE,EACE,IAAA,EAAA,EAAA,QAAgB,IAAI,EACpB,EAAW,GAAA,EAAU,GAAQ,CACjC,KAAM,EAAQ,KACd,OAAQ,EAAQ,MAClB,CAAC,EACK,GACJ,IAAc,SACV,EAAA,EACA,IAAc,OACZ,EAAA,EAC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