@undp/data-viz 1.5.6 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +650 -648
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BulletChart.cjs +1 -1
  6. package/dist/BulletChart.cjs.map +1 -1
  7. package/dist/BulletChart.js +210 -208
  8. package/dist/BulletChart.js.map +1 -1
  9. package/dist/ButterflyChart.cjs +1 -1
  10. package/dist/ButterflyChart.cjs.map +1 -1
  11. package/dist/ButterflyChart.js +42 -40
  12. package/dist/ButterflyChart.js.map +1 -1
  13. package/dist/DifferenceLineChart.cjs +1 -1
  14. package/dist/DifferenceLineChart.cjs.map +1 -1
  15. package/dist/DifferenceLineChart.js +122 -120
  16. package/dist/DifferenceLineChart.js.map +1 -1
  17. package/dist/DualAxisLineChart.cjs +1 -1
  18. package/dist/DualAxisLineChart.cjs.map +1 -1
  19. package/dist/DualAxisLineChart.js +133 -113
  20. package/dist/DualAxisLineChart.js.map +1 -1
  21. package/dist/DumbbellChart.cjs +1 -1
  22. package/dist/DumbbellChart.cjs.map +1 -1
  23. package/dist/DumbbellChart.js +274 -274
  24. package/dist/DumbbellChart.js.map +1 -1
  25. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  26. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  27. package/dist/LineChartWithConfidenceInterval.js +194 -174
  28. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  29. package/dist/MultiLineAltChart.cjs +1 -1
  30. package/dist/MultiLineAltChart.cjs.map +1 -1
  31. package/dist/MultiLineAltChart.js +160 -161
  32. package/dist/MultiLineAltChart.js.map +1 -1
  33. package/dist/MultiLineChart.cjs +1 -1
  34. package/dist/MultiLineChart.cjs.map +1 -1
  35. package/dist/MultiLineChart.js +77 -66
  36. package/dist/MultiLineChart.js.map +1 -1
  37. package/dist/ParetoChart.cjs +1 -1
  38. package/dist/ParetoChart.cjs.map +1 -1
  39. package/dist/ParetoChart.js +166 -161
  40. package/dist/ParetoChart.js.map +1 -1
  41. package/dist/RadarChart.cjs +1 -1
  42. package/dist/RadarChart.cjs.map +1 -1
  43. package/dist/RadarChart.js +253 -241
  44. package/dist/RadarChart.js.map +1 -1
  45. package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-C2--oMQq.js} +10 -9
  46. package/dist/RegressionLine-C2--oMQq.js.map +1 -0
  47. package/dist/RegressionLine-Dj0GSiAp.cjs +2 -0
  48. package/dist/RegressionLine-Dj0GSiAp.cjs.map +1 -0
  49. package/dist/ScatterPlot.cjs +1 -1
  50. package/dist/ScatterPlot.cjs.map +1 -1
  51. package/dist/ScatterPlot.js +130 -129
  52. package/dist/ScatterPlot.js.map +1 -1
  53. package/dist/SimpleLineChart.cjs +1 -1
  54. package/dist/SimpleLineChart.cjs.map +1 -1
  55. package/dist/SimpleLineChart.js +43 -38
  56. package/dist/SimpleLineChart.js.map +1 -1
  57. package/dist/SlopeChart.cjs +1 -1
  58. package/dist/SlopeChart.cjs.map +1 -1
  59. package/dist/SlopeChart.js +113 -109
  60. package/dist/SlopeChart.js.map +1 -1
  61. package/dist/StripChart.cjs +1 -1
  62. package/dist/StripChart.cjs.map +1 -1
  63. package/dist/StripChart.js +282 -270
  64. package/dist/StripChart.js.map +1 -1
  65. package/dist/ThreeDGlobe.cjs +1 -1
  66. package/dist/ThreeDGlobe.cjs.map +1 -1
  67. package/dist/ThreeDGlobe.js +284 -349
  68. package/dist/ThreeDGlobe.js.map +1 -1
  69. package/dist/UnitChart.cjs +1 -1
  70. package/dist/UnitChart.cjs.map +1 -1
  71. package/dist/UnitChart.js +20 -21
  72. package/dist/UnitChart.js.map +1 -1
  73. package/dist/getCentroidCoordinates-Dfk6IqEG.js +70 -0
  74. package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -0
  75. package/dist/getCentroidCoordinates-DxTBqzp2.cjs +2 -0
  76. package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -0
  77. package/dist/index.cjs +1 -1
  78. package/dist/index.d.ts +7 -0
  79. package/dist/index.js +34 -32
  80. package/dist/index.js.map +1 -1
  81. package/dist/utils.cjs +1 -1
  82. package/dist/utils.d.ts +8 -0
  83. package/dist/utils.js +16 -14
  84. package/dist/utils.js.map +1 -1
  85. package/package.json +1 -1
  86. package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
  87. package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
  88. package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LineChartWithConfidenceInterval.js","sources":["../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/Graph.tsx","../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n area,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { pointer, select } from 'd3-selection';\r\nimport { linearRegression, linearRegressionLine } from 'simple-statistics';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { motion, useInView } from 'motion/react';\r\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\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 ReferenceDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getLineEndPoint } from '@/Utils/getLineEndPoint';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { RegressionLine } from '@/Components/Elements/RegressionLine';\r\nimport { Annotation } from '@/Components/Elements/Annotations';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { CustomArea } from '@/Components/Elements/HighlightArea/customArea';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\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;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n 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}\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 } = 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const 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 graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\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 = x.ticks(noOfXTicks);\r\n\r\n useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 />\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 'NA',\r\n precision,\r\n prefix,\r\n suffix,\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 <g key={i}>\r\n <text\r\n y={graphHeight}\r\n x={x(d)}\r\n style={{ textAnchor: 'middle' }}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] 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(\r\n 'undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100',\r\n classNames?.mouseOverLine,\r\n )}\r\n style={styles?.mouseOverLine}\r\n />\r\n ) : null}\r\n <g>\r\n {dataFormatted.map((d, i) => (\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 style={{ fill: intervalLineColors[0] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y(d.yMin) },\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 },\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 style={{ fill: intervalLineColors[1] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y(d.yMax) },\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.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 fill: lineColor,\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, x: x(d.date), y: y(d.y) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\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(d.y, 'NA', precision, prefix, suffix)}\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 fill: intervalLineColors[0],\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: { opacity: 0, x: x(d.date), y: y(d.yMin) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y(d.yMin),\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(d.yMin, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n <motion.text\r\n dy={-8}\r\n style={{\r\n fill: intervalLineColors[1],\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: { opacity: 0, x: x(d.date), y: y(d.yMax) },\r\n whileInView: {\r\n opacity: 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(d.yMax, 'NA', precision, prefix, suffix)}\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 ? (\r\n <>\r\n {refValues.map((el, i) => (\r\n <RefLineY\r\n key={i}\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 </>\r\n ) : null}\r\n <g>\r\n {annotations.map((d, i) => {\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={i}\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 { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n AnnotationSettingsDataType,\r\n CustomHighlightAreaSettingsDataType,\r\n Languages,\r\n LineChartWithConfidenceIntervalDataType,\r\n ReferenceDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n HighlightAreaSettingsDataType,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\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 /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\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 */\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 /** 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 /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\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 suffix = '',\r\n sources,\r\n prefix = '',\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 precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a line chart that highlights the difference between two datasets over time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\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.current : 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 <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {colorLegendColors && colorLegendDomain ? (\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 />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n lineColor={lineColor || Colors.primaryColors['blue-600']}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n suffix={suffix}\r\n prefix={prefix}\r\n dateFormat={dateFormat}\r\n showValues={showValues}\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 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 precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\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 </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","lineColor","suffix","prefix","dateFormat","highlightAreaSettings","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","refValues","minValue","maxValue","animate","rtl","strokeWidth","showDots","annotations","customHighlightAreaSettings","regressionLine","showIntervalDots","showIntervalValues","intervalLineStrokeWidth","intervalLineColors","intervalAreaColor","intervalAreaOpacity","yAxisTitle","noOfYTicks","minDate","maxDate","curveType","styles","classNames","precision","customLayers","svgRef","useRef","isInView","useInView","hasAnimatedOnce","setHasAnimatedOnce","useState","useEffect","timeout","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","margin","MouseoverRectRef","dataFormatted","orderBy","d","checkIfNullOrUndefined","parse","highlightAreaSettingsFormatted","customHighlightAreaSettingsFormatted","el","j","graphWidth","graphHeight","minYear","maxYear","minParam","maxParam","x","scaleTime","y","scaleLinear","lineShape","line","lineShapeMin","lineShapeMax","areaShape","area","yTicks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","regressionLineParam","linearRegression","predict","linearRegressionLine","jsxs","Fragment","jsx","motion","HighlightArea","CustomArea","YTicksAndGridLines","Axis","numberFormattingFunction","AxisTitle","i","format","cn","RefLineY","endPoints","getLineEndPoint","connectorSettings","labelSettings","Annotation","RegressionLine","Tooltip","LineChartWithConfidenceInterval","graphTitle","sources","graphDescription","footNote","backgroundColor","padding","relativeHeight","graphID","Colors","graphDownload","dataDownload","language","minHeight","theme","ariaLabel","colorLegendTitle","colorLegendColors","colorLegendDomain","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","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EA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"LineChartWithConfidenceInterval.js","sources":["../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/Graph.tsx","../src/Components/Graphs/LineCharts/LineChartWithConfidenceInterval/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n area,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { pointer, select } from 'd3-selection';\r\nimport { linearRegression, linearRegressionLine } from 'simple-statistics';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { motion, useInView } from 'motion/react';\r\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\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 ReferenceDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getLineEndPoint } from '@/Utils/getLineEndPoint';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { RegressionLine } from '@/Components/Elements/RegressionLine';\r\nimport { Annotation } from '@/Components/Elements/Annotations';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { CustomArea } from '@/Components/Elements/HighlightArea/customArea';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\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;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n 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}\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 } = 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const 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 graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\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 = x.ticks(noOfXTicks);\r\n\r\n useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\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 />\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 'NA',\r\n precision,\r\n prefix,\r\n suffix,\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 <g key={i}>\r\n <text\r\n y={graphHeight}\r\n x={x(d)}\r\n style={{ textAnchor: 'middle' }}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] 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(\r\n 'undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100',\r\n classNames?.mouseOverLine,\r\n )}\r\n style={styles?.mouseOverLine}\r\n />\r\n ) : null}\r\n <g>\r\n {dataFormatted.map((d, i) => (\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(d.y, 'NA', precision, prefix, suffix)}\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(d.yMin, 'NA', precision, prefix, suffix)}\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(d.yMax, 'NA', precision, prefix, suffix)}\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 ? (\r\n <>\r\n {refValues.map((el, i) => (\r\n <RefLineY\r\n key={i}\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 </>\r\n ) : null}\r\n <g>\r\n {annotations.map((d, i) => {\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={i}\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 { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport {\r\n AnnotationSettingsDataType,\r\n CustomHighlightAreaSettingsDataType,\r\n Languages,\r\n LineChartWithConfidenceIntervalDataType,\r\n ReferenceDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n HighlightAreaSettingsDataType,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\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 /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\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 */\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 /** 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 /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\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 suffix = '',\r\n sources,\r\n prefix = '',\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 precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a line chart that highlights the difference between two datasets over time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\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.current : 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 <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {colorLegendColors && colorLegendDomain ? (\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 />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n lineColor={lineColor || Colors.primaryColors['blue-600']}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n suffix={suffix}\r\n prefix={prefix}\r\n dateFormat={dateFormat}\r\n showValues={showValues}\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 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 precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\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 </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","lineColor","suffix","prefix","dateFormat","highlightAreaSettings","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","refValues","minValue","maxValue","animate","rtl","strokeWidth","showDots","annotations","customHighlightAreaSettings","regressionLine","showIntervalDots","showIntervalValues","intervalLineStrokeWidth","intervalLineColors","intervalAreaColor","intervalAreaOpacity","yAxisTitle","noOfYTicks","minDate","maxDate","curveType","styles","classNames","precision","customLayers","svgRef","useRef","isInView","useInView","hasAnimatedOnce","setHasAnimatedOnce","useState","useEffect","timeout","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","margin","MouseoverRectRef","dataFormatted","orderBy","d","checkIfNullOrUndefined","parse","highlightAreaSettingsFormatted","customHighlightAreaSettingsFormatted","el","j","graphWidth","graphHeight","minYear","maxYear","minParam","maxParam","x","scaleTime","y","scaleLinear","lineShape","line","lineShapeMin","lineShapeMax","areaShape","area","yTicks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","regressionLineParam","linearRegression","predict","linearRegressionLine","jsxs","Fragment","jsx","motion","HighlightArea","CustomArea","YTicksAndGridLines","Axis","numberFormattingFunction","AxisTitle","i","format","cn","RefLineY","endPoints","getLineEndPoint","connectorSettings","labelSettings","Annotation","RegressionLine","Tooltip","LineChartWithConfidenceInterval","graphTitle","sources","graphDescription","footNote","backgroundColor","padding","relativeHeight","graphID","Colors","graphDownload","dataDownload","language","minHeight","theme","ariaLabel","colorLegendTitle","colorLegendColors","colorLegendDomain","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC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,oBACA,UAAAE;AAAA,oBACA,OAAA9H;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),p=require("react"),d=require("./parse-hMnG_lRV.cjs"),De=require("./index-CQ3e6Ewi.cjs"),qe=require("./numberFormattingFunction-02t-wJta.cjs"),Me=require("./Tooltip-De16GWhY.cjs"),h=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ae=require("./customArea-CK768gCn.cjs"),$e=require("./AxisTitle-CK9YeovX.cjs"),Te=require("./Axis-DE7dSn1_.cjs"),Ve=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Ue=require("./ReferenceLine-CFVBBN__.cjs"),Fe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),He=require("./index-BYzIB5V6.cjs"),L=require("./Colors.cjs"),fe=require("./uniqBy-O05lp2S5.cjs"),We=require("./sort-O96oMZLb.cjs"),Le=require("./init-DU0ybBc_.cjs"),Ge=require("./time-Byw_jYQ7.cjs"),Ye=require("./linear-BVckp9RD.cjs"),Pe=require("./delaunay-rcy0HhZi.cjs"),Ie=require("./line-DHV4JwCR.cjs"),he=require("./step-BZ3C8QFW.cjs"),Xe=require("./select-Bnfk0lJx.cjs"),Be=require("./pointer-Dkq5NV1q.cjs"),ze=require("./use-in-view-sQJZ_xDO.cjs"),Y=require("./proxy-BHRoeZgd.cjs"),Je=require("./GraphFooter.cjs"),Ke=require("./GraphHeader.cjs"),Qe=require("./EmptyState-d8_8SxeW.cjs"),Ze=require("./ColorLegendWithMouseOver.cjs");function _e(de){const{data:s,width:I,height:K,lineColors:a,dateFormat:x,noOfXTicks:pe,rightMargin:_,topMargin:ge,bottomMargin:P,suffix:A,prefix:m,leftMargin:C,tooltip:ee,onSeriesMouseOver:T,refValues:Q,highlightAreaSettings:S,minValue:X,maxValue:te,highlightedLines:N,animate:n,rtl:ie,strokeWidth:k,showDots:B,annotations:ye,customHighlightAreaSettings:je,yAxisTitle:oe,noOfYTicks:we,minDate:ne,maxDate:re,curveType:z,styles:v,colorDomain:O,selectedColor:V,classNames:g,showLabels:U,dimmedOpacity:R,precision:D,naLabel:be,customLayers:se}=de,ae=p.useRef(null),y=ze.useInView(ae,{once:n.once,amount:n.amount}),[E,ve]=p.useState(!1);p.useEffect(()=>{if(y&&!E){const e=setTimeout(()=>{ve(!0)},(n.duration+.5)*1e3);return()=>clearTimeout(e)}},[y,E,n.duration]);const Oe=z==="linear"?Ie.curveLinear:z==="step"?he.curveStep:z==="stepAfter"?he.stepAfter:z==="stepBefore"?he.stepBefore:he.monotoneX,l=De.orderBy(s.map(e=>({...e,date:d.parse(`${e.date}`,x,new Date)})),["date"],["asc"]).filter(e=>!h.checkIfNullOrUndefined(e.y)),Ce=fe.uniqBy(l,"label",!0),Z=We.sort(fe.uniqBy(s,"date",!0).map(e=>d.parse(`${e}`,x,new Date)),(e,i)=>Le.ascending(e,i)),[f,j]=p.useState(void 0),[q,F]=p.useState(void 0),[le,H]=p.useState(void 0),w={top:ge,bottom:P,left:oe?C+30:C,right:_},W=p.useRef(null),ce=Ce.map(e=>De.orderBy(l.filter(i=>i.label==e),["date"],["asc"])),ue=S.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:d.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:d.parse(`${e.coordinates[1]}`,x,new Date)]})),xe=je.map(e=>({...e,coordinates:e.coordinates.map((i,u)=>u%2===0?d.parse(`${i}`,x,new Date):i)})),b=I-w.left-w.right,M=K-w.top-w.bottom,G=ne?d.parse(`${ne}`,x,new Date):Z[0],me=re?d.parse(`${re}`,x,new Date):Z[Z.length-1],o=h.checkIfNullOrUndefined(X)?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))>0?0:Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0:X,J=Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0,r=Ge.time().domain([G,me]).range([0,b]),c=Ye.linear().domain([h.checkIfNullOrUndefined(X)?o:X,h.checkIfNullOrUndefined(te)?J>0?J:0:te]).range([M,0]).nice(),Se=Pe.Delaunay.from(l.filter(e=>!h.checkIfNullOrUndefined(e.date)&&!h.checkIfNullOrUndefined(e.y)),e=>r(e.date),e=>c(e.y)).voronoi([0,0,b<0?0:b,M<0?0:M]),Re=Ie.line().x(e=>r(e.date)).y(e=>c(e.y)).curve(Oe),Ne=c.ticks(we),ke=r.ticks(pe);return p.useEffect(()=>{const e=u=>{const $=l[Le.bisectCenter(l.map(Ee=>Ee.date),r.invert(Be.pointer(u)[0]),0)];j($||l[l.length-1]),H(u.clientY),F(u.clientX),T?.($||l[l.length-1])},i=()=>{j(void 0),F(void 0),H(void 0)};Xe.select(W.current).on("mousemove",e).on("mouseout",i),T?.(void 0)},[r,l,T]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y.motion.svg,{width:`${I}px`,height:`${K}px`,viewBox:`0 0 ${I} ${K}`,direction:"ltr",ref:ae,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${w.left},${w.top})`,children:[t.jsxRuntimeExports.jsx(He.HighlightArea,{areaSettings:ue,width:b,height:M,scale:r,animate:n,isInView:y}),t.jsxRuntimeExports.jsx(Ae.CustomArea,{areaSettings:xe,scaleX:r,scaleY:c,animate:n,isInView:y}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{values:Ne.filter(e=>e!==0),y:Ne.filter(e=>e!==0).map(e=>c(e)),x1:0-C,x2:b+w.right,styles:{gridLines:v?.yAxis?.gridLines,labels:v?.yAxis?.labels},classNames:{gridLines:g?.yAxis?.gridLines,labels:g?.yAxis?.labels},suffix:A,prefix:m,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:D}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:c(o<0?0:o),y2:c(o<0?0:o),x1:0-C,x2:b+w.right,label:qe.numberFormattingFunction(o<0?0:o,"NA",D,m,A),labelPos:{x:0-C,y:c(o<0?0:o),dx:0,dy:J<0?"1em":-5},classNames:{axis:g?.xAxis?.axis,label:g?.yAxis?.labels},styles:{axis:v?.xAxis?.axis,label:v?.yAxis?.labels}}),t.jsxRuntimeExports.jsx($e.AxisTitle,{x:0-C-15,y:M/2,style:v?.yAxis?.title,className:g?.yAxis?.title,text:oe,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(Ve.XTicksAndGridLines,{values:ke.map(e=>d.format(e,x)),x:ke.map(e=>r(e)),y1:0,y2:M,styles:{gridLines:v?.xAxis?.gridLines,labels:v?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",g?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",g?.xAxis?.labels)},suffix:A,prefix:m,labelType:"primary",showGridLines:!0,precision:D})}),se.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs(Y.motion.g,{children:[ce.map(e=>t.jsxRuntimeExports.jsxs(Y.motion.g,{exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&a[O.indexOf(e[0].color)]===V?1:R:N.length!==0?N.indexOf(e[0].label)!==-1?1:R:1},whileInView:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&a[O.indexOf(e[0].color)]===V?1:R:N.length!==0?N.indexOf(e[0].label)!==-1?1:R:1,transition:{duration:n.duration}}},initial:"initial",animate:y?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(Y.motion.path,{d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",style:{fill:"none",strokeWidth:f?e[0].label===f.label?k+Math.max(2,.5*k):k:N.length!==0&&N.indexOf(e[0].label)!==-1?k+Math.max(2,.5*k):k},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{pathLength:0,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:s.filter(i=>i.color).length===0?a[0]:e[0].color?a[O.indexOf(e[0].color)]:L.Colors.gray},whileInView:{pathLength:1,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:s.filter(i=>i.color).length===0?a[0]:e[0].color?a[O.indexOf(e[0].color)]:L.Colors.gray,transition:{duration:n.duration}}},initial:"initial",animate:y?"whileInView":"initial"}),e.map((i,u)=>t.jsxRuntimeExports.jsx(Y.motion.g,{children:h.checkIfNullOrUndefined(i.y)?null:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:B?t.jsxRuntimeExports.jsx(Y.motion.circle,{r:b/e.length<5?0:b/e.length<20?2:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,fill:s.filter($=>$.color).length===0?a[0]:e[0].color?a[O.indexOf(e[0].color)]:L.Colors.gray,cx:r(i.date),cy:c(i.y)},whileInView:{opacity:1,fill:s.filter($=>$.color).length===0?a[0]:e[0].color?a[O.indexOf(e[0].color)]:L.Colors.gray,transition:{duration:E?n.duration:.5,delay:E?0:n.duration},cx:r(i.date),cy:c(i.y)}},initial:"initial",animate:y?"whileInView":"initial"}):null})},u)),(N.indexOf(e[0].label)!==-1||f?.label===e[0].label)&&U?t.jsxRuntimeExports.jsx(Y.motion.text,{style:{fill:s.filter(i=>i.color).length===0?a[0]:e[0].color?a[O.indexOf(e[0].color)]:L.Colors.gray},className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:r(e[e.length-1].date),y:c(e[e.length-1].y)},whileInView:{opacity:1,x:r(e[e.length-1].date),y:c(e[e.length-1].y),transition:{duration:E?n.duration:.5,delay:E?0:n.duration}}},initial:"initial",animate:y?"whileInView":"initial",children:e[0].label}):null]},e[0].label)),f?t.jsxRuntimeExports.jsx("text",{y:c(f.y)-8,x:r(f.date),className:t.mo("graph-value text-sm font-bold",g?.graphObjectValues),style:{fill:s.filter(e=>e.color).length===0?a[0]:f.color?a[O.indexOf(f.color)]:L.Colors.gray,textAnchor:"middle",...v?.graphObjectValues||{}},children:qe.numberFormattingFunction(f.y,be,D,m,A)}):null]}),l.filter(e=>!h.checkIfNullOrUndefined(e.y)).map((e,i)=>t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:Se.renderCell(l.findIndex(u=>u.label===e.label&&u.date===e.date)),opacity:0,onMouseEnter:u=>{j(e),H(u.clientY),F(u.clientX),T?.(e)},onMouseMove:u=>{j(e),H(u.clientY),F(u.clientX)},onMouseLeave:()=>{j(void 0),F(void 0),H(void 0),T?.(void 0)}})},i)),Q?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Q.map((e,i)=>t.jsxRuntimeExports.jsx(Ue.RefLineY,{text:e.text,color:e.color,y:c(e.value),x1:0-C,x2:b+w.right,classNames:e.classNames,styles:e.styles,animate:n,isInView:y},i))}):null,t.jsxRuntimeExports.jsx("g",{children:ye.map((e,i)=>{const u=Ae.getLineEndPoint({x:e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?c(e.yCoordinate):0},h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),$=e.showConnector?{y1:u.y,x1:u.x,y2:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?c(e.yCoordinate):0,cx:e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Ee={y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:ie?0:e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:ie?e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):b+w.right-(e.xCoordinate?r(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(Ae.Annotation,{color:e.color,connectorsSettings:$,labelSettings:Ee,text:e.text,classNames:e.classNames,styles:e.styles,animate:n,isInView:y},i)})}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),f&&ee&&q&&le?t.jsxRuntimeExports.jsx(Me.Tooltip,{data:f,body:ee,xPos:q,yPos:le,backgroundStyle:v?.tooltip,className:g?.tooltip}):null]})}function et(de){const{data:s,graphTitle:I,showNAColor:K=!0,colors:a,colorDomain:x,suffix:pe="",sources:_,prefix:ge="",graphDescription:P,height:A,width:m,footNote:C,noOfXTicks:ee=10,dateFormat:T="yyyy",padding:Q,backgroundColor:S=!1,leftMargin:X=30,rightMargin:te=50,topMargin:N=20,bottomMargin:n=25,showColorScale:ie=!0,tooltip:k,relativeHeight:B,onSeriesMouseOver:ye,showLabels:je=!0,refValues:oe=[],highlightAreaSettings:we=[],graphID:ne,minValue:re,maxValue:z,highlightedLines:v=[],graphDownload:O=!1,dataDownload:V=!1,animate:g=!1,language:U="en",colorLegendTitle:R,minHeight:D=0,strokeWidth:be=2,showDots:se=!0,annotations:ae=[],customHighlightAreaSettings:y=[],theme:E="light",ariaLabel:ve,yAxisTitle:Oe,noOfYTicks:l=5,minDate:Ce,maxDate:Z,curveType:f="curve",styles:j,classNames:q,dimmedOpacity:F=.3,precision:le=2,customLayers:H=[],naLabel:w="NA"}=de,[W,ce]=p.useState(0),[ue,xe]=p.useState(0),[b,M]=p.useState(void 0),G=p.useRef(null),me=p.useRef(null);return p.useEffect(()=>{const o=new ResizeObserver(J=>{ce(m||J[0].target.clientWidth||620),xe(A||J[0].target.clientHeight||480)});return G.current&&(xe(G.current.clientHeight||480),ce(G.current.clientWidth||620),m||o.observe(G.current)),()=>o.disconnect()},[m,A]),t.jsxRuntimeExports.jsx("div",{className:`${E||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:U==="he"||U==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${U||"en"}`,m?"w-fit":"w-full",q?.graphContainer),style:{...j?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:ne,ref:me,"aria-label":ve||`${I?`The graph shows ${I}. `:""}This is a multi-line chart that shows trends over time.${P?` ${P}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?Q||"1rem":Q||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[I||P||O||V?t.jsxRuntimeExports.jsx(Ke.GraphHeader,{styles:{title:j?.title,description:j?.description},classNames:{title:q?.title,description:q?.description},graphTitle:I,graphDescription:P,width:m,graphDownload:O?me.current:void 0,dataDownload:V?s.map(o=>o.data).filter(o=>o!==void 0).length>0?s.map(o=>o.data).filter(o=>o!==void 0):s.filter(o=>o!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:s.length===0?t.jsxRuntimeExports.jsx(Qe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ie&&s.filter(o=>o.color).length!==0?t.jsxRuntimeExports.jsx(Ze.ColorLegendWithMouseOver,{width:m,colorLegendTitle:R,colors:a||L.Colors[E].categoricalColors.colors,colorDomain:x||fe.uniqBy(s,"color",!0),setSelectedColor:M,showNAColor:K}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:G,"aria-label":"Graph area",children:(m||W)&&(A||ue)?t.jsxRuntimeExports.jsx(_e,{data:s,lineColors:s.filter(o=>o.color).length===0?a?[a]:[L.Colors.primaryColors["blue-600"]]:a||L.Colors[E].categoricalColors.colors,width:m||W,height:Math.max(D,A||(B?D?(m||W)*B>D?(m||W)*B:D:(m||W)*B:ue)),dateFormat:T,noOfXTicks:ee,leftMargin:X,rightMargin:te,topMargin:N,bottomMargin:n,tooltip:k,onSeriesMouseOver:ye,suffix:pe,prefix:ge,highlightAreaSettings:we,refValues:oe,minValue:re,maxValue:z,highlightedLines:v,animate:g===!0?{duration:.5,once:!0,amount:.5}:g||{duration:0,once:!0,amount:0},rtl:U==="he"||U==="ar",strokeWidth:be,showDots:se,annotations:ae,customHighlightAreaSettings:y,yAxisTitle:Oe,noOfYTicks:l,minDate:Ce,maxDate:Z,curveType:f,styles:j,classNames:q,selectedColor:b,showLabels:je,colorDomain:s.filter(o=>o.color).length===0?[]:x||fe.uniqBy(s,"color",!0),dimmedOpacity:F,precision:le,customLayers:H,naLabel:w}):null})]})}),_||C?t.jsxRuntimeExports.jsx(Je.GraphFooter,{styles:{footnote:j?.footnote,source:j?.source},classNames:{footnote:q?.footnote,source:q?.source},sources:_,footNote:C,width:m}):null]})})})})}exports.MultiLineAltChart=et;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),g=require("react"),d=require("./parse-hMnG_lRV.cjs"),De=require("./index-CQ3e6Ewi.cjs"),qe=require("./numberFormattingFunction-02t-wJta.cjs"),Me=require("./Tooltip-De16GWhY.cjs"),h=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ae=require("./customArea-CK768gCn.cjs"),$e=require("./AxisTitle-CK9YeovX.cjs"),Te=require("./Axis-DE7dSn1_.cjs"),Ve=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Ue=require("./ReferenceLine-CFVBBN__.cjs"),Fe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),He=require("./index-BYzIB5V6.cjs"),A=require("./Colors.cjs"),fe=require("./uniqBy-O05lp2S5.cjs"),We=require("./sort-O96oMZLb.cjs"),Le=require("./init-DU0ybBc_.cjs"),Ge=require("./time-Byw_jYQ7.cjs"),Ye=require("./linear-BVckp9RD.cjs"),Pe=require("./delaunay-rcy0HhZi.cjs"),Ie=require("./line-DHV4JwCR.cjs"),he=require("./step-BZ3C8QFW.cjs"),Xe=require("./select-Bnfk0lJx.cjs"),Be=require("./pointer-Dkq5NV1q.cjs"),ze=require("./use-in-view-sQJZ_xDO.cjs"),Y=require("./proxy-BHRoeZgd.cjs"),Je=require("./GraphFooter.cjs"),Ke=require("./GraphHeader.cjs"),Qe=require("./EmptyState-d8_8SxeW.cjs"),Ze=require("./ColorLegendWithMouseOver.cjs");function _e(de){const{data:n,width:I,height:K,lineColors:r,dateFormat:x,noOfXTicks:ge,rightMargin:_,topMargin:pe,bottomMargin:P,suffix:N,prefix:m,leftMargin:C,tooltip:ee,onSeriesMouseOver:T,refValues:Q,highlightAreaSettings:S,minValue:X,maxValue:te,highlightedLines:k,animate:s,rtl:ie,strokeWidth:D,showDots:B,annotations:ye,customHighlightAreaSettings:je,yAxisTitle:oe,noOfYTicks:we,minDate:re,maxDate:ne,curveType:z,styles:O,colorDomain:p,selectedColor:V,classNames:y,showLabels:U,dimmedOpacity:R,precision:q,naLabel:be,customLayers:se}=de,ae=g.useRef(null),j=ze.useInView(ae,{once:s.once,amount:s.amount}),[E,ve]=g.useState(!1);g.useEffect(()=>{if(j&&!E){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[j,E,s.duration]);const Oe=z==="linear"?Ie.curveLinear:z==="step"?he.curveStep:z==="stepAfter"?he.stepAfter:z==="stepBefore"?he.stepBefore:he.monotoneX,l=De.orderBy(n.map(e=>({...e,date:d.parse(`${e.date}`,x,new Date)})),["date"],["asc"]).filter(e=>!h.checkIfNullOrUndefined(e.y)),Ce=fe.uniqBy(l,"label",!0),Z=We.sort(fe.uniqBy(n,"date",!0).map(e=>d.parse(`${e}`,x,new Date)),(e,i)=>Le.ascending(e,i)),[f,w]=g.useState(void 0),[L,F]=g.useState(void 0),[le,H]=g.useState(void 0),b={top:pe,bottom:P,left:oe?C+30:C,right:_},W=g.useRef(null),ce=Ce.map(e=>De.orderBy(l.filter(i=>i.label==e),["date"],["asc"])),ue=S.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:d.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:d.parse(`${e.coordinates[1]}`,x,new Date)]})),xe=je.map(e=>({...e,coordinates:e.coordinates.map((i,u)=>u%2===0?d.parse(`${i}`,x,new Date):i)})),v=I-b.left-b.right,M=K-b.top-b.bottom,G=re?d.parse(`${re}`,x,new Date):Z[0],me=ne?d.parse(`${ne}`,x,new Date):Z[Z.length-1],o=h.checkIfNullOrUndefined(X)?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))>0?0:Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0:X,J=Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0,a=Ge.time().domain([G,me]).range([0,v]),c=Ye.linear().domain([h.checkIfNullOrUndefined(X)?o:X,h.checkIfNullOrUndefined(te)?J>0?J:0:te]).range([M,0]).nice(),Se=Pe.Delaunay.from(l.filter(e=>!h.checkIfNullOrUndefined(e.date)&&!h.checkIfNullOrUndefined(e.y)),e=>a(e.date),e=>c(e.y)).voronoi([0,0,v<0?0:v,M<0?0:M]),Re=Ie.line().x(e=>a(e.date)).y(e=>c(e.y)).curve(Oe),Ne=c.ticks(we),ke=a.ticks(ge);return g.useEffect(()=>{const e=u=>{const $=l[Le.bisectCenter(l.map(Ee=>Ee.date),a.invert(Be.pointer(u)[0]),0)];w($||l[l.length-1]),H(u.clientY),F(u.clientX),T?.($||l[l.length-1])},i=()=>{w(void 0),F(void 0),H(void 0)};Xe.select(W.current).on("mousemove",e).on("mouseout",i),T?.(void 0)},[a,l,T]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y.motion.svg,{width:`${I}px`,height:`${K}px`,viewBox:`0 0 ${I} ${K}`,direction:"ltr",ref:ae,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${b.left},${b.top})`,children:[t.jsxRuntimeExports.jsx(He.HighlightArea,{areaSettings:ue,width:v,height:M,scale:a,animate:s,isInView:j}),t.jsxRuntimeExports.jsx(Ae.CustomArea,{areaSettings:xe,scaleX:a,scaleY:c,animate:s,isInView:j}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{values:Ne.filter(e=>e!==0),y:Ne.filter(e=>e!==0).map(e=>c(e)),x1:0-C,x2:v+b.right,styles:{gridLines:O?.yAxis?.gridLines,labels:O?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:N,prefix:m,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:q}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:c(o<0?0:o),y2:c(o<0?0:o),x1:0-C,x2:v+b.right,label:qe.numberFormattingFunction(o<0?0:o,"NA",q,m,N),labelPos:{x:0-C,y:c(o<0?0:o),dx:0,dy:J<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:O?.xAxis?.axis,label:O?.yAxis?.labels}}),t.jsxRuntimeExports.jsx($e.AxisTitle,{x:0-C-15,y:M/2,style:O?.yAxis?.title,className:y?.yAxis?.title,text:oe,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(Ve.XTicksAndGridLines,{values:ke.map(e=>d.format(e,x)),x:ke.map(e=>a(e)),y1:0,y2:M,styles:{gridLines:O?.xAxis?.gridLines,labels:O?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:N,prefix:m,labelType:"primary",showGridLines:!0,precision:q})}),se.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs(Y.motion.g,{children:[ce.map(e=>t.jsxRuntimeExports.jsxs(Y.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&r[p.indexOf(e[0].color)]===V?1:R:k.length!==0?k.indexOf(e[0].label)!==-1?1:R:1},whileInView:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&r[p.indexOf(e[0].color)]===V?1:R:k.length!==0?k.indexOf(e[0].label)!==-1?1:R:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(Y.motion.path,{d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",style:{fill:"none",strokeWidth:f?e[0].label===f.label?D+Math.max(2,.5*D):D:k.length!==0&&k.indexOf(e[0].label)!==-1?D+Math.max(2,.5*D):D},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray},whileInView:{pathLength:1,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),e.map((i,u)=>t.jsxRuntimeExports.jsx(Y.motion.g,{children:h.checkIfNullOrUndefined(i.y)?null:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:B?t.jsxRuntimeExports.jsx(Y.motion.circle,{r:v/e.length<5?0:v/e.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:n.filter($=>$.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,cx:a(i.date),cy:c(i.y)},whileInView:{opacity:1,fill:n.filter($=>$.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,transition:{duration:E?s.duration:.5,delay:E?0:s.duration},cx:a(i.date),cy:c(i.y)}},initial:"initial",animate:j?"whileInView":"initial"}):null})},u)),(k.indexOf(e[0].label)!==-1||f?.label===e[0].label)&&U?t.jsxRuntimeExports.jsx(Y.motion.text,{className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,x:a(e[e.length-1].date),y:c(e[e.length-1].y)},whileInView:{opacity:1,fill:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,x:a(e[e.length-1].date),y:c(e[e.length-1].y),transition:{duration:E?s.duration:.5,delay:E?0:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:e[0].label}):null]},e[0].label)),f?t.jsxRuntimeExports.jsx("text",{y:c(f.y)-8,x:a(f.date),className:t.mo("graph-value text-sm font-bold",y?.graphObjectValues),style:{fill:n.filter(e=>e.color).length===0?r[0]:f.color?r[p.indexOf(f.color)]:A.Colors.gray,textAnchor:"middle",...O?.graphObjectValues||{}},children:qe.numberFormattingFunction(f.y,be,q,m,N)}):null]}),l.filter(e=>!h.checkIfNullOrUndefined(e.y)).map((e,i)=>t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:Se.renderCell(l.findIndex(u=>u.label===e.label&&u.date===e.date)),opacity:0,onMouseEnter:u=>{w(e),H(u.clientY),F(u.clientX),T?.(e)},onMouseMove:u=>{w(e),H(u.clientY),F(u.clientX)},onMouseLeave:()=>{w(void 0),F(void 0),H(void 0),T?.(void 0)}})},i)),Q?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Q.map((e,i)=>t.jsxRuntimeExports.jsx(Ue.RefLineY,{text:e.text,color:e.color,y:c(e.value),x1:0-C,x2:v+b.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:j},i))}):null,t.jsxRuntimeExports.jsx("g",{children:ye.map((e,i)=>{const u=Ae.getLineEndPoint({x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?c(e.yCoordinate):0},h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),$=e.showConnector?{y1:u.y,x1:u.x,y2:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?c(e.yCoordinate):0,cx:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Ee={y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:ie?0:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:ie?e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):v+b.right-(e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(Ae.Annotation,{color:e.color,connectorsSettings:$,labelSettings:Ee,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:j},i)})}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),f&&ee&&L&&le?t.jsxRuntimeExports.jsx(Me.Tooltip,{data:f,body:ee,xPos:L,yPos:le,backgroundStyle:O?.tooltip,className:y?.tooltip}):null]})}function et(de){const{data:n,graphTitle:I,showNAColor:K=!0,colors:r,colorDomain:x,suffix:ge="",sources:_,prefix:pe="",graphDescription:P,height:N,width:m,footNote:C,noOfXTicks:ee=10,dateFormat:T="yyyy",padding:Q,backgroundColor:S=!1,leftMargin:X=30,rightMargin:te=50,topMargin:k=20,bottomMargin:s=25,showColorScale:ie=!0,tooltip:D,relativeHeight:B,onSeriesMouseOver:ye,showLabels:je=!0,refValues:oe=[],highlightAreaSettings:we=[],graphID:re,minValue:ne,maxValue:z,highlightedLines:O=[],graphDownload:p=!1,dataDownload:V=!1,animate:y=!1,language:U="en",colorLegendTitle:R,minHeight:q=0,strokeWidth:be=2,showDots:se=!0,annotations:ae=[],customHighlightAreaSettings:j=[],theme:E="light",ariaLabel:ve,yAxisTitle:Oe,noOfYTicks:l=5,minDate:Ce,maxDate:Z,curveType:f="curve",styles:w,classNames:L,dimmedOpacity:F=.3,precision:le=2,customLayers:H=[],naLabel:b="NA"}=de,[W,ce]=g.useState(0),[ue,xe]=g.useState(0),[v,M]=g.useState(void 0),G=g.useRef(null),me=g.useRef(null);return g.useEffect(()=>{const o=new ResizeObserver(J=>{ce(m||J[0].target.clientWidth||620),xe(N||J[0].target.clientHeight||480)});return G.current&&(xe(G.current.clientHeight||480),ce(G.current.clientWidth||620),m||o.observe(G.current)),()=>o.disconnect()},[m,N]),t.jsxRuntimeExports.jsx("div",{className:`${E||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:U==="he"||U==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${U||"en"}`,m?"w-fit":"w-full",L?.graphContainer),style:{...w?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:re,ref:me,"aria-label":ve||`${I?`The graph shows ${I}. `:""}This is a multi-line chart that shows trends over time.${P?` ${P}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?Q||"1rem":Q||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[I||P||p||V?t.jsxRuntimeExports.jsx(Ke.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:L?.title,description:L?.description},graphTitle:I,graphDescription:P,width:m,graphDownload:p?me.current:void 0,dataDownload:V?n.map(o=>o.data).filter(o=>o!==void 0).length>0?n.map(o=>o.data).filter(o=>o!==void 0):n.filter(o=>o!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?t.jsxRuntimeExports.jsx(Qe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ie&&n.filter(o=>o.color).length!==0?t.jsxRuntimeExports.jsx(Ze.ColorLegendWithMouseOver,{width:m,colorLegendTitle:R,colors:r||A.Colors[E].categoricalColors.colors,colorDomain:x||fe.uniqBy(n,"color",!0),setSelectedColor:M,showNAColor:K}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:G,"aria-label":"Graph area",children:(m||W)&&(N||ue)?t.jsxRuntimeExports.jsx(_e,{data:n,lineColors:n.filter(o=>o.color).length===0?r?[r]:[A.Colors.primaryColors["blue-600"]]:r||A.Colors[E].categoricalColors.colors,width:m||W,height:Math.max(q,N||(B?q?(m||W)*B>q?(m||W)*B:q:(m||W)*B:ue)),dateFormat:T,noOfXTicks:ee,leftMargin:X,rightMargin:te,topMargin:k,bottomMargin:s,tooltip:D,onSeriesMouseOver:ye,suffix:ge,prefix:pe,highlightAreaSettings:we,refValues:oe,minValue:ne,maxValue:z,highlightedLines:O,animate:y===!0?{duration:.5,once:!0,amount:.5}:y||{duration:0,once:!0,amount:0},rtl:U==="he"||U==="ar",strokeWidth:be,showDots:se,annotations:ae,customHighlightAreaSettings:j,yAxisTitle:Oe,noOfYTicks:l,minDate:Ce,maxDate:Z,curveType:f,styles:w,classNames:L,selectedColor:v,showLabels:je,colorDomain:n.filter(o=>o.color).length===0?[]:x||fe.uniqBy(n,"color",!0),dimmedOpacity:F,precision:le,customLayers:H,naLabel:b}):null})]})}),_||C?t.jsxRuntimeExports.jsx(Je.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:L?.footnote,source:L?.source},sources:_,footNote:C,width:m}):null]})})})})}exports.MultiLineAltChart=et;
2
2
  //# sourceMappingURL=MultiLineAltChart.cjs.map