{"version":3,"file":"DifferenceLineChart-Dry9dh1E.cjs","names":[],"sources":["../src/Components/Graphs/LineCharts/DifferenceLineChart/Graph.tsx","../src/Components/Graphs/LineCharts/DifferenceLineChart/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  line,\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 { 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  DifferenceLineChartDataType,\r\n  HighlightAreaSettingsDataType,\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: DifferenceLineChartDataType[];\r\n  lineColors: [string, string];\r\n  diffAreaColors: [string, string];\r\n  width: number;\r\n  height: number;\r\n  suffix: string;\r\n  prefix: string;\r\n  dateFormat: string;\r\n  showValues: boolean;\r\n  noOfXTicks: number | 'showAvailableOnly';\r\n  rightMargin: number;\r\n  leftMargin: number;\r\n  topMargin: number;\r\n  bottomMargin: number;\r\n  highlightAreaSettings: HighlightAreaSettingsDataType[];\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  animate: AnimateDataType;\r\n  rtl: boolean;\r\n  colorDomain: [string, string];\r\n  showColorLegendAtTop?: boolean;\r\n  idSuffix: string;\r\n  strokeWidth: number;\r\n  showDots: boolean;\r\n  refValues: ReferenceDataType[];\r\n  maxValue?: number;\r\n  minValue?: number;\r\n  annotations: AnnotationSettingsDataType[];\r\n  customHighlightAreaSettings: CustomHighlightAreaSettingsDataType[];\r\n  yAxisTitle?: string;\r\n  noOfYTicks: number;\r\n  minDate?: string | number;\r\n  maxDate?: string | number;\r\n  curveType: CurveTypes;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  precision: number;\r\n  customLayers: CustomLayerDataType[];\r\n  locale: string;\r\n  naLabel: string;\r\n  padZeros: PadZerosTypes;\r\n}\r\n\r\ninterface FormattedDataType {\r\n  y1: number;\r\n  y2: number;\r\n  date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n  const {\r\n    data,\r\n    width,\r\n    height,\r\n    lineColors,\r\n    suffix,\r\n    prefix,\r\n    dateFormat,\r\n    showValues,\r\n    noOfXTicks,\r\n    rightMargin,\r\n    leftMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    tooltip,\r\n    highlightAreaSettings,\r\n    onSeriesMouseOver,\r\n    animate,\r\n    rtl,\r\n    showColorLegendAtTop,\r\n    colorDomain,\r\n    diffAreaColors,\r\n    idSuffix,\r\n    strokeWidth,\r\n    showDots,\r\n    refValues,\r\n    minValue,\r\n    maxValue,\r\n    annotations,\r\n    customHighlightAreaSettings,\r\n    yAxisTitle,\r\n    noOfYTicks,\r\n    minDate,\r\n    maxDate,\r\n    curveType,\r\n    styles,\r\n    classNames,\r\n    precision,\r\n    customLayers,\r\n    locale,\r\n    naLabel,\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 [hasAnimatedOnce, setHasAnimatedOnce] = useState(false);\r\n\r\n  useEffect(() => {\r\n    if (isInView && !hasAnimatedOnce) {\r\n      const timeout = setTimeout(\r\n        () => {\r\n          setHasAnimatedOnce(true);\r\n        },\r\n        (animate.duration + 0.5) * 1000,\r\n      );\r\n      return () => clearTimeout(timeout);\r\n    }\r\n  }, [isInView, hasAnimatedOnce, animate.duration]);\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 { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n  const minYear = minDate ? parse(`${minDate}`, dateFormat, new Date()) : dataFormatted[0].date;\r\n  const maxYear = maxDate\r\n    ? parse(`${maxDate}`, dateFormat, new Date())\r\n    : dataFormatted[dataFormatted.length - 1].date;\r\n  const minParam1 =\r\n    Math.min(...dataFormatted.map((d) => d.y1)) !== Infinity\r\n      ? Math.min(...dataFormatted.map((d) => d.y1)) > 0\r\n        ? 0\r\n        : Math.min(...dataFormatted.map((d) => d.y1))\r\n      : 0;\r\n  const minParam2 =\r\n    Math.min(...dataFormatted.map((d) => d.y2)) !== Infinity\r\n      ? Math.min(...dataFormatted.map((d) => d.y2)) > 0\r\n        ? 0\r\n        : Math.min(...dataFormatted.map((d) => d.y2))\r\n      : 0;\r\n  const maxParam1 =\r\n    Math.max(...dataFormatted.map((d) => d.y1)) !== Infinity\r\n      ? Math.max(...dataFormatted.map((d) => d.y1))\r\n      : 0;\r\n  const maxParam2 =\r\n    Math.max(...dataFormatted.map((d) => d.y2)) !== Infinity\r\n      ? Math.max(...dataFormatted.map((d) => d.y2))\r\n      : 0;\r\n\r\n  const minParam = checkIfNullOrUndefined(minValue)\r\n    ? minParam1 < minParam2\r\n      ? minParam1\r\n      : minParam2\r\n    : (minValue as number);\r\n  const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n  const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n\r\n  const y = scaleLinear()\r\n    .domain([\r\n      checkIfNullOrUndefined(minValue) ? minParam : (minValue as number),\r\n      checkIfNullOrUndefined(maxValue) ? (maxParam > 0 ? maxParam : 0) : (maxValue as number),\r\n    ])\r\n    .range([graphHeight, 0])\r\n    .nice();\r\n\r\n  const lineShape1 = line<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y((d) => y(d.y1))\r\n    .curve(curve);\r\n\r\n  const lineShape2 = line<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y((d) => y(d.y2))\r\n    .curve(curve);\r\n\r\n  const mainGraphArea = area<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y1((d) => y(d.y1))\r\n    .y0((d) => y(d.y2))\r\n    .curve(curve);\r\n  const mainGraphArea1 = area<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y1((d) => y(d.y1))\r\n    .y0(0)\r\n    .curve(curve);\r\n  const mainGraphArea2 = area<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y1((d) => y(d.y2))\r\n    .y0(0)\r\n    .curve(curve);\r\n  const yTicks = y.ticks(noOfYTicks);\r\n  const xTicks =\r\n    noOfXTicks === 'showAvailableOnly'\r\n      ? [...new Set(dataFormatted.map((d) => d.date.getTime()))].map((t) => new Date(t))\r\n      : 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  }, [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        <g transform={`translate(${margin.left},${margin.top})`}>\r\n          <clipPath id={`above${idSuffix}`}>\r\n            <path\r\n              // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n              d={mainGraphArea2(dataFormatted as any) as string}\r\n              style={{ fill: 'none' }}\r\n            />\r\n          </clipPath>\r\n          <clipPath id={`below${idSuffix}`}>\r\n            <path\r\n              // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n              d={mainGraphArea1(dataFormatted as any) as string}\r\n              style={{ fill: 'none' }}\r\n            />\r\n          </clipPath>\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            areaSettings={customHighlightAreaSettingsFormatted}\r\n            scaleX={x}\r\n            scaleY={y}\r\n            animate={animate}\r\n            isInView={isInView}\r\n          />\r\n          <g>\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                  y: y(minParam < 0 ? 0 : minParam),\r\n                  dx: 0,\r\n                  dy: maxParam < 0 ? '1rem' : -5,\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          </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-[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          <g>\r\n            <motion.path\r\n              clipPath={`url(#below${idSuffix})`}\r\n              d={mainGraphArea(dataFormatted) || ''}\r\n              style={{ fill: diffAreaColors[1] }}\r\n              exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n              variants={{\r\n                initial: { opacity: 1 },\r\n                whileInView: { opacity: 1, transition: { duration: animate.duration } },\r\n              }}\r\n              initial='initial'\r\n              animate={isInView ? 'whileInView' : 'initial'}\r\n            />\r\n            <motion.path\r\n              clipPath={`url(#above${idSuffix})`}\r\n              d={mainGraphArea(dataFormatted) || ''}\r\n              style={{ fill: diffAreaColors[0] }}\r\n              exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n              variants={{\r\n                initial: { opacity: 0 },\r\n                whileInView: { opacity: 1, transition: { duration: animate.duration } },\r\n              }}\r\n              initial='initial'\r\n              animate={isInView ? 'whileInView' : 'initial'}\r\n            />\r\n          </g>\r\n          <g>\r\n            <motion.path\r\n              d={lineShape1(dataFormatted) || ''}\r\n              style={{\r\n                fill: 'none',\r\n                stroke: lineColors[0],\r\n                strokeWidth,\r\n              }}\r\n              exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n              variants={{\r\n                initial: { pathLength: 0, d: lineShape1(dataFormatted) || '', opacity: 1 },\r\n                whileInView: {\r\n                  pathLength: 1,\r\n                  d: lineShape1(dataFormatted) || '',\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            />\r\n            <motion.path\r\n              style={{\r\n                fill: 'none',\r\n                stroke: lineColors[1],\r\n                strokeWidth,\r\n              }}\r\n              exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n              variants={{\r\n                initial: { pathLength: 0, d: lineShape2(dataFormatted) || '', opacity: 1 },\r\n                whileInView: {\r\n                  pathLength: 1,\r\n                  d: lineShape2(dataFormatted) || '',\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            />\r\n            {showColorLegendAtTop ? null : (\r\n              <g>\r\n                <motion.text\r\n                  key={colorDomain[0]}\r\n                  className='text-xs'\r\n                  dx={5}\r\n                  dy={4}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                  variants={{\r\n                    initial: {\r\n                      opacity: 0,\r\n                      x: x(dataFormatted[dataFormatted.length - 1].date),\r\n                      y: y(dataFormatted[dataFormatted.length - 1].y1 as number),\r\n                      fill: lineColors[0],\r\n                    },\r\n                    whileInView: {\r\n                      opacity: 1,\r\n                      x: x(dataFormatted[dataFormatted.length - 1].date),\r\n                      y: y(dataFormatted[dataFormatted.length - 1].y1 as number),\r\n                      fill: lineColors[0],\r\n                      transition: {\r\n                        duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n                        delay: hasAnimatedOnce ? 0 : animate.duration,\r\n                      },\r\n                    },\r\n                  }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                >\r\n                  {colorDomain[0]}\r\n                </motion.text>\r\n                <motion.text\r\n                  key={colorDomain[1]}\r\n                  className='text-xs'\r\n                  dx={5}\r\n                  dy={4}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                  variants={{\r\n                    initial: {\r\n                      opacity: 0,\r\n                      x: x(dataFormatted[dataFormatted.length - 1].date),\r\n                      y: y(dataFormatted[dataFormatted.length - 1].y2 as number),\r\n                      fill: lineColors[1],\r\n                    },\r\n                    whileInView: {\r\n                      opacity: 1,\r\n                      x: x(dataFormatted[dataFormatted.length - 1].date),\r\n                      y: y(dataFormatted[dataFormatted.length - 1].y2 as number),\r\n                      fill: lineColors[1],\r\n                      transition: {\r\n                        duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n                        delay: hasAnimatedOnce ? 0 : animate.duration,\r\n                      },\r\n                    },\r\n                  }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                >\r\n                  {colorDomain[1]}\r\n                </motion.text>\r\n              </g>\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            {dataFormatted.map((d, i) => (\r\n              // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n              <motion.g key={i}>\r\n                {!checkIfNullOrUndefined(d.y1) ? (\r\n                  <>\r\n                    {showDots ? (\r\n                      <motion.circle\r\n                        r={\r\n                          graphWidth / dataFormatted.length < 5\r\n                            ? 0\r\n                            : graphWidth / dataFormatted.length < 20\r\n                              ? 2\r\n                              : 4\r\n                        }\r\n                        exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        variants={{\r\n                          initial: { opacity: 0, cx: x(d.date), cy: y(d.y1), fill: lineColors[0] },\r\n                          whileInView: {\r\n                            opacity: 1,\r\n                            fill: lineColors[0],\r\n                            transition: { duration: 0.5, delay: animate.duration },\r\n                            cx: x(d.date),\r\n                            cy: y(d.y1),\r\n                          },\r\n                        }}\r\n                        initial='initial'\r\n                        animate={isInView ? 'whileInView' : 'initial'}\r\n                      />\r\n                    ) : null}\r\n                    {showValues ? (\r\n                      <motion.text\r\n                        dy={d.y2 < d.y1 ? -8 : '1em'}\r\n                        style={{\r\n                          textAnchor: 'middle',\r\n                          ...(styles?.graphObjectValues || {}),\r\n                        }}\r\n                        className={cn(\r\n                          'graph-value graph-value-line-1 text-xs font-bold',\r\n                          classNames?.graphObjectValues,\r\n                        )}\r\n                        exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        variants={{\r\n                          initial: { opacity: 0, x: x(d.date), y: y(d.y1), fill: lineColors[0] },\r\n                          whileInView: {\r\n                            opacity: 1,\r\n                            fill: lineColors[0],\r\n                            x: x(d.date),\r\n                            y: y(d.y1),\r\n                            transition: {\r\n                              duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n                              delay: hasAnimatedOnce ? 0 : animate.duration,\r\n                            },\r\n                          },\r\n                        }}\r\n                        initial='initial'\r\n                        animate={isInView ? 'whileInView' : 'initial'}\r\n                      >\r\n                        {numberFormattingFunction(\r\n                          d.y1,\r\n                          naLabel,\r\n                          precision,\r\n                          prefix,\r\n                          suffix,\r\n                          locale,\r\n                          padZeros,\r\n                        )}\r\n                      </motion.text>\r\n                    ) : null}\r\n                  </>\r\n                ) : null}\r\n                {!checkIfNullOrUndefined(d.y2) ? (\r\n                  <>\r\n                    {showDots ? (\r\n                      <motion.circle\r\n                        r={\r\n                          graphWidth / dataFormatted.length < 5\r\n                            ? 0\r\n                            : graphWidth / dataFormatted.length < 20\r\n                              ? 2\r\n                              : 4\r\n                        }\r\n                        exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        variants={{\r\n                          initial: { opacity: 0, cx: x(d.date), cy: y(d.y2), fill: lineColors[1] },\r\n                          whileInView: {\r\n                            opacity: 1,\r\n                            fill: lineColors[1],\r\n                            transition: {\r\n                              duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n                              delay: hasAnimatedOnce ? 0 : animate.duration,\r\n                            },\r\n                            cx: x(d.date),\r\n                            cy: y(d.y2),\r\n                          },\r\n                        }}\r\n                        initial='initial'\r\n                        animate={isInView ? 'whileInView' : 'initial'}\r\n                      />\r\n                    ) : null}\r\n                    {showValues ? (\r\n                      <motion.text\r\n                        dy={d.y2 > d.y1 ? -8 : '1em'}\r\n                        style={{\r\n                          textAnchor: 'middle',\r\n                          ...(styles?.graphObjectValues || {}),\r\n                        }}\r\n                        className={cn(\r\n                          'graph-value graph-value-line-2 text-xs font-bold',\r\n                          classNames?.graphObjectValues,\r\n                        )}\r\n                        exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        variants={{\r\n                          initial: { opacity: 0, x: x(d.date), y: y(d.y2), fill: lineColors[1] },\r\n                          whileInView: {\r\n                            opacity: 1,\r\n                            x: x(d.date),\r\n                            y: y(d.y2),\r\n                            fill: lineColors[1],\r\n                            transition: {\r\n                              duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n                              delay: hasAnimatedOnce ? 0 : animate.duration,\r\n                            },\r\n                          },\r\n                        }}\r\n                        initial='initial'\r\n                        animate={isInView ? 'whileInView' : 'initial'}\r\n                      >\r\n                        {numberFormattingFunction(\r\n                          d.y2,\r\n                          naLabel,\r\n                          precision,\r\n                          prefix,\r\n                          suffix,\r\n                          locale,\r\n                          padZeros,\r\n                        )}\r\n                      </motion.text>\r\n                    ) : null}\r\n                  </>\r\n                ) : null}\r\n              </motion.g>\r\n            ))}\r\n          </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                    cy: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n                    cx: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 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        </g>\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  ClassNameObject,\r\n  CurveTypes,\r\n  CustomHighlightAreaSettingsDataType,\r\n  CustomLayerDataType,\r\n  DifferenceLineChartDataType,\r\n  HighlightAreaSettingsDataType,\r\n  Languages,\r\n  NumberFormatOptions,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\nimport { getNoOfTicks } from '@/Utils/getNoOfTicks';\r\nimport { Graph } from './Graph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: DifferenceLineChartDataType[];\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 the 2 lines */\r\n  lineColors?: [string, string];\r\n  /** Array of colors to highlight the negative and positive difference between the lines */\r\n  diffAreaColors?: [string, string];\r\n  /** Toggle the visibility of color legend between the top of the graphs and next to the line */\r\n  showColorLegendAtTop?: boolean;\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  /** Maximum value of the date for the chart */\r\n  maxDate?: string | number;\r\n  /** Minimum value of the date for the chart */\r\n  minDate?: string | number;\r\n  /** Reference values for comparison */\r\n  refValues?: ReferenceDataType[];\r\n  /** No. of ticks on the x-axis or use the value `showAvailableOnly` to show only year which are present in data  */\r\n  noOfXTicks?: number | 'showAvailableOnly';\r\n  /** No. of ticks on the y-axis  */\r\n  noOfYTicks?: number;\r\n\r\n  // Graph Parameters\r\n  /** Toggle visibility of values */\r\n  showValues?: boolean;\r\n  /** Toggle visibility of dots on the line */\r\n  showDots?: boolean;\r\n  /** Stroke width of the line */\r\n  strokeWidth?: number;\r\n  /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n  animate?: boolean | AnimateDataType;\r\n  /** Labels for the lines  */\r\n  labels: [string, string];\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  /** 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  /** Defines how “NA” values should be displayed/labelled in the graph */\r\n  naLabel?: string;\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  /** 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 DifferenceLineChart(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\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    showValues = false,\r\n    padding,\r\n    lineColors = [\r\n      Colors.light.categoricalColors.colors[0],\r\n      Colors.light.categoricalColors.colors[1],\r\n    ],\r\n    backgroundColor = false,\r\n    leftMargin = 30,\r\n    rightMargin = 50,\r\n    topMargin = 20,\r\n    bottomMargin = 25,\r\n    tooltip,\r\n    highlightAreaSettings = [],\r\n    relativeHeight,\r\n    onSeriesMouseOver,\r\n    graphID,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    animate = false,\r\n    language = 'en',\r\n    minHeight = 0,\r\n    labels,\r\n    showColorLegendAtTop = false,\r\n    colorLegendTitle,\r\n    diffAreaColors = [Colors.alerts.red, Colors.alerts.darkGreen],\r\n    strokeWidth = 2,\r\n    showDots = true,\r\n    refValues = [],\r\n    minValue,\r\n    maxValue,\r\n    annotations = [],\r\n    customHighlightAreaSettings = [],\r\n    theme = 'light',\r\n    ariaLabel,\r\n    yAxisTitle,\r\n    noOfYTicks = 5,\r\n    minDate,\r\n    maxDate,\r\n    curveType = 'curve',\r\n    styles,\r\n    classNames,\r\n    customLayers = [],\r\n    naLabel = 'NA',\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      {showColorLegendAtTop && data.length > 0 ? (\r\n        <ColorLegend\r\n          colorDomain={labels}\r\n          colorLegendTitle={colorLegendTitle}\r\n          colors={lineColors}\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            lineColors={lineColors}\r\n            colorDomain={labels}\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            dateFormat={dateFormat}\r\n            showValues={showValues}\r\n            noOfXTicks={noOfXTicks ?? getNoOfTicks(svgWidth)}\r\n            leftMargin={leftMargin}\r\n            rightMargin={rightMargin}\r\n            topMargin={topMargin}\r\n            bottomMargin={bottomMargin}\r\n            highlightAreaSettings={highlightAreaSettings}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            showColorLegendAtTop={showColorLegendAtTop}\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            rtl={language === 'he' || language === 'ar'}\r\n            diffAreaColors={diffAreaColors}\r\n            idSuffix={generateRandomString(8)}\r\n            strokeWidth={strokeWidth}\r\n            showDots={showDots}\r\n            refValues={refValues}\r\n            minValue={minValue}\r\n            maxValue={maxValue}\r\n            annotations={annotations}\r\n            customHighlightAreaSettings={customHighlightAreaSettings}\r\n            yAxisTitle={yAxisTitle}\r\n            noOfYTicks={noOfYTicks}\r\n            minDate={minDate}\r\n            maxDate={maxDate}\r\n            curveType={curveType}\r\n            styles={styles}\r\n            classNames={classNames}\r\n            customLayers={customLayers}\r\n            naLabel={naLabel}\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":"k1CAiGA,SAAgB,GAAM,EAAc,CAClC,GAAM,CACJ,OACA,QACA,SACA,aACA,SACA,SACA,aACA,cACA,cACA,eACA,aACA,YACA,gBACA,UACA,yBACA,oBACA,UACA,OACA,wBACA,cACA,kBACA,WACA,eACA,YACA,aACA,WACA,WACA,eACA,+BACA,aACA,cACA,UACA,UACA,YACA,SACA,aACA,YACA,eACA,SACA,UACA,YACE,EACE,IAAA,EAAA,EAAA,QAAgB,IAAI,EACpB,EAAW,GAAA,EAAU,GAAQ,CACjC,KAAM,EAAQ,KACd,OAAQ,EAAQ,MAClB,CAAC,EACK,CAAC,EAAiB,KAAA,EAAA,EAAA,UAA+B,EAAK,GAE5D,EAAA,EAAA,eAAgB,CACd,GAAI,GAAY,CAAC,EAAiB,CAChC,IAAM,EAAU,eACR,CACJ,GAAmB,EAAI,CACzB,GACC,EAAQ,SAAW,IAAO,GAC7B,EACA,UAAa,aAAa,CAAO,CACnC,C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