@undp/data-viz 1.4.11 → 1.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/DualAxisLineChart.cjs +1 -1
  2. package/dist/DualAxisLineChart.cjs.map +1 -1
  3. package/dist/DualAxisLineChart.d.ts +3 -1
  4. package/dist/DualAxisLineChart.js +232 -229
  5. package/dist/DualAxisLineChart.js.map +1 -1
  6. package/dist/{GraphEl-s3ctz7oA.js → GraphEl-B3xVlimz.js} +5 -1
  7. package/dist/GraphEl-B3xVlimz.js.map +1 -0
  8. package/dist/GraphEl-DO-juRN8.cjs +2 -0
  9. package/dist/GraphEl-DO-juRN8.cjs.map +1 -0
  10. package/dist/GriddedGraphs.cjs +1 -1
  11. package/dist/GriddedGraphs.d.ts +1 -0
  12. package/dist/GriddedGraphs.js +1 -1
  13. package/dist/GriddedGraphsFromConfig.d.ts +1 -0
  14. package/dist/MultiGraphDashboard.d.ts +1 -0
  15. package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
  16. package/dist/ParetoChart.cjs +1 -1
  17. package/dist/ParetoChart.cjs.map +1 -1
  18. package/dist/ParetoChart.d.ts +4 -0
  19. package/dist/ParetoChart.js +310 -306
  20. package/dist/ParetoChart.js.map +1 -1
  21. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
  22. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
  23. package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
  24. package/dist/ScrollStory.d.ts +1 -0
  25. package/dist/SingleGraphDashboard.cjs +1 -1
  26. package/dist/SingleGraphDashboard.d.ts +1 -0
  27. package/dist/SingleGraphDashboard.js +1 -1
  28. package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
  29. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
  30. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
  31. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
  32. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
  33. package/dist/ThreeDGlobe.cjs +1 -1
  34. package/dist/ThreeDGlobe.cjs.map +1 -1
  35. package/dist/ThreeDGlobe.js +73 -71
  36. package/dist/ThreeDGlobe.js.map +1 -1
  37. package/dist/Types.d.ts +1 -0
  38. package/dist/index.d.ts +8 -1
  39. package/package.json +1 -1
  40. package/dist/GraphEl-OzC-icbr.cjs +0 -2
  41. package/dist/GraphEl-OzC-icbr.cjs.map +0 -1
  42. package/dist/GraphEl-s3ctz7oA.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ParetoChart.js","sources":["../src/Components/Graphs/ParetoChart/Graph.tsx","../src/Components/Graphs/ParetoChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleBand, scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n ParetoChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\n\r\ninterface Props {\r\n data: ParetoChartDataType[];\r\n barColor: string;\r\n lineColor: string;\r\n axisTitles: [string, string];\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n barPadding: number;\r\n truncateBy: number;\r\n showLabels: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n noOfTicks: number;\r\n lineSuffix: string;\r\n barSuffix: string;\r\n linePrefix: string;\r\n showValues: boolean;\r\n barPrefix: string;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n naLabel: string;\r\n customLayers: CustomLayerDataType[];\r\n}\r\ninterface DataFormattedType {\r\n id: string;\r\n label: number | string;\r\n line?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n barColor,\r\n lineColor,\r\n axisTitles,\r\n sameAxes,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n showValues,\r\n onSeriesMouseOver,\r\n barPadding,\r\n truncateBy,\r\n showLabels,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n noOfTicks,\r\n lineSuffix,\r\n barSuffix,\r\n linePrefix,\r\n barPrefix,\r\n curveType,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n customLayers,\r\n naLabel,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const curve =\r\n curveType === 'linear'\r\n ? curveLinear\r\n : curveType === 'step'\r\n ? curveStep\r\n : curveType === 'stepAfter'\r\n ? curveStepAfter\r\n : curveType === 'stepBefore'\r\n ? curveStepBefore\r\n : curveMonotoneX;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n const x = scaleBand()\r\n .domain(dataWithId.map(d => `${d.id}`))\r\n .range([0, graphWidth])\r\n .paddingInner(barPadding);\r\n const minParam1 =\r\n Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape = line<DataFormattedType>()\r\n .defined(d => !checkIfNullOrUndefined(d.line))\r\n .x(d => (x(`${d.id}`) as number) + x.bandwidth() / 2)\r\n .y(d => y2(d.line as number))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfTicks);\r\n const y2Ticks = y2.ticks(noOfTicks);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: barColor,\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: barColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, barPrefix, barSuffix)}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: barColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: barColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[0].length > 100 ? `${axisTitles[0].substring(0, 100)}...` : axisTitles[0]\r\n }\r\n rotate90\r\n />\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColor,\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, linePrefix, lineSuffix)}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[1].length > 100 ? `${axisTitles[1].substring(0, 100)}...` : axisTitles[1]\r\n }\r\n rotate90\r\n />\r\n </g>\r\n <Axis\r\n y1={sameAxes ? y1(0) : graphHeight}\r\n y2={sameAxes ? y1(0) : graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.rect\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n attrY: d.bar ? (d.bar > 0 ? y1(d.bar) : y1(0)) : 0,\r\n height: d.bar ? Math.abs(y1(d.bar) - y1(0)) : 0,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n x={x(`${i}`)}\r\n width={x.bandwidth()}\r\n style={{ fill: barColor }}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.bar) ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n attrY: y1(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n attrY: y1(d.bar || 0),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n fill: barColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy={d.bar ? (d.bar >= 0 ? '-5px' : '1em') : '-5px'}\r\n >\r\n {numberFormattingFunction(d.bar, naLabel, precision, barPrefix, barSuffix)}\r\n </motion.text>\r\n ) : null}\r\n {showLabels ? (\r\n <XAxesLabels\r\n value={\r\n `${d.label}`.length < truncateBy\r\n ? `${d.label}`\r\n : `${`${d.label}`.substring(0, truncateBy)}...`\r\n }\r\n y={graphHeight + 5}\r\n x={x(`${d.id}`) as number}\r\n width={x.bandwidth()}\r\n height={margin.bottom}\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='top'\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <motion.path\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n d: lineShape(dataWithId.map(d => ({ ...d, line: 0 }))) as string,\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n d: lineShape(dataWithId) as string,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n stroke: lineColor,\r\n fill: 'none',\r\n strokeWidth: 2,\r\n }}\r\n />\r\n {dataWithId.map((d, i) => (\r\n <g key={i}>\r\n {!checkIfNullOrUndefined(d.line) ? (\r\n <g\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.circle\r\n exit={{\r\n cy: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n cy: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cy: y2(d.line as number),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n cx={(x(d.id) as number) + x.bandwidth() / 2}\r\n r={\r\n graphWidth / dataWithId.length < 5\r\n ? 0\r\n : graphWidth / dataWithId.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColor }}\r\n />\r\n {showValues ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n y: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n fill: lineColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n variants={{\r\n initial: {\r\n y: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y2(d.line as number),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy='-5px'\r\n >\r\n {numberFormattingFunction(\r\n d.line,\r\n naLabel,\r\n precision,\r\n linePrefix,\r\n lineSuffix,\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </g>\r\n ) : null}\r\n </g>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n Languages,\r\n ParetoChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ParetoChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color of the bars */\r\n barColor?: string;\r\n /** Color of the line */\r\n lineColor?: string;\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Padding between bars */\r\n barPadding?: number;\r\n\r\n // Values and Ticks\r\n /** Suffix for values of the lines */\r\n lineSuffix?: string;\r\n /** Suffix for values of the bars */\r\n barSuffix?: string;\r\n /** Prefix for values of the lines */\r\n linePrefix?: string;\r\n /** Prefix for values of the bars */\r\n barPrefix?: string;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Enables same axis for bars and line */\r\n sameAxes?: boolean;\r\n /** Title for the bar axis */\r\n barAxisTitle?: string;\r\n /** Title for the line axis */\r\n lineAxisTitle?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ParetoChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n padding,\r\n lineColor = Colors.light.categoricalColors.colors[1],\r\n barColor = Colors.light.categoricalColors.colors[0],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n lineAxisTitle = 'Line chart',\r\n barAxisTitle = 'Bar graph',\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n barPadding = 0.25,\r\n truncateBy = 999,\r\n showLabels = true,\r\n onSeriesMouseClick,\r\n language = 'en',\r\n colorLegendTitle,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n showValues = true,\r\n noOfTicks = 5,\r\n lineSuffix = '',\r\n barSuffix = '',\r\n linePrefix = '',\r\n barPrefix = '',\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n customLayers = [],\r\n naLabel = 'NA',\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a pareto chart that shows a variable as bars and another as line chart.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n <ColorLegend\r\n colorDomain={[barAxisTitle, lineAxisTitle]}\r\n colors={[\r\n barColor || Colors[theme].categoricalColors.colors[0],\r\n lineColor || Colors[theme].categoricalColors.colors[1],\r\n ]}\r\n colorLegendTitle={colorLegendTitle}\r\n showNAColor={false}\r\n />\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n sameAxes={sameAxes}\r\n lineColor={lineColor}\r\n barColor={barColor}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n truncateBy={truncateBy}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n axisTitles={[barAxisTitle, lineAxisTitle]}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n barPadding={barPadding}\r\n showLabels={showLabels}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n noOfTicks={noOfTicks}\r\n lineSuffix={lineSuffix}\r\n barSuffix={barSuffix}\r\n linePrefix={linePrefix}\r\n barPrefix={barPrefix}\r\n curveType={curveType}\r\n showValues={showValues}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n precision={precision}\r\n customLayers={customLayers}\r\n naLabel={naLabel}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","barColor","lineColor","axisTitles","sameAxes","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","showValues","onSeriesMouseOver","barPadding","truncateBy","showLabels","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","noOfTicks","lineSuffix","barSuffix","linePrefix","barPrefix","curveType","styles","classNames","animate","precision","customLayers","naLabel","svgRef","useRef","isInView","useInView","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","i","x","scaleBand","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","y1","scaleLinear","y2","lineShape","line","checkIfNullOrUndefined","y1Ticks","y2Ticks","jsxs","Fragment","jsx","motion","cn","numberFormattingFunction","Axis","AxisTitle","AnimatePresence","event","isEqual","XAxesLabels","Tooltip","Modal","string2HTML","ParetoChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","lineAxisTitle","barAxisTitle","relativeHeight","graphID","graphDownload","dataDownload","language","colorLegendTitle","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2EO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mB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AAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ParetoChart.js","sources":["../src/Components/Graphs/ParetoChart/Graph.tsx","../src/Components/Graphs/ParetoChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleBand, scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n ParetoChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\n\r\ninterface Props {\r\n data: ParetoChartDataType[];\r\n barColor: string;\r\n lineColor: string;\r\n axisTitles: [string, string];\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n barPadding: number;\r\n truncateBy: number;\r\n showLabels: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n noOfTicks: number;\r\n lineSuffix: string;\r\n barSuffix: string;\r\n linePrefix: string;\r\n showValues: boolean;\r\n barPrefix: string;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n naLabel: string;\r\n customLayers: CustomLayerDataType[];\r\n showAxisLabels: boolean;\r\n}\r\ninterface DataFormattedType {\r\n id: string;\r\n label: number | string;\r\n line?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n barColor,\r\n lineColor,\r\n axisTitles,\r\n sameAxes,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n showValues,\r\n onSeriesMouseOver,\r\n barPadding,\r\n truncateBy,\r\n showLabels,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n noOfTicks,\r\n lineSuffix,\r\n barSuffix,\r\n linePrefix,\r\n barPrefix,\r\n curveType,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n customLayers,\r\n naLabel,\r\n showAxisLabels,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const curve =\r\n curveType === 'linear'\r\n ? curveLinear\r\n : curveType === 'step'\r\n ? curveStep\r\n : curveType === 'stepAfter'\r\n ? curveStepAfter\r\n : curveType === 'stepBefore'\r\n ? curveStepBefore\r\n : curveMonotoneX;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n const x = scaleBand()\r\n .domain(dataWithId.map(d => `${d.id}`))\r\n .range([0, graphWidth])\r\n .paddingInner(barPadding);\r\n const minParam1 =\r\n Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape = line<DataFormattedType>()\r\n .defined(d => !checkIfNullOrUndefined(d.line))\r\n .x(d => (x(`${d.id}`) as number) + x.bandwidth() / 2)\r\n .y(d => y2(d.line as number))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfTicks);\r\n const y2Ticks = y2.ticks(noOfTicks);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: barColor,\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: barColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, barPrefix, barSuffix)}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: barColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: barColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[0].length > 100\r\n ? `${axisTitles[0].substring(0, 100)}...`\r\n : axisTitles[0]\r\n }\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColor,\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, linePrefix, lineSuffix)}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[1].length > 100\r\n ? `${axisTitles[1].substring(0, 100)}...`\r\n : axisTitles[1]\r\n }\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <Axis\r\n y1={sameAxes ? y1(0) : graphHeight}\r\n y2={sameAxes ? y1(0) : graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.rect\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n attrY: d.bar ? (d.bar > 0 ? y1(d.bar) : y1(0)) : 0,\r\n height: d.bar ? Math.abs(y1(d.bar) - y1(0)) : 0,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n x={x(`${i}`)}\r\n width={x.bandwidth()}\r\n style={{ fill: barColor }}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.bar) ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n attrY: y1(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n attrY: y1(d.bar || 0),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n fill: barColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy={d.bar ? (d.bar >= 0 ? '-5px' : '1em') : '-5px'}\r\n >\r\n {numberFormattingFunction(d.bar, naLabel, precision, barPrefix, barSuffix)}\r\n </motion.text>\r\n ) : null}\r\n {showLabels ? (\r\n <XAxesLabels\r\n value={\r\n `${d.label}`.length < truncateBy\r\n ? `${d.label}`\r\n : `${`${d.label}`.substring(0, truncateBy)}...`\r\n }\r\n y={graphHeight + 5}\r\n x={x(`${d.id}`) as number}\r\n width={x.bandwidth()}\r\n height={margin.bottom}\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='top'\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <motion.path\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n d: lineShape(dataWithId.map(d => ({ ...d, line: 0 }))) as string,\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n d: lineShape(dataWithId) as string,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n style={{\r\n stroke: lineColor,\r\n fill: 'none',\r\n strokeWidth: 2,\r\n }}\r\n />\r\n {dataWithId.map((d, i) => (\r\n <g key={i}>\r\n {!checkIfNullOrUndefined(d.line) ? (\r\n <g\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.circle\r\n exit={{\r\n cy: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n cy: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cy: y2(d.line as number),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n cx={(x(d.id) as number) + x.bandwidth() / 2}\r\n r={\r\n graphWidth / dataWithId.length < 5\r\n ? 0\r\n : graphWidth / dataWithId.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColor }}\r\n />\r\n {showValues ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n y: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n fill: lineColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n variants={{\r\n initial: {\r\n y: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y2(d.line as number),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy='-5px'\r\n >\r\n {numberFormattingFunction(\r\n d.line,\r\n naLabel,\r\n precision,\r\n linePrefix,\r\n lineSuffix,\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </g>\r\n ) : null}\r\n </g>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n Languages,\r\n ParetoChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ParetoChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color of the bars */\r\n barColor?: string;\r\n /** Color of the line */\r\n lineColor?: string;\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Padding between bars */\r\n barPadding?: number;\r\n\r\n // Values and Ticks\r\n /** Suffix for values of the lines */\r\n lineSuffix?: string;\r\n /** Suffix for values of the bars */\r\n barSuffix?: string;\r\n /** Prefix for values of the lines */\r\n linePrefix?: string;\r\n /** Prefix for values of the bars */\r\n barPrefix?: string;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Enables same axis for bars and line */\r\n sameAxes?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of labels of the axis. */\r\n showAxisLabels?: boolean;\r\n /** Title for the bar axis */\r\n barAxisTitle?: string;\r\n /** Title for the line axis */\r\n lineAxisTitle?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ParetoChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n padding,\r\n lineColor = Colors.light.categoricalColors.colors[1],\r\n barColor = Colors.light.categoricalColors.colors[0],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n lineAxisTitle = 'Line chart',\r\n barAxisTitle = 'Bar graph',\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n barPadding = 0.25,\r\n truncateBy = 999,\r\n showLabels = true,\r\n onSeriesMouseClick,\r\n language = 'en',\r\n colorLegendTitle,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n showValues = true,\r\n noOfTicks = 5,\r\n lineSuffix = '',\r\n barSuffix = '',\r\n linePrefix = '',\r\n barPrefix = '',\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n customLayers = [],\r\n naLabel = 'NA',\r\n showColorScale = true,\r\n showAxisLabels = true,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a pareto chart that shows a variable as bars and another as line chart.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? null : (\r\n <ColorLegend\r\n colorDomain={[barAxisTitle, lineAxisTitle]}\r\n colors={[\r\n barColor || Colors[theme].categoricalColors.colors[0],\r\n lineColor || Colors[theme].categoricalColors.colors[1],\r\n ]}\r\n colorLegendTitle={colorLegendTitle}\r\n showNAColor={false}\r\n />\r\n )}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n sameAxes={sameAxes}\r\n lineColor={lineColor}\r\n barColor={barColor}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n truncateBy={truncateBy}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n axisTitles={[barAxisTitle, lineAxisTitle]}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n barPadding={barPadding}\r\n showLabels={showLabels}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n noOfTicks={noOfTicks}\r\n lineSuffix={lineSuffix}\r\n barSuffix={barSuffix}\r\n linePrefix={linePrefix}\r\n barPrefix={barPrefix}\r\n curveType={curveType}\r\n showValues={showValues}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n precision={precision}\r\n customLayers={customLayers}\r\n naLabel={naLabel}\r\n showAxisLabels={showAxisLabels}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","barColor","lineColor","axisTitles","sameAxes","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","showValues","onSeriesMouseOver","barPadding","truncateBy","showLabels","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","noOfTicks","lineSuffix","barSuffix","linePrefix","barPrefix","curveType","styles","classNames","animate","precision","customLayers","naLabel","showAxisLabels","svgRef","useRef","isInView","useInView","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","i","x","scaleBand","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","y1","scaleLinear","y2","lineShape","line","checkIfNullOrUndefined","y1Ticks","y2Ticks","jsxs","Fragment","jsx","motion","cn","numberFormattingFunction","Axis","AxisTitle","AnimatePresence","event","isEqual","XAxesLabels","Tooltip","Modal","string2HTML","ParetoChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","lineAxisTitle","barAxisTitle","relativeHeight","graphID","graphDownload","dataDownload","language","colorLegendTitle","minHeight","theme","ariaLabel","showColorScale","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4EO,SAASA,GAAMC,IAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,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,oBAEtB,SAAAgE;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA5F;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -455,6 +455,7 @@ declare interface GraphSettingsDataType {
455
455
  globeCurvatureResolution?: number;
456
456
  lightColor?: string;
457
457
  fogSetting?: FogDataType;
458
+ showAxisLabels?: boolean;
458
459
  }
459
460
 
460
461
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -474,6 +474,7 @@ declare interface GraphSettingsDataType {
474
474
  globeCurvatureResolution?: number;
475
475
  lightColor?: string;
476
476
  fogSetting?: FogDataType;
477
+ showAxisLabels?: boolean;
477
478
  }
478
479
 
479
480
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -377,6 +377,7 @@ declare interface GraphSettingsDataType {
377
377
  globeCurvatureResolution?: number;
378
378
  lightColor?: string;
379
379
  fogSetting?: FogDataType;
380
+ showAxisLabels?: boolean;
380
381
  }
381
382
 
382
383
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -383,6 +383,7 @@ declare interface GraphSettingsDataType {
383
383
  globeCurvatureResolution?: number;
384
384
  lightColor?: string;
385
385
  fogSetting?: FogDataType;
386
+ showAxisLabels?: boolean;
386
387
  }
387
388
 
388
389
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),ae=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),te=require("./index-BXns0-ng.cjs"),C=require("./DropdownSelect-BmE5JaeE.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),le=require("./Typography-k-kOjICQ.cjs"),ne=require("./Spinner-DA6Z5E4n.cjs"),re=require("./GraphEl-OzC-icbr.cjs"),G=require("./fetchAndParseData-CQyVGCul.cjs"),U=require("./transformDataForAggregation-Du-Hei-W.cjs"),z=require("./getUniqValue-CHqgSss5.cjs"),ie=require("./GraphHeader.cjs"),W=require("./filterData-DN6py7y_.cjs"),oe=require("./getGraphList-gf02xgT2.cjs"),Z=require("./transformDataForSelect-YmStusCI.cjs"),se=s=>{if(s.findIndex(r=>r.chartConfigId==="yMin")!==-1&&s.findIndex(r=>r.chartConfigId==="yMax")!==-1)return s;const l=[...s];return s.findIndex(r=>r.chartConfigId==="yMin")===-1&&l.push({chartConfigId:"yMin",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Min`}),s.findIndex(r=>r.chartConfigId==="yMax")===-1&&l.push({chartConfigId:"yMax",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Max`}),l},F=(s,l)=>{const r=l?.map(y=>{const f=s?.findIndex(i=>i.chartConfigId===y.chartConfigId);if(f===-1)return{};const v=s[f]?.allowedColumnIds?.findIndex(i=>i.value===y.columnId);return v===-1?{}:s[f].allowedColumnIds[v].graphSettings||{}})||[];return Object.assign({},...r)};function ue(s){const{graphSettings:l,dataSettings:r,filters:y,graphType:f,dataTransform:v,graphDataConfiguration:i,dataFilters:q,debugMode:D,dataSelectionOptions:j,advancedDataSelectionOptions:N,readableHeader:J,noOfFiltersPerRow:p=4,updateFilters:B,uiMode:g="normal",highlightDataPointSettings:I}=s,[b,K]=o.useState(void 0),[S,Q]=o.useState(void 0),[m,w]=o.useState(i),[x,R]=o.useState({}),[V,X]=o.useState(void 0),[Y,_]=o.useState([]),P=o.useRef(null),H=o.useRef(i),[E,O]=o.useState([]),k=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),L=o.useCallback(async()=>{if(r)try{const d=await(r.dataURL?typeof r.dataURL=="string"?r.fileType==="json"?G.fetchAndParseJSON(r.dataURL,r.columnsToArray,r.dataTransformation,D):r.fileType==="api"?G.fetchAndTransformDataFromAPI(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,D):G.fetchAndParseCSV(r.dataURL,r.dataTransformation,r.columnsToArray,D,r.delimiter,!0):G.fetchAndParseMultipleDataSources(r.dataURL,r.idColumnTitle):G.transformColumnsToArray(r.data,r.columnsToArray));Q(d);const a=(y||[]).map(t=>({filter:t.column,label:t.label||`Filter by ${t.column}`,singleSelect:t.singleSelect,clearable:t.clearable,defaultValue:Z.transformDefaultValue(t.defaultValue),value:Z.transformDefaultValue(t.defaultValue),availableValues:z.getUniqValue(d,t.column).filter(u=>!t.excludeValues?.includes(`${u}`)).map(u=>({value:u,label:u})),allowSelectAll:t.allowSelectAll,width:t.width}));O(a)}catch(e){console.error("Data fetching error:",e)}},[r,y,D]);o.useEffect(()=>{L()},[L]);const $=o.useMemo(()=>!S||E.length===0?S:S.filter(d=>E.every(a=>a.value&&A.flattenDeep([a.value]).length>0?ae.intersection(A.flattenDeep([d[a.filter]]),A.flattenDeep([a.value]).map(t=>t.value)).length>0:!0)),[E,S]);o.useEffect(()=>{j&&R(F(j,i))},[j,i]),o.useEffect(()=>{S&&K($)},[$,f,S]),o.useEffect(()=>{I?.column&&$&&_(z.getUniqValue($,I.column).filter(e=>!I?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[$,I]),o.useEffect(()=>{te.isEqual(H.current,i)||(w(i),H.current=i)},[i]);const M=o.useCallback((e,d)=>{O(a=>a.map(t=>t.filter===e?{...t,value:d}:t))},[]),ee=o.useMemo(()=>{if(!b)return;const e=f==="lineChartWithConfidenceInterval"&&m?se(m):m;return U.transformDataForGraph(v?U.transformDataForAggregation(W.filterData(b,q||[]),v.keyColumn,v.aggregationColumnsSetting):W.filterData(b,q||[]),f,e)},[f,m,b,q,v]);return r?n.jsxRuntimeExports.jsx("div",{className:`${l?.theme||"light"} flex ${l?.width?"w-fit grow-0":"w-full grow"}${l?.height?"":" h-full"}`,dir:l?.language==="he"||l?.language==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${l?.backgroundColor?l?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l?.language||"en"}`,l?.classNames?.graphContainer),style:{...l?.styles?.graphContainer||{},...l?.backgroundColor&&l?.backgroundColor!==!0?{backgroundColor:l?.backgroundColor}:{}},id:l?.graphID,ref:P,children:n.jsxRuntimeExports.jsx("div",{style:{padding:l?.backgroundColor?l?.padding||"1rem":l?.padding||0,flexGrow:1,display:"flex"},children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:b||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(f)!==-1?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||l?.graphTitle||l?.graphDescription||l?.graphDownload||l?.dataDownload?n.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:x?.styles?.title||l?.styles?.title,description:x?.styles?.description||l?.styles?.description},classNames:{title:x?.classNames?.title||l?.classNames?.title,description:x?.classNames?.description||l?.classNames?.description},graphTitle:x?.graphTitle||l?.graphTitle,graphDescription:x?.graphDescription||l?.graphDescription,width:x?.width||l?.width,graphDownload:l?.graphDownload?P.current:void 0,dataDownload:l?.dataDownload&&b&&b.length>0?b:null}):null,E.length!==0||(j||[]).length!==0||(N||[]).length!==0||I?n.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[N?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),w(a?.dataConfiguration)}}):n.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:g,onValueChange:a=>{const t=e.options[e.options.findIndex(u=>u.label===a)];R(t.graphSettings||{}),w(t.dataConfiguration)},children:e.options.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),j?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Hu(k),onChange:a=>{const t={columnId:(a||[]).map(c=>c.value),chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)}}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:a.label,value:a.label},t))}):e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);R(F(j,u)),w(u)}}):n.jsxRuntimeExports.jsx(h.fe,{variant:g,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const u={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},c=m?.map(T=>T.chartConfigId===u.chartConfigId?u:T);R(F(j,c)),w(c)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),E?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{M(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?n.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{M(e.filter,e.availableValues)},children:"Select all options"}):null]})]},d)),I?n.jsxRuntimeExports.jsxs("div",{style:{width:I.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:I.label||"Highlight data"}),n.jsxRuntimeExports.jsx(C.Za,{options:Y,variant:g,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:e=>{X(e?.map(d=>d.value))},value:V?.map(e=>({label:e,value:e})),defaultValue:I.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,n.jsxRuntimeExports.jsx(re.GraphEl,{graph:f,graphData:ee,graphDataConfiguration:m,debugMode:D,readableHeader:J||[],updateFilters:B,settings:{...l||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:l?.theme,...V?{highlightedDataPoints:V,highlightedIds:V?.map(e=>`${e}`),highlightedLines:V?.map(e=>e)}:{}}})]}):n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(ne.y,{})})})})})}):n.jsxRuntimeExports.jsx(le.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboard=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),o=require("react"),ae=require("./index-Ds0uHjK9.cjs"),A=require("./index-B0rbzOoC.cjs"),te=require("./index-BXns0-ng.cjs"),C=require("./DropdownSelect-BmE5JaeE.cjs"),h=require("./checkIfMultiple-BXbHUCWM.cjs"),le=require("./Typography-k-kOjICQ.cjs"),ne=require("./Spinner-DA6Z5E4n.cjs"),re=require("./GraphEl-DO-juRN8.cjs"),G=require("./fetchAndParseData-CQyVGCul.cjs"),U=require("./transformDataForAggregation-Du-Hei-W.cjs"),z=require("./getUniqValue-CHqgSss5.cjs"),ie=require("./GraphHeader.cjs"),W=require("./filterData-DN6py7y_.cjs"),oe=require("./getGraphList-gf02xgT2.cjs"),Z=require("./transformDataForSelect-YmStusCI.cjs"),se=s=>{if(s.findIndex(r=>r.chartConfigId==="yMin")!==-1&&s.findIndex(r=>r.chartConfigId==="yMax")!==-1)return s;const l=[...s];return s.findIndex(r=>r.chartConfigId==="yMin")===-1&&l.push({chartConfigId:"yMin",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Min`}),s.findIndex(r=>r.chartConfigId==="yMax")===-1&&l.push({chartConfigId:"yMax",columnId:`${s[s.findIndex(r=>r.chartConfigId==="y")].columnId}Max`}),l},F=(s,l)=>{const r=l?.map(y=>{const f=s?.findIndex(i=>i.chartConfigId===y.chartConfigId);if(f===-1)return{};const v=s[f]?.allowedColumnIds?.findIndex(i=>i.value===y.columnId);return v===-1?{}:s[f].allowedColumnIds[v].graphSettings||{}})||[];return Object.assign({},...r)};function ue(s){const{graphSettings:l,dataSettings:r,filters:y,graphType:f,dataTransform:v,graphDataConfiguration:i,dataFilters:q,debugMode:D,dataSelectionOptions:j,advancedDataSelectionOptions:N,readableHeader:J,noOfFiltersPerRow:p=4,updateFilters:B,uiMode:g="normal",highlightDataPointSettings:I}=s,[b,K]=o.useState(void 0),[S,Q]=o.useState(void 0),[m,w]=o.useState(i),[x,R]=o.useState({}),[V,X]=o.useState(void 0),[Y,_]=o.useState([]),P=o.useRef(null),H=o.useRef(i),[E,O]=o.useState([]),k=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),L=o.useCallback(async()=>{if(r)try{const d=await(r.dataURL?typeof r.dataURL=="string"?r.fileType==="json"?G.fetchAndParseJSON(r.dataURL,r.columnsToArray,r.dataTransformation,D):r.fileType==="api"?G.fetchAndTransformDataFromAPI(r.dataURL,r.apiHeaders,r.columnsToArray,r.dataTransformation,D):G.fetchAndParseCSV(r.dataURL,r.dataTransformation,r.columnsToArray,D,r.delimiter,!0):G.fetchAndParseMultipleDataSources(r.dataURL,r.idColumnTitle):G.transformColumnsToArray(r.data,r.columnsToArray));Q(d);const a=(y||[]).map(t=>({filter:t.column,label:t.label||`Filter by ${t.column}`,singleSelect:t.singleSelect,clearable:t.clearable,defaultValue:Z.transformDefaultValue(t.defaultValue),value:Z.transformDefaultValue(t.defaultValue),availableValues:z.getUniqValue(d,t.column).filter(u=>!t.excludeValues?.includes(`${u}`)).map(u=>({value:u,label:u})),allowSelectAll:t.allowSelectAll,width:t.width}));O(a)}catch(e){console.error("Data fetching error:",e)}},[r,y,D]);o.useEffect(()=>{L()},[L]);const $=o.useMemo(()=>!S||E.length===0?S:S.filter(d=>E.every(a=>a.value&&A.flattenDeep([a.value]).length>0?ae.intersection(A.flattenDeep([d[a.filter]]),A.flattenDeep([a.value]).map(t=>t.value)).length>0:!0)),[E,S]);o.useEffect(()=>{j&&R(F(j,i))},[j,i]),o.useEffect(()=>{S&&K($)},[$,f,S]),o.useEffect(()=>{I?.column&&$&&_(z.getUniqValue($,I.column).filter(e=>!I?.excludeValues?.includes(`${e}`)).map(e=>({value:e,label:e})))},[$,I]),o.useEffect(()=>{te.isEqual(H.current,i)||(w(i),H.current=i)},[i]);const M=o.useCallback((e,d)=>{O(a=>a.map(t=>t.filter===e?{...t,value:d}:t))},[]),ee=o.useMemo(()=>{if(!b)return;const e=f==="lineChartWithConfidenceInterval"&&m?se(m):m;return U.transformDataForGraph(v?U.transformDataForAggregation(W.filterData(b,q||[]),v.keyColumn,v.aggregationColumnsSetting):W.filterData(b,q||[]),f,e)},[f,m,b,q,v]);return r?n.jsxRuntimeExports.jsx("div",{className:`${l?.theme||"light"} flex ${l?.width?"w-fit grow-0":"w-full grow"}${l?.height?"":" h-full"}`,dir:l?.language==="he"||l?.language==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${l?.backgroundColor?l?.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${l?.language||"en"}`,l?.classNames?.graphContainer),style:{...l?.styles?.graphContainer||{},...l?.backgroundColor&&l?.backgroundColor!==!0?{backgroundColor:l?.backgroundColor}:{}},id:l?.graphID,ref:P,children:n.jsxRuntimeExports.jsx("div",{style:{padding:l?.backgroundColor?l?.padding||"1rem":l?.padding||0,flexGrow:1,display:"flex"},children:n.jsxRuntimeExports.jsx("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:b||oe.graphList.filter(e=>e.geoHubMapPresentation).map(e=>e.graphID).indexOf(f)!==-1?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[x?.graphTitle||x?.graphDescription||l?.graphTitle||l?.graphDescription||l?.graphDownload||l?.dataDownload?n.jsxRuntimeExports.jsx(ie.GraphHeader,{styles:{title:x?.styles?.title||l?.styles?.title,description:x?.styles?.description||l?.styles?.description},classNames:{title:x?.classNames?.title||l?.classNames?.title,description:x?.classNames?.description||l?.classNames?.description},graphTitle:x?.graphTitle||l?.graphTitle,graphDescription:x?.graphDescription||l?.graphDescription,width:x?.width||l?.width,graphDownload:l?.graphDownload?P.current:void 0,dataDownload:l?.dataDownload&&b&&b.length>0?b:null}):null,E.length!==0||(j||[]).length!==0||(N||[]).length!==0||I?n.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%"},children:[N?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.options.map(a=>({...a,value:a.label})),size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),w(a?.dataConfiguration)}}):n.jsxRuntimeExports.jsx(h.fe,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:g,onValueChange:a=>{const t=e.options[e.options.findIndex(u=>u.label===a)];R(t.graphSettings||{}),w(t.dataConfiguration)},children:e.options.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),j?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:e.ui!=="radio"?0:1,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),h.checkIfMultiple(e.chartConfigId,m||[])?e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isMulti:!0,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]):void 0,filterOption:C.Hu(k),onChange:a=>{const t={columnId:(a||[]).map(c=>c.value),chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)}}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:i?i[i.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(t=>t.value===a)]).map(a=>a.value):[],onValueChange:a=>{const t={columnId:a||[],chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);w(u)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:a.label,value:a.label},t))}):e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.allowedColumnIds,size:"sm",isClearable:!1,isSearchable:!0,variant:g,controlShouldRenderValue:!0,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)]:void 0,onChange:a=>{const t={columnId:a?.value,chartConfigId:e.chartConfigId},u=m?.map(c=>c.chartConfigId===t.chartConfigId?t:c);R(F(j,u)),w(u)}}):n.jsxRuntimeExports.jsx(h.fe,{variant:g,defaultValue:i?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===i[i.findIndex(t=>t.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const u={columnId:e.allowedColumnIds[e.allowedColumnIds.findIndex(T=>T.label===a)].value,chartConfigId:e.chartConfigId},c=m?.map(T=>T.chartConfigId===u.chartConfigId?u:T);R(F(j,c)),w(c)},children:e.allowedColumnIds.map((a,t)=>n.jsxRuntimeExports.jsx(h.ve,{label:a.label,value:a.label},t))})]},d)),E?.map((e,d)=>n.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:e.label}),e.singleSelect?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?n.jsxRuntimeExports.jsx(C.Za,{options:e.availableValues,variant:g,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:a=>{M(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):n.jsxRuntimeExports.jsx(h.w,{variant:g,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{M(e.filter,e.availableValues.filter(t=>a.indexOf(`${t.value}`)!==-1))},children:e.availableValues.map((a,t)=>n.jsxRuntimeExports.jsx(h.G,{label:`${a.label}`,value:`${a.value}`},t))}),e.allowSelectAll?n.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{M(e.filter,e.availableValues)},children:"Select all options"}):null]})]},d)),I?n.jsxRuntimeExports.jsxs("div",{style:{width:I.width||`calc(${100/p}% - ${(p-1)/p}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[n.jsxRuntimeExports.jsx(h.f,{className:"mb-2",children:I.label||"Highlight data"}),n.jsxRuntimeExports.jsx(C.Za,{options:Y,variant:g,size:"sm",isMulti:!0,isClearable:!0,isSearchable:!0,controlShouldRenderValue:!0,filterOption:C.Hu(k),onChange:e=>{X(e?.map(d=>d.value))},value:V?.map(e=>({label:e,value:e})),defaultValue:I.defaultValues?.map(e=>({label:e,value:e}))})]}):null]}):null,n.jsxRuntimeExports.jsx(re.GraphEl,{graph:f,graphData:ee,graphDataConfiguration:m,debugMode:D,readableHeader:J||[],updateFilters:B,settings:{...l||{},...x,graphTitle:void 0,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",theme:l?.theme,...V?{highlightedDataPoints:V,highlightedIds:V?.map(e=>`${e}`),highlightedLines:V?.map(e=>e)}:{}}})]}):n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:n.jsxRuntimeExports.jsx(ne.y,{})})})})})}):n.jsxRuntimeExports.jsx(le.u,{size:"xs",className:"text-center text-accent-dark-red dark:text-accent-red p-2",children:"Please make sure either `dataSettings` props are present as they are required for data."})}exports.SingleGraphDashboard=ue;
2
2
  //# sourceMappingURL=SingleGraphDashboard.cjs.map
@@ -431,6 +431,7 @@ declare interface GraphSettingsDataType {
431
431
  globeCurvatureResolution?: number;
432
432
  lightColor?: string;
433
433
  fogSetting?: FogDataType;
434
+ showAxisLabels?: boolean;
434
435
  }
435
436
 
436
437
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -7,7 +7,7 @@ import { Z as y, H as N } from "./DropdownSelect-CeHog_ih.js";
7
7
  import { f as F, a as J, v as B, c as ca, w as K, G as Q } from "./checkIfMultiple-ChTJk2Tk.js";
8
8
  import { u as ha } from "./Typography-Ctgfl1J5.js";
9
9
  import { y as fa } from "./Spinner-C85UF28E.js";
10
- import { G as ga } from "./GraphEl-s3ctz7oA.js";
10
+ import { G as ga } from "./GraphEl-B3xVlimz.js";
11
11
  import { f as pa, a as ma, b as Ca, c as xa, t as Ia } from "./fetchAndParseData-4gsYTy6_.js";
12
12
  import { a as va, t as ba } from "./transformDataForAggregation-CdcwlnNe.js";
13
13
  import { g as X } from "./getUniqValue-BtUENB2H.js";
@@ -454,6 +454,7 @@ declare interface GraphSettingsDataType {
454
454
  globeCurvatureResolution?: number;
455
455
  lightColor?: string;
456
456
  fogSetting?: FogDataType;
457
+ showAxisLabels?: boolean;
457
458
  }
458
459
 
459
460
  declare type GraphType = GraphTypeForGriddedGraph;
@@ -346,6 +346,7 @@ declare interface GraphSettingsDataType {
346
346
  globeCurvatureResolution?: number;
347
347
  lightColor?: string;
348
348
  fogSetting?: FogDataType;
349
+ showAxisLabels?: boolean;
349
350
  }
350
351
 
351
352
  declare interface HighlightAreaSettingsDataType {
@@ -353,6 +353,7 @@ declare interface GraphSettingsDataType {
353
353
  globeCurvatureResolution?: number;
354
354
  lightColor?: string;
355
355
  fogSetting?: FogDataType;
356
+ showAxisLabels?: boolean;
356
357
  }
357
358
 
358
359
  declare interface HighlightAreaSettingsDataType {
@@ -431,6 +431,7 @@ declare interface GraphSettingsDataType {
431
431
  globeCurvatureResolution?: number;
432
432
  lightColor?: string;
433
433
  fogSetting?: FogDataType;
434
+ showAxisLabels?: boolean;
434
435
  }
435
436
 
436
437
  declare interface HighlightAreaSettingsDataType {
@@ -454,6 +454,7 @@ declare interface GraphSettingsDataType {
454
454
  globeCurvatureResolution?: number;
455
455
  lightColor?: string;
456
456
  fogSetting?: FogDataType;
457
+ showAxisLabels?: boolean;
457
458
  }
458
459
 
459
460
  declare interface HighlightAreaSettingsDataType {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),a=require("react"),pe=require("./Spinner-DA6Z5E4n.cjs"),he=require("react-globe.gl"),me=require("./index-BXns0-ng.cjs"),xe=require("three"),fe=require("./Modal-tXZlLE5s.cjs"),de=require("./Typography-k-kOjICQ.cjs"),ye=require("./Tooltip-n8z5bfav.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./index-BW_-wD2k.cjs"),be=require("./string2HTML-D2Avudmb.cjs"),Ee=require("./ordinal-BOeNbyae.cjs"),Ce=require("./threshold-DNsSUf8Q.cjs"),Re=require("./GraphHeader.cjs"),we=require("./GraphFooter.cjs"),De=require("./fetchAndParseData-CQyVGCul.cjs"),O=require("./Colors.cjs"),Se=require("./getUniqValue-CHqgSss5.cjs"),ke=require("./getJenks-TWQvbuOz.cjs");function Ne(y){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const c in y)if(c!=="default"){const u=Object.getOwnPropertyDescriptor(y,c);Object.defineProperty(d,c,u.get?u:{enumerable:!0,get:()=>y[c]})}}return d.default=y,Object.freeze(d)}const z=Ne(xe);function Me(y){const{width:d,autoRotate:c,data:u,enableZoom:T,categorical:M,colorDomain:g,colors:s,globeMaterial:i,height:Z,polygonData:Y,mapProperty:p,mapBorderColor:P,atmosphereColor:I,tooltip:U,styles:b,classNames:K,mapNoDataColor:h,colorLegendTitle:H,showColorScale:Q,hoverStrokeColor:ee,detailsOnClick:j,onSeriesMouseClick:E,onSeriesMouseOver:m,resetSelectionOnDoubleClick:q,highlightedIds:W,scale:x,globeOffset:C,polygonAltitude:A,centerLng:$,centerLat:F,atmosphereAltitude:V,globeCurvatureResolution:te,lightColor:G,fogSettings:D}=y,n=a.useRef(void 0),[S,L]=a.useState(void 0),[re,_]=a.useState(!(d<680)),[J,oe]=a.useState({x:0,y:0}),[R,se]=a.useState(void 0),X=M?Ee.ordinal().domain(g).range(s):Ce.threshold().domain(g).range(s);a.useEffect(()=>{n.current&&(n.current.controls().enableZoom=T)},[T]),a.useEffect(()=>{n.current&&(R?n.current.controls().autoRotate=!1:(n.current.controls().autoRotate=c!==0,n.current.controls().autoRotateSpeed=c))},[R,c]),a.useEffect(()=>{const e=n.current?.renderer().domElement;if(!e)return;const r=o=>{oe({x:o.clientX,y:o.clientY})};return e.addEventListener("mousemove",r),()=>e.removeEventListener("mousemove",r)},[]),a.useEffect(()=>{n.current&&n.current.pointOfView({lat:F,lng:$,altitude:x},1e3)},[x,$,F]);const ne=i||new z.MeshBasicMaterial({color:"#FFF"});return a.useEffect(()=>{if(!n.current)return;const e=n.current.scene();e.children.filter(o=>o.type==="DirectionalLight"||o.type==="AmbientLight").forEach(o=>e.remove(o));const r=new z.AmbientLight(G,.2);e.add(r),setTimeout(()=>{(e.children[3]?.children[0]?.children[4]?.children||[]).forEach(f=>{const v=f.children[1];v&&(v.renderOrder=2)})},300),D&&(e.fog=new z.Fog(D.color,D.near,D.far))},[G,x,D]),t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(he,{ref:n,globeOffset:C,lineHoverPrecision:0,polygonsData:Y,polygonAltitude:e=>W.includes(e?.properties?.[p])?.1:e?.properties?.[p]===R?.id?.01:A,polygonCapColor:e=>{const r=e?.properties?.[p],o=u.find(f=>f.id===r)?.x;return o!=null?X(o):h},polygonSideColor:e=>{const r=e?.properties?.[p],o=u.find(v=>v.id===r)?.x,f=o!=null?X(o):h;return W.includes(e?.properties?.[p])?f:"rgba(100,100,100,0)"},polygonStrokeColor:e=>e?.properties?.[p]===R?.id?ee:P,onPolygonClick:e=>{const r=e?.properties?.[p]?u.find(o=>o.id===e?.properties?.[p]):void 0;(E||j)&&(me.isEqual(S,r)&&q&&r?(L(void 0),E?.(void 0)):(L(r),E?.(r))),L(r),E?.(r)},onPolygonHover:e=>{const r=e?.properties?.[p]?u.find(o=>o.id===e?.properties?.[p]):void 0;se(r),m?.(r)},atmosphereColor:I,atmosphereAltitude:V,globeCurvatureResolution:te,globeMaterial:ne,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{if(n.current){n.current.pointOfView({lat:F,lng:$});const e=n.current.scene();setTimeout(()=>{e.children.filter(w=>w.type==="DirectionalLight").map(w=>{e.remove(w)});const f=new z.AmbientLight(G,.2);e.add(f),(e.children[3]?.children[0]?.children[4]?.children||[]).forEach(w=>{const k=w.children[1];k.renderOrder=2})},300);const r=new z.DirectionalLight(16777215,.1),o=n.current.camera();r.position.set(0,0,1),o.add(r),e.add(o)}}}),Q===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:re?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{_(!1)},children:t.jsxRuntimeExports.jsx(ve.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:M?void 0:"340px"},children:[H&&H!==""?t.jsxRuntimeExports.jsx(de.u,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:H}):null,M?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((e,r)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:s[r%s.length]}}),t.jsxRuntimeExports.jsx(de.u,{size:"sm",marginBottom:"none",leading:"none",children:e})]},r))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[g.map((e,r)=>t.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:r*320/s.length+1,y:1,width:320/s.length-2,height:8,style:{fill:s[r],stroke:s[r]}}),t.jsxRuntimeExports.jsx("text",{x:(r+1)*320/s.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:je.numberFormattingFunction(e,"NA")})]},r)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{x:g.length*320/s.length+1,y:1,width:320/s.length-2,height:8,style:{fill:s[g.length],stroke:s[g.length]}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{_(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),R&&U?t.jsxRuntimeExports.jsx(ye.Tooltip,{data:R,body:U,xPos:J.x,yPos:J.y,backgroundStyle:b?.tooltip,className:K?.tooltip}):null,j&&S!==void 0?t.jsxRuntimeExports.jsx(fe.X,{open:S!==void 0,onClose:()=>{L(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:be.string2HTML(j,S)}:void 0,children:typeof j=="function"?j(S):null})}):null]})}function qe(y){const{data:d,mapData:c="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:u,colors:T,sources:M,graphDescription:g,height:s,width:i,footNote:Z="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:Y,colorLegendTitle:p,scaleType:P="threshold",padding:I,mapNoDataColor:U=O.Colors.light.graphNoData,backgroundColor:b=!1,mapBorderColor:K=O.Colors.light.grays["gray-500"],relativeHeight:h,tooltip:H,graphID:Q,mapProperty:ee="ISO3",dataDownload:j=!1,language:E="en",minHeight:m=0,theme:q="light",ariaLabel:W,styles:x,classNames:C,autoRotate:A=!0,enableZoom:$=!0,globeMaterial:F,centerPoint:V=[0,0],atmosphereColor:te="#999",showColorScale:G=!0,resetSelectionOnDoubleClick:D=!0,detailsOnClick:n,onSeriesMouseOver:S,onSeriesMouseClick:L,highlightedIds:re=[],scale:_=1,globeOffset:J=[0,0],polygonAltitude:oe=.01,globeCurvatureResolution:R=4,atmosphereAltitude:se=.15,lightColor:X="#dce9fe",fogSettings:ne}=y,[e,r]=a.useState(void 0),[o,f]=a.useState(0),[v,w]=a.useState(0),k=a.useRef(null);a.useEffect(()=>{const l=new ResizeObserver(B=>{f(i||B[0].target.clientWidth||760),w(s||B[0].target.clientHeight||480)});return k.current&&(w(k.current.clientHeight||480),f(k.current.clientWidth||760),i||l.observe(k.current)),()=>l.disconnect()},[i,s]),a.useEffect(()=>{typeof c=="string"?De.fetchAndParseJSON(c).then(B=>{if(c==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const ue=B.features.map(N=>{if(N.geometry.type==="Polygon"){const ae=[...N.geometry.coordinates[0]].reverse(),le={...N.geometry,coordinates:[ae]};return{...N,geometry:le}}const ce=[];N.geometry.coordinates.forEach(ae=>{const le=[...ae[0]].reverse();ce.push([le])});const ge={...N.geometry,coordinates:ce};return{...N,geometry:ge}});r(ue)}else r(B.features)}):r(c.features)},[c]);const ie=Y||(P==="categorical"?Se.getUniqValue(d,"x"):ke.getJenks(d.map(l=>l.x),T?.length||4));return t.jsxRuntimeExports.jsx("div",{className:`${q||"light"} flex ${i?"w-fit grow-0":"w-full grow"}`,dir:E==="he"||E==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${b?b===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${E||"en"}`,C?.graphContainer),style:{...x?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:Q,"aria-label":W||`${u?`The graph shows ${u}. `:""}This is a map.${g?` ${g}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?I||"1rem":I||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[u||g||j?t.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:x?.title,description:x?.description},classNames:{title:C?.title,description:C?.description},graphTitle:u,graphDescription:g,width:i,graphDownload:void 0,dataDownload:j?d.map(l=>l.data).filter(l=>l!==void 0).length>0?d.map(l=>l.data).filter(l=>l!==void 0):d.filter(l=>l!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:k,"aria-label":"Map area",children:(i||o)&&(s||v)&&e?t.jsxRuntimeExports.jsx(Me,{data:d,globeOffset:J,polygonData:e,colorDomain:ie,width:i||o,height:Math.max(m,s||(h?m?(i||o)*h>m?(i||o)*h:m:(i||o)*h:v)),colors:T||(P==="categorical"?O.Colors[q].sequentialColors[`neutralColorsx0${ie.length}`]:O.Colors[q].sequentialColors[`neutralColorsx0${ie.length+1}`]),mapNoDataColor:U,categorical:P==="categorical",mapBorderColor:K,tooltip:H,mapProperty:ee,styles:x,classNames:C,autoRotate:A===!0?1.5:A===!1?0:A,enableZoom:$,globeMaterial:F,atmosphereColor:te,colorLegendTitle:p,showColorScale:G,hoverStrokeColor:q==="light"?O.Colors.light.grays["gray-700"]:O.Colors.light.grays["gray-300"],highlightedIds:re,resetSelectionOnDoubleClick:D,detailsOnClick:n,onSeriesMouseOver:S,onSeriesMouseClick:L,scale:_,polygonAltitude:oe,centerLat:V[0],centerLng:V[1],atmosphereAltitude:se,globeCurvatureResolution:R,lightColor:X,fogSettings:ne}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(m,s||(h?m?(i||o)*h>m?(i||o)*h:m:(i||o)*h:v))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(pe.y,{"aria-label":"Loading graph"})})}),M||Z?t.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:x?.footnote,source:x?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:M,footNote:Z,width:i}):null]})})})})}exports.ThreeDGlobe=qe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),a=require("react"),pe=require("./Spinner-DA6Z5E4n.cjs"),he=require("react-globe.gl"),me=require("./index-BXns0-ng.cjs"),xe=require("three"),fe=require("./Modal-tXZlLE5s.cjs"),de=require("./Typography-k-kOjICQ.cjs"),ye=require("./Tooltip-n8z5bfav.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./index-BW_-wD2k.cjs"),be=require("./string2HTML-D2Avudmb.cjs"),Ee=require("./ordinal-BOeNbyae.cjs"),Ce=require("./threshold-DNsSUf8Q.cjs"),Re=require("./GraphHeader.cjs"),we=require("./GraphFooter.cjs"),De=require("./fetchAndParseData-CQyVGCul.cjs"),O=require("./Colors.cjs"),Se=require("./getUniqValue-CHqgSss5.cjs"),ke=require("./getJenks-TWQvbuOz.cjs");function Ne(y){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const c in y)if(c!=="default"){const u=Object.getOwnPropertyDescriptor(y,c);Object.defineProperty(d,c,u.get?u:{enumerable:!0,get:()=>y[c]})}}return d.default=y,Object.freeze(d)}const z=Ne(xe);function Me(y){const{width:d,autoRotate:c,data:u,enableZoom:T,categorical:M,colorDomain:g,colors:s,globeMaterial:i,height:I,polygonData:Y,mapProperty:p,mapBorderColor:P,atmosphereColor:U,tooltip:W,styles:b,classNames:K,mapNoDataColor:h,colorLegendTitle:H,showColorScale:Q,hoverStrokeColor:ee,detailsOnClick:j,onSeriesMouseClick:E,onSeriesMouseOver:m,resetSelectionOnDoubleClick:q,highlightedIds:V,scale:x,globeOffset:C,polygonAltitude:A,centerLng:$,centerLat:F,atmosphereAltitude:_,globeCurvatureResolution:te,lightColor:G,fogSettings:D}=y,n=a.useRef(void 0),[S,L]=a.useState(void 0),[re,J]=a.useState(!(d<680)),[X,oe]=a.useState({x:0,y:0}),[R,se]=a.useState(void 0),Z=M?Ee.ordinal().domain(g).range(s):Ce.threshold().domain(g).range(s);a.useEffect(()=>{n.current&&(n.current.controls().enableZoom=T)},[T]),a.useEffect(()=>{n.current&&(R?n.current.controls().autoRotate=!1:(n.current.controls().autoRotate=c!==0,n.current.controls().autoRotateSpeed=c))},[R,c]),a.useEffect(()=>{const e=n.current?.renderer().domElement;if(!e)return;const r=o=>{oe({x:o.clientX,y:o.clientY})};return e.addEventListener("mousemove",r),()=>e.removeEventListener("mousemove",r)},[]),a.useEffect(()=>{n.current&&n.current.pointOfView({lat:F,lng:$,altitude:x},1e3)},[x,$,F]);const ne=i||new z.MeshBasicMaterial({color:"#FFF"});return a.useEffect(()=>{if(!n.current)return;const e=n.current.scene();e.children.filter(o=>o.type==="DirectionalLight"||o.type==="AmbientLight").forEach(o=>e.remove(o));const r=new z.AmbientLight(G,.2);e.add(r),setTimeout(()=>{(e.children[3]?.children[0]?.children[4]?.children||[]).forEach(f=>{const v=f.children[1];v&&(v.renderOrder=2)})},300),D&&(e.fog=new z.Fog(D.color,D.near,D.far))},[G,x,D]),t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(he,{ref:n,height:I,width:d,globeOffset:C,lineHoverPrecision:0,polygonsData:Y,polygonAltitude:e=>V.includes(e?.properties?.[p])?.1:e?.properties?.[p]===R?.id?.01:A,polygonCapColor:e=>{const r=e?.properties?.[p],o=u.find(f=>f.id===r)?.x;return o!=null?Z(o):h},polygonSideColor:e=>{const r=e?.properties?.[p],o=u.find(v=>v.id===r)?.x,f=o!=null?Z(o):h;return V.includes(e?.properties?.[p])?f:"rgba(100,100,100,0)"},polygonStrokeColor:e=>e?.properties?.[p]===R?.id?ee:P,onPolygonClick:e=>{const r=e?.properties?.[p]?u.find(o=>o.id===e?.properties?.[p]):void 0;(E||j)&&(me.isEqual(S,r)&&q&&r?(L(void 0),E?.(void 0)):(L(r),E?.(r))),L(r),E?.(r)},onPolygonHover:e=>{const r=e?.properties?.[p]?u.find(o=>o.id===e?.properties?.[p]):void 0;se(r),m?.(r)},atmosphereColor:U,atmosphereAltitude:_,globeCurvatureResolution:te,globeMaterial:ne,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{if(n.current){n.current.pointOfView({lat:F,lng:$});const e=n.current.scene();setTimeout(()=>{e.children.filter(w=>w.type==="DirectionalLight").map(w=>{e.remove(w)});const f=new z.AmbientLight(G,.2);e.add(f),(e.children[3]?.children[0]?.children[4]?.children||[]).forEach(w=>{const k=w.children[1];k.renderOrder=2})},300);const r=new z.DirectionalLight(16777215,.1),o=n.current.camera();r.position.set(0,0,1),o.add(r),e.add(o)}}}),Q===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:re?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{J(!1)},children:t.jsxRuntimeExports.jsx(ve.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:M?void 0:"340px"},children:[H&&H!==""?t.jsxRuntimeExports.jsx(de.u,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:H}):null,M?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((e,r)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:s[r%s.length]}}),t.jsxRuntimeExports.jsx(de.u,{size:"sm",marginBottom:"none",leading:"none",children:e})]},r))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[g.map((e,r)=>t.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:r*320/s.length+1,y:1,width:320/s.length-2,height:8,style:{fill:s[r],stroke:s[r]}}),t.jsxRuntimeExports.jsx("text",{x:(r+1)*320/s.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:je.numberFormattingFunction(e,"NA")})]},r)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{x:g.length*320/s.length+1,y:1,width:320/s.length-2,height:8,style:{fill:s[g.length],stroke:s[g.length]}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{J(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),R&&W?t.jsxRuntimeExports.jsx(ye.Tooltip,{data:R,body:W,xPos:X.x,yPos:X.y,backgroundStyle:b?.tooltip,className:K?.tooltip}):null,j&&S!==void 0?t.jsxRuntimeExports.jsx(fe.X,{open:S!==void 0,onClose:()=>{L(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:be.string2HTML(j,S)}:void 0,children:typeof j=="function"?j(S):null})}):null]})}function qe(y){const{data:d,mapData:c="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:u,colors:T,sources:M,graphDescription:g,height:s,width:i,footNote:I="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:Y,colorLegendTitle:p,scaleType:P="threshold",padding:U,mapNoDataColor:W=O.Colors.light.graphNoData,backgroundColor:b=!1,mapBorderColor:K=O.Colors.light.grays["gray-500"],relativeHeight:h,tooltip:H,graphID:Q,mapProperty:ee="ISO3",dataDownload:j=!1,language:E="en",minHeight:m=0,theme:q="light",ariaLabel:V,styles:x,classNames:C,autoRotate:A=!0,enableZoom:$=!0,globeMaterial:F,centerPoint:_=[0,0],atmosphereColor:te="#999",showColorScale:G=!0,resetSelectionOnDoubleClick:D=!0,detailsOnClick:n,onSeriesMouseOver:S,onSeriesMouseClick:L,highlightedIds:re=[],scale:J=1,globeOffset:X=[0,0],polygonAltitude:oe=.01,globeCurvatureResolution:R=4,atmosphereAltitude:se=.15,lightColor:Z="#dce9fe",fogSettings:ne}=y,[e,r]=a.useState(void 0),[o,f]=a.useState(0),[v,w]=a.useState(0),k=a.useRef(null);a.useEffect(()=>{const l=new ResizeObserver(B=>{f(i||B[0].target.clientWidth||760),w(s||B[0].target.clientHeight||480)});return k.current&&(w(k.current.clientHeight||480),f(k.current.clientWidth||760),i||l.observe(k.current)),()=>l.disconnect()},[i,s]),a.useEffect(()=>{typeof c=="string"?De.fetchAndParseJSON(c).then(B=>{if(c==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const ue=B.features.map(N=>{if(N.geometry.type==="Polygon"){const ae=[...N.geometry.coordinates[0]].reverse(),le={...N.geometry,coordinates:[ae]};return{...N,geometry:le}}const ce=[];N.geometry.coordinates.forEach(ae=>{const le=[...ae[0]].reverse();ce.push([le])});const ge={...N.geometry,coordinates:ce};return{...N,geometry:ge}});r(ue)}else r(B.features)}):r(c.features)},[c]);const ie=Y||(P==="categorical"?Se.getUniqValue(d,"x"):ke.getJenks(d.map(l=>l.x),T?.length||4));return t.jsxRuntimeExports.jsx("div",{className:`${q||"light"} flex ${i?"w-fit grow-0":"w-full grow"}`,dir:E==="he"||E==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${b?b===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${E||"en"}`,C?.graphContainer),style:{...x?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:Q,"aria-label":V||`${u?`The graph shows ${u}. `:""}This is a map.${g?` ${g}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?U||"1rem":U||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[u||g||j?t.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:x?.title,description:x?.description},classNames:{title:C?.title,description:C?.description},graphTitle:u,graphDescription:g,width:i,graphDownload:void 0,dataDownload:j?d.map(l=>l.data).filter(l=>l!==void 0).length>0?d.map(l=>l.data).filter(l=>l!==void 0):d.filter(l=>l!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:k,"aria-label":"Map area",children:(i||o)&&(s||v)&&e?t.jsxRuntimeExports.jsx(Me,{data:d,globeOffset:X,polygonData:e,colorDomain:ie,width:i||o,height:Math.max(m,s||(h?m?(i||o)*h>m?(i||o)*h:m:(i||o)*h:v)),colors:T||(P==="categorical"?O.Colors[q].sequentialColors[`neutralColorsx0${ie.length}`]:O.Colors[q].sequentialColors[`neutralColorsx0${ie.length+1}`]),mapNoDataColor:W,categorical:P==="categorical",mapBorderColor:K,tooltip:H,mapProperty:ee,styles:x,classNames:C,autoRotate:A===!0?1.5:A===!1?0:A,enableZoom:$,globeMaterial:F,atmosphereColor:te,colorLegendTitle:p,showColorScale:G,hoverStrokeColor:q==="light"?O.Colors.light.grays["gray-700"]:O.Colors.light.grays["gray-300"],highlightedIds:re,resetSelectionOnDoubleClick:D,detailsOnClick:n,onSeriesMouseOver:S,onSeriesMouseClick:L,scale:J,polygonAltitude:oe,centerLat:_[0],centerLng:_[1],atmosphereAltitude:se,globeCurvatureResolution:R,lightColor:Z,fogSettings:ne}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(m,s||(h?m?(i||o)*h>m?(i||o)*h:m:(i||o)*h:v))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(pe.y,{"aria-label":"Loading graph"})})}),M||I?t.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:x?.footnote,source:x?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:M,footNote:I,width:i}):null]})})})})}exports.ThreeDGlobe=qe;
2
2
  //# sourceMappingURL=ThreeDGlobe.cjs.map