@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
package/dist/StripChart.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripChart.cjs","sources":["../src/Utils/getTickPosition.ts","../src/Components/Graphs/StripChart/Horizontal/Graph.tsx","../src/Components/Graphs/StripChart/Horizontal/index.tsx","../src/Components/Graphs/StripChart/Vertical/Graph.tsx","../src/Components/Graphs/StripChart/Vertical/index.tsx","../src/Components/Graphs/StripChart/index.tsx"],"sourcesContent":["export function getTickPositions(count: number, width: number) {\r\n if (count < 2) return [];\r\n const step = width / (count - 1);\r\n return Array.from({ length: count }, (_, i) => i * step);\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { 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\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n noOfTicks,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // 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,\r\n right: rightMargin,\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\r\n const sortedData = orderBy(\r\n dataWithId,\r\n [\r\n item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n },\r\n ],\r\n ['desc'],\r\n );\r\n const xMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const xMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const x = scaleLinear().domain([xMinValue, xMaxValue]).range([0, graphWidth]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphWidth);\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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: x(0),\r\n y: graphHeight / 2,\r\n },\r\n whileInView: {\r\n x: x(d.position),\r\n y: graphHeight / 2,\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\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 {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n y={0 - radius}\r\n x={-1}\r\n height={radius * 2}\r\n width={2}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n x={0}\r\n y={0 - radius - 5}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\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={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n x={tick}\r\n y={graphHeight / 2 + radius}\r\n style={{\r\n textAnchor: i === 0 ? 'start' : i === ticks.length - 1 ? 'end' : 'middle',\r\n ...(styles?.xAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.xAxis?.labels,\r\n )}\r\n dy='1em'\r\n >\r\n {numberFormattingFunction(x.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\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 {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n stripType?: 'strip' | 'dot';\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function HorizontalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 5,\r\n rightMargin = 5,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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 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 strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\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 !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full 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 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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\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 noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { 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\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // 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,\r\n right: rightMargin,\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\r\n const sortedData = orderBy(\r\n dataWithId,\r\n [\r\n item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n },\r\n ],\r\n ['desc'],\r\n );\r\n const yMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const yMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const y = scaleLinear().domain([yMinValue, yMaxValue]).range([graphHeight, 0]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphHeight);\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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: graphWidth / 2,\r\n y: y(0),\r\n },\r\n whileInView: {\r\n x: graphWidth / 2,\r\n y: y(d.position),\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\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 {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n x={0 - radius}\r\n y={-1}\r\n width={radius * 2}\r\n height={2}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n y={0}\r\n dy='0.33em'\r\n x={0 + radius + 3}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\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={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n textAnchor: 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n y={tick}\r\n x={graphWidth / 2 + radius + 5}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.yAxis?.labels,\r\n )}\r\n >\r\n {numberFormattingFunction(y.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\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 {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n stripType?: 'strip' | 'dot';\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function VerticalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 20,\r\n rightMargin = 20,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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 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 strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\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 !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\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 noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { HorizontalStripChart } from './Horizontal';\r\nimport { VerticalStripChart } from './Vertical';\r\n\r\nimport {\r\n SourcesDataType,\r\n Languages,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: StripChartDataType[];\r\n\r\n /** Orientation of the graph */\r\n orientation?: 'vertical' | 'horizontal';\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 or array of colors for circles */\r\n colors?: string | string[];\r\n /** Color of the highlighted data points */\r\n highlightColor?: string;\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color of value labels */\r\n valueColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n\r\n // Graph Parameters\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n /** Radius of the dots or width of the strips */\r\n radius?: number;\r\n /** Opacity of each dot or strip */\r\n dotOpacity?: number;\r\n /** Type of strip */\r\n stripType?: 'strip' | 'dot';\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\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 StripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius,\r\n padding,\r\n backgroundColor,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n highlightedDataPoints,\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n graphDownload,\r\n dataDownload,\r\n prefix,\r\n suffix,\r\n stripType,\r\n language,\r\n highlightColor,\r\n dotOpacity,\r\n showNAColor,\r\n minHeight,\r\n theme,\r\n ariaLabel,\r\n valueColor,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n orientation = 'vertical',\r\n styles,\r\n classNames,\r\n animate,\r\n dimmedOpacity = 0.3,\r\n precision,\r\n customLayers,\r\n } = props;\r\n\r\n if (orientation === 'vertical')\r\n return (\r\n <VerticalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n return (\r\n <HorizontalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n}\r\n"],"names":["getTickPositions","count","width","step","_","i","Graph","props","data","height","colors","colorDomain","radius","leftMargin","rightMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","highlightedDataPoints","selectedColor","minValue","maxValue","onSeriesMouseClick","prefix","suffix","stripType","highlightColor","dotOpacity","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","valueColor","animate","noOfTicks","dimmedOpacity","precision","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","sortedData","orderBy","item","index","xMaxValue","checkIfNullOrUndefined","xMinValue","x","scaleLinear","ticks","jsxs","Fragment","jsx","motion","AnimatePresence","event","isEqual","el","Colors","cn","tick","numberFormattingFunction","Tooltip","Modal","string2HTML","HorizontalStripChart","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","GraphFooter","yMaxValue","yMinValue","y","VerticalStripChart","StripChart","orientation"],"mappings":"0xBAAO,SAASA,GAAiBC,EAAeC,EAAe,CAC7D,GAAID,EAAQ,EAAG,MAAO,CAAA,EACtB,MAAME,EAAOD,GAASD,EAAQ,GAC9B,OAAO,MAAM,KAAK,CAAE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ACA,aAAAC,EACA,OAAAtE,EACA,OAAAC,EACA,UAAAC,EACA,SAAAqE,EACA,eAAApE,EACA,WAAAC,EACA,YAAAoE,EACA,UAAAC,EACA,MAAAC,EACA,UAAAC,EACA,4BAAAtE,EACA,OAAAE,EACA,WAAAE,EACA,eAAAH,EACA,WAAAE,EACA,QAAAE,GACA,cAAAE,GACA,UAAAC,GACA,aAAAC,CAAA,CAAA,EAIJ+B,EAAAA,kBAAAA,IAACa,GAAA,CACC,KAAA1E,EACA,WAAA2E,EACA,OAAAzE,EACA,QAAA0E,EACA,iBAAAC,EACA,OAAA5E,EACA,MAAAP,EACA,SAAAoF,EACA,YAAA3E,EACA,iBAAA4E,GACA,OAAA3E,EACA,QAAA4E,EACA,gBAAAC,EACA,WAAA5E,EACA,YAAAC,EACA,UAAAC,EACA,aAAAC,EACA,QAAAC,EACA,eAAAyE,EACA,kBAAAxE,EACA,eAAAyE,EACA,sBAAAxE,EACA,QAAAyE,GACA,SAAAvE,EACA,SAAAC,EACA,mBAAAC,EACA,UAAAY,EACA,cAAA0D,EACA,aAAAC,EACA,OAAAtE,EACA,OAAAC,EACA,UAAAC,EACA,SAAAqE,EACA,eAAApE,EACA,WAAAC,EACA,YAAAoE,EACA,UAAAC,EACA,MAAAC,EACA,UAAAC,EACA,4BAAAtE,EACA,OAAAE,EACA,WAAAE,EACA,eAAAH,EACA,WAAAE,EACA,QAAAE,GACA,cAAAE,GACA,UAAAC,GACA,aAAAC,CAAA,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"StripChart.cjs","sources":["../src/Utils/getTickPosition.ts","../src/Components/Graphs/StripChart/Horizontal/Graph.tsx","../src/Components/Graphs/StripChart/Horizontal/index.tsx","../src/Components/Graphs/StripChart/Vertical/Graph.tsx","../src/Components/Graphs/StripChart/Vertical/index.tsx","../src/Components/Graphs/StripChart/index.tsx"],"sourcesContent":["export function getTickPositions(count: number, width: number) {\r\n if (count < 2) return [];\r\n const step = width / (count - 1);\r\n return Array.from({ length: count }, (_, i) => i * step);\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { 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\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n noOfTicks,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // 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,\r\n right: rightMargin,\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\r\n const sortedData = orderBy(\r\n dataWithId,\r\n [\r\n item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n },\r\n ],\r\n ['desc'],\r\n );\r\n const xMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const xMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const x = scaleLinear().domain([xMinValue, xMaxValue]).range([0, graphWidth]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphWidth);\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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: x(0),\r\n y: graphHeight / 2,\r\n },\r\n whileInView: {\r\n x: x(d.position),\r\n y: graphHeight / 2,\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\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 {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n x={-1}\r\n width={2}\r\n variants={{\r\n initial: {\r\n y: 0 - radius,\r\n height: radius * 2,\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n y: 0 - radius,\r\n height: radius * 2,\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n x={0}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n y: 0 - radius - 5,\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n y: 0 - radius - 5,\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n x={tick}\r\n y={graphHeight / 2 + radius}\r\n style={{\r\n textAnchor: i === 0 ? 'start' : i === ticks.length - 1 ? 'end' : 'middle',\r\n ...(styles?.xAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.xAxis?.labels,\r\n )}\r\n dy='1em'\r\n >\r\n {numberFormattingFunction(x.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\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 {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n stripType?: 'strip' | 'dot';\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function HorizontalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 5,\r\n rightMargin = 5,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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 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 strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\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 !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full 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 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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\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 noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { 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\nimport orderBy from 'lodash.orderby';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getTickPositions } from '@/Utils/getTickPosition';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n prefix: string;\r\n suffix: string;\r\n stripType: 'strip' | 'dot';\r\n highlightColor?: string;\r\n dotOpacity: number;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate: AnimateDataType;\r\n noOfTicks: number;\r\n dimmedOpacity: number;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n prefix,\r\n suffix,\r\n stripType,\r\n highlightColor,\r\n dotOpacity,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate,\r\n dimmedOpacity,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // 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,\r\n right: rightMargin,\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\r\n const sortedData = orderBy(\r\n dataWithId,\r\n [\r\n item => {\r\n const index = (highlightedDataPoints || []).indexOf(item.label);\r\n return index === -1 ? Infinity : index;\r\n },\r\n ],\r\n ['desc'],\r\n );\r\n const yMaxValue = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) < 0\r\n ? 0\r\n : Math.max(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const yMinValue = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position)) >= 0\r\n ? 0\r\n : Math.min(...data.filter(d => !checkIfNullOrUndefined(d.position)).map(d => d.position));\r\n const y = scaleLinear().domain([yMinValue, yMaxValue]).range([graphHeight, 0]).nice();\r\n const ticks = getTickPositions(noOfTicks, graphHeight);\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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {sortedData.map(d => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: graphWidth / 2,\r\n y: y(0),\r\n },\r\n whileInView: {\r\n x: graphWidth / 2,\r\n y: y(d.position),\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 0.95\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.95\r\n : dimmedOpacity\r\n : dotOpacity,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\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 {stripType === 'dot' ? (\r\n <motion.circle\r\n cy={0}\r\n cx={0}\r\n variants={{\r\n initial: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n />\r\n ) : (\r\n <motion.rect\r\n y={-1}\r\n height={2}\r\n variants={{\r\n initial: {\r\n x: 0 - radius,\r\n width: radius * 2,\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n },\r\n whileInView: {\r\n x: 0 - radius,\r\n width: radius * 2,\r\n fill:\r\n highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n />\r\n )}\r\n {highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n y={0}\r\n dy='0.33em'\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n x: 0 + radius + 3,\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n x: 0 + radius + 3,\r\n fill:\r\n valueColor ||\r\n (highlightColor && highlightedDataPoints\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? highlightColor\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]\r\n : data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)]),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-sm font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n >\r\n {numberFormattingFunction(d.position, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n {ticks.map((tick, i) => (\r\n <text\r\n key={i}\r\n y={tick}\r\n x={graphWidth / 2 + radius + 5}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn(\r\n 'fill-primary-gray-550 dark:fill-primary-gray-500 text-xs',\r\n classNames?.yAxis?.labels,\r\n )}\r\n >\r\n {numberFormattingFunction(y.invert(tick), 'NA', precision, prefix, suffix)}\r\n </text>\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 {\r\n Languages,\r\n SourcesDataType,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n data: StripChartDataType[];\r\n graphTitle?: string | React.ReactNode;\r\n graphDescription?: string | React.ReactNode;\r\n footNote?: string | React.ReactNode;\r\n width?: number;\r\n height?: number;\r\n sources?: SourcesDataType[];\r\n colors?: string | string[];\r\n colorDomain?: string[];\r\n colorLegendTitle?: string;\r\n radius?: number;\r\n backgroundColor?: string | boolean;\r\n padding?: string;\r\n leftMargin?: number;\r\n rightMargin?: number;\r\n topMargin?: number;\r\n bottomMargin?: number;\r\n relativeHeight?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints?: (string | number)[];\r\n showColorScale?: boolean;\r\n graphID?: string;\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n graphDownload?: boolean;\r\n dataDownload?: boolean;\r\n prefix?: string;\r\n suffix?: string;\r\n stripType?: 'strip' | 'dot';\r\n language?: Languages;\r\n highlightColor?: string;\r\n dotOpacity?: number;\r\n showNAColor?: boolean;\r\n minHeight?: number;\r\n theme?: 'light' | 'dark';\r\n ariaLabel?: string;\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 styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n valueColor?: string;\r\n animate?: boolean | AnimateDataType;\r\n noOfTicks?: number;\r\n dimmedOpacity?: number;\r\n precision?: number;\r\n customLayers?: CustomLayerDataType[];\r\n}\r\n\r\nexport function VerticalStripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 20,\r\n rightMargin = 20,\r\n topMargin = 10,\r\n bottomMargin = 10,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n prefix = '',\r\n suffix = '',\r\n stripType = 'dot',\r\n language = 'en',\r\n highlightColor,\r\n dotOpacity = 0.3,\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n valueColor,\r\n animate = false,\r\n noOfTicks = 2,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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 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 strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${\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 !== false && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\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 colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n valueColor={valueColor}\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 noOfTicks={noOfTicks}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { HorizontalStripChart } from './Horizontal';\r\nimport { VerticalStripChart } from './Vertical';\r\n\r\nimport {\r\n SourcesDataType,\r\n Languages,\r\n StripChartDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: StripChartDataType[];\r\n\r\n /** Orientation of the graph */\r\n orientation?: 'vertical' | 'horizontal';\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 or array of colors for circles */\r\n colors?: string | string[];\r\n /** Color of the highlighted data points */\r\n highlightColor?: string;\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color of value labels */\r\n valueColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n\r\n // Graph Parameters\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n /** Radius of the dots or width of the strips */\r\n radius?: number;\r\n /** Opacity of each dot or strip */\r\n dotOpacity?: number;\r\n /** Type of strip */\r\n stripType?: 'strip' | 'dot';\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\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 StripChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius,\r\n padding,\r\n backgroundColor,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n highlightedDataPoints,\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n noOfTicks,\r\n graphDownload,\r\n dataDownload,\r\n prefix,\r\n suffix,\r\n stripType,\r\n language,\r\n highlightColor,\r\n dotOpacity,\r\n showNAColor,\r\n minHeight,\r\n theme,\r\n ariaLabel,\r\n valueColor,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n orientation = 'vertical',\r\n styles,\r\n classNames,\r\n animate,\r\n dimmedOpacity = 0.3,\r\n precision,\r\n customLayers,\r\n } = props;\r\n\r\n if (orientation === 'vertical')\r\n return (\r\n <VerticalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n return (\r\n <HorizontalStripChart\r\n data={data}\r\n graphTitle={graphTitle}\r\n colors={colors}\r\n sources={sources}\r\n graphDescription={graphDescription}\r\n height={height}\r\n width={width}\r\n footNote={footNote}\r\n colorDomain={colorDomain}\r\n colorLegendTitle={colorLegendTitle}\r\n radius={radius}\r\n padding={padding}\r\n backgroundColor={backgroundColor}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n relativeHeight={relativeHeight}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n showColorScale={showColorScale}\r\n highlightedDataPoints={highlightedDataPoints}\r\n graphID={graphID}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n noOfTicks={noOfTicks}\r\n graphDownload={graphDownload}\r\n dataDownload={dataDownload}\r\n prefix={prefix}\r\n suffix={suffix}\r\n stripType={stripType}\r\n language={language}\r\n highlightColor={highlightColor}\r\n dotOpacity={dotOpacity}\r\n showNAColor={showNAColor}\r\n minHeight={minHeight}\r\n theme={theme}\r\n ariaLabel={ariaLabel}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n valueColor={valueColor}\r\n detailsOnClick={detailsOnClick}\r\n classNames={classNames}\r\n animate={animate}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n );\r\n}\r\n"],"names":["getTickPositions","count","width","step","_","i","Graph","props","data","height","colors","colorDomain","radius","leftMargin","rightMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","highlightedDataPoints","selectedColor","minValue","maxValue","onSeriesMouseClick","prefix","suffix","stripType","highlightColor","dotOpacity","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","valueColor","animate","noOfTicks","dimmedOpacity","precision","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","sortedData","orderBy","item","index","xMaxValue","checkIfNullOrUndefined","xMinValue","x","scaleLinear","ticks","jsxs","Fragment","jsx","motion","AnimatePresence","event","isEqual","el","Colors","cn","tick","numberFormattingFunction","Tooltip","Modal","string2HTML","HorizontalStripChart","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","GraphFooter","yMaxValue","yMinValue","y","VerticalStripChart","StripChart","orientation"],"m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