{"version":3,"file":"LineChartWithConfidenceInterval-DbVIKFqQ.cjs","names":[],"sources":["../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/Graph.tsx","../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/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 { linearRegression, linearRegressionLine } from 'simple-statistics';\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 { 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 { RegressionLine } from '@/Components/Elements/RegressionLine';\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  LineChartWithConfidenceIntervalDataType,\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: LineChartWithConfidenceIntervalDataType[];\r\n  lineColor: 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  // 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  animate: AnimateDataType;\r\n  rtl: boolean;\r\n  strokeWidth: number;\r\n  showDots: boolean;\r\n  annotations: AnnotationSettingsDataType[];\r\n  customHighlightAreaSettings: CustomHighlightAreaSettingsDataType[];\r\n  regressionLine: boolean | string;\r\n  showIntervalDots: boolean;\r\n  showIntervalValues: boolean;\r\n  intervalLineStrokeWidth: number;\r\n  intervalLineColors: [string, string];\r\n  intervalAreaColor: string;\r\n  intervalAreaOpacity: number;\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  padZeros: PadZerosTypes;\r\n}\r\ninterface FormattedDataType {\r\n  y: number;\r\n  date: Date;\r\n  yMin: number;\r\n  yMax: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n  const {\r\n    data,\r\n    width,\r\n    height,\r\n    lineColor,\r\n    suffix,\r\n    prefix,\r\n    dateFormat,\r\n    highlightAreaSettings,\r\n    showValues,\r\n    noOfXTicks,\r\n    rightMargin,\r\n    leftMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    minValue,\r\n    maxValue,\r\n    animate,\r\n    rtl,\r\n    strokeWidth,\r\n    showDots,\r\n    annotations,\r\n    customHighlightAreaSettings,\r\n    regressionLine,\r\n    showIntervalDots,\r\n    showIntervalValues,\r\n    intervalLineStrokeWidth,\r\n    intervalLineColors,\r\n    intervalAreaColor,\r\n    intervalAreaOpacity,\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    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: FormattedDataType[] = orderBy(\r\n    data\r\n      .filter((d) => !checkIfNullOrUndefined(d.y))\r\n      .map((d) => ({\r\n        date: parse(`${d.date}`, dateFormat, new Date()),\r\n        y: d.y as number,\r\n        yMin: checkIfNullOrUndefined(d.yMin) ? (d.y as number) : (d.yMin as number),\r\n        yMax: checkIfNullOrUndefined(d.yMax) ? (d.y as number) : (d.yMax as number),\r\n        data: d.data,\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 minParam: number = !checkIfNullOrUndefined(minValue)\r\n    ? (minValue as number)\r\n    : Math.min(...dataFormatted.map((d) => Math.min(d.y, d.yMax, d.yMin)))\r\n      ? Math.min(...dataFormatted.map((d) => Math.min(d.y, d.yMax, d.yMin))) > 0\r\n        ? 0\r\n        : Math.min(...dataFormatted.map((d) => Math.min(d.y, d.yMax, d.yMin)))\r\n      : 0;\r\n  const maxParam: number = Math.max(...dataFormatted.map((d) => Math.max(d.y, d.yMax, d.yMin)))\r\n    ? Math.max(...dataFormatted.map((d) => Math.max(d.y, d.yMax, d.yMin)))\r\n    : 0;\r\n  const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n  const y = scaleLinear()\r\n    .domain([\r\n      minParam,\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 lineShape = line<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y((d) => y(d.y))\r\n    .curve(curve);\r\n\r\n  const lineShapeMin = line<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y((d) => y(d.yMin))\r\n    .curve(curve);\r\n\r\n  const lineShapeMax = line<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y((d) => y(d.yMax))\r\n    .curve(curve);\r\n\r\n  const areaShape = area<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y0((d) => y(d.yMin))\r\n    .y1((d) => y(d.yMax))\r\n    .curve(curve);\r\n\r\n  const yTicks = y.ticks(noOfYTicks);\r\n\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\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  const regressionLineParam = linearRegression(\r\n    dataFormatted\r\n      .filter((d) => !checkIfNullOrUndefined(d.date) && !checkIfNullOrUndefined(d.y))\r\n      .map((d) => [x(d.date), y(d.y as number)]),\r\n  );\r\n  const predict = linearRegressionLine(regressionLineParam);\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          <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            <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 ? '1em' : -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            {xTicks.map((d, i) => (\r\n              // biome-ignore lint/suspicious/noArrayIndexKey: index is the unique identifier\r\n              <g key={i}>\r\n                <text\r\n                  y={graphHeight}\r\n                  x={x(d)}\r\n                  style={{ textAnchor: 'middle' }}\r\n                  className='fill-content-primary xs:max-[360px]:hidden text-[9px] md:text-2xs lg:text-xs'\r\n                  dy={15}\r\n                >\r\n                  {format(d, dateFormat)}\r\n                </text>\r\n              </g>\r\n            ))}\r\n          </g>\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <motion.path\r\n            style={{\r\n              fill: intervalAreaColor,\r\n            }}\r\n            exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n            variants={{\r\n              initial: { opacity: 0, d: areaShape(dataFormatted) || '' },\r\n              whileInView: {\r\n                opacity: intervalAreaOpacity,\r\n                d: areaShape(dataFormatted) || '',\r\n                transition: { duration: animate.duration },\r\n              },\r\n            }}\r\n            initial='initial'\r\n            animate={isInView ? 'whileInView' : 'initial'}\r\n          />\r\n          {intervalLineStrokeWidth ? (\r\n            <>\r\n              <motion.path\r\n                style={{\r\n                  stroke: intervalLineColors[0],\r\n                  fill: 'none',\r\n                  strokeWidth: intervalLineStrokeWidth,\r\n                }}\r\n                exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                variants={{\r\n                  initial: {\r\n                    pathLength: 0,\r\n                    d: lineShapeMin(dataFormatted) || '',\r\n                    opacity: 1,\r\n                  },\r\n                  whileInView: {\r\n                    pathLength: 1,\r\n                    d: lineShapeMin(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                  stroke: intervalLineColors[1],\r\n                  fill: 'none',\r\n                  strokeWidth: intervalLineStrokeWidth,\r\n                }}\r\n                exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                variants={{\r\n                  initial: {\r\n                    pathLength: 0,\r\n                    d: lineShapeMax(dataFormatted) || '',\r\n                    opacity: 1,\r\n                  },\r\n                  whileInView: {\r\n                    pathLength: 1,\r\n                    d: lineShapeMax(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            </>\r\n          ) : null}\r\n          <motion.path\r\n            style={{\r\n              stroke: lineColor,\r\n              fill: 'none',\r\n              strokeWidth,\r\n            }}\r\n            exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n            variants={{\r\n              initial: {\r\n                pathLength: 0,\r\n                d: lineShape(dataFormatted) || '',\r\n                opacity: 1,\r\n              },\r\n              whileInView: {\r\n                pathLength: 1,\r\n                d: lineShape(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          {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          <g>\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.y) ? (\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                        style={{ fill: lineColor }}\r\n                        exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        variants={{\r\n                          initial: { opacity: 0, cx: x(d.date), cy: y(d.y) },\r\n                          whileInView: {\r\n                            opacity: 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.y),\r\n                          },\r\n                        }}\r\n                        initial='initial'\r\n                        animate={isInView ? 'whileInView' : 'initial'}\r\n                      />\r\n                    ) : null}\r\n                    {showIntervalDots ? (\r\n                      <>\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: {\r\n                              opacity: 0,\r\n                              fill: intervalLineColors[0],\r\n                              cx: x(d.date),\r\n                              cy: y(d.yMin),\r\n                            },\r\n                            whileInView: {\r\n                              opacity: 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.yMin),\r\n                              fill: intervalLineColors[0],\r\n                            },\r\n                          }}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                        />\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: {\r\n                              opacity: 0,\r\n                              fill: intervalLineColors[1],\r\n                              cx: x(d.date),\r\n                              cy: y(d.yMax),\r\n                            },\r\n                            whileInView: {\r\n                              opacity: 1,\r\n                              fill: intervalLineColors[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.yMax),\r\n                            },\r\n                          }}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                        />\r\n                      </>\r\n                    ) : null}\r\n                    {showValues ? (\r\n                      <motion.text\r\n                        dy={-8}\r\n                        style={{\r\n                          textAnchor: 'middle',\r\n                          ...(styles?.graphObjectValues || {}),\r\n                        }}\r\n                        className={cn(\r\n                          'graph-value 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, fill: lineColor, x: x(d.date), y: y(d.y) },\r\n                          whileInView: {\r\n                            opacity: 1,\r\n                            x: x(d.date),\r\n                            fill: lineColor,\r\n                            y: y(d.y),\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.y,\r\n                          undefined,\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                    {showIntervalValues ? (\r\n                      <>\r\n                        <motion.text\r\n                          dy='1em'\r\n                          style={{\r\n                            textAnchor: 'middle',\r\n                            ...(styles?.graphObjectValues || {}),\r\n                          }}\r\n                          className={cn('text-xs font-bold', classNames?.graphObjectValues)}\r\n                          exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                          variants={{\r\n                            initial: {\r\n                              opacity: 0,\r\n                              fill: intervalLineColors[0],\r\n                              x: x(d.date),\r\n                              y: y(d.yMin),\r\n                            },\r\n                            whileInView: {\r\n                              opacity: 1,\r\n                              x: x(d.date),\r\n                              y: y(d.yMin),\r\n                              fill: intervalLineColors[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                          {numberFormattingFunction(\r\n                            d.yMin,\r\n                            undefined,\r\n                            precision,\r\n                            prefix,\r\n                            suffix,\r\n                            locale,\r\n                            padZeros,\r\n                          )}\r\n                        </motion.text>\r\n                        <motion.text\r\n                          dy={-8}\r\n                          style={{\r\n                            textAnchor: 'middle',\r\n                            ...(styles?.graphObjectValues || {}),\r\n                          }}\r\n                          className={cn('text-xs font-bold', classNames?.graphObjectValues)}\r\n                          exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                          variants={{\r\n                            initial: {\r\n                              opacity: 0,\r\n                              fill: intervalLineColors[1],\r\n                              x: x(d.date),\r\n                              y: y(d.yMax),\r\n                            },\r\n                            whileInView: {\r\n                              opacity: 1,\r\n                              fill: intervalLineColors[1],\r\n                              x: x(d.date),\r\n                              y: y(d.yMax),\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.yMax,\r\n                            undefined,\r\n                            precision,\r\n                            prefix,\r\n                            suffix,\r\n                            locale,\r\n                            padZeros,\r\n                          )}\r\n                        </motion.text>\r\n                      </>\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          <g>\r\n            {regressionLine ? (\r\n              <RegressionLine\r\n                x1={0}\r\n                x2={graphWidth}\r\n                y1={predict(0)}\r\n                y2={predict(graphWidth)}\r\n                graphHeight={graphHeight}\r\n                graphWidth={graphWidth}\r\n                className={classNames?.regLine}\r\n                style={styles?.regLine}\r\n                color={typeof regressionLine === 'string' ? regressionLine : undefined}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ) : null}\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  HighlightAreaSettingsDataType,\r\n  Languages,\r\n  LineChartWithConfidenceIntervalDataType,\r\n  NumberFormatOptions,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n} from '@/Types';\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: LineChartWithConfidenceIntervalDataType[];\r\n\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** Colors of the line */\r\n  lineColor?: string;\r\n  /** Colors of the interval area */\r\n  intervalAreaColor?: string;\r\n  /** Colors of the top and bottom lines of the interval */\r\n  intervalLineColors?: [string, string];\r\n  /** Colors for the legend */\r\n  colorLegendColors?: string[];\r\n  /** Domain of colors for the legend */\r\n  colorLegendDomain?: 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  /** 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  /** 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 values of the interval area */\r\n  showIntervalValues?: boolean;\r\n  /** Toggle visibility of dots on the line */\r\n  showDots?: boolean;\r\n  /** Toggle visibility of dots on the line of te interval area */\r\n  showIntervalDots?: boolean;\r\n  /** Stroke width of the line */\r\n  strokeWidth?: number;\r\n  /** Stroke width of the lines of the interval area */\r\n  intervalLineStrokeWidth?: number;\r\n  /** Opacity of the interval area */\r\n  intervalAreaOpacity?: 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  /** 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  /** Toggles the visibility of the regression line for the data. If the type is string then string is use to define the color of the line. */\r\n  regressionLine?: boolean | string;\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  /** 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 LineChartWithConfidenceInterval(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    backgroundColor = false,\r\n    padding,\r\n    lineColor,\r\n    leftMargin = 30,\r\n    rightMargin = 30,\r\n    topMargin = 20,\r\n    bottomMargin = 25,\r\n    tooltip,\r\n    refValues = [],\r\n    highlightAreaSettings = [],\r\n    relativeHeight,\r\n    onSeriesMouseOver,\r\n    graphID,\r\n    minValue,\r\n    maxValue,\r\n    regressionLine = false,\r\n    showIntervalDots = false,\r\n    showIntervalValues = false,\r\n    intervalLineStrokeWidth = 0,\r\n    intervalLineColors = [Colors.light.grays['gray-500'], Colors.light.grays['gray-500']],\r\n    intervalAreaColor = Colors.primaryColors['blue-100'],\r\n    intervalAreaOpacity = 0.4,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    animate = false,\r\n    language = 'en',\r\n    minHeight = 0,\r\n    strokeWidth = 2,\r\n    showDots = true,\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    colorLegendTitle,\r\n    colorLegendColors,\r\n    colorLegendDomain,\r\n    curveType = 'curve',\r\n    styles,\r\n    classNames,\r\n    customLayers = [],\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      {colorLegendColors && colorLegendDomain && data.length > 0 ? (\r\n        <ColorLegend\r\n          width={width}\r\n          colorLegendTitle={colorLegendTitle}\r\n          colors={colorLegendColors}\r\n          colorDomain={colorLegendDomain}\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            lineColor={lineColor || Colors.primaryColors['blue-600']}\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            tooltip={tooltip}\r\n            highlightAreaSettings={highlightAreaSettings}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            refValues={refValues}\r\n            minValue={minValue}\r\n            maxValue={maxValue}\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            strokeWidth={strokeWidth}\r\n            showDots={showDots}\r\n            annotations={annotations}\r\n            customHighlightAreaSettings={customHighlightAreaSettings}\r\n            regressionLine={regressionLine}\r\n            showIntervalDots={showIntervalDots}\r\n            showIntervalValues={showIntervalValues}\r\n            intervalLineStrokeWidth={intervalLineStrokeWidth}\r\n            intervalLineColors={intervalLineColors}\r\n            intervalAreaColor={intervalAreaColor}\r\n            intervalAreaOpacity={intervalAreaOpacity}\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            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":"60CAoGA,SAAgB,GAAM,EAAc,CAClC,GAAM,CACJ,OACA,QACA,SACA,YACA,SACA,SACA,aACA,yBACA,cACA,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