@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.
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +650 -648
- package/dist/BarGraph.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +210 -208
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +42 -40
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +122 -120
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +133 -113
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +274 -274
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +194 -174
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +160 -161
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +77 -66
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +166 -161
- package/dist/ParetoChart.js.map +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +253 -241
- package/dist/RadarChart.js.map +1 -1
- package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-C2--oMQq.js} +10 -9
- package/dist/RegressionLine-C2--oMQq.js.map +1 -0
- package/dist/RegressionLine-Dj0GSiAp.cjs +2 -0
- package/dist/RegressionLine-Dj0GSiAp.cjs.map +1 -0
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +130 -129
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +43 -38
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +113 -109
- package/dist/SlopeChart.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +282 -270
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +284 -349
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +20 -21
- package/dist/UnitChart.js.map +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js +70 -0
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -0
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs +2 -0
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +34 -32
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.ts +8 -0
- package/dist/utils.js +16 -14
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
- package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
- package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DualAxisLineChart.js","sources":["../src/Components/Graphs/LineCharts/DualAxisLineChart/Graph.tsx","../src/Components/Graphs/LineCharts/DualAxisLineChart/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\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 { motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n DualAxisLineChartDataType,\r\n HighlightAreaSettingsDataType,\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 { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\n\r\ninterface Props {\r\n data: DualAxisLineChartDataType[];\r\n lineColors: [string, string];\r\n labels: [string, string];\r\n width: number;\r\n height: number;\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 sameAxes: boolean;\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\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 animate: AnimateDataType;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n noOfYTicks: number;\r\n lineSuffixes: [string, string];\r\n linePrefixes: [string, string];\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 showAxisLabels: boolean;\r\n}\r\n\r\ninterface FormattedDataType {\r\n y1: number;\r\n y2: number;\r\n date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n lineColors,\r\n labels,\r\n sameAxes,\r\n dateFormat,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n highlightAreaSettings,\r\n onSeriesMouseOver,\r\n animate,\r\n strokeWidth,\r\n showDots,\r\n noOfYTicks,\r\n lineSuffixes,\r\n linePrefixes,\r\n minDate,\r\n maxDate,\r\n curveType,\r\n styles,\r\n classNames,\r\n precision,\r\n customLayers,\r\n showAxisLabels,\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: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const MouseoverRectRef = useRef(null);\r\n const dataFormatted = orderBy(\r\n data.map(d => ({\r\n ...d,\r\n date: parse(`${d.date}`, dateFormat, new Date()),\r\n })),\r\n ['date'],\r\n ['asc'],\r\n );\r\n const highlightAreaSettingsFormatted = highlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: [\r\n d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n ],\r\n }));\r\n const 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 minParam1 =\r\n Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape1 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y1))\r\n .x(d => x(d.date))\r\n .y(d => y1(d.y1))\r\n .curve(curve);\r\n\r\n const lineShape2 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y2))\r\n .x(d => x(d.date))\r\n .y(d => y2(d.y2))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfYTicks);\r\n const y2Ticks = y2.ticks(noOfYTicks);\r\n const xTicks = x.ticks(noOfXTicks);\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\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 <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: lineColors[0],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[0], lineSuffixes[0])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[0], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[0], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[0].length > 100 ? `${labels[0].substring(0, 100)}...` : labels[0]}\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColors[1],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[1], lineSuffixes[1])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[1], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[1], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[1].length > 100 ? `${labels[1].substring(0, 100)}...` : labels[1]}\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n <Axis\r\n y1={graphHeight}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\r\n <XTicksAndGridLines\r\n values={xTicks.map(d => format(d, dateFormat))}\r\n x={xTicks.map(d => x(d))}\r\n y1={0}\r\n y2={graphHeight}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: cn('opacity-0', classNames?.xAxis?.gridLines),\r\n labels: cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs',\r\n classNames?.xAxis?.labels,\r\n ),\r\n }}\r\n labelType='primary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <g>\r\n <motion.path\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\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 d={\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || ''\r\n }\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\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 <g>\r\n {dataFormatted.map((d, i) => (\r\n <motion.g key={i}>\r\n {!checkIfNullOrUndefined(d.y1) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColors[0] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y1(d.y1 as number) },\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: y1(d.y1 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y2)\r\n ? -8\r\n : (d.y2 as number) < (d.y1 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[0],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-1 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y2(d.y1 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y1 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y1,\r\n 'NA',\r\n precision,\r\n linePrefixes[0],\r\n lineSuffixes[0],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n {!checkIfNullOrUndefined(d.y2) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColors[1] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y2(d.y2 as number) },\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: y2(d.y2 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y1)\r\n ? -8\r\n : (d.y1 as number) < (d.y2 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[1],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-2 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y2(d.y2 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y2 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y2,\r\n 'NA',\r\n precision,\r\n linePrefixes[1],\r\n lineSuffixes[1],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\r\n </g>\r\n {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 { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n DualAxisLineChartDataType,\r\n Languages,\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 { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DualAxisLineChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for the 2 lines */\r\n lineColors?: [string, string];\r\n /** 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 of the lines */\r\n linePrefixes?: [string, string];\r\n /** Suffix for values of the lines */\r\n lineSuffixes?: [string, string];\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 dots on the line */\r\n showDots?: boolean;\r\n /** Stroke width of the line */\r\n strokeWidth?: number;\r\n /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n animate?: boolean | AnimateDataType;\r\n /** Enables same axis for the 2 lines */\r\n sameAxes?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of labels of the axis. */\r\n showAxisLabels?: boolean;\r\n /** Labels for the lines */\r\n labels: [string, string];\r\n /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */\r\n dateFormat?: string;\r\n /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\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 DualAxisLineChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n padding,\r\n lineColors = [\r\n Colors.light.categoricalColors.colors[0],\r\n Colors.light.categoricalColors.colors[1],\r\n ],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n labels,\r\n lineSuffixes = ['', ''],\r\n linePrefixes = ['', ''],\r\n tooltip,\r\n highlightAreaSettings = [],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n strokeWidth = 2,\r\n showDots = true,\r\n language = 'en',\r\n showColorScale = true,\r\n minHeight = 0,\r\n colorLegendTitle,\r\n theme = 'light',\r\n ariaLabel,\r\n noOfYTicks = 5,\r\n maxDate,\r\n minDate,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n showAxisLabels = true,\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 show trends for 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 {!showColorScale ? null : (\r\n <ColorLegend\r\n colorDomain={labels}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={lineColors}\r\n showNAColor={false}\r\n />\r\n )}\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 sameAxes={sameAxes}\r\n lineColors={lineColors}\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 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 labels={labels}\r\n highlightAreaSettings={highlightAreaSettings}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\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 strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n noOfYTicks={noOfYTicks}\r\n lineSuffixes={lineSuffixes}\r\n linePrefixes={linePrefixes}\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 showAxisLabels={showAxisLabels}\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","lineColors","labels","sameAxes","dateFormat","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","highlightAreaSettings","onSeriesMouseOver","animate","strokeWidth","showDots","noOfYTicks","lineSuffixes","linePrefixes","minDate","maxDate","curveType","styles","classNames","precision","customLayers","showAxisLabels","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","parse","highlightAreaSettingsFormatted","graphWidth","graphHeight","minYear","maxYear","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","x","scaleTime","y1","scaleLinear","y2","lineShape1","line","checkIfNullOrUndefined","lineShape2","y1Ticks","y2Ticks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","jsxs","Fragment","jsx","motion","HighlightArea","i","cn","numberFormattingFunction","Axis","AxisTitle","XTicksAndGridLines","format","el","Tooltip","DualAxisLineChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","language","showColorScale","minHeight","colorLegendTitle","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4EO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC;AAAA,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IAAA,IACrCA,KAAW,EAAE,UAAU,GAAG,MAAM,IAAM,QAAQ,EAAA;AAAA,0BAEpD,aAAAC;AAAA,0BACA,UAAAC;AAAA,0BACA,YAAAC;AAAA,0BACA,cAAAC;AAAA,0BACA,cAAAC;AAAA,0BACA,SAAAC;AAAA,0BACA,SAAAC;AAAA,0BACA,WAAAC;AAAA,0BACA,QAAAC;AAAA,0BACA,YAAAC;AAAA,0BACA,WAAAC;AAAA,0BACA,cAAAC;AAAA,0BACA,gBAAAC;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACN,EAAA,CACF,EAAA,CAEJ;AAAA,gBACC0E,KAAWE,IACVhB,gBAAAA,EAAAA;AAAAA,kBAACyC;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUzG,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAA6E;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAAxG;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"DualAxisLineChart.js","sources":["../src/Components/Graphs/LineCharts/DualAxisLineChart/Graph.tsx","../src/Components/Graphs/LineCharts/DualAxisLineChart/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\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 { motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n DualAxisLineChartDataType,\r\n HighlightAreaSettingsDataType,\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 { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\n\r\ninterface Props {\r\n data: DualAxisLineChartDataType[];\r\n lineColors: [string, string];\r\n labels: [string, string];\r\n width: number;\r\n height: number;\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 sameAxes: boolean;\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\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 animate: AnimateDataType;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n noOfYTicks: number;\r\n lineSuffixes: [string, string];\r\n linePrefixes: [string, string];\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 showAxisLabels: boolean;\r\n}\r\n\r\ninterface FormattedDataType {\r\n y1: number;\r\n y2: number;\r\n date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n lineColors,\r\n labels,\r\n sameAxes,\r\n dateFormat,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n highlightAreaSettings,\r\n onSeriesMouseOver,\r\n animate,\r\n strokeWidth,\r\n showDots,\r\n noOfYTicks,\r\n lineSuffixes,\r\n linePrefixes,\r\n minDate,\r\n maxDate,\r\n curveType,\r\n styles,\r\n classNames,\r\n precision,\r\n customLayers,\r\n showAxisLabels,\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: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const MouseoverRectRef = useRef(null);\r\n const dataFormatted = orderBy(\r\n data.map(d => ({\r\n ...d,\r\n date: parse(`${d.date}`, dateFormat, new Date()),\r\n })),\r\n ['date'],\r\n ['asc'],\r\n );\r\n const highlightAreaSettingsFormatted = highlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: [\r\n d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n ],\r\n }));\r\n const 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 minParam1 =\r\n Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape1 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y1))\r\n .x(d => x(d.date))\r\n .y(d => y1(d.y1))\r\n .curve(curve);\r\n\r\n const lineShape2 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y2))\r\n .x(d => x(d.date))\r\n .y(d => y2(d.y2))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfYTicks);\r\n const y2Ticks = y2.ticks(noOfYTicks);\r\n const xTicks = x.ticks(noOfXTicks);\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\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 <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: lineColors[0],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[0], lineSuffixes[0])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[0], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[0], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[0].length > 100 ? `${labels[0].substring(0, 100)}...` : labels[0]}\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColors[1],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[1], lineSuffixes[1])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[1], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[1], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[1].length > 100 ? `${labels[1].substring(0, 100)}...` : labels[1]}\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n <Axis\r\n y1={graphHeight}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\r\n <XTicksAndGridLines\r\n values={xTicks.map(d => format(d, dateFormat))}\r\n x={xTicks.map(d => x(d))}\r\n y1={0}\r\n y2={graphHeight}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: cn('opacity-0', classNames?.xAxis?.gridLines),\r\n labels: cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs',\r\n classNames?.xAxis?.labels,\r\n ),\r\n }}\r\n labelType='primary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <g>\r\n <motion.path\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\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 d={\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || ''\r\n }\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\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 <g>\r\n {dataFormatted.map((d, i) => (\r\n <motion.g key={i}>\r\n {!checkIfNullOrUndefined(d.y1) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n cx: x(d.date),\r\n cy: y1(d.y1 as number),\r\n fill: lineColors[0],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n fill: lineColors[0],\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y1(d.y1 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y2)\r\n ? -8\r\n : (d.y2 as number) < (d.y1 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-1 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: x(d.date),\r\n y: y2(d.y1 as number),\r\n fill: lineColors[0],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n fill: lineColors[0],\r\n y: y2(d.y1 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y1,\r\n 'NA',\r\n precision,\r\n linePrefixes[0],\r\n lineSuffixes[0],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n {!checkIfNullOrUndefined(d.y2) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n cx: x(d.date),\r\n cy: y2(d.y2 as number),\r\n fill: lineColors[1],\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 fill: lineColors[1],\r\n cx: x(d.date),\r\n cy: y2(d.y2 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y1)\r\n ? -8\r\n : (d.y1 as number) < (d.y2 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-2 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: x(d.date),\r\n y: y2(d.y2 as number),\r\n fill: lineColors[1],\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y2 as number),\r\n fill: lineColors[1],\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y2,\r\n 'NA',\r\n precision,\r\n linePrefixes[1],\r\n lineSuffixes[1],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\r\n </g>\r\n {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 { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n DualAxisLineChartDataType,\r\n Languages,\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 { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DualAxisLineChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for the 2 lines */\r\n lineColors?: [string, string];\r\n /** 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 of the lines */\r\n linePrefixes?: [string, string];\r\n /** Suffix for values of the lines */\r\n lineSuffixes?: [string, string];\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 dots on the line */\r\n showDots?: boolean;\r\n /** Stroke width of the line */\r\n strokeWidth?: number;\r\n /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n animate?: boolean | AnimateDataType;\r\n /** Enables same axis for the 2 lines */\r\n sameAxes?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of labels of the axis. */\r\n showAxisLabels?: boolean;\r\n /** Labels for the lines */\r\n labels: [string, string];\r\n /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */\r\n dateFormat?: string;\r\n /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\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 DualAxisLineChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n padding,\r\n lineColors = [\r\n Colors.light.categoricalColors.colors[0],\r\n Colors.light.categoricalColors.colors[1],\r\n ],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n labels,\r\n lineSuffixes = ['', ''],\r\n linePrefixes = ['', ''],\r\n tooltip,\r\n highlightAreaSettings = [],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n strokeWidth = 2,\r\n showDots = true,\r\n language = 'en',\r\n showColorScale = true,\r\n minHeight = 0,\r\n colorLegendTitle,\r\n theme = 'light',\r\n ariaLabel,\r\n noOfYTicks = 5,\r\n maxDate,\r\n minDate,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n showAxisLabels = true,\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 show trends for 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 {!showColorScale ? null : (\r\n <ColorLegend\r\n colorDomain={labels}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={lineColors}\r\n showNAColor={false}\r\n />\r\n )}\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 sameAxes={sameAxes}\r\n lineColors={lineColors}\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 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 labels={labels}\r\n highlightAreaSettings={highlightAreaSettings}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\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 strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n noOfYTicks={noOfYTicks}\r\n lineSuffixes={lineSuffixes}\r\n linePrefixes={linePrefixes}\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 showAxisLabels={showAxisLabels}\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","lineColors","labels","sameAxes","dateFormat","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","highlightAreaSettings","onSeriesMouseOver","animate","strokeWidth","showDots","noOfYTicks","lineSuffixes","linePrefixes","minDate","maxDate","curveType","styles","classNames","precision","customLayers","showAxisLabels","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","parse","highlightAreaSettingsFormatted","graphWidth","graphHeight","minYear","maxYear","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","x","scaleTime","y1","scaleLinear","y2","lineShape1","line","checkIfNullOrUndefined","lineShape2","y1Ticks","y2Ticks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","jsxs","Fragment","jsx","motion","HighlightArea","i","cn","numberFormattingFunction","Axis","AxisTitle","XTicksAndGridLines","format","el","Tooltip","DualAxisLineChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","language","showColorScale","minHeight","colorLegendTitle","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA4EO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,IACE9B,IACE+B,IAASC,GAAO,IAAI,GACpBC,IAAWC,GAAUH,GAAQ;AAAA,IACjC,MAAMd,EAAQ;AAAA,IACd,QAAQA,EAAQ;AAAA,EAAA,CACjB,GACK,CAACkB,GAAiBC,CAAkB,IAAIC,EAAS,EAAK;AAE5D,EAAAC,GAAU,MAAM;AACd,QAAIL,KAAY,CAACE,GAAiB;AAChC,YAAMI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A,WAAAC;AAAA,0BACA,cAAAC;AAAA,0BACA,gBAAAC;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACN,EAAA,CACF,EAAA,CAEJ;AAAA,gBACC0E,KAAWE,IACVhB,gBAAAA,EAAAA;AAAAA,kBAACyC;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUzG,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAA6E;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAAxG;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
package/dist/DumbbellChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),x=require("react"),ve=require("./parse-hMnG_lRV.cjs"),Oe=require("./getSliderMarks-CRIbTGYV.cjs"),Me=require("./index-CQ3e6Ewi.cjs"),Le=require("./index-DQA8q5sC.cjs"),Ve=require("./Modal-tXZlLE5s.cjs"),Te=require("./numberFormattingFunction-02t-wJta.cjs"),$e=require("./Tooltip-De16GWhY.cjs"),A=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ae=require("./string2HTML-z7CwHXcx.cjs"),Ze=require("./XTicksAndGridLines-CCzXIV8d.cjs"),qe=require("./AxisTitle-CK9YeovX.cjs"),et=require("./YAxesLabels-yRFFdx1s.cjs"),Fe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Pe=require("./ReferenceLine-CFVBBN__.cjs"),Be=require("./linear-BVckp9RD.cjs"),He=require("./band-CAApY4Pd.cjs"),We=require("./use-in-view-sQJZ_xDO.cjs"),le=require("./proxy-BHRoeZgd.cjs"),Ue=require("./index-BW8iNx7E.cjs"),Ge=require("./GraphHeader.cjs"),Xe=require("./GraphFooter.cjs"),Ye=require("./ColorLegendWithMouseOver.cjs"),_e=require("./Colors.cjs"),ze=require("./EmptyState-d8_8SxeW.cjs"),Ne=require("./index-BW_-wD2k.cjs"),je=require("./ensureCompleteData-DkQYPeDa.cjs"),Je=require("./uniqBy-O05lp2S5.cjs"),Ke=require("./sort-O96oMZLb.cjs"),Qe=require("./init-DU0ybBc_.cjs"),tt=require("./Axis-DE7dSn1_.cjs"),it=require("./XAxesLabels-Drf7M3YK.cjs");function at(ye){const{data:l,dotColors:g,suffix:_,prefix:z,barPadding:w,showValues:ue,showTicks:Z,leftMargin:ee,truncateBy:ce,width:te,height:ie,rightMargin:J,topMargin:N,bottomMargin:s,radius:q,showLabels:xe,tooltip:O,onSeriesMouseOver:F,maxValue:E,minValue:ae,onSeriesMouseClick:B,selectedColor:I,arrowConnector:R,connectorStrokeWidth:pe,maxBarThickness:re,minBarThickness:ne,resetSelectionOnDoubleClick:ge,detailsOnClick:v,axisTitle:U,noOfTicks:fe,valueColor:se,styles:d,classNames:h,labelOrder:D,refValues:oe,rtl:y,animate:u,precision:M,customLayers:G,highlightedDataPoints:X,dimmedOpacity:L}=ye,j=x.useRef(null),p=We.useInView(j,{once:u.once,amount:u.amount}),m={top:U?N+25:N,bottom:s,left:ee,right:J},H=te-m.left-m.right,W=ie-m.top-m.bottom,[K,P]=x.useState(void 0),[C,b]=x.useState(void 0),[S,Q]=x.useState(void 0),[V,$]=x.useState(void 0),Y=l.map((t,n)=>({...t,id:D?`${t.label}`:`${n}`})),k=D||Y.map(t=>`${t.id}`),f=Be.linear().domain([ae,E]).range([0,H]).nice(),T=He.band().domain(k).range([0,ne?Math.max(W,ne*Y.length):re?Math.min(W,re*Y.length):W]).paddingInner(w),a=f.ticks(fe);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(le.motion.svg,{width:`${te}px`,height:`${ie}px`,viewBox:`0 0 ${te} ${ie}`,direction:"ltr",ref:j,children:[R?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,i.jsxRuntimeExports.jsxs("g",{transform:`translate(${m.left},${m.top})`,children:[Z?i.jsxRuntimeExports.jsx(Ze.XTicksAndGridLines,{values:a.filter((t,n)=>n!==0),x:a.filter((t,n)=>n!==0).map(t=>f(t)),y1:0-N,y2:W+m.bottom,styles:{gridLines:d?.xAxis?.gridLines,labels:d?.xAxis?.labels},classNames:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},suffix:_,prefix:z,labelType:"secondary",showGridLines:!0,precision:M}):null,i.jsxRuntimeExports.jsx(qe.AxisTitle,{x:H/2,y:0-m.top+15,style:d?.xAxis?.title,className:h?.xAxis?.title,text:U}),i.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{y:Y.map(t=>T(`${t.id}`)+T.bandwidth()/2),x1:0,x2:H,styles:{gridLines:d?.yAxis?.gridLines},classNames:{gridLines:h?.yAxis?.gridLines},labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:M}),G.filter(t=>t.position==="before").map(t=>t.layer),i.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[Y.map(t=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:T(`${t.id}`)+T.bandwidth()/2,opacity:X.length!==0?X.indexOf(t.label)!==-1?.85:L:.85},whileInView:{x:0,y:T(`${t.id}`)+T.bandwidth()/2,opacity:X.length!==0?X.indexOf(t.label)!==-1?.85:L:.85,transition:{duration:u.duration}}},initial:"initial",animate:p?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[xe?i.jsxRuntimeExports.jsx(et.YAxesLabels,{value:`${t.label}`.length<ce?`${t.label}`:`${`${t.label}`.substring(0,ce)}...`,y:0-T.bandwidth()/2,x:0-m.left,width:m.left,height:T.bandwidth(),alignment:"right",style:d?.yAxis?.labels,className:h?.yAxis?.labels,animate:u,isInView:p}):null,i.jsxRuntimeExports.jsx(le.motion.line,{y1:0,y2:0,style:{strokeWidth:pe,...d?.dataConnectors||{},opacity:I?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",h?.dataConnectors),markerEnd:R&&t.x.indexOf(Math.min(...t.x.filter(n=>n!==null)))===0?"url(#arrow)":"",markerStart:R&&t.x.indexOf(Math.min(...t.x.filter(n=>n!==null)))===t.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:f(Math.min(...t.x.filter(n=>n!==null)))+q,x2:f(Math.max(...t.x.filter(n=>n!==null)))-q,transition:{duration:u.duration}}},initial:"initial",animate:p?"whileInView":"initial"}),t.x.map((n,o)=>i.jsxRuntimeExports.jsx(le.motion.g,{onMouseEnter:de=>{P({...t,xIndex:o}),$(de.clientY),Q(de.clientX),F?.({...t,xIndex:o})},onClick:()=>{(B||v)&&(Le.isEqual(C,{...t,xIndex:o})&&ge?(b(void 0),B?.(void 0)):(b({...t,xIndex:o}),B&&B({...t,xIndex:o})))},onMouseMove:de=>{P({...t,xIndex:o}),$(de.clientY),Q(de.clientX)},onMouseLeave:()=>{P(void 0),Q(void 0),$(void 0),F?.(void 0)},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{opacity:I?g[o]===I?1:.3:1},whileInView:{opacity:I?g[o]===I?1:.3:1,transition:{duration:u.duration}}},initial:"initial",animate:p?"whileInView":"initial",children:A.checkIfNullOrUndefined(n)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,r:q,style:{fill:g[o],fillOpacity:.85,stroke:g[o],strokeWidth:1,opacity:A.checkIfNullOrUndefined(n)?0:1},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{cx:f(0),opacity:0},whileInView:{cx:f(n||0),opacity:A.checkIfNullOrUndefined(n)?0:1,transition:{duration:u.duration}}},initial:"initial",animate:p?"whileInView":"initial"}),ue?i.jsxRuntimeExports.jsx(le.motion.text,{y:0,style:{fill:se||g[o],textAnchor:"middle",...d?.graphObjectValues||{}},dx:0,dy:0-q-3,className:i.mo("graph-value text-sm font-bold",A.checkIfNullOrUndefined(n)?"0opacity-0":"opacity-100",h?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:f(0),opacity:0},whileInView:{x:f(n||0),opacity:1,transition:{duration:u.duration}}},initial:"initial",animate:p?"whileInView":"initial",children:Te.numberFormattingFunction(n,"NA",M,z,_)}):null]})},o))]},t.label)),oe?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:oe.map((t,n)=>i.jsxRuntimeExports.jsx(Pe.RefLineX,{text:t.text,color:t.color,x:f(t.value),y1:0-m.top,y2:W+m.bottom,textSide:f(t.value)>H*.75||y?"left":"right",classNames:t.classNames,styles:t.styles,animate:u,isInView:p},n))}):null]}),G.filter(t=>t.position==="after").map(t=>t.layer)]})]}),K&&O&&S&&V?i.jsxRuntimeExports.jsx($e.Tooltip,{data:K,body:O,xPos:S,yPos:V,backgroundStyle:d?.tooltip,className:h?.tooltip}):null,v&&C!==void 0?i.jsxRuntimeExports.jsx(Ve.X,{open:C!==void 0,onClose:()=>{b(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof v=="string"?{__html:Ae.string2HTML(v,C)}:void 0,children:typeof v=="function"?v(C):null})}):null]})}function rt(ye){const{data:l,graphTitle:g,colors:_=_e.Colors.light.categoricalColors.colors,sources:z,graphDescription:w,barPadding:ue=.25,showTicks:Z=!0,leftMargin:ee=100,rightMargin:ce=40,topMargin:te=20,bottomMargin:ie=10,truncateBy:J=999,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E=!1,radius:ae=3,showLabels:B=!0,tooltip:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:re,suffix:ne="",prefix:ge="",maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:se=!1,dataDownload:d=!1,showValues:h=!0,sortParameter:D,arrowConnector:oe=!1,connectorStrokeWidth:y=2,language:u="en",minHeight:M=0,theme:G="light",labelOrder:X,maxBarThickness:L,maxNumberOfBars:j,minBarThickness:p,ariaLabel:m,resetSelectionOnDoubleClick:H=!0,detailsOnClick:W,axisTitle:K,noOfTicks:P=5,valueColor:C,styles:b,classNames:S,refValues:Q,filterNA:V=!0,animate:$=!1,precision:Y=2,customLayers:k=[],showColorScale:f=!0,highlightedDataPoints:T=[],dimmedOpacity:a=.3,timeline:t={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},sortData:n}=ye,[o,de]=x.useState(0),[ke,Ee]=x.useState(0),[me,Ie]=x.useState(t.autoplay),c=Ke.sort(Je.uniqBy(l,"date",!0).map(e=>ve.parse(`${e}`,t.dateFormat||"yyyy",new Date).getTime()),(e,r)=>Qe.ascending(e,r)),[be,we]=x.useState(t.autoplay?0:c.length-1),[De,Se]=x.useState(void 0),he=x.useRef(null),Re=x.useRef(null);x.useEffect(()=>{const e=new ResizeObserver(r=>{de(s||r[0].target.clientWidth||620),Ee(N||r[0].target.clientHeight||480)});return he.current&&(Ee(he.current.clientHeight||480),de(he.current.clientWidth||620),s||e.observe(he.current)),()=>e.disconnect()},[s,N]),x.useEffect(()=>{const e=setInterval(()=>{we(r=>r<c.length-1?r+1:0)},(t.speed||2)*1e3);return me||clearInterval(e),()=>clearInterval(e)},[c,me,t.speed]);const Ce=Oe.getSliderMarks(c,be,t.showOnlyActiveDate,t.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${G||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:u==="he"||u==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${u||"en"}`,s?"w-fit":"w-full",S?.graphContainer),style:{...b?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:re,ref:Re,"aria-label":m||`${g?`The graph shows ${g}. `:""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${w?` ${w}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?F||"1rem":F||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[g||w||se||d?i.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:S?.title,description:S?.description},graphTitle:g,graphDescription:w,width:s,graphDownload:se?Re.current:void 0,dataDownload:d?l.map(e=>e.data).filter(e=>e!==void 0).length>0?l.map(e=>e.data).filter(e=>e!==void 0):l.filter(e=>e!==void 0):null}):null,t.enabled&&c.length>0&&Ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ie(!me)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":me?"Click to pause animation":"Click to play animation",children:me?i.jsxRuntimeExports.jsx(Ne.Pause,{}):i.jsxRuntimeExports.jsx(Ne.Play,{})}),i.jsxRuntimeExports.jsx(Oe.xr,{min:c[0],max:c[c.length-1],marks:Ce,step:null,defaultValue:c[c.length-1],value:c[be],onChangeComplete:e=>{we(c.indexOf(e))},onChange:e=>{we(c.indexOf(e))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?i.jsxRuntimeExports.jsx(ze.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[f?i.jsxRuntimeExports.jsx(Ye.ColorLegendWithMouseOver,{width:s,colorDomain:xe,colors:_,colorLegendTitle:O,setSelectedColor:Se,showNAColor:!1}):null,i.jsxRuntimeExports.jsx("div",{className:"flex grow w-full justify-center leading-0",ref:he,"aria-label":"Graph area",children:(s||o)&&(N||ke)?i.jsxRuntimeExports.jsx(at,{data:D!==void 0?D==="diff"?Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[e.x.length-1])||A.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0],[n||"asc"]).filter((e,r)=>j?r<j:!0):Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[D])?-1/0:e.x[D],[n||"asc"]).filter((e,r)=>j?r<j:!0):je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>V?!e.x.every(r=>r==null):e).filter((e,r)=>j?r<j:!0),dotColors:_,width:s||o,height:Math.max(M,N||(R?M?(s||o)*R>M?(s||o)*R:M:(s||o)*R:ke)),suffix:ne,prefix:ge,radius:ae,barPadding:ue,showTicks:Z,leftMargin:ee,rightMargin:ce,topMargin:te,bottomMargin:ie,truncateBy:J,showLabels:B,showValues:h,tooltip:I,onSeriesMouseOver:pe,maxValue:A.checkIfNullOrUndefined(v)?Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null))))<0?0:Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null)))):v,minValue:A.checkIfNullOrUndefined(U)?Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null))))>0?0:Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null)))):U,onSeriesMouseClick:fe,selectedColor:De,arrowConnector:oe,connectorStrokeWidth:y,maxBarThickness:L,minBarThickness:p,resetSelectionOnDoubleClick:H,detailsOnClick:W,axisTitle:K,noOfTicks:P,valueColor:C,styles:b,classNames:S,labelOrder:X,refValues:Q,rtl:u==="he"||u==="ar",animate:$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},precision:Y,customLayers:k,highlightedDataPoints:T,dimmedOpacity:a}):null})]})}),z||q?i.jsxRuntimeExports.jsx(Xe.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:S?.footnote,source:S?.source},sources:z,footNote:q,width:s}):null]})})})})}function nt(ye){const{data:l,dotColors:g,barPadding:_,showTicks:z,leftMargin:w,truncateBy:ue,width:Z,height:ee,rightMargin:ce,topMargin:te,bottomMargin:ie,radius:J,showLabels:N,tooltip:s,onSeriesMouseOver:q,maxValue:xe,minValue:O,onSeriesMouseClick:F,showValues:E,suffix:ae,prefix:B,selectedColor:I,arrowConnector:R,connectorStrokeWidth:pe,maxBarThickness:re,minBarThickness:ne,resetSelectionOnDoubleClick:ge,detailsOnClick:v,axisTitle:U,noOfTicks:fe,valueColor:se,styles:d,classNames:h,labelOrder:D,refValues:oe,animate:y,precision:u,customLayers:M,highlightedDataPoints:G,dimmedOpacity:X}=ye,L=x.useRef(null),j=We.useInView(L,{once:y.once,amount:y.amount}),p={top:te,bottom:ie,left:U?w+30:w,right:ce},m=Z-p.left-p.right,H=ee-p.top-p.bottom,[W,K]=x.useState(void 0),[P,C]=x.useState(void 0),[b,S]=x.useState(void 0),[Q,V]=x.useState(void 0),$=l.map((a,t)=>({...a,id:D?`${a.label}`:`${t}`})),Y=D||$.map(a=>`${a.id}`),k=Be.linear().domain([O,xe]).range([H,0]).nice(),f=He.band().domain(Y).range([0,ne?Math.max(m,ne*$.length):re?Math.min(m,re*$.length):m]).paddingInner(_),T=k.ticks(fe);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(le.motion.svg,{width:`${Z}px`,height:`${ee}px`,viewBox:`0 0 ${Z} ${ee}`,direction:"ltr",ref:L,children:[R?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,i.jsxRuntimeExports.jsxs("g",{transform:`translate(${p.left},${p.top})`,children:[i.jsxRuntimeExports.jsx(tt.Axis,{y1:k(O<0?0:O),y2:k(O<0?0:O),x1:0-w,x2:m+p.right,label:Te.numberFormattingFunction(O<0?0:O,"NA",u,B,ae),labelPos:{x:0-w,dx:0,dy:xe<0?"1em":-5,y:k(O<0?0:O)},classNames:{axis:h?.xAxis?.axis,label:h?.yAxis?.labels},styles:{axis:d?.xAxis?.axis,label:d?.yAxis?.labels}}),z?i.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{values:T.filter(a=>a!==0),y:T.filter(a=>a!==0).map(a=>k(a)),x1:0-w,x2:m+p.right,styles:{gridLines:d?.yAxis?.gridLines,labels:d?.yAxis?.labels},classNames:{gridLines:h?.yAxis?.gridLines,labels:h?.yAxis?.labels},suffix:ae,prefix:B,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:u}):null,i.jsxRuntimeExports.jsx(qe.AxisTitle,{x:0-w-15,y:H/2,style:d?.yAxis?.title,className:h?.yAxis?.title,text:U,rotate90:!0}),M.filter(a=>a.position==="before").map(a=>a.layer),i.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[$.map(a=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:f(`${a.id}`)+f.bandwidth()/2,y:0,opacity:G.length!==0?G.indexOf(a.label)!==-1?.85:X:.85},whileInView:{x:f(`${a.id}`)+f.bandwidth()/2,y:0,opacity:G.length!==0?G.indexOf(a.label)!==-1?.85:X:.85,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},children:[N?i.jsxRuntimeExports.jsx(it.XAxesLabels,{value:`${a.label}`.length<ue?`${a.label}`:`${`${a.label}`.substring(0,ue)}...`,y:H+5,x:0-f.bandwidth()/2,width:f.bandwidth(),height:p.bottom,style:d?.xAxis?.labels,className:h?.xAxis?.labels,alignment:"top",animate:y,isInView:j}):null,i.jsxRuntimeExports.jsx(le.motion.line,{x1:0,x2:0,style:{strokeWidth:pe,...d?.dataConnectors||{},opacity:I?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",h?.dataConnectors),markerEnd:R&&a.x.indexOf(Math.min(...a.x.filter(t=>t!==null)))===0?"url(#arrow)":"",markerStart:R&&a.x.indexOf(Math.min(...a.x.filter(t=>t!==null)))===a.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:k(Math.min(...a.x.filter(t=>t!==null)))+J,y2:k(Math.max(...a.x.filter(t=>t!==null)))-J,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),a.x.map((t,n)=>i.jsxRuntimeExports.jsx(le.motion.g,{onMouseEnter:o=>{K({...a,xIndex:n}),V(o.clientY),S(o.clientX),q?.({...a,xIndex:n})},onClick:()=>{(F||v)&&(Le.isEqual(P,{...a,xIndex:n})&&ge?(C(void 0),F?.(void 0)):(C({...a,xIndex:n}),F&&F({...a,xIndex:n})))},onMouseMove:o=>{K({...a,xIndex:n}),V(o.clientY),S(o.clientX)},onMouseLeave:()=>{K(void 0),S(void 0),V(void 0),q?.(void 0)},exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{opacity:I?g[n]===I?1:.3:1},whileInView:{opacity:I?g[n]===I?1:.3:1,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:A.checkIfNullOrUndefined(t)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,r:J,style:{fill:g[n],fillOpacity:.85,stroke:g[n],strokeWidth:1},exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{cy:k(0),opacity:0},whileInView:{cy:k(t||0),opacity:A.checkIfNullOrUndefined(t)?0:1,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),E?i.jsxRuntimeExports.jsx(le.motion.text,{x:0,style:{fill:se||g[n],textAnchor:"start",...d?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",A.checkIfNullOrUndefined(t)?"opacity-0":"opacity-100",h?.graphObjectValues),dx:J+3,dy:"0.33em",exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{y:k(0),opacity:0},whileInView:{y:k(t||0),opacity:1,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:Te.numberFormattingFunction(t,"NA",u,B,ae)}):null]})},n))]},a.label)),oe?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:oe.map((a,t)=>i.jsxRuntimeExports.jsx(Pe.RefLineY,{text:a.text,color:a.color,y:k(a.value),x1:0-w,x2:m+p.right,classNames:a.classNames,styles:a.styles,animate:y,isInView:j},t))}):null]}),M.filter(a=>a.position==="after").map(a=>a.layer)]})]}),W&&s&&b&&Q?i.jsxRuntimeExports.jsx($e.Tooltip,{data:W,body:s,xPos:b,yPos:Q,backgroundStyle:d?.tooltip,className:h?.tooltip}):null,v&&P!==void 0?i.jsxRuntimeExports.jsx(Ve.X,{open:P!==void 0,onClose:()=>{C(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof v=="string"?{__html:Ae.string2HTML(v,P)}:void 0,children:typeof v=="function"?v(P):null})}):null]})}function st(ye){const{data:l,graphTitle:g,colors:_=_e.Colors.light.categoricalColors.colors,sources:z,graphDescription:w,barPadding:ue=.25,showTicks:Z=!0,leftMargin:ee=20,rightMargin:ce=20,topMargin:te=20,bottomMargin:ie=25,truncateBy:J=999,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E=!1,radius:ae=3,tooltip:B,showLabels:I=!0,relativeHeight:R,onSeriesMouseOver:pe,graphID:re,suffix:ne="",prefix:ge="",maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:se=!1,dataDownload:d=!1,showValues:h=!0,sortParameter:D,arrowConnector:oe=!1,connectorStrokeWidth:y=2,language:u="en",minHeight:M=0,theme:G="light",maxBarThickness:X,maxNumberOfBars:L,minBarThickness:j,ariaLabel:p,resetSelectionOnDoubleClick:m=!0,detailsOnClick:H,axisTitle:W,noOfTicks:K=5,valueColor:P,styles:C,classNames:b,labelOrder:S,refValues:Q,filterNA:V=!0,animate:$=!1,precision:Y=2,customLayers:k=[],showColorScale:f=!0,highlightedDataPoints:T=[],dimmedOpacity:a=.3,timeline:t={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},sortData:n}=ye,[o,de]=x.useState(0),[ke,Ee]=x.useState(0),[me,Ie]=x.useState(t.autoplay),c=Ke.sort(Je.uniqBy(l,"date",!0).map(e=>ve.parse(`${e}`,t.dateFormat||"yyyy",new Date).getTime()),(e,r)=>Qe.ascending(e,r)),[be,we]=x.useState(t.autoplay?0:c.length-1),[De,Se]=x.useState(void 0),he=x.useRef(null),Re=x.useRef(null);x.useEffect(()=>{const e=new ResizeObserver(r=>{de(s||r[0].target.clientWidth||620),Ee(N||r[0].target.clientHeight||480)});return he.current&&(Ee(he.current.clientHeight||480),de(he.current.clientWidth||620),s||e.observe(he.current)),()=>e.disconnect()},[s,N]),x.useEffect(()=>{const e=setInterval(()=>{we(r=>r<c.length-1?r+1:0)},(t.speed||2)*1e3);return me||clearInterval(e),()=>clearInterval(e)},[c,me,t.speed]);const Ce=Oe.getSliderMarks(c,be,t.showOnlyActiveDate,t.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${G||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:u==="he"||u==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${u||"en"}`,s?"w-fit":"w-full",b?.graphContainer),style:{...C?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:re,ref:Re,"aria-label":p||`${g?`The graph shows ${g}. `:""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${w?` ${w}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?F||"1rem":F||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[g||w||se||d?i.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:b?.title,description:b?.description},graphTitle:g,graphDescription:w,width:s,graphDownload:se?Re.current:void 0,dataDownload:d?l.map(e=>e.data).filter(e=>e!==void 0).length>0?l.map(e=>e.data).filter(e=>e!==void 0):l.filter(e=>e!==void 0):null}):null,t.enabled&&c.length>0&&Ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ie(!me)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":me?"Click to pause animation":"Click to play animation",children:me?i.jsxRuntimeExports.jsx(Ne.Pause,{}):i.jsxRuntimeExports.jsx(Ne.Play,{})}),i.jsxRuntimeExports.jsx(Oe.xr,{min:c[0],max:c[c.length-1],marks:Ce,step:null,defaultValue:c[c.length-1],value:c[be],onChangeComplete:e=>{we(c.indexOf(e))},onChange:e=>{we(c.indexOf(e))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?i.jsxRuntimeExports.jsx(ze.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[f?i.jsxRuntimeExports.jsx(Ye.ColorLegendWithMouseOver,{width:s,colorDomain:xe,colors:_,colorLegendTitle:O,setSelectedColor:Se,showNAColor:!1}):null,i.jsxRuntimeExports.jsx("div",{className:"flex grow w-full justify-center leading-0",ref:he,"aria-label":"Graph area",children:(s||o)&&(N||ke)?i.jsxRuntimeExports.jsx(nt,{data:D!==void 0?D==="diff"?Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[e.x.length-1])||A.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0],[n||"asc"]).filter((e,r)=>L?r<L:!0):Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[D])?-1/0:e.x[D],[n||"asc"]).filter((e,r)=>L?r<L:!0):je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>V?!e.x.every(r=>r==null):e).filter((e,r)=>L?r<L:!0),dotColors:_,width:s||o,height:Math.max(M,N||(R?M?(s||o)*R>M?(s||o)*R:M:(s||o)*R:ke)),radius:ae,barPadding:ue,showTicks:Z,leftMargin:ee,rightMargin:ce,topMargin:te,bottomMargin:ie,truncateBy:J,showLabels:I,showValues:h,tooltip:B,suffix:ne,prefix:ge,onSeriesMouseOver:pe,maxValue:A.checkIfNullOrUndefined(v)?Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null))))<0?0:Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null)))):v,minValue:A.checkIfNullOrUndefined(U)?Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null))))>0?0:Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null)))):U,onSeriesMouseClick:fe,selectedColor:De,arrowConnector:oe,connectorStrokeWidth:y,maxBarThickness:X,minBarThickness:j,resetSelectionOnDoubleClick:m,detailsOnClick:H,axisTitle:W,noOfTicks:K,valueColor:P,styles:C,classNames:b,labelOrder:S,refValues:Q,animate:$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},precision:Y,customLayers:k,highlightedDataPoints:T,dimmedOpacity:a}):null})]})}),z||q?i.jsxRuntimeExports.jsx(Xe.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:z,footNote:q,width:s}):null]})})})})}function ot(ye){const{data:l,graphTitle:g,colors:_,sources:z,graphDescription:w,barPadding:ue,showTicks:Z,leftMargin:ee,rightMargin:ce,topMargin:te,bottomMargin:ie,truncateBy:J,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E,radius:ae,tooltip:B,showLabels:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:re,suffix:ne,prefix:ge,maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:se,dataDownload:d,showValues:h,sortParameter:D,arrowConnector:oe,connectorStrokeWidth:y,language:u,minHeight:M,theme:G,maxBarThickness:X,maxNumberOfBars:L,minBarThickness:j,ariaLabel:p,resetSelectionOnDoubleClick:m,detailsOnClick:H,axisTitle:W,noOfTicks:K,valueColor:P,orientation:C="vertical",styles:b,classNames:S,labelOrder:Q,refValues:V,filterNA:$,animate:Y,precision:k,showColorScale:f,customLayers:T,highlightedDataPoints:a,dimmedOpacity:t,timeline:n,sortData:o}=ye;return C==="vertical"?i.jsxRuntimeExports.jsx(st,{data:l,graphTitle:g,colors:_,sources:z,graphDescription:w,barPadding:ue,showTicks:Z,leftMargin:ee,rightMargin:ce,topMargin:te,bottomMargin:ie,truncateBy:J,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E,radius:ae,tooltip:B,showLabels:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:re,suffix:ne,prefix:ge,maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:se,dataDownload:d,showValues:h,sortParameter:D,arrowConnector:oe,connectorStrokeWidth:y,language:u,minHeight:M,theme:G,maxBarThickness:X,maxNumberOfBars:L,minBarThickness:j,ariaLabel:p,resetSelectionOnDoubleClick:m,styles:b,detailsOnClick:H,axisTitle:W,noOfTicks:K,labelOrder:Q,valueColor:P,classNames:S,refValues:V,filterNA:$,animate:Y,precision:k,showColorScale:f,customLayers:T,highlightedDataPoints:a,dimmedOpacity:t,timeline:n,sortData:o}):i.jsxRuntimeExports.jsx(rt,{data:l,graphTitle:g,colors:_,sources:z,graphDescription:w,barPadding:ue,showTicks:Z,leftMargin:ee,rightMargin:ce,topMargin:te,bottomMargin:ie,truncateBy:J,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E,radius:ae,tooltip:B,showLabels:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:re,suffix:ne,prefix:ge,maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:se,dataDownload:d,showValues:h,sortParameter:D,arrowConnector:oe,connectorStrokeWidth:y,language:u,minHeight:M,theme:G,maxBarThickness:X,maxNumberOfBars:L,minBarThickness:j,ariaLabel:p,resetSelectionOnDoubleClick:m,styles:b,detailsOnClick:H,axisTitle:W,noOfTicks:K,valueColor:P,classNames:S,labelOrder:Q,refValues:V,filterNA:$,animate:Y,precision:k,showColorScale:f,customLayers:T,highlightedDataPoints:a,dimmedOpacity:t,timeline:n,sortData:o})}exports.DumbbellChart=ot;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),x=require("react"),ve=require("./parse-hMnG_lRV.cjs"),Oe=require("./getSliderMarks-CRIbTGYV.cjs"),Me=require("./index-CQ3e6Ewi.cjs"),Le=require("./index-DQA8q5sC.cjs"),Ve=require("./Modal-tXZlLE5s.cjs"),Te=require("./numberFormattingFunction-02t-wJta.cjs"),$e=require("./Tooltip-De16GWhY.cjs"),A=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ae=require("./string2HTML-z7CwHXcx.cjs"),Ze=require("./XTicksAndGridLines-CCzXIV8d.cjs"),qe=require("./AxisTitle-CK9YeovX.cjs"),et=require("./YAxesLabels-yRFFdx1s.cjs"),Fe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Pe=require("./ReferenceLine-CFVBBN__.cjs"),Be=require("./linear-BVckp9RD.cjs"),He=require("./band-CAApY4Pd.cjs"),We=require("./use-in-view-sQJZ_xDO.cjs"),le=require("./proxy-BHRoeZgd.cjs"),Ue=require("./index-BW8iNx7E.cjs"),Ge=require("./GraphHeader.cjs"),Xe=require("./GraphFooter.cjs"),Ye=require("./ColorLegendWithMouseOver.cjs"),_e=require("./Colors.cjs"),ze=require("./EmptyState-d8_8SxeW.cjs"),Ne=require("./index-BW_-wD2k.cjs"),je=require("./ensureCompleteData-DkQYPeDa.cjs"),Je=require("./uniqBy-O05lp2S5.cjs"),Ke=require("./sort-O96oMZLb.cjs"),Qe=require("./init-DU0ybBc_.cjs"),tt=require("./Axis-DE7dSn1_.cjs"),it=require("./XAxesLabels-Drf7M3YK.cjs");function at(ye){const{data:l,dotColors:m,suffix:z,prefix:J,barPadding:w,showValues:ue,showTicks:ee,leftMargin:te,truncateBy:ce,width:ie,height:ae,rightMargin:K,topMargin:N,bottomMargin:s,radius:q,showLabels:xe,tooltip:O,onSeriesMouseOver:F,maxValue:E,minValue:re,onSeriesMouseClick:B,selectedColor:I,arrowConnector:R,connectorStrokeWidth:pe,maxBarThickness:ne,minBarThickness:se,resetSelectionOnDoubleClick:ge,detailsOnClick:v,axisTitle:U,noOfTicks:fe,valueColor:G,styles:d,classNames:p,labelOrder:D,refValues:oe,rtl:y,animate:u,precision:M,customLayers:X,highlightedDataPoints:Y,dimmedOpacity:L}=ye,j=x.useRef(null),g=We.useInView(j,{once:u.once,amount:u.amount}),h={top:U?N+25:N,bottom:s,left:te,right:K},H=ie-h.left-h.right,W=ae-h.top-h.bottom,[Q,P]=x.useState(void 0),[C,b]=x.useState(void 0),[S,Z]=x.useState(void 0),[V,$]=x.useState(void 0),_=l.map((t,n)=>({...t,id:D?`${t.label}`:`${n}`})),k=D||_.map(t=>`${t.id}`),f=Be.linear().domain([re,E]).range([0,H]).nice(),T=He.band().domain(k).range([0,se?Math.max(W,se*_.length):ne?Math.min(W,ne*_.length):W]).paddingInner(w),a=f.ticks(fe);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(le.motion.svg,{width:`${ie}px`,height:`${ae}px`,viewBox:`0 0 ${ie} ${ae}`,direction:"ltr",ref:j,children:[R?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,i.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[ee?i.jsxRuntimeExports.jsx(Ze.XTicksAndGridLines,{values:a.filter((t,n)=>n!==0),x:a.filter((t,n)=>n!==0).map(t=>f(t)),y1:0-N,y2:W+h.bottom,styles:{gridLines:d?.xAxis?.gridLines,labels:d?.xAxis?.labels},classNames:{gridLines:p?.xAxis?.gridLines,labels:p?.xAxis?.labels},suffix:z,prefix:J,labelType:"secondary",showGridLines:!0,precision:M}):null,i.jsxRuntimeExports.jsx(qe.AxisTitle,{x:H/2,y:0-h.top+15,style:d?.xAxis?.title,className:p?.xAxis?.title,text:U}),i.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{y:_.map(t=>T(`${t.id}`)+T.bandwidth()/2),x1:0,x2:H,styles:{gridLines:d?.yAxis?.gridLines},classNames:{gridLines:p?.yAxis?.gridLines},labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:M}),X.filter(t=>t.position==="before").map(t=>t.layer),i.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[_.map(t=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:0,y:T(`${t.id}`)+T.bandwidth()/2,opacity:Y.length!==0?Y.indexOf(t.label)!==-1?.85:L:.85},whileInView:{x:0,y:T(`${t.id}`)+T.bandwidth()/2,opacity:Y.length!==0?Y.indexOf(t.label)!==-1?.85:L:.85,transition:{duration:u.duration}}},initial:"initial",animate:g?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[xe?i.jsxRuntimeExports.jsx(et.YAxesLabels,{value:`${t.label}`.length<ce?`${t.label}`:`${`${t.label}`.substring(0,ce)}...`,y:0-T.bandwidth()/2,x:0-h.left,width:h.left,height:T.bandwidth(),alignment:"right",style:d?.yAxis?.labels,className:p?.yAxis?.labels,animate:u,isInView:g}):null,i.jsxRuntimeExports.jsx(le.motion.line,{y1:0,y2:0,style:{strokeWidth:pe,...d?.dataConnectors||{},opacity:I?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",p?.dataConnectors),markerEnd:R&&t.x.indexOf(Math.min(...t.x.filter(n=>n!==null)))===0?"url(#arrow)":"",markerStart:R&&t.x.indexOf(Math.min(...t.x.filter(n=>n!==null)))===t.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x1:0,x2:0},whileInView:{x1:f(Math.min(...t.x.filter(n=>n!==null)))+q,x2:f(Math.max(...t.x.filter(n=>n!==null)))-q,transition:{duration:u.duration}}},initial:"initial",animate:g?"whileInView":"initial"}),t.x.map((n,o)=>i.jsxRuntimeExports.jsx(le.motion.g,{onMouseEnter:de=>{P({...t,xIndex:o}),$(de.clientY),Z(de.clientX),F?.({...t,xIndex:o})},onClick:()=>{(B||v)&&(Le.isEqual(C,{...t,xIndex:o})&&ge?(b(void 0),B?.(void 0)):(b({...t,xIndex:o}),B&&B({...t,xIndex:o})))},onMouseMove:de=>{P({...t,xIndex:o}),$(de.clientY),Z(de.clientX)},onMouseLeave:()=>{P(void 0),Z(void 0),$(void 0),F?.(void 0)},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{opacity:I?m[o]===I?1:.3:1},whileInView:{opacity:I?m[o]===I?1:.3:1,transition:{duration:u.duration}}},initial:"initial",animate:g?"whileInView":"initial",children:A.checkIfNullOrUndefined(n)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,r:q,style:{fill:m[o],fillOpacity:.85,stroke:m[o],strokeWidth:1,opacity:A.checkIfNullOrUndefined(n)?0:1},exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{cx:f(0),opacity:0},whileInView:{cx:f(n||0),opacity:A.checkIfNullOrUndefined(n)?0:1,transition:{duration:u.duration}}},initial:"initial",animate:g?"whileInView":"initial"}),ue?i.jsxRuntimeExports.jsx(le.motion.text,{y:0,style:{textAnchor:"middle",...d?.graphObjectValues||{}},dx:0,dy:0-q-3,className:i.mo("graph-value text-sm font-bold",A.checkIfNullOrUndefined(n)?"0opacity-0":"opacity-100",p?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:f(0),opacity:0,fill:G||m[o]},whileInView:{x:f(n||0),fill:G||m[o],opacity:1,transition:{duration:u.duration}}},initial:"initial",animate:g?"whileInView":"initial",children:Te.numberFormattingFunction(n,"NA",M,J,z)}):null]})},o))]},t.label)),oe?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:oe.map((t,n)=>i.jsxRuntimeExports.jsx(Pe.RefLineX,{text:t.text,color:t.color,x:f(t.value),y1:0-h.top,y2:W+h.bottom,textSide:f(t.value)>H*.75||y?"left":"right",classNames:t.classNames,styles:t.styles,animate:u,isInView:g},n))}):null]}),X.filter(t=>t.position==="after").map(t=>t.layer)]})]}),Q&&O&&S&&V?i.jsxRuntimeExports.jsx($e.Tooltip,{data:Q,body:O,xPos:S,yPos:V,backgroundStyle:d?.tooltip,className:p?.tooltip}):null,v&&C!==void 0?i.jsxRuntimeExports.jsx(Ve.X,{open:C!==void 0,onClose:()=>{b(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof v=="string"?{__html:Ae.string2HTML(v,C)}:void 0,children:typeof v=="function"?v(C):null})}):null]})}function rt(ye){const{data:l,graphTitle:m,colors:z=_e.Colors.light.categoricalColors.colors,sources:J,graphDescription:w,barPadding:ue=.25,showTicks:ee=!0,leftMargin:te=100,rightMargin:ce=40,topMargin:ie=20,bottomMargin:ae=10,truncateBy:K=999,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E=!1,radius:re=3,showLabels:B=!0,tooltip:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:ne,suffix:se="",prefix:ge="",maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:G=!1,dataDownload:d=!1,showValues:p=!0,sortParameter:D,arrowConnector:oe=!1,connectorStrokeWidth:y=2,language:u="en",minHeight:M=0,theme:X="light",labelOrder:Y,maxBarThickness:L,maxNumberOfBars:j,minBarThickness:g,ariaLabel:h,resetSelectionOnDoubleClick:H=!0,detailsOnClick:W,axisTitle:Q,noOfTicks:P=5,valueColor:C,styles:b,classNames:S,refValues:Z,filterNA:V=!0,animate:$=!1,precision:_=2,customLayers:k=[],showColorScale:f=!0,highlightedDataPoints:T=[],dimmedOpacity:a=.3,timeline:t={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},sortData:n}=ye,[o,de]=x.useState(0),[ke,Ee]=x.useState(0),[me,Ie]=x.useState(t.autoplay),c=Ke.sort(Je.uniqBy(l,"date",!0).map(e=>ve.parse(`${e}`,t.dateFormat||"yyyy",new Date).getTime()),(e,r)=>Qe.ascending(e,r)),[be,we]=x.useState(t.autoplay?0:c.length-1),[De,Se]=x.useState(void 0),he=x.useRef(null),Re=x.useRef(null);x.useEffect(()=>{const e=new ResizeObserver(r=>{de(s||r[0].target.clientWidth||620),Ee(N||r[0].target.clientHeight||480)});return he.current&&(Ee(he.current.clientHeight||480),de(he.current.clientWidth||620),s||e.observe(he.current)),()=>e.disconnect()},[s,N]),x.useEffect(()=>{const e=setInterval(()=>{we(r=>r<c.length-1?r+1:0)},(t.speed||2)*1e3);return me||clearInterval(e),()=>clearInterval(e)},[c,me,t.speed]);const Ce=Oe.getSliderMarks(c,be,t.showOnlyActiveDate,t.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${X||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:u==="he"||u==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${u||"en"}`,s?"w-fit":"w-full",S?.graphContainer),style:{...b?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:ne,ref:Re,"aria-label":h||`${m?`The graph shows ${m}. `:""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${w?` ${w}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?F||"1rem":F||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[m||w||G||d?i.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:S?.title,description:S?.description},graphTitle:m,graphDescription:w,width:s,graphDownload:G?Re.current:void 0,dataDownload:d?l.map(e=>e.data).filter(e=>e!==void 0).length>0?l.map(e=>e.data).filter(e=>e!==void 0):l.filter(e=>e!==void 0):null}):null,t.enabled&&c.length>0&&Ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ie(!me)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":me?"Click to pause animation":"Click to play animation",children:me?i.jsxRuntimeExports.jsx(Ne.Pause,{}):i.jsxRuntimeExports.jsx(Ne.Play,{})}),i.jsxRuntimeExports.jsx(Oe.xr,{min:c[0],max:c[c.length-1],marks:Ce,step:null,defaultValue:c[c.length-1],value:c[be],onChangeComplete:e=>{we(c.indexOf(e))},onChange:e=>{we(c.indexOf(e))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?i.jsxRuntimeExports.jsx(ze.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[f?i.jsxRuntimeExports.jsx(Ye.ColorLegendWithMouseOver,{width:s,colorDomain:xe,colors:z,colorLegendTitle:O,setSelectedColor:Se,showNAColor:!1}):null,i.jsxRuntimeExports.jsx("div",{className:"flex grow w-full justify-center leading-0",ref:he,"aria-label":"Graph area",children:(s||o)&&(N||ke)?i.jsxRuntimeExports.jsx(at,{data:D!==void 0?D==="diff"?Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[e.x.length-1])||A.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0],[n||"asc"]).filter((e,r)=>j?r<j:!0):Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[D])?-1/0:e.x[D],[n||"asc"]).filter((e,r)=>j?r<j:!0):je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>V?!e.x.every(r=>r==null):e).filter((e,r)=>j?r<j:!0),dotColors:z,width:s||o,height:Math.max(M,N||(R?M?(s||o)*R>M?(s||o)*R:M:(s||o)*R:ke)),suffix:se,prefix:ge,radius:re,barPadding:ue,showTicks:ee,leftMargin:te,rightMargin:ce,topMargin:ie,bottomMargin:ae,truncateBy:K,showLabels:B,showValues:p,tooltip:I,onSeriesMouseOver:pe,maxValue:A.checkIfNullOrUndefined(v)?Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null))))<0?0:Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null)))):v,minValue:A.checkIfNullOrUndefined(U)?Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null))))>0?0:Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null)))):U,onSeriesMouseClick:fe,selectedColor:De,arrowConnector:oe,connectorStrokeWidth:y,maxBarThickness:L,minBarThickness:g,resetSelectionOnDoubleClick:H,detailsOnClick:W,axisTitle:Q,noOfTicks:P,valueColor:C,styles:b,classNames:S,labelOrder:Y,refValues:Z,rtl:u==="he"||u==="ar",animate:$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},precision:_,customLayers:k,highlightedDataPoints:T,dimmedOpacity:a}):null})]})}),J||q?i.jsxRuntimeExports.jsx(Xe.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:S?.footnote,source:S?.source},sources:J,footNote:q,width:s}):null]})})})})}function nt(ye){const{data:l,dotColors:m,barPadding:z,showTicks:J,leftMargin:w,truncateBy:ue,width:ee,height:te,rightMargin:ce,topMargin:ie,bottomMargin:ae,radius:K,showLabels:N,tooltip:s,onSeriesMouseOver:q,maxValue:xe,minValue:O,onSeriesMouseClick:F,showValues:E,suffix:re,prefix:B,selectedColor:I,arrowConnector:R,connectorStrokeWidth:pe,maxBarThickness:ne,minBarThickness:se,resetSelectionOnDoubleClick:ge,detailsOnClick:v,axisTitle:U,noOfTicks:fe,valueColor:G,styles:d,classNames:p,labelOrder:D,refValues:oe,animate:y,precision:u,customLayers:M,highlightedDataPoints:X,dimmedOpacity:Y}=ye,L=x.useRef(null),j=We.useInView(L,{once:y.once,amount:y.amount}),g={top:ie,bottom:ae,left:U?w+30:w,right:ce},h=ee-g.left-g.right,H=te-g.top-g.bottom,[W,Q]=x.useState(void 0),[P,C]=x.useState(void 0),[b,S]=x.useState(void 0),[Z,V]=x.useState(void 0),$=l.map((a,t)=>({...a,id:D?`${a.label}`:`${t}`})),_=D||$.map(a=>`${a.id}`),k=Be.linear().domain([O,xe]).range([H,0]).nice(),f=He.band().domain(_).range([0,se?Math.max(h,se*$.length):ne?Math.min(h,ne*$.length):h]).paddingInner(z),T=k.ticks(fe);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsxs(le.motion.svg,{width:`${ee}px`,height:`${te}px`,viewBox:`0 0 ${ee} ${te}`,direction:"ltr",ref:L,children:[R?i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:i.jsxRuntimeExports.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-primary-gray-600 dark:fill-primary-gray-300"})})}):null,i.jsxRuntimeExports.jsxs("g",{transform:`translate(${g.left},${g.top})`,children:[i.jsxRuntimeExports.jsx(tt.Axis,{y1:k(O<0?0:O),y2:k(O<0?0:O),x1:0-w,x2:h+g.right,label:Te.numberFormattingFunction(O<0?0:O,"NA",u,B,re),labelPos:{x:0-w,dx:0,dy:xe<0?"1em":-5,y:k(O<0?0:O)},classNames:{axis:p?.xAxis?.axis,label:p?.yAxis?.labels},styles:{axis:d?.xAxis?.axis,label:d?.yAxis?.labels}}),J?i.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{values:T.filter(a=>a!==0),y:T.filter(a=>a!==0).map(a=>k(a)),x1:0-w,x2:h+g.right,styles:{gridLines:d?.yAxis?.gridLines,labels:d?.yAxis?.labels},classNames:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},suffix:re,prefix:B,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:u}):null,i.jsxRuntimeExports.jsx(qe.AxisTitle,{x:0-w-15,y:H/2,style:d?.yAxis?.title,className:p?.yAxis?.title,text:U,rotate90:!0}),M.filter(a=>a.position==="before").map(a=>a.layer),i.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[$.map(a=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{x:f(`${a.id}`)+f.bandwidth()/2,y:0,opacity:X.length!==0?X.indexOf(a.label)!==-1?.85:Y:.85},whileInView:{x:f(`${a.id}`)+f.bandwidth()/2,y:0,opacity:X.length!==0?X.indexOf(a.label)!==-1?.85:Y:.85,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},children:[N?i.jsxRuntimeExports.jsx(it.XAxesLabels,{value:`${a.label}`.length<ue?`${a.label}`:`${`${a.label}`.substring(0,ue)}...`,y:H+5,x:0-f.bandwidth()/2,width:f.bandwidth(),height:g.bottom,style:d?.xAxis?.labels,className:p?.xAxis?.labels,alignment:"top",animate:y,isInView:j}):null,i.jsxRuntimeExports.jsx(le.motion.line,{x1:0,x2:0,style:{strokeWidth:pe,...d?.dataConnectors||{},opacity:I?.3:1},className:i.mo("stroke-primary-gray-600 dark:stroke-primary-gray-300",p?.dataConnectors),markerEnd:R&&a.x.indexOf(Math.min(...a.x.filter(t=>t!==null)))===0?"url(#arrow)":"",markerStart:R&&a.x.indexOf(Math.min(...a.x.filter(t=>t!==null)))===a.x.length-1?"url(#arrow)":"",exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{y1:0,y2:0},whileInView:{y1:k(Math.min(...a.x.filter(t=>t!==null)))+K,y2:k(Math.max(...a.x.filter(t=>t!==null)))-K,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),a.x.map((t,n)=>i.jsxRuntimeExports.jsx(le.motion.g,{onMouseEnter:o=>{Q({...a,xIndex:n}),V(o.clientY),S(o.clientX),q?.({...a,xIndex:n})},onClick:()=>{(F||v)&&(Le.isEqual(P,{...a,xIndex:n})&&ge?(C(void 0),F?.(void 0)):(C({...a,xIndex:n}),F&&F({...a,xIndex:n})))},onMouseMove:o=>{Q({...a,xIndex:n}),V(o.clientY),S(o.clientX)},onMouseLeave:()=>{Q(void 0),S(void 0),V(void 0),q?.(void 0)},exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{opacity:I?m[n]===I?1:.3:1},whileInView:{opacity:I?m[n]===I?1:.3:1,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:A.checkIfNullOrUndefined(t)?null:i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,r:K,style:{fill:m[n],fillOpacity:.85,stroke:m[n],strokeWidth:1},exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{cy:k(0),opacity:0},whileInView:{cy:k(t||0),opacity:A.checkIfNullOrUndefined(t)?0:1,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),E?i.jsxRuntimeExports.jsx(le.motion.text,{x:0,style:{textAnchor:"start",...d?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",A.checkIfNullOrUndefined(t)?"opacity-0":"opacity-100",p?.graphObjectValues),dx:K+3,dy:"0.33em",exit:{opacity:0,transition:{duration:y.duration}},variants:{initial:{y:k(0),opacity:0,fill:G||m[n]},whileInView:{y:k(t||0),fill:G||m[n],opacity:1,transition:{duration:y.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:Te.numberFormattingFunction(t,"NA",u,B,re)}):null]})},n))]},a.label)),oe?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:oe.map((a,t)=>i.jsxRuntimeExports.jsx(Pe.RefLineY,{text:a.text,color:a.color,y:k(a.value),x1:0-w,x2:h+g.right,classNames:a.classNames,styles:a.styles,animate:y,isInView:j},t))}):null]}),M.filter(a=>a.position==="after").map(a=>a.layer)]})]}),W&&s&&b&&Z?i.jsxRuntimeExports.jsx($e.Tooltip,{data:W,body:s,xPos:b,yPos:Z,backgroundStyle:d?.tooltip,className:p?.tooltip}):null,v&&P!==void 0?i.jsxRuntimeExports.jsx(Ve.X,{open:P!==void 0,onClose:()=>{C(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof v=="string"?{__html:Ae.string2HTML(v,P)}:void 0,children:typeof v=="function"?v(P):null})}):null]})}function st(ye){const{data:l,graphTitle:m,colors:z=_e.Colors.light.categoricalColors.colors,sources:J,graphDescription:w,barPadding:ue=.25,showTicks:ee=!0,leftMargin:te=20,rightMargin:ce=20,topMargin:ie=20,bottomMargin:ae=25,truncateBy:K=999,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E=!1,radius:re=3,tooltip:B,showLabels:I=!0,relativeHeight:R,onSeriesMouseOver:pe,graphID:ne,suffix:se="",prefix:ge="",maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:G=!1,dataDownload:d=!1,showValues:p=!0,sortParameter:D,arrowConnector:oe=!1,connectorStrokeWidth:y=2,language:u="en",minHeight:M=0,theme:X="light",maxBarThickness:Y,maxNumberOfBars:L,minBarThickness:j,ariaLabel:g,resetSelectionOnDoubleClick:h=!0,detailsOnClick:H,axisTitle:W,noOfTicks:Q=5,valueColor:P,styles:C,classNames:b,labelOrder:S,refValues:Z,filterNA:V=!0,animate:$=!1,precision:_=2,customLayers:k=[],showColorScale:f=!0,highlightedDataPoints:T=[],dimmedOpacity:a=.3,timeline:t={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},sortData:n}=ye,[o,de]=x.useState(0),[ke,Ee]=x.useState(0),[me,Ie]=x.useState(t.autoplay),c=Ke.sort(Je.uniqBy(l,"date",!0).map(e=>ve.parse(`${e}`,t.dateFormat||"yyyy",new Date).getTime()),(e,r)=>Qe.ascending(e,r)),[be,we]=x.useState(t.autoplay?0:c.length-1),[De,Se]=x.useState(void 0),he=x.useRef(null),Re=x.useRef(null);x.useEffect(()=>{const e=new ResizeObserver(r=>{de(s||r[0].target.clientWidth||620),Ee(N||r[0].target.clientHeight||480)});return he.current&&(Ee(he.current.clientHeight||480),de(he.current.clientWidth||620),s||e.observe(he.current)),()=>e.disconnect()},[s,N]),x.useEffect(()=>{const e=setInterval(()=>{we(r=>r<c.length-1?r+1:0)},(t.speed||2)*1e3);return me||clearInterval(e),()=>clearInterval(e)},[c,me,t.speed]);const Ce=Oe.getSliderMarks(c,be,t.showOnlyActiveDate,t.dateFormat||"yyyy");return i.jsxRuntimeExports.jsx("div",{className:`${X||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:u==="he"||u==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${u||"en"}`,s?"w-fit":"w-full",b?.graphContainer),style:{...C?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:ne,ref:Re,"aria-label":g||`${m?`The graph shows ${m}. `:""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${w?` ${w}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?F||"1rem":F||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[m||w||G||d?i.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:b?.title,description:b?.description},graphTitle:m,graphDescription:w,width:s,graphDownload:G?Re.current:void 0,dataDownload:d?l.map(e=>e.data).filter(e=>e!==void 0).length>0?l.map(e=>e.data).filter(e=>e!==void 0):l.filter(e=>e!==void 0):null}):null,t.enabled&&c.length>0&&Ce?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Ie(!me)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":me?"Click to pause animation":"Click to play animation",children:me?i.jsxRuntimeExports.jsx(Ne.Pause,{}):i.jsxRuntimeExports.jsx(Ne.Play,{})}),i.jsxRuntimeExports.jsx(Oe.xr,{min:c[0],max:c[c.length-1],marks:Ce,step:null,defaultValue:c[c.length-1],value:c[be],onChangeComplete:e=>{we(c.indexOf(e))},onChange:e=>{we(c.indexOf(e))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?i.jsxRuntimeExports.jsx(ze.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[f?i.jsxRuntimeExports.jsx(Ye.ColorLegendWithMouseOver,{width:s,colorDomain:xe,colors:z,colorLegendTitle:O,setSelectedColor:Se,showNAColor:!1}):null,i.jsxRuntimeExports.jsx("div",{className:"flex grow w-full justify-center leading-0",ref:he,"aria-label":"Graph area",children:(s||o)&&(N||ke)?i.jsxRuntimeExports.jsx(nt,{data:D!==void 0?D==="diff"?Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[e.x.length-1])||A.checkIfNullOrUndefined(e.x[0])?-1/0:e.x[e.x.length-1]-e.x[0],[n||"asc"]).filter((e,r)=>L?r<L:!0):Me.orderBy(je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>t.enabled?e.date===ve.format(new Date(c[be]),t.dateFormat||"yyyy"):e).filter(e=>V?!e.x.every(r=>r==null):e),e=>A.checkIfNullOrUndefined(e.x[D])?-1/0:e.x[D],[n||"asc"]).filter((e,r)=>L?r<L:!0):je.ensureCompleteDataForDumbbellChart(l,t.dateFormat||"yyyy").filter(e=>V?!e.x.every(r=>r==null):e).filter((e,r)=>L?r<L:!0),dotColors:z,width:s||o,height:Math.max(M,N||(R?M?(s||o)*R>M?(s||o)*R:M:(s||o)*R:ke)),radius:re,barPadding:ue,showTicks:ee,leftMargin:te,rightMargin:ce,topMargin:ie,bottomMargin:ae,truncateBy:K,showLabels:I,showValues:p,tooltip:B,suffix:se,prefix:ge,onSeriesMouseOver:pe,maxValue:A.checkIfNullOrUndefined(v)?Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null))))<0?0:Math.max(...l.map(e=>Math.max(...e.x.filter(r=>r!==null)))):v,minValue:A.checkIfNullOrUndefined(U)?Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null))))>0?0:Math.min(...l.map(e=>Math.min(...e.x.filter(r=>r!==null)))):U,onSeriesMouseClick:fe,selectedColor:De,arrowConnector:oe,connectorStrokeWidth:y,maxBarThickness:Y,minBarThickness:j,resetSelectionOnDoubleClick:h,detailsOnClick:H,axisTitle:W,noOfTicks:Q,valueColor:P,styles:C,classNames:b,labelOrder:S,refValues:Z,animate:$===!0?{duration:.5,once:!0,amount:.5}:$||{duration:0,once:!0,amount:0},precision:_,customLayers:k,highlightedDataPoints:T,dimmedOpacity:a}):null})]})}),J||q?i.jsxRuntimeExports.jsx(Xe.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:J,footNote:q,width:s}):null]})})})})}function ot(ye){const{data:l,graphTitle:m,colors:z,sources:J,graphDescription:w,barPadding:ue,showTicks:ee,leftMargin:te,rightMargin:ce,topMargin:ie,bottomMargin:ae,truncateBy:K,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E,radius:re,tooltip:B,showLabels:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:ne,suffix:se,prefix:ge,maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:G,dataDownload:d,showValues:p,sortParameter:D,arrowConnector:oe,connectorStrokeWidth:y,language:u,minHeight:M,theme:X,maxBarThickness:Y,maxNumberOfBars:L,minBarThickness:j,ariaLabel:g,resetSelectionOnDoubleClick:h,detailsOnClick:H,axisTitle:W,noOfTicks:Q,valueColor:P,orientation:C="vertical",styles:b,classNames:S,labelOrder:Z,refValues:V,filterNA:$,animate:_,precision:k,showColorScale:f,customLayers:T,highlightedDataPoints:a,dimmedOpacity:t,timeline:n,sortData:o}=ye;return C==="vertical"?i.jsxRuntimeExports.jsx(st,{data:l,graphTitle:m,colors:z,sources:J,graphDescription:w,barPadding:ue,showTicks:ee,leftMargin:te,rightMargin:ce,topMargin:ie,bottomMargin:ae,truncateBy:K,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E,radius:re,tooltip:B,showLabels:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:ne,suffix:se,prefix:ge,maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:G,dataDownload:d,showValues:p,sortParameter:D,arrowConnector:oe,connectorStrokeWidth:y,language:u,minHeight:M,theme:X,maxBarThickness:Y,maxNumberOfBars:L,minBarThickness:j,ariaLabel:g,resetSelectionOnDoubleClick:h,styles:b,detailsOnClick:H,axisTitle:W,noOfTicks:Q,labelOrder:Z,valueColor:P,classNames:S,refValues:V,filterNA:$,animate:_,precision:k,showColorScale:f,customLayers:T,highlightedDataPoints:a,dimmedOpacity:t,timeline:n,sortData:o}):i.jsxRuntimeExports.jsx(rt,{data:l,graphTitle:m,colors:z,sources:J,graphDescription:w,barPadding:ue,showTicks:ee,leftMargin:te,rightMargin:ce,topMargin:ie,bottomMargin:ae,truncateBy:K,height:N,width:s,footNote:q,colorDomain:xe,colorLegendTitle:O,padding:F,backgroundColor:E,radius:re,tooltip:B,showLabels:I,relativeHeight:R,onSeriesMouseOver:pe,graphID:ne,suffix:se,prefix:ge,maxValue:v,minValue:U,onSeriesMouseClick:fe,graphDownload:G,dataDownload:d,showValues:p,sortParameter:D,arrowConnector:oe,connectorStrokeWidth:y,language:u,minHeight:M,theme:X,maxBarThickness:Y,maxNumberOfBars:L,minBarThickness:j,ariaLabel:g,resetSelectionOnDoubleClick:h,styles:b,detailsOnClick:H,axisTitle:W,noOfTicks:Q,valueColor:P,classNames:S,labelOrder:Z,refValues:V,filterNA:$,animate:_,precision:k,showColorScale:f,customLayers:T,highlightedDataPoints:a,dimmedOpacity:t,timeline:n,sortData:o})}exports.DumbbellChart=ot;
|
|
2
2
|
//# sourceMappingURL=DumbbellChart.cjs.map
|