@undp/data-viz 1.5.7 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +650 -648
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BulletChart.cjs +1 -1
  6. package/dist/BulletChart.cjs.map +1 -1
  7. package/dist/BulletChart.js +210 -208
  8. package/dist/BulletChart.js.map +1 -1
  9. package/dist/ButterflyChart.cjs +1 -1
  10. package/dist/ButterflyChart.cjs.map +1 -1
  11. package/dist/ButterflyChart.js +42 -40
  12. package/dist/ButterflyChart.js.map +1 -1
  13. package/dist/DifferenceLineChart.cjs +1 -1
  14. package/dist/DifferenceLineChart.cjs.map +1 -1
  15. package/dist/DifferenceLineChart.js +122 -120
  16. package/dist/DifferenceLineChart.js.map +1 -1
  17. package/dist/DualAxisLineChart.cjs +1 -1
  18. package/dist/DualAxisLineChart.cjs.map +1 -1
  19. package/dist/DualAxisLineChart.js +133 -113
  20. package/dist/DualAxisLineChart.js.map +1 -1
  21. package/dist/DumbbellChart.cjs +1 -1
  22. package/dist/DumbbellChart.cjs.map +1 -1
  23. package/dist/DumbbellChart.js +274 -274
  24. package/dist/DumbbellChart.js.map +1 -1
  25. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  26. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  27. package/dist/LineChartWithConfidenceInterval.js +194 -174
  28. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  29. package/dist/MultiLineAltChart.cjs +1 -1
  30. package/dist/MultiLineAltChart.cjs.map +1 -1
  31. package/dist/MultiLineAltChart.js +160 -161
  32. package/dist/MultiLineAltChart.js.map +1 -1
  33. package/dist/MultiLineChart.cjs +1 -1
  34. package/dist/MultiLineChart.cjs.map +1 -1
  35. package/dist/MultiLineChart.js +77 -66
  36. package/dist/MultiLineChart.js.map +1 -1
  37. package/dist/ParetoChart.cjs +1 -1
  38. package/dist/ParetoChart.cjs.map +1 -1
  39. package/dist/ParetoChart.js +166 -161
  40. package/dist/ParetoChart.js.map +1 -1
  41. package/dist/RadarChart.cjs +1 -1
  42. package/dist/RadarChart.cjs.map +1 -1
  43. package/dist/RadarChart.js +253 -241
  44. package/dist/RadarChart.js.map +1 -1
  45. package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-C2--oMQq.js} +10 -9
  46. package/dist/RegressionLine-C2--oMQq.js.map +1 -0
  47. package/dist/RegressionLine-Dj0GSiAp.cjs +2 -0
  48. package/dist/RegressionLine-Dj0GSiAp.cjs.map +1 -0
  49. package/dist/ScatterPlot.cjs +1 -1
  50. package/dist/ScatterPlot.cjs.map +1 -1
  51. package/dist/ScatterPlot.js +130 -129
  52. package/dist/ScatterPlot.js.map +1 -1
  53. package/dist/SimpleLineChart.cjs +1 -1
  54. package/dist/SimpleLineChart.cjs.map +1 -1
  55. package/dist/SimpleLineChart.js +43 -38
  56. package/dist/SimpleLineChart.js.map +1 -1
  57. package/dist/SlopeChart.cjs +1 -1
  58. package/dist/SlopeChart.cjs.map +1 -1
  59. package/dist/SlopeChart.js +113 -109
  60. package/dist/SlopeChart.js.map +1 -1
  61. package/dist/StripChart.cjs +1 -1
  62. package/dist/StripChart.cjs.map +1 -1
  63. package/dist/StripChart.js +282 -270
  64. package/dist/StripChart.js.map +1 -1
  65. package/dist/UnitChart.cjs +1 -1
  66. package/dist/UnitChart.cjs.map +1 -1
  67. package/dist/UnitChart.js +20 -21
  68. package/dist/UnitChart.js.map +1 -1
  69. package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
  70. package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
  71. package/package.json +1 -1
  72. package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
  73. package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
  74. package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ParetoChart.js","sources":["../src/Components/Graphs/ParetoChart/Graph.tsx","../src/Components/Graphs/ParetoChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { 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 { scaleBand, scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n ParetoChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\n\r\ninterface Props {\r\n data: ParetoChartDataType[];\r\n barColor: string;\r\n lineColor: string;\r\n axisTitles: [string, string];\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\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 barPadding: number;\r\n truncateBy: number;\r\n showLabels: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n noOfTicks: number;\r\n lineSuffix: string;\r\n barSuffix: string;\r\n linePrefix: string;\r\n showValues: boolean;\r\n barPrefix: string;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n naLabel: string;\r\n customLayers: CustomLayerDataType[];\r\n showAxisLabels: boolean;\r\n}\r\ninterface DataFormattedType {\r\n id: string;\r\n label: number | string;\r\n line?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n barColor,\r\n lineColor,\r\n axisTitles,\r\n sameAxes,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n showValues,\r\n onSeriesMouseOver,\r\n barPadding,\r\n truncateBy,\r\n showLabels,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n noOfTicks,\r\n lineSuffix,\r\n barSuffix,\r\n linePrefix,\r\n barPrefix,\r\n curveType,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n customLayers,\r\n naLabel,\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 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = 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 graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n const x = scaleBand()\r\n .domain(dataWithId.map(d => `${d.id}`))\r\n .range([0, graphWidth])\r\n .paddingInner(barPadding);\r\n const minParam1 =\r\n Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.line).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\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 lineShape = line<DataFormattedType>()\r\n .defined(d => !checkIfNullOrUndefined(d.line))\r\n .x(d => (x(`${d.id}`) as number) + x.bandwidth() / 2)\r\n .y(d => y2(d.line as number))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfTicks);\r\n const y2Ticks = y2.ticks(noOfTicks);\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 <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: barColor,\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: barColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, barPrefix, barSuffix)}\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: barColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: barColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[0].length > 100\r\n ? `${axisTitles[0].substring(0, 100)}...`\r\n : axisTitles[0]\r\n }\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: lineColor,\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: lineColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, linePrefix, lineSuffix)}\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: lineColor, ...(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: lineColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[1].length > 100\r\n ? `${axisTitles[1].substring(0, 100)}...`\r\n : axisTitles[1]\r\n }\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <Axis\r\n y1={sameAxes ? y1(0) : graphHeight}\r\n y2={sameAxes ? y1(0) : 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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.rect\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n attrY: d.bar ? (d.bar > 0 ? y1(d.bar) : y1(0)) : 0,\r\n height: d.bar ? Math.abs(y1(d.bar) - y1(0)) : 0,\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 exit={{\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n x={x(`${i}`)}\r\n width={x.bandwidth()}\r\n style={{ fill: barColor }}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.bar) ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n attrY: y1(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n attrY: y1(d.bar || 0),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n fill: barColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy={d.bar ? (d.bar >= 0 ? '-5px' : '1em') : '-5px'}\r\n >\r\n {numberFormattingFunction(d.bar, naLabel, precision, barPrefix, barSuffix)}\r\n </motion.text>\r\n ) : null}\r\n {showLabels ? (\r\n <XAxesLabels\r\n value={\r\n `${d.label}`.length < truncateBy\r\n ? `${d.label}`\r\n : `${`${d.label}`.substring(0, truncateBy)}...`\r\n }\r\n y={graphHeight + 5}\r\n x={x(`${d.id}`) as number}\r\n width={x.bandwidth()}\r\n height={margin.bottom}\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='top'\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <motion.path\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n d: lineShape(dataWithId.map(d => ({ ...d, line: 0 }))) as string,\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n d: lineShape(dataWithId) as string,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n stroke: lineColor,\r\n fill: 'none',\r\n strokeWidth: 2,\r\n }}\r\n />\r\n {dataWithId.map((d, i) => (\r\n <g key={i}>\r\n {!checkIfNullOrUndefined(d.line) ? (\r\n <g\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.circle\r\n exit={{\r\n cy: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n cy: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cy: y2(d.line as number),\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 cx={(x(d.id) as number) + x.bandwidth() / 2}\r\n r={\r\n graphWidth / dataWithId.length < 5\r\n ? 0\r\n : graphWidth / dataWithId.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColor }}\r\n />\r\n {showValues ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n y: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n fill: lineColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n variants={{\r\n initial: {\r\n y: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y2(d.line as number),\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 className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy='-5px'\r\n >\r\n {numberFormattingFunction(\r\n d.line,\r\n naLabel,\r\n precision,\r\n linePrefix,\r\n lineSuffix,\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </g>\r\n ) : null}\r\n </g>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\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 {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\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 Languages,\r\n ParetoChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\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: ParetoChartDataType[];\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 /** Color of the bars */\r\n barColor?: string;\r\n /** Color of the line */\r\n lineColor?: 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 /** Padding between bars */\r\n barPadding?: number;\r\n\r\n // Values and Ticks\r\n /** Suffix for values of the lines */\r\n lineSuffix?: string;\r\n /** Suffix for values of the bars */\r\n barSuffix?: string;\r\n /** Prefix for values of the lines */\r\n linePrefix?: string;\r\n /** Prefix for values of the bars */\r\n barPrefix?: string;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Enables same axis for bars and line */\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 /** Title for the bar axis */\r\n barAxisTitle?: string;\r\n /** Title for the line axis */\r\n lineAxisTitle?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\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 /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: 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 /** Details displayed on the modal when user clicks of a data point. 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 detailsOnClick?: 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 /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_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 ParetoChart(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 padding,\r\n lineColor = Colors.light.categoricalColors.colors[1],\r\n barColor = Colors.light.categoricalColors.colors[0],\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 lineAxisTitle = 'Line chart',\r\n barAxisTitle = 'Bar graph',\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n barPadding = 0.25,\r\n truncateBy = 999,\r\n showLabels = true,\r\n onSeriesMouseClick,\r\n language = 'en',\r\n colorLegendTitle,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n showValues = true,\r\n noOfTicks = 5,\r\n lineSuffix = '',\r\n barSuffix = '',\r\n linePrefix = '',\r\n barPrefix = '',\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n customLayers = [],\r\n naLabel = 'NA',\r\n showColorScale = true,\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 pareto chart that shows a variable as bars and another as line chart.${\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={[barAxisTitle, lineAxisTitle]}\r\n colors={[\r\n barColor || Colors[theme].categoricalColors.colors[0],\r\n lineColor || Colors[theme].categoricalColors.colors[1],\r\n ]}\r\n colorLegendTitle={colorLegendTitle}\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 lineColor={lineColor}\r\n barColor={barColor}\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 truncateBy={truncateBy}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n axisTitles={[barAxisTitle, lineAxisTitle]}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n barPadding={barPadding}\r\n showLabels={showLabels}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n noOfTicks={noOfTicks}\r\n lineSuffix={lineSuffix}\r\n barSuffix={barSuffix}\r\n linePrefix={linePrefix}\r\n barPrefix={barPrefix}\r\n curveType={curveType}\r\n showValues={showValues}\r\n styles={styles}\r\n classNames={classNames}\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 precision={precision}\r\n customLayers={customLayers}\r\n naLabel={naLabel}\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","barColor","lineColor","axisTitles","sameAxes","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","showValues","onSeriesMouseOver","barPadding","truncateBy","showLabels","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","noOfTicks","lineSuffix","barSuffix","linePrefix","barPrefix","curveType","styles","classNames","animate","precision","customLayers","naLabel","showAxisLabels","svgRef","useRef","isInView","useInView","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","i","x","scaleBand","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","y1","scaleLinear","y2","lineShape","line","checkIfNullOrUndefined","y1Ticks","y2Ticks","jsxs","Fragment","jsx","motion","cn","numberFormattingFunction","Axis","AxisTitle","AnimatePresence","event","isEqual","XAxesLabels","Tooltip","Modal","string2HTML","ParetoChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","lineAxisTitle","barAxisTitle","relativeHeight","graphID","graphDownload","dataDownload","language","colorLegendTitle","minHeight","theme","ariaLabel","showColorScale","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4EO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,I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SAAAgE;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA5F;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":"ParetoChart.js","sources":["../src/Components/Graphs/ParetoChart/Graph.tsx","../src/Components/Graphs/ParetoChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { 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 { scaleBand, scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n ParetoChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\n\r\ninterface Props {\r\n data: ParetoChartDataType[];\r\n barColor: string;\r\n lineColor: string;\r\n axisTitles: [string, string];\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\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 barPadding: number;\r\n truncateBy: number;\r\n showLabels: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n noOfTicks: number;\r\n lineSuffix: string;\r\n barSuffix: string;\r\n linePrefix: string;\r\n showValues: boolean;\r\n barPrefix: string;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n naLabel: string;\r\n customLayers: CustomLayerDataType[];\r\n showAxisLabels: boolean;\r\n}\r\ninterface DataFormattedType {\r\n id: string;\r\n label: number | string;\r\n line?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n barColor,\r\n lineColor,\r\n axisTitles,\r\n sameAxes,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n showValues,\r\n onSeriesMouseOver,\r\n barPadding,\r\n truncateBy,\r\n showLabels,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n noOfTicks,\r\n lineSuffix,\r\n barSuffix,\r\n linePrefix,\r\n barPrefix,\r\n curveType,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n customLayers,\r\n naLabel,\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 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = 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 graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n const x = scaleBand()\r\n .domain(dataWithId.map(d => `${d.id}`))\r\n .range([0, graphWidth])\r\n .paddingInner(barPadding);\r\n const minParam1 =\r\n Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.line).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\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 lineShape = line<DataFormattedType>()\r\n .defined(d => !checkIfNullOrUndefined(d.line))\r\n .x(d => (x(`${d.id}`) as number) + x.bandwidth() / 2)\r\n .y(d => y2(d.line as number))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfTicks);\r\n const y2Ticks = y2.ticks(noOfTicks);\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 <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: barColor,\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: barColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, barPrefix, barSuffix)}\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: barColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: barColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[0].length > 100\r\n ? `${axisTitles[0].substring(0, 100)}...`\r\n : axisTitles[0]\r\n }\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: lineColor,\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: lineColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, linePrefix, lineSuffix)}\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: lineColor, ...(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: lineColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[1].length > 100\r\n ? `${axisTitles[1].substring(0, 100)}...`\r\n : axisTitles[1]\r\n }\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <Axis\r\n y1={sameAxes ? y1(0) : graphHeight}\r\n y2={sameAxes ? y1(0) : 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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.rect\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 1,\r\n fill: barColor,\r\n },\r\n whileInView: {\r\n attrY: d.bar ? (d.bar > 0 ? y1(d.bar) : y1(0)) : 0,\r\n height: d.bar ? Math.abs(y1(d.bar) - y1(0)) : 0,\r\n opacity: 1,\r\n fill: barColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n x={x(`${i}`)}\r\n width={x.bandwidth()}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.bar) ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n attrY: y1(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n opacity: 0,\r\n fill: barColor,\r\n },\r\n whileInView: {\r\n attrY: y1(d.bar || 0),\r\n opacity: 1,\r\n fill: barColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy={d.bar ? (d.bar >= 0 ? '-5px' : '1em') : '-5px'}\r\n >\r\n {numberFormattingFunction(d.bar, naLabel, precision, barPrefix, barSuffix)}\r\n </motion.text>\r\n ) : null}\r\n {showLabels ? (\r\n <XAxesLabels\r\n value={\r\n `${d.label}`.length < truncateBy\r\n ? `${d.label}`\r\n : `${`${d.label}`.substring(0, truncateBy)}...`\r\n }\r\n y={graphHeight + 5}\r\n x={x(`${d.id}`) as number}\r\n width={x.bandwidth()}\r\n height={margin.bottom}\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='top'\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <motion.path\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n d: lineShape(dataWithId.map(d => ({ ...d, line: 0 }))) as string,\r\n opacity: 0,\r\n stroke: lineColor,\r\n },\r\n whileInView: {\r\n d: lineShape(dataWithId) as string,\r\n opacity: 1,\r\n stroke: lineColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n fill: 'none',\r\n strokeWidth: 2,\r\n }}\r\n />\r\n {dataWithId.map((d, i) => (\r\n <g key={i}>\r\n {!checkIfNullOrUndefined(d.line) ? (\r\n <g\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.circle\r\n exit={{\r\n cy: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n cy: y2(0),\r\n opacity: 0,\r\n fill: lineColor,\r\n },\r\n whileInView: {\r\n cy: y2(d.line as number),\r\n opacity: 1,\r\n fill: lineColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n cx={(x(d.id) as number) + x.bandwidth() / 2}\r\n r={\r\n graphWidth / dataWithId.length < 5\r\n ? 0\r\n : graphWidth / dataWithId.length < 20\r\n ? 2\r\n : 4\r\n }\r\n />\r\n {showValues ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n y: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n variants={{\r\n initial: {\r\n y: y2(0),\r\n opacity: 0,\r\n fill: lineColor,\r\n },\r\n whileInView: {\r\n y: y2(d.line as number),\r\n opacity: 1,\r\n fill: lineColor,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy='-5px'\r\n >\r\n {numberFormattingFunction(\r\n d.line,\r\n naLabel,\r\n precision,\r\n linePrefix,\r\n lineSuffix,\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </g>\r\n ) : null}\r\n </g>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\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 {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\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 Languages,\r\n ParetoChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\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: ParetoChartDataType[];\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 /** Color of the bars */\r\n barColor?: string;\r\n /** Color of the line */\r\n lineColor?: 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 /** Padding between bars */\r\n barPadding?: number;\r\n\r\n // Values and Ticks\r\n /** Suffix for values of the lines */\r\n lineSuffix?: string;\r\n /** Suffix for values of the bars */\r\n barSuffix?: string;\r\n /** Prefix for values of the lines */\r\n linePrefix?: string;\r\n /** Prefix for values of the bars */\r\n barPrefix?: string;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Enables same axis for bars and line */\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 /** Title for the bar axis */\r\n barAxisTitle?: string;\r\n /** Title for the line axis */\r\n lineAxisTitle?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\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 /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: 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 /** Details displayed on the modal when user clicks of a data point. 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 detailsOnClick?: 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 /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_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 ParetoChart(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 padding,\r\n lineColor = Colors.light.categoricalColors.colors[1],\r\n barColor = Colors.light.categoricalColors.colors[0],\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 lineAxisTitle = 'Line chart',\r\n barAxisTitle = 'Bar graph',\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n barPadding = 0.25,\r\n truncateBy = 999,\r\n showLabels = true,\r\n onSeriesMouseClick,\r\n language = 'en',\r\n colorLegendTitle,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n showValues = true,\r\n noOfTicks = 5,\r\n lineSuffix = '',\r\n barSuffix = '',\r\n linePrefix = '',\r\n barPrefix = '',\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n customLayers = [],\r\n naLabel = 'NA',\r\n showColorScale = true,\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 pareto chart that shows a variable as bars and another as line chart.${\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={[barAxisTitle, lineAxisTitle]}\r\n colors={[\r\n barColor || Colors[theme].categoricalColors.colors[0],\r\n lineColor || Colors[theme].categoricalColors.colors[1],\r\n ]}\r\n colorLegendTitle={colorLegendTitle}\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 lineColor={lineColor}\r\n barColor={barColor}\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 truncateBy={truncateBy}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n axisTitles={[barAxisTitle, lineAxisTitle]}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n barPadding={barPadding}\r\n showLabels={showLabels}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n noOfTicks={noOfTicks}\r\n lineSuffix={lineSuffix}\r\n barSuffix={barSuffix}\r\n linePrefix={linePrefix}\r\n barPrefix={barPrefix}\r\n curveType={curveType}\r\n showValues={showValues}\r\n styles={styles}\r\n classNames={classNames}\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 precision={precision}\r\n customLayers={customLayers}\r\n naLabel={naLabel}\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","barColor","lineColor","axisTitles","sameAxes","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","showValues","onSeriesMouseOver","barPadding","truncateBy","showLabels","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","noOfTicks","lineSuffix","barSuffix","linePrefix","barPrefix","curveType","styles","classNames","animate","precision","customLayers","naLabel","showAxisLabels","svgRef","useRef","isInView","useInView","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","i","x","scaleBand","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","y1","scaleLinear","y2","lineShape","line","checkIfNullOrUndefined","y1Ticks","y2Ticks","jsxs","Fragment","jsx","motion","cn","numberFormattingFunction","Axis","AxisTitle","AnimatePresence","event","isEqual","XAxesLabels","Tooltip","Modal","string2HTML","ParetoChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","lineAxisTitle","barAxisTitle","relativeHeight","graphID","graphDownload","dataDownload","language","colorLegendTitle","minHeight","theme","ariaLabel","showColorScale","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4EO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AA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A,kBAAA;AAAA,gBACN,EAAA,CACF,EAAA,CAEJ;AAAA,gBACC2D,KAAWE,IACVjB,gBAAAA,EAAAA;AAAAA,kBAAC6C;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAU/F,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAAgE;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA5F;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),wt=require("./index-DQA8q5sC.cjs"),bt=require("./Modal-tXZlLE5s.cjs"),Et=require("./Tooltip-De16GWhY.cjs"),V=require("./Colors.cjs"),xt=require("./numberFormattingFunction-02t-wJta.cjs"),kt=require("./string2HTML-z7CwHXcx.cjs"),N=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./linear-BVckp9RD.cjs"),mt=require("./line-DHV4JwCR.cjs"),Rt=require("./use-in-view-sQJZ_xDO.cjs"),W=require("./proxy-BHRoeZgd.cjs"),Ct=require("./index-BW8iNx7E.cjs"),It=require("./GraphFooter.cjs"),St=require("./GraphHeader.cjs"),Nt=require("./EmptyState-d8_8SxeW.cjs"),Ot=require("./ColorLegendWithMouseOver.cjs"),pt=require("./uniqBy-O05lp2S5.cjs");var Pt=gt(mt.curveLinear);function ft(t){this._curve=t}ft.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function gt(t){function e(o){return new ft(t(o))}return e._curve=t,e}function qt(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(o){return arguments.length?e(gt(o)):e()._curve},t}function Tt(){return qt(mt.line().curve(Pt))}function it(){}function ht(t,e,o){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-o),t._x2,t._y2)}function _t(t,e){this._context=t,this._k=(1-e)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ht(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ht(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function o(l){return new _t(l,e)}return o.tension=function(l){return t(+l)},o})(0);function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ht(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Vt=function t(e){function o(l){return new yt(l,e)}return o.tension=function(l){return t(+l)},o}(0);function vt(t){this._context=t}vt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function $t(t){return new vt(t)}function Dt(t){const{data:e,radius:o,lineColors:l,tooltip:k,onSeriesMouseOver:$,onSeriesMouseClick:M,colorDomain:u,detailsOnClick:j,styles:y,classNames:d,selectedColor:O,axisLabels:G,strokeWidth:et,showValues:nt,showDots:st,rightMargin:ot,topMargin:U,bottomMargin:rt,leftMargin:D,curveType:X,noOfTicks:B,minValue:P,maxValue:q,resetSelectionOnDoubleClick:at,fillShape:c,highlightedLines:g,animate:x,dimmedOpacity:_,precision:R,customLayers:Y}=t,z=f.useRef(null),T=Rt.useInView(z,{once:x.once,amount:x.amount}),w=X==="linear"?$t:Vt,b={top:U,left:D},v=Math.min((2*o-D-ot)/2,(2*o-U-rt)/2),[E,L]=f.useState(void 0),[C,A]=f.useState(void 0),[J,H]=f.useState(void 0),[K,F]=f.useState(void 0),a=dt.linear().domain([0,e[0].values.length]).range([0,2*Math.PI]),Q=N.checkIfNullOrUndefined(q)?Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):q,lt=N.checkIfNullOrUndefined(P)?Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):P,p=dt.linear().domain([lt,Q]).range([0,v]).nice(),ct=p.ticks(B),I=Tt().radius(i=>p(i)).angle((i,s)=>a(s)).curve(w);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(W.motion.svg,{width:`${o*2}px`,height:`${o*2}px`,viewBox:`0 0 ${o*2} ${o*2}`,direction:"ltr",ref:z,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${b.left},${b.top})`,children:[Y.filter(i=>i.position==="before").map(i=>i.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[G.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(a(s)-Math.PI/2)*v,y2:Math.sin(a(s)-Math.PI/2)*v,className:n.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(a(s)-Math.PI/2)*(v+6),y:Math.sin(a(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(a(s)-Math.PI/2)<0?"end":Math.cos(a(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(a(s)-Math.PI/2)<0?0:Math.sin(a(s)-Math.PI/2)<1e-5?5:10,className:n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",d?.xAxis?.labels),children:i})]},s)),ct.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:I(Array(G.length).fill(i))||"",className:n.mo("stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*p(i)>-1e-4?Math.sin(-Math.PI/2)*p(i)-7:Math.sin(-Math.PI/2)*p(i)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:n.mo("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",d?.xAxis?.labels),style:y?.xAxis?.labels,children:xt.numberFormattingFunction(i,"NA",R)})})})]},s)),n.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:e.map((i,s)=>n.jsxRuntimeExports.jsxs(W.motion.g,{variants:{initial:{opacity:E?i.label===E.label?1:_:O?i.color&&l[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:.3:1},whileInView:{opacity:E?i.label===E.label?1:_:O?i.color&&l[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:T?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:r=>{L(i),F(r.clientY),H(r.clientX),$?.(i)},onMouseMove:r=>{L(i),F(r.clientY),H(r.clientX)},onMouseLeave:()=>{L(void 0),H(void 0),F(void 0),$?.(void 0)},onClick:()=>{(M||j)&&(wt.isEqual(C,i)&&at?(A(void 0),M?.(void 0)):(A(i),M?.(i)))},children:[n.jsxRuntimeExports.jsx(W.motion.path,{d:I(i.values)||"",variants:{initial:{d:I(i.values.map(r=>0))||""},whileInView:{d:I(i.values)||"",transition:{duration:x.duration}}},initial:"initial",animate:T?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:e.filter(r=>r.color).length===0?l[0]:i.color?l[u.indexOf(i.color)]:V.Colors.gray,fill:c?e.filter(r=>r.color).length===0?l[0]:i.color?l[u.indexOf(i.color)]:V.Colors.gray:"none",fillOpacity:.1,strokeWidth:et}}),n.jsxRuntimeExports.jsx("g",{children:i.values.map((r,m)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(r)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[st?n.jsxRuntimeExports.jsx(W.motion.circle,{cx:Math.cos(a(m)-Math.PI/2)*p(r),cy:Math.sin(a(m)-Math.PI/2)*p(r),r:4,style:{fill:e.filter(Z=>Z.color).length===0?l[0]:i.color?l[u.indexOf(i.color)]:V.Colors.gray},variants:{initial:{cx:0,cy:0,opacity:0},whileInView:{cx:Math.cos(a(m)-Math.PI/2)*p(r),cy:Math.sin(a(m)-Math.PI/2)*p(r),opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:T?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,nt?n.jsxRuntimeExports.jsx(W.motion.text,{x:Math.cos(a(m)-Math.PI/2)*(p(r)+6),y:Math.sin(a(m)-Math.PI/2)*(p(r)+6),style:{fill:l[s],textAnchor:Math.cos(a(m)-Math.PI/2)<0?"end":Math.cos(a(m)-Math.PI/2)<1e-5?"middle":"start",...y?.graphObjectValues||{}},dy:Math.sin(a(m)-Math.PI/2)<0?10:(Math.sin(a(m)-Math.PI/2)<1e-5,0),className:n.mo("graph-value text-xs font-bold",d?.graphObjectValues),variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:T?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:xt.numberFormattingFunction(r,"NA",R)}):null]})},m))})]},i.label||s))})]}),Y.filter(i=>i.position==="after").map(i=>i.layer)]})}),E&&k&&J&&K?n.jsxRuntimeExports.jsx(Et.Tooltip,{data:E,body:k,xPos:J,yPos:K,backgroundStyle:y?.tooltip,className:d?.tooltip}):null,j&&C!==void 0?n.jsxRuntimeExports.jsx(bt.X,{open:C!==void 0,onClose:()=>{A(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:kt.string2HTML(j,C)}:void 0,children:typeof j=="function"?j(C):null})}):null]})}function Lt(t){const{graphTitle:e,colors:o,sources:l,graphDescription:k,footNote:$,radius:M,data:u,showColorScale:j=!0,padding:y,backgroundColor:d=!1,tooltip:O,onSeriesMouseOver:G,graphID:et,onSeriesMouseClick:nt,topMargin:st=75,bottomMargin:ot=75,leftMargin:U=75,rightMargin:rt=75,graphDownload:D=!1,dataDownload:X=!1,colorDomain:B,language:P="en",theme:q="light",highlightedLines:at=[],width:c,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:R,ariaLabel:Y,colorLegendTitle:z,detailsOnClick:T,styles:w,classNames:b,showNAColor:v=!0,axisLabels:E,showDots:L=!0,showValues:C=!1,curveType:A="curve",noOfTicks:J=5,minValue:H,maxValue:K,fillShape:F=!1,resetSelectionOnDoubleClick:a=!0,animate:Q=!1,dimmedOpacity:lt=.3,precision:p=2,customLayers:ct=[]}=t,[I,i]=f.useState(0),[s,r]=f.useState(0),[m,Z]=f.useState(0),[Mt,jt]=f.useState(void 0),S=f.useRef(null),ut=f.useRef(null);return f.useEffect(()=>{const h=new ResizeObserver(tt=>{r(c||tt[0].target.clientWidth||420),Z(g||tt[0].target.clientHeight||420),i((Math.min(c||tt[0].target.clientWidth||620,g||tt[0].target.clientHeight||480)||420)/2)});return S.current&&(Z(S.current.clientHeight||420),r(S.current.clientWidth||420),i((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!c||!M)&&h.observe(S.current)),()=>h.disconnect()},[c,g,M]),n.jsxRuntimeExports.jsx("div",{className:`${q||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:P==="he"||P==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${P||"en"}`,c?"w-fit":"w-full",b?.graphContainer),style:{...w?.graphContainer||{},minHeight:"inherit",...d&&d!==!0?{backgroundColor:d}:{}},id:et,ref:ut,"aria-label":Y||`${e?`The graph shows ${e}. `:""}This is a donut or pie chart chart. ${k?` ${k}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:d?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[e||k||D||X?n.jsxRuntimeExports.jsx(St.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:b?.title,description:b?.description},graphTitle:e,graphDescription:k,width:c,graphDownload:D?ut.current:void 0,dataDownload:X?u.map(h=>h.data).filter(h=>h!==void 0).length>0?u.map(h=>h.data).filter(h=>h!==void 0):u.filter(h=>h!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:c?`${c}px`:"100%"},children:u.length===0?n.jsxRuntimeExports.jsx(Nt.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[j&&u.filter(h=>h.color).length!==0?n.jsxRuntimeExports.jsx(Ot.ColorLegendWithMouseOver,{width:c,colorLegendTitle:z,colors:o||V.Colors[q].categoricalColors.colors,colorDomain:B||pt.uniqBy(u,"color",!0),setSelectedColor:jt,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${c?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:c?`${c}px`:"100%",height:g?`${Math.max(x,g||(R?x?(c||s)*R>x?(c||s)*R:x:(c||s)*R:m))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:M||I?n.jsxRuntimeExports.jsx(Dt,{data:u,lineColors:u.filter(h=>h.color).length===0?o?[o]:[V.Colors.primaryColors["blue-600"]]:o||V.Colors[q].categoricalColors.colors,radius:M||I,tooltip:O,colorDomain:B||pt.uniqBy(u,"color",!0),onSeriesMouseOver:G,onSeriesMouseClick:nt,styles:w,detailsOnClick:T,selectedColor:Mt,axisLabels:E,strokeWidth:_,showValues:C,showDots:L,topMargin:st,bottomMargin:ot,leftMargin:U,rightMargin:rt,curveType:A,noOfTicks:J,minValue:H,maxValue:K,fillShape:F,highlightedLines:at,resetSelectionOnDoubleClick:a,animate:Q===!0?{duration:.5,once:!0,amount:.5}:Q||{duration:0,once:!0,amount:0},dimmedOpacity:lt,precision:p,customLayers:ct}):null})})]})}),l||$?n.jsxRuntimeExports.jsx(It.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:l,footNote:$,width:c}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),wt=require("./index-DQA8q5sC.cjs"),bt=require("./Modal-tXZlLE5s.cjs"),Et=require("./Tooltip-De16GWhY.cjs"),M=require("./Colors.cjs"),xt=require("./numberFormattingFunction-02t-wJta.cjs"),kt=require("./string2HTML-z7CwHXcx.cjs"),N=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./linear-BVckp9RD.cjs"),mt=require("./line-DHV4JwCR.cjs"),Rt=require("./use-in-view-sQJZ_xDO.cjs"),G=require("./proxy-BHRoeZgd.cjs"),Ct=require("./index-BW8iNx7E.cjs"),It=require("./GraphFooter.cjs"),Ot=require("./GraphHeader.cjs"),St=require("./EmptyState-d8_8SxeW.cjs"),Nt=require("./ColorLegendWithMouseOver.cjs"),pt=require("./uniqBy-O05lp2S5.cjs");var Pt=gt(mt.curveLinear);function ft(t){this._curve=t}ft.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,i){this._curve.point(i*Math.sin(t),i*-Math.cos(t))}};function gt(t){function i(a){return new ft(t(a))}return i._curve=t,i}function qt(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(a){return arguments.length?i(gt(a)):i()._curve},t}function Tt(){return qt(mt.line().curve(Pt))}function it(){}function ht(t,i,a){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-a),t._x2,t._y2)}function _t(t,i){this._context=t,this._k=(1-i)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ht(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:ht(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};(function t(i){function a(o){return new _t(o,i)}return a.tension=function(o){return t(+o)},a})(0);function yt(t,i){this._context=t,this._k=(1-i)/6}yt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:ht(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const Vt=function t(i){function a(o){return new yt(o,i)}return a.tension=function(o){return t(+o)},a}(0);function vt(t){this._context=t}vt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}};function $t(t){return new vt(t)}function Dt(t){const{data:i,radius:a,lineColors:o,tooltip:R,onSeriesMouseOver:D,onSeriesMouseClick:j,colorDomain:h,detailsOnClick:w,styles:y,classNames:p,selectedColor:P,axisLabels:U,strokeWidth:X,showValues:nt,showDots:st,rightMargin:ot,topMargin:B,bottomMargin:rt,leftMargin:L,curveType:Y,noOfTicks:z,minValue:q,maxValue:T,resetSelectionOnDoubleClick:at,fillShape:c,highlightedLines:g,animate:x,dimmedOpacity:_,precision:C,customLayers:J}=t,K=f.useRef(null),V=Rt.useInView(K,{once:x.once,amount:x.amount}),b=Y==="linear"?$t:Vt,E={top:B,left:L},v=Math.min((2*a-L-ot)/2,(2*a-B-rt)/2),[k,A]=f.useState(void 0),[I,H]=f.useState(void 0),[Q,F]=f.useState(void 0),[Z,W]=f.useState(void 0),l=dt.linear().domain([0,i[0].values.length]).range([0,2*Math.PI]),tt=N.checkIfNullOrUndefined(T)?Math.max(...i.map(e=>Math.max(...e.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...i.map(e=>Math.max(...e.values.filter(s=>!N.checkIfNullOrUndefined(s))))):T,lt=N.checkIfNullOrUndefined(q)?Math.min(...i.map(e=>Math.min(...e.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...i.map(e=>Math.min(...e.values.filter(s=>!N.checkIfNullOrUndefined(s))))):q,m=dt.linear().domain([lt,tt]).range([0,v]).nice(),ct=m.ticks(z),O=Tt().radius(e=>m(e)).angle((e,s)=>l(s)).curve(b);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(G.motion.svg,{width:`${a*2}px`,height:`${a*2}px`,viewBox:`0 0 ${a*2} ${a*2}`,direction:"ltr",ref:K,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${E.left},${E.top})`,children:[J.filter(e=>e.position==="before").map(e=>e.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[U.map((e,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(l(s)-Math.PI/2)*v,y2:Math.sin(l(s)-Math.PI/2)*v,className:n.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",p?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(l(s)-Math.PI/2)*(v+6),y:Math.sin(l(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(l(s)-Math.PI/2)<0?"end":Math.cos(l(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(l(s)-Math.PI/2)<0?0:Math.sin(l(s)-Math.PI/2)<1e-5?5:10,className:n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",p?.xAxis?.labels),children:e})]},s)),ct.map((e,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:O(Array(U.length).fill(e))||"",className:n.mo("stroke-primary-gray-500 dark:stroke-primary-gray-550",p?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*m(e)>-1e-4?Math.sin(-Math.PI/2)*m(e)-7:Math.sin(-Math.PI/2)*m(e)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:n.mo("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",p?.xAxis?.labels),style:y?.xAxis?.labels,children:xt.numberFormattingFunction(e,"NA",C)})})})]},s)),n.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:i.map((e,s)=>n.jsxRuntimeExports.jsxs(G.motion.g,{variants:{initial:{opacity:k?e.label===k.label?1:_:P?e.color&&o[h.indexOf(e.color)]===P?1:_:g.length!==0?e.label&&g.indexOf(e.label)!==-1?1:.3:1},whileInView:{opacity:k?e.label===k.label?1:_:P?e.color&&o[h.indexOf(e.color)]===P?1:_:g.length!==0?e.label&&g.indexOf(e.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:r=>{A(e),W(r.clientY),F(r.clientX),D?.(e)},onMouseMove:r=>{A(e),W(r.clientY),F(r.clientX)},onMouseLeave:()=>{A(void 0),F(void 0),W(void 0),D?.(void 0)},onClick:()=>{(j||w)&&(wt.isEqual(I,e)&&at?(H(void 0),j?.(void 0)):(H(e),j?.(e)))},children:[n.jsxRuntimeExports.jsx(G.motion.path,{d:O(e.values)||"",variants:{initial:{d:O(e.values.map(r=>0))||"",stroke:i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray,fill:c?i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray:"none",strokeWidth:X},whileInView:{d:O(e.values)||"",transition:{duration:x.duration},stroke:i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray,fill:c?i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray:"none",strokeWidth:X}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{fillOpacity:.1}}),n.jsxRuntimeExports.jsx("g",{children:e.values.map((r,d)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(r)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[st?n.jsxRuntimeExports.jsx(G.motion.circle,{r:4,variants:{initial:{cx:0,cy:0,opacity:0,fill:i.filter($=>$.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray},whileInView:{cx:Math.cos(l(d)-Math.PI/2)*m(r),cy:Math.sin(l(d)-Math.PI/2)*m(r),opacity:1,transition:{duration:x.duration},fill:i.filter($=>$.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,nt?n.jsxRuntimeExports.jsx(G.motion.text,{style:{...y?.graphObjectValues||{}},dy:Math.sin(l(d)-Math.PI/2)<0?10:(Math.sin(l(d)-Math.PI/2)<1e-5,0),className:n.mo("graph-value text-xs font-bold",p?.graphObjectValues),variants:{initial:{opacity:0,x:Math.cos(l(d)-Math.PI/2)*(m(r)+6),y:Math.sin(l(d)-Math.PI/2)*(m(r)+6),fill:o[s],textAnchor:Math.cos(l(d)-Math.PI/2)<0?"end":Math.cos(l(d)-Math.PI/2)<1e-5?"middle":"start"},whileInView:{opacity:1,x:Math.cos(l(d)-Math.PI/2)*(m(r)+6),y:Math.sin(l(d)-Math.PI/2)*(m(r)+6),fill:o[s],textAnchor:Math.cos(l(d)-Math.PI/2)<0?"end":Math.cos(l(d)-Math.PI/2)<1e-5?"middle":"start",transition:{duration:x.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:xt.numberFormattingFunction(r,"NA",C)}):null]})},d))})]},e.label||s))})]}),J.filter(e=>e.position==="after").map(e=>e.layer)]})}),k&&R&&Q&&Z?n.jsxRuntimeExports.jsx(Et.Tooltip,{data:k,body:R,xPos:Q,yPos:Z,backgroundStyle:y?.tooltip,className:p?.tooltip}):null,w&&I!==void 0?n.jsxRuntimeExports.jsx(bt.X,{open:I!==void 0,onClose:()=>{H(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:kt.string2HTML(w,I)}:void 0,children:typeof w=="function"?w(I):null})}):null]})}function Lt(t){const{graphTitle:i,colors:a,sources:o,graphDescription:R,footNote:D,radius:j,data:h,showColorScale:w=!0,padding:y,backgroundColor:p=!1,tooltip:P,onSeriesMouseOver:U,graphID:X,onSeriesMouseClick:nt,topMargin:st=75,bottomMargin:ot=75,leftMargin:B=75,rightMargin:rt=75,graphDownload:L=!1,dataDownload:Y=!1,colorDomain:z,language:q="en",theme:T="light",highlightedLines:at=[],width:c,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:C,ariaLabel:J,colorLegendTitle:K,detailsOnClick:V,styles:b,classNames:E,showNAColor:v=!0,axisLabels:k,showDots:A=!0,showValues:I=!1,curveType:H="curve",noOfTicks:Q=5,minValue:F,maxValue:Z,fillShape:W=!1,resetSelectionOnDoubleClick:l=!0,animate:tt=!1,dimmedOpacity:lt=.3,precision:m=2,customLayers:ct=[]}=t,[O,e]=f.useState(0),[s,r]=f.useState(0),[d,$]=f.useState(0),[Mt,jt]=f.useState(void 0),S=f.useRef(null),ut=f.useRef(null);return f.useEffect(()=>{const u=new ResizeObserver(et=>{r(c||et[0].target.clientWidth||420),$(g||et[0].target.clientHeight||420),e((Math.min(c||et[0].target.clientWidth||620,g||et[0].target.clientHeight||480)||420)/2)});return S.current&&($(S.current.clientHeight||420),r(S.current.clientWidth||420),e((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!c||!j)&&u.observe(S.current)),()=>u.disconnect()},[c,g,j]),n.jsxRuntimeExports.jsx("div",{className:`${T||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:q==="he"||q==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${p?p===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${q||"en"}`,c?"w-fit":"w-full",E?.graphContainer),style:{...b?.graphContainer||{},minHeight:"inherit",...p&&p!==!0?{backgroundColor:p}:{}},id:X,ref:ut,"aria-label":J||`${i?`The graph shows ${i}. `:""}This is a donut or pie chart chart. ${R?` ${R}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:p?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[i||R||L||Y?n.jsxRuntimeExports.jsx(Ot.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:E?.title,description:E?.description},graphTitle:i,graphDescription:R,width:c,graphDownload:L?ut.current:void 0,dataDownload:Y?h.map(u=>u.data).filter(u=>u!==void 0).length>0?h.map(u=>u.data).filter(u=>u!==void 0):h.filter(u=>u!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:c?`${c}px`:"100%"},children:h.length===0?n.jsxRuntimeExports.jsx(St.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[w&&h.filter(u=>u.color).length!==0?n.jsxRuntimeExports.jsx(Nt.ColorLegendWithMouseOver,{width:c,colorLegendTitle:K,colors:a||M.Colors[T].categoricalColors.colors,colorDomain:z||pt.uniqBy(h,"color",!0),setSelectedColor:jt,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${c?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:c?`${c}px`:"100%",height:g?`${Math.max(x,g||(C?x?(c||s)*C>x?(c||s)*C:x:(c||s)*C:d))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:j||O?n.jsxRuntimeExports.jsx(Dt,{data:h,lineColors:h.filter(u=>u.color).length===0?a?[a]:[M.Colors.primaryColors["blue-600"]]:a||M.Colors[T].categoricalColors.colors,radius:j||O,tooltip:P,colorDomain:z||pt.uniqBy(h,"color",!0),onSeriesMouseOver:U,onSeriesMouseClick:nt,styles:b,detailsOnClick:V,selectedColor:Mt,axisLabels:k,strokeWidth:_,showValues:I,showDots:A,topMargin:st,bottomMargin:ot,leftMargin:B,rightMargin:rt,curveType:H,noOfTicks:Q,minValue:F,maxValue:Z,fillShape:W,highlightedLines:at,resetSelectionOnDoubleClick:l,animate:tt===!0?{duration:.5,once:!0,amount:.5}:tt||{duration:0,once:!0,amount:0},dimmedOpacity:lt,precision:m,customLayers:ct}):null})})]})}),o||D?n.jsxRuntimeExports.jsx(It.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:o,footNote:D,width:c}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
2
2
  //# sourceMappingURL=RadarChart.cjs.map