{"version":3,"file":"BarGraph-CWwrx3V7.cjs","names":[],"sources":["../src/Components/Graphs/BarGraph/GroupedBarGraph/Graph.tsx","../src/Components/Graphs/BarGraph/GroupedBarGraph/index.tsx","../src/Components/Graphs/BarGraph/SimpleBarGraph/Graph.tsx","../src/Components/Graphs/BarGraph/SimpleBarGraph/index.tsx","../src/Components/Graphs/BarGraph/StackedBarGraph/Graph.tsx","../src/Components/Graphs/BarGraph/StackedBarGraph/index.tsx","../src/Components/Graphs/BarGraph/index.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { scaleBand, scaleLinear } from 'd3-scale';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { useMemo, useRef, useState } from 'react';\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\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { YAxesLabels } from '@/Components/Elements/Axes/YAxesLabels';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { RefLineX, RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  GroupedBarGraphDataType,\r\n  PadZerosTypes,\r\n  ReferenceDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getGraphDimensions } from '@/Utils/getGraphDimensions';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\n\r\ninterface Props {\r\n  data: GroupedBarGraphDataType[];\r\n  barColors: string[];\r\n  barPadding: number;\r\n  showTicks: boolean;\r\n  leftMargin?: number;\r\n  rightMargin?: number;\r\n  topMargin?: number;\r\n  bottomMargin?: number;\r\n  truncateBy: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels: boolean | ((_d: any) => React.ReactNode);\r\n  width: number;\r\n  suffix: string;\r\n  prefix: string;\r\n  showValues: boolean;\r\n  height: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  refValues?: ReferenceDataType[];\r\n  maxValue: number;\r\n  minValue: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  selectedColor?: string;\r\n  rtl: boolean;\r\n  labelOrder?: (string | number)[];\r\n  maxBarThickness?: number;\r\n  resetSelectionOnDoubleClick: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  barAxisTitle?: string;\r\n  noOfTicks: number;\r\n  valueColor?: string;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  animate: AnimateDataType;\r\n  colorDomain: string[];\r\n  precision: number;\r\n  customLayers: CustomLayerDataType[];\r\n  naLabel: string;\r\n  hideAxisLine: boolean;\r\n  locale: string;\r\n  padZeros: PadZerosTypes;\r\n  cornerRadius: number;\r\n  trackColor?: string;\r\n}\r\n\r\nexport function HorizontalGraph(props: Props) {\r\n  const {\r\n    data,\r\n    leftMargin = 100,\r\n    rightMargin = 40,\r\n    topMargin = 25,\r\n    bottomMargin = 10,\r\n    barColors,\r\n    barPadding,\r\n    showTicks,\r\n    truncateBy,\r\n    width,\r\n    height,\r\n    suffix,\r\n    prefix,\r\n    showValues,\r\n    showLabels,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    maxValue,\r\n    minValue,\r\n    onSeriesMouseClick,\r\n    selectedColor,\r\n    rtl,\r\n    labelOrder,\r\n    maxBarThickness,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    valueColor,\r\n    noOfTicks,\r\n    styles,\r\n    classNames,\r\n    animate,\r\n    colorDomain,\r\n    precision,\r\n    customLayers,\r\n    naLabel,\r\n    hideAxisLine,\r\n    locale,\r\n    padZeros,\r\n    cornerRadius,\r\n    trackColor,\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 margin = {\r\n    top: barAxisTitle ? topMargin + 25 : topMargin,\r\n    bottom: bottomMargin,\r\n    left: leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n\r\n  const dataWithId = useMemo(() => {\r\n    const idSet = new Set<string | number>();\r\n\r\n    const dataWithIdWithoutMissingIds = data.map((d, i) => {\r\n      const id = labelOrder ? d.label : `${i}`;\r\n      idSet.add(id);\r\n      return { ...d, id };\r\n    });\r\n\r\n    const missingIds = labelOrder ? labelOrder.filter((id) => !idSet.has(id)) : [];\r\n\r\n    return [\r\n      ...dataWithIdWithoutMissingIds,\r\n      ...missingIds.map((id) => ({\r\n        id,\r\n        label: id,\r\n        size: Array(data[0].size.length).fill(null),\r\n      })),\r\n    ];\r\n  }, [data, labelOrder]);\r\n\r\n  const barOrder = useMemo(() => {\r\n    return labelOrder ?? dataWithId.map((d) => `${d.id}`);\r\n  }, [labelOrder, dataWithId]);\r\n\r\n  const x = scaleLinear().domain([minValue, maxValue]).range([0, graphWidth]).nice();\r\n  const y = scaleBand<string | number>()\r\n    .domain(barOrder)\r\n    .range([\r\n      0,\r\n      maxBarThickness ? Math.min(graphHeight, maxBarThickness * barOrder.length) : graphHeight,\r\n    ])\r\n    .paddingInner(barPadding);\r\n  const subBarScale = scaleBand()\r\n    .domain(data[0].size.map((_d, i) => `${i}`))\r\n    .range([0, y.bandwidth()])\r\n    .paddingInner(0.1);\r\n  const xTicks = x.ticks(noOfTicks);\r\n  return (\r\n    <>\r\n      <motion.svg\r\n        ref={svgRef}\r\n        width={`${width}px`}\r\n        height={`${height}px`}\r\n        viewBox={`0 0 ${width} ${height}`}\r\n        direction='ltr'\r\n      >\r\n        <g transform={`translate(${margin.left},${margin.top})`}>\r\n          {showTicks ? (\r\n            <XTicksAndGridLines\r\n              values={xTicks.filter((d) => d !== 0)}\r\n              x={xTicks.filter((d) => d !== 0).map((d) => x(d))}\r\n              y1={0 - topMargin}\r\n              y2={graphHeight + margin.bottom}\r\n              styles={{\r\n                gridLines: styles?.xAxis?.gridLines,\r\n                labels: styles?.xAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: classNames?.xAxis?.gridLines,\r\n                labels: classNames?.xAxis?.labels,\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='secondary'\r\n              showGridLines\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n          ) : null}\r\n          <AxisTitle\r\n            x={graphWidth / 2}\r\n            y={0 - margin.top + 15}\r\n            style={styles?.xAxis?.title}\r\n            className={classNames?.xAxis?.title}\r\n            text={barAxisTitle}\r\n          />\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <AnimatePresence>\r\n            {dataWithId.map((d) =>\r\n              !checkIfNullOrUndefined(y(d.id)) ? (\r\n                <motion.g\r\n                  key={d.label}\r\n                  variants={{\r\n                    initial: {\r\n                      x: 0,\r\n                      y: y(`${d.id}`),\r\n                    },\r\n                    whileInView: {\r\n                      x: 0,\r\n                      y: y(`${d.id}`),\r\n                      transition: { duration: animate.duration },\r\n                    },\r\n                  }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                >\r\n                  {d.size.map((el, j) => (\r\n                    <motion.g\r\n                      className='undp-viz-g-with-hover'\r\n                      key={`${d.label}-${colorDomain[j] || j}`}\r\n                      opacity={selectedColor ? (barColors[j] === selectedColor ? 1 : 0.3) : 0.85}\r\n                      onMouseEnter={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\r\n                        setEventY(event.clientY);\r\n                        setEventX(event.clientX);\r\n                        onSeriesMouseOver?.({ ...d, sizeIndex: j });\r\n                      }}\r\n                      onMouseMove={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\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                      onClick={() => {\r\n                        if (onSeriesMouseClick || detailsOnClick) {\r\n                          if (\r\n                            isEqual(mouseClickData, { ...d, sizeIndex: j }) &&\r\n                            resetSelectionOnDoubleClick\r\n                          ) {\r\n                            setMouseClickData(undefined);\r\n                            onSeriesMouseClick?.(undefined);\r\n                          } else {\r\n                            setMouseClickData({ ...d, sizeIndex: j });\r\n                            if (onSeriesMouseClick) onSeriesMouseClick({ ...d, sizeIndex: j });\r\n                          }\r\n                        }\r\n                      }}\r\n                    >\r\n                      {trackColor && (\r\n                        <motion.rect\r\n                          height={subBarScale.bandwidth()}\r\n                          variants={{\r\n                            initial: {\r\n                              width: graphWidth,\r\n                              x: 0,\r\n                              y: subBarScale(`${j}`),\r\n                              fill: trackColor,\r\n                            },\r\n                            whileInView: {\r\n                              width: graphWidth,\r\n                              x: 0,\r\n                              y: subBarScale(`${j}`),\r\n                              fill: trackColor,\r\n                            },\r\n                          }}\r\n                          rx={cornerRadius}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                          exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        />\r\n                      )}\r\n                      {!checkIfNullOrUndefined(el) ? (\r\n                        <motion.rect\r\n                          y={subBarScale(`${j}`)}\r\n                          rx={cornerRadius}\r\n                          variants={{\r\n                            initial: {\r\n                              width: 0,\r\n                              x: x(0),\r\n                              fill: barColors[j],\r\n                            },\r\n                            whileInView: {\r\n                              width: !checkIfNullOrUndefined(el)\r\n                                ? (el as number) >= 0\r\n                                  ? x(el as number) - x(0)\r\n                                  : x(0) - x(el as number)\r\n                                : 0,\r\n                              x: (el as number) >= 0 ? x(0) : x(el as number),\r\n                              fill: barColors[j],\r\n                              transition: { duration: animate.duration },\r\n                            },\r\n                          }}\r\n                          exit={{\r\n                            width: 0,\r\n                            x: x(0),\r\n                            transition: { duration: animate.duration },\r\n                          }}\r\n                          height={subBarScale.bandwidth()}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                        />\r\n                      ) : null}\r\n                      {showValues ? (\r\n                        <motion.text\r\n                          y={(subBarScale(`${j}`) as number) + subBarScale.bandwidth() / 2}\r\n                          style={{\r\n                            textAnchor: el ? (el < 0 ? 'end' : 'start') : 'start',\r\n                            ...(styles?.graphObjectValues || {}),\r\n                          }}\r\n                          className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                          dx={el ? (el < 0 ? -5 : 5) : 5}\r\n                          dy='0.33em'\r\n                          variants={{\r\n                            initial: { x: x(0), opacity: 0, fill: valueColor || barColors[j] },\r\n                            whileInView: {\r\n                              x: x(el || 0),\r\n                              opacity: 1,\r\n                              fill: valueColor || barColors[j],\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                            opacity: 0,\r\n                            transition: { duration: animate.duration },\r\n                          }}\r\n                        >\r\n                          {numberFormattingFunction(\r\n                            el,\r\n                            naLabel,\r\n                            precision,\r\n                            prefix,\r\n                            suffix,\r\n                            locale,\r\n                            padZeros,\r\n                          )}\r\n                        </motion.text>\r\n                      ) : null}\r\n                    </motion.g>\r\n                  ))}\r\n                  {showLabels ? (\r\n                    <YAxesLabels\r\n                      value={\r\n                        typeof showLabels === 'function'\r\n                          ? showLabels(d)\r\n                          : `${d.label}`.length < truncateBy\r\n                            ? `${d.label}`\r\n                            : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={0}\r\n                      x={0 - margin.left}\r\n                      width={x(minValue < 0 ? 0 : minValue) + margin.left}\r\n                      height={y.bandwidth()}\r\n                      style={styles?.yAxis?.labels}\r\n                      className={classNames?.yAxis?.labels}\r\n                      animate={animate}\r\n                      isInView={isInView}\r\n                    />\r\n                  ) : null}\r\n                </motion.g>\r\n              ) : null,\r\n            )}\r\n            <Axis\r\n              x1={x(minValue < 0 ? 0 : minValue)}\r\n              x2={x(minValue < 0 ? 0 : minValue)}\r\n              y1={-2.5}\r\n              y2={graphHeight + margin.bottom}\r\n              classNames={{ axis: classNames?.yAxis?.axis }}\r\n              styles={{ axis: styles?.yAxis?.axis }}\r\n              hideAxisLine={hideAxisLine}\r\n            />\r\n            {refValues?.map((el) => (\r\n              <RefLineX\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                x={x(el.value as number)}\r\n                y1={0 - margin.top}\r\n                y2={graphHeight + margin.bottom}\r\n                textSide={x(el.value as number) > graphWidth * 0.75 || rtl ? 'left' : 'right'}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n          </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        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n\r\nexport function VerticalGraph(props: Props) {\r\n  const {\r\n    data,\r\n    leftMargin = 20,\r\n    rightMargin = 20,\r\n    topMargin = 20,\r\n    bottomMargin = 25,\r\n    width,\r\n    height,\r\n    barColors,\r\n    suffix,\r\n    prefix,\r\n    barPadding,\r\n    showLabels,\r\n    showValues,\r\n    showTicks,\r\n    truncateBy,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    maxValue,\r\n    minValue,\r\n    onSeriesMouseClick,\r\n    selectedColor,\r\n    labelOrder,\r\n    maxBarThickness,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    valueColor,\r\n    noOfTicks,\r\n    styles,\r\n    classNames,\r\n    animate,\r\n    colorDomain,\r\n    precision,\r\n    customLayers,\r\n    naLabel,\r\n    hideAxisLine,\r\n    locale,\r\n    padZeros,\r\n    cornerRadius,\r\n    trackColor,\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 margin = {\r\n    top: topMargin,\r\n    bottom: bottomMargin,\r\n    left: barAxisTitle ? leftMargin + 30 : leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n\r\n  const dataWithId = useMemo(() => {\r\n    const idSet = new Set<string | number>();\r\n\r\n    const dataWithIdWithoutMissingIds = data.map((d, i) => {\r\n      const id = labelOrder ? d.label : `${i}`;\r\n      idSet.add(id);\r\n      return { ...d, id };\r\n    });\r\n\r\n    const missingIds = labelOrder ? labelOrder.filter((id) => !idSet.has(id)) : [];\r\n\r\n    return [\r\n      ...dataWithIdWithoutMissingIds,\r\n      ...missingIds.map((id) => ({\r\n        id,\r\n        label: id,\r\n        size: Array(data[0].size.length).fill(null),\r\n      })),\r\n    ];\r\n  }, [data, labelOrder]);\r\n\r\n  const barOrder = useMemo(() => {\r\n    return labelOrder ?? dataWithId.map((d) => `${d.id}`);\r\n  }, [labelOrder, dataWithId]);\r\n\r\n  const y = scaleLinear().domain([minValue, maxValue]).range([graphHeight, 0]).nice();\r\n\r\n  const x = scaleBand<string | number>()\r\n    .domain(barOrder)\r\n    .range([\r\n      0,\r\n      maxBarThickness ? Math.min(graphWidth, maxBarThickness * barOrder.length) : graphWidth,\r\n    ])\r\n    .paddingInner(barPadding);\r\n  const subBarScale = scaleBand()\r\n    .domain(data[0].size.map((_d, i) => `${i}`))\r\n    .range([0, x.bandwidth()])\r\n    .paddingInner(0.1);\r\n  const yTicks = y.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          <Axis\r\n            y1={y(minValue < 0 ? 0 : minValue)}\r\n            y2={y(minValue < 0 ? 0 : minValue)}\r\n            x1={0 - leftMargin}\r\n            x2={graphWidth + margin.right}\r\n            label={\r\n              showTicks\r\n                ? numberFormattingFunction(\r\n                    minValue < 0 ? 0 : minValue,\r\n                    naLabel,\r\n                    precision,\r\n                    prefix,\r\n                    suffix,\r\n                    locale,\r\n                    padZeros,\r\n                  )\r\n                : undefined\r\n            }\r\n            hideAxisLine={hideAxisLine}\r\n            labelPos={{\r\n              x: 0 - leftMargin,\r\n              dx: 0,\r\n              dy: maxValue < 0 ? '1em' : -5,\r\n              y: y(minValue < 0 ? 0 : minValue),\r\n            }}\r\n            classNames={{\r\n              axis: classNames?.xAxis?.axis,\r\n              label: classNames?.yAxis?.labels,\r\n            }}\r\n            styles={{ axis: styles?.xAxis?.axis, label: styles?.yAxis?.labels }}\r\n          />\r\n          {showTicks ? (\r\n            <YTicksAndGridLines\r\n              values={yTicks.filter((d) => d !== 0)}\r\n              y={yTicks.filter((d) => d !== 0).map((d) => y(d))}\r\n              x1={0 - leftMargin}\r\n              x2={graphWidth + margin.right}\r\n              styles={{\r\n                gridLines: styles?.yAxis?.gridLines,\r\n                labels: styles?.yAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: classNames?.yAxis?.gridLines,\r\n                labels: classNames?.yAxis?.labels,\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='secondary'\r\n              showGridLines\r\n              labelPos='vertical'\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n          ) : null}\r\n          <AxisTitle\r\n            x={0 - leftMargin - 15}\r\n            y={graphHeight / 2}\r\n            style={styles?.yAxis?.title}\r\n            className={classNames?.yAxis?.title}\r\n            text={barAxisTitle}\r\n            rotate90\r\n          />\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <AnimatePresence>\r\n            {dataWithId.map((d) =>\r\n              !checkIfNullOrUndefined(x(d.id)) ? (\r\n                <motion.g\r\n                  key={d.label}\r\n                  variants={{\r\n                    initial: {\r\n                      x: x(`${d.id}`),\r\n                      y: 0,\r\n                    },\r\n                    whileInView: {\r\n                      x: x(`${d.id}`),\r\n                      y: 0,\r\n                      transition: { duration: animate.duration },\r\n                    },\r\n                  }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                >\r\n                  {d.size.map((el, j) => (\r\n                    <motion.g\r\n                      className='undp-viz-g-with-hover'\r\n                      key={`${d.label}-${colorDomain[j] || j}`}\r\n                      opacity={selectedColor ? (barColors[j] === selectedColor ? 1 : 0.3) : 0.85}\r\n                      onMouseEnter={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\r\n                        setEventY(event.clientY);\r\n                        setEventX(event.clientX);\r\n                        onSeriesMouseOver?.({ ...d, sizeIndex: j });\r\n                      }}\r\n                      onMouseMove={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\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                      onClick={() => {\r\n                        if (onSeriesMouseClick || detailsOnClick) {\r\n                          if (\r\n                            isEqual(mouseClickData, { ...d, sizeIndex: j }) &&\r\n                            resetSelectionOnDoubleClick\r\n                          ) {\r\n                            setMouseClickData(undefined);\r\n                            onSeriesMouseClick?.(undefined);\r\n                          } else {\r\n                            setMouseClickData({ ...d, sizeIndex: j });\r\n                            if (onSeriesMouseClick) onSeriesMouseClick({ ...d, sizeIndex: j });\r\n                          }\r\n                        }\r\n                      }}\r\n                    >\r\n                      {trackColor && (\r\n                        <motion.rect\r\n                          width={subBarScale.bandwidth()}\r\n                          variants={{\r\n                            initial: {\r\n                              height: graphHeight,\r\n                              y: 0,\r\n                              x: subBarScale(`${j}`),\r\n                              fill: trackColor,\r\n                            },\r\n                            whileInView: {\r\n                              height: graphHeight,\r\n                              y: 0,\r\n                              x: subBarScale(`${j}`),\r\n                              fill: trackColor,\r\n                            },\r\n                          }}\r\n                          rx={cornerRadius}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                          exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        />\r\n                      )}\r\n                      {!checkIfNullOrUndefined(el) ? (\r\n                        <motion.rect\r\n                          rx={cornerRadius}\r\n                          x={subBarScale(`${j}`)}\r\n                          width={subBarScale.bandwidth()}\r\n                          variants={{\r\n                            initial: {\r\n                              height: 0,\r\n                              y: y(0),\r\n                              fill: barColors[j],\r\n                            },\r\n                            whileInView: {\r\n                              height: !checkIfNullOrUndefined(el)\r\n                                ? Math.abs(y(el as number) - y(0))\r\n                                : 0,\r\n                              y: !checkIfNullOrUndefined(el)\r\n                                ? (el as number) > 0\r\n                                  ? y(el as number)\r\n                                  : y(0)\r\n                                : y(0),\r\n                              fill: barColors[j],\r\n                              transition: { duration: animate.duration },\r\n                            },\r\n                          }}\r\n                          exit={{\r\n                            height: 0,\r\n                            y: y(0),\r\n                            transition: { duration: animate.duration },\r\n                          }}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                        />\r\n                      ) : null}\r\n                      {showValues ? (\r\n                        <motion.text\r\n                          x={(subBarScale(`${j}`) as number) + subBarScale.bandwidth() / 2}\r\n                          style={{\r\n                            textAnchor: 'middle',\r\n                            ...(styles?.graphObjectValues || {}),\r\n                          }}\r\n                          className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                          dy={el ? (el >= 0 ? '-5px' : '1em') : '-5px'}\r\n                          variants={{\r\n                            initial: { y: y(0), opacity: 0, fill: valueColor || barColors[j] },\r\n                            whileInView: {\r\n                              y: y(el || 0),\r\n                              opacity: 1,\r\n                              fill: valueColor || barColors[j],\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                            opacity: 0,\r\n                            transition: { duration: animate.duration },\r\n                          }}\r\n                        >\r\n                          {numberFormattingFunction(\r\n                            el,\r\n                            naLabel,\r\n                            precision,\r\n                            prefix,\r\n                            suffix,\r\n                            locale,\r\n                            padZeros,\r\n                          )}\r\n                        </motion.text>\r\n                      ) : null}\r\n                    </motion.g>\r\n                  ))}\r\n                  {showLabels ? (\r\n                    <XAxesLabels\r\n                      value={\r\n                        typeof showLabels === 'function'\r\n                          ? showLabels(d)\r\n                          : `${d.label}`.length < truncateBy\r\n                            ? `${d.label}`\r\n                            : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={y(0) + 5}\r\n                      x={0}\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              ) : null,\r\n            )}\r\n            {refValues?.map((el) => (\r\n              <RefLineY\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                y={y(el.value as number)}\r\n                x1={0 - leftMargin}\r\n                x2={graphWidth + margin.right}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n          </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        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n","import orderBy from 'lodash.orderby';\r\nimport sum from 'lodash.sum';\r\nimport { useRef, useState } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Timeline } from '@/Components/Elements/Timeline';\r\nimport { useElementSize } from '@/hooks/useElementSize';\r\nimport { useTimeline } from '@/hooks/useTimeline';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  GroupedBarGraphDataType,\r\n  Languages,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n  TimelineDataType,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ensureCompleteDataForStackedBarChart } from '@/Utils/ensureCompleteData';\r\nimport { HorizontalGraph, VerticalGraph } from './Graph';\r\n\r\ninterface Props {\r\n  data: GroupedBarGraphDataType[];\r\n  colors?: string[];\r\n  graphTitle?: string | React.ReactNode;\r\n  graphDescription?: string | React.ReactNode;\r\n  footNote?: string | React.ReactNode;\r\n  width?: number;\r\n  height?: number;\r\n  sources?: SourcesDataType[];\r\n  barPadding?: number;\r\n  showTicks?: boolean;\r\n  truncateBy?: number;\r\n  colorDomain: string[];\r\n  colorLegendTitle?: string;\r\n  suffix?: string;\r\n  prefix?: string;\r\n  showValues?: boolean;\r\n  backgroundColor?: string | boolean;\r\n  padding?: string;\r\n  leftMargin?: number;\r\n  rightMargin?: number;\r\n  topMargin?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels?: boolean | ((_d: any) => React.ReactNode);\r\n  bottomMargin?: number;\r\n  relativeHeight?: number;\r\n  sortParameter?: number | 'total';\r\n  sortData?: 'asc' | 'desc';\r\n  showColorScale?: boolean;\r\n  minHeight?: number;\r\n  trackColor?: string;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  refValues?: ReferenceDataType[];\r\n  graphID?: string;\r\n  maxValue?: number;\r\n  minValue?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  graphDownload?: boolean;\r\n  dataDownload?: boolean;\r\n  labelOrder?: (string | number)[];\r\n  language?: Languages;\r\n  theme?: 'light' | 'dark';\r\n  maxBarThickness?: number;\r\n  ariaLabel?: string;\r\n  resetSelectionOnDoubleClick?: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  barAxisTitle?: string;\r\n  noOfTicks?: number;\r\n  valueColor?: string;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  filterNA?: boolean;\r\n  animate?: boolean | AnimateDataType;\r\n  precision?: number;\r\n  customLayers?: CustomLayerDataType[];\r\n  timeline?: TimelineDataType;\r\n  naLabel?: string;\r\n  orientation?: 'horizontal' | 'vertical';\r\n  hideAxisLine?: boolean;\r\n  locale?: string;\r\n  padZeros?: 'all' | 'decimal' | 'none';\r\n  cornerRadius?: number;\r\n}\r\n\r\nexport function GroupedBarGraphEl(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors = Colors.light.categoricalColors.colors,\r\n    sources,\r\n    graphDescription,\r\n    barPadding = 0.25,\r\n    showTicks = true,\r\n    truncateBy = 999,\r\n    height,\r\n    width,\r\n    footNote,\r\n    colorDomain,\r\n    colorLegendTitle,\r\n    suffix = '',\r\n    prefix = '',\r\n    showValues = true,\r\n    showColorScale = true,\r\n    padding,\r\n    backgroundColor = false,\r\n    leftMargin,\r\n    rightMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    showLabels = true,\r\n    relativeHeight,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    graphID,\r\n    maxValue,\r\n    minValue,\r\n    onSeriesMouseClick,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    language = 'en',\r\n    labelOrder,\r\n    minHeight = 0,\r\n    theme = 'light',\r\n    maxBarThickness,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick = true,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks = 5,\r\n    valueColor,\r\n    styles,\r\n    classNames,\r\n    filterNA = true,\r\n    animate = false,\r\n    precision = 2,\r\n    customLayers = [],\r\n    timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n    naLabel = 'NA',\r\n    sortParameter,\r\n    sortData,\r\n    orientation = 'vertical',\r\n    hideAxisLine = false,\r\n    locale = 'en',\r\n    padZeros = 'none',\r\n    trackColor,\r\n    cornerRadius = 0,\r\n  } = props;\r\n\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\r\n  const { uniqDatesSorted, index, setIndex, play, setPlay, markObj, activeDate, dateFormat } =\r\n    useTimeline(data, timeline);\r\n  const Comp = orientation === 'horizontal' ? HorizontalGraph : VerticalGraph;\r\n  const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\r\n  return (\r\n    <GraphContainer\r\n      className={classNames?.graphContainer}\r\n      style={styles?.graphContainer}\r\n      id={graphID}\r\n      ref={graphParentDiv}\r\n      aria-label={ariaLabel}\r\n      backgroundColor={backgroundColor}\r\n      theme={theme}\r\n      language={language}\r\n      minHeight={minHeight}\r\n      width={width}\r\n      height={height}\r\n      relativeHeight={relativeHeight}\r\n      padding={padding}\r\n    >\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 : 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      {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n        <Timeline\r\n          play={play}\r\n          setPlay={setPlay}\r\n          uniqDatesSorted={uniqDatesSorted}\r\n          markObj={markObj}\r\n          index={index}\r\n          setIndex={setIndex}\r\n          color={timeline.color}\r\n        />\r\n      ) : null}\r\n      {showColorScale && data.length > 0 ? (\r\n        <ColorLegendWithMouseOver\r\n          width={width}\r\n          colorDomain={colorDomain}\r\n          colors={colors}\r\n          colorLegendTitle={colorLegendTitle}\r\n          setSelectedColor={setSelectedColor}\r\n          showNAColor={false}\r\n          className={classNames?.colorLegend}\r\n        />\r\n      ) : null}\r\n      <GraphArea ref={graphDiv}>\r\n        {data.length === 0 && <EmptyState />}\r\n        {svgWidth && svgHeight && data.length > 0 ? (\r\n          <Comp\r\n            hideAxisLine={hideAxisLine}\r\n            data={\r\n              sortParameter !== undefined\r\n                ? sortParameter === 'total'\r\n                  ? orderBy(\r\n                      ensureCompleteDataForStackedBarChart(data, dateFormat)\r\n                        .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                        .filter((d) => (filterNA ? !d.size.every((item) => item == null) : d)),\r\n                      (d) => sum(d.size.filter((el) => !checkIfNullOrUndefined(el))),\r\n                      [sortData || 'asc'],\r\n                    )\r\n                  : orderBy(\r\n                      ensureCompleteDataForStackedBarChart(data, dateFormat)\r\n                        .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                        .filter((d) => (filterNA ? !d.size.every((item) => item == null) : d)),\r\n                      (d) =>\r\n                        checkIfNullOrUndefined(d.size[sortParameter])\r\n                          ? -Infinity\r\n                          : d.size[sortParameter],\r\n                      [sortData || 'asc'],\r\n                    )\r\n                : ensureCompleteDataForStackedBarChart(data, dateFormat)\r\n                    .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                    .filter((d) => (filterNA ? !d.size.every((item) => item == null) : d))\r\n            }\r\n            barColors={colors}\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            suffix={suffix}\r\n            prefix={prefix}\r\n            showValues={showValues}\r\n            barPadding={barPadding}\r\n            showTicks={showTicks}\r\n            leftMargin={leftMargin}\r\n            rightMargin={rightMargin}\r\n            topMargin={topMargin}\r\n            bottomMargin={bottomMargin}\r\n            truncateBy={truncateBy}\r\n            showLabels={showLabels}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            refValues={refValues}\r\n            maxValue={\r\n              !checkIfNullOrUndefined(maxValue)\r\n                ? (maxValue as number)\r\n                : Math.max(\r\n                      ...data.map((d) =>\r\n                        Math.max(...(d.size.filter((l) => !checkIfNullOrUndefined(l)) as number[])),\r\n                      ),\r\n                    ) < 0\r\n                  ? 0\r\n                  : Math.max(\r\n                      ...data.map((d) =>\r\n                        Math.max(...(d.size.filter((l) => !checkIfNullOrUndefined(l)) as number[])),\r\n                      ),\r\n                    )\r\n            }\r\n            minValue={\r\n              !checkIfNullOrUndefined(minValue)\r\n                ? (minValue as number)\r\n                : Math.min(\r\n                      ...data.map((d) =>\r\n                        Math.min(...(d.size.filter((l) => !checkIfNullOrUndefined(l)) as number[])),\r\n                      ),\r\n                    ) >= 0\r\n                  ? 0\r\n                  : Math.min(\r\n                      ...data.map((d) =>\r\n                        Math.min(...(d.size.filter((l) => !checkIfNullOrUndefined(l)) as number[])),\r\n                      ),\r\n                    )\r\n            }\r\n            onSeriesMouseClick={onSeriesMouseClick}\r\n            selectedColor={selectedColor}\r\n            labelOrder={labelOrder}\r\n            rtl={language === 'he' || language === 'ar'}\r\n            maxBarThickness={maxBarThickness}\r\n            resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n            detailsOnClick={detailsOnClick}\r\n            barAxisTitle={barAxisTitle}\r\n            noOfTicks={noOfTicks}\r\n            valueColor={valueColor}\r\n            styles={styles}\r\n            classNames={classNames}\r\n            colorDomain={colorDomain}\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            locale={locale}\r\n            padZeros={padZeros}\r\n            cornerRadius={cornerRadius}\r\n            trackColor={trackColor}\r\n          />\r\n        ) : null}\r\n      </GraphArea>\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    </GraphContainer>\r\n  );\r\n}\r\n","import { cn } from '@undp/design-system-react/cn';\r\nimport { scaleBand, scaleLinear } from 'd3-scale';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { useMemo, useRef, useState } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\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\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { YAxesLabels } from '@/Components/Elements/Axes/YAxesLabels';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { RefLineX, RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport type {\r\n  AnimateDataType,\r\n  BarGraphDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  PadZerosTypes,\r\n  ReferenceDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getGraphDimensions } from '@/Utils/getGraphDimensions';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\n\r\ninterface Props {\r\n  data: BarGraphDataType[];\r\n  barColor: string[];\r\n  colorDomain: string[];\r\n  suffix: string;\r\n  prefix: string;\r\n  barPadding: number;\r\n  showValues: boolean;\r\n  showTicks: boolean;\r\n  leftMargin?: number;\r\n  rightMargin?: number;\r\n  topMargin?: number;\r\n  bottomMargin?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels: boolean | ((_d: any) => React.ReactNode);\r\n  truncateBy: number;\r\n  width: number;\r\n  height: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  refValues?: ReferenceDataType[];\r\n  selectedColor?: string;\r\n  maxValue: number;\r\n  minValue: number;\r\n  highlightedDataPoints?: (string | number)[];\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  labelOrder?: (string | number)[];\r\n  rtl: boolean;\r\n  maxBarThickness?: number;\r\n  minBarThickness?: number;\r\n  resetSelectionOnDoubleClick: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  barAxisTitle?: string;\r\n  noOfTicks: number;\r\n  valueColor?: string;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  animate: AnimateDataType;\r\n  dimmedOpacity: number;\r\n  precision: number;\r\n  customLayers: CustomLayerDataType[];\r\n  naLabel: string;\r\n  trackColor?: string;\r\n  hideAxisLine: boolean;\r\n  locale: string;\r\n  padZeros: PadZerosTypes;\r\n  cornerRadius: number;\r\n}\r\n\r\nexport function HorizontalGraph(props: Props) {\r\n  const {\r\n    data,\r\n    barColor,\r\n    suffix,\r\n    prefix,\r\n    barPadding,\r\n    showValues,\r\n    showTicks,\r\n    truncateBy,\r\n    width,\r\n    height,\r\n    colorDomain,\r\n    topMargin = 25,\r\n    bottomMargin = 10,\r\n    leftMargin = 100,\r\n    rightMargin = 40,\r\n    showLabels,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    selectedColor,\r\n    highlightedDataPoints,\r\n    maxValue,\r\n    minValue,\r\n    onSeriesMouseClick,\r\n    labelOrder,\r\n    rtl,\r\n    maxBarThickness,\r\n    minBarThickness,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    valueColor,\r\n    noOfTicks,\r\n    styles,\r\n    classNames,\r\n    animate,\r\n    dimmedOpacity,\r\n    precision,\r\n    customLayers,\r\n    naLabel,\r\n    trackColor,\r\n    hideAxisLine,\r\n    locale,\r\n    padZeros,\r\n    cornerRadius,\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  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\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: barAxisTitle ? topMargin + 25 : topMargin,\r\n    bottom: bottomMargin,\r\n    left: leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  const { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n\r\n  const dataWithId = useMemo(() => {\r\n    const idSet = new Set<string | number>();\r\n\r\n    const dataWithIdWithoutMissingIds = data.map((d, i) => {\r\n      const id = labelOrder ? d.label : `${i}`;\r\n      idSet.add(id);\r\n      return { ...d, id };\r\n    });\r\n\r\n    const missingIds = labelOrder ? labelOrder.filter((id) => !idSet.has(id)) : [];\r\n\r\n    return [\r\n      ...dataWithIdWithoutMissingIds,\r\n      ...missingIds.map((id) => ({\r\n        id,\r\n        label: id,\r\n        color: null,\r\n        size: null,\r\n      })),\r\n    ];\r\n  }, [data, labelOrder]);\r\n\r\n  const barOrder = useMemo(() => {\r\n    return labelOrder ?? dataWithId.map((d) => `${d.id}`);\r\n  }, [labelOrder, dataWithId]);\r\n\r\n  const x = scaleLinear().domain([minValue, maxValue]).range([0, graphWidth]).nice();\r\n  const y = scaleBand<string | number>()\r\n    .domain(barOrder)\r\n    .range([\r\n      0,\r\n      minBarThickness\r\n        ? Math.max(graphHeight, minBarThickness * barOrder.length)\r\n        : maxBarThickness\r\n          ? Math.min(graphHeight, maxBarThickness * barOrder.length)\r\n          : graphHeight,\r\n    ])\r\n    .paddingInner(barPadding);\r\n  const xTicks = x.ticks(noOfTicks);\r\n\r\n  return (\r\n    <>\r\n      <motion.svg\r\n        ref={svgRef}\r\n        width={`${width}px`}\r\n        height={`${height}px`}\r\n        viewBox={`0 0 ${width} ${height}`}\r\n        direction='ltr'\r\n      >\r\n        <g transform={`translate(${margin.left},${margin.top})`}>\r\n          {showTicks ? (\r\n            <XTicksAndGridLines\r\n              values={xTicks.filter((d) => d !== 0)}\r\n              x={xTicks.filter((d) => d !== 0).map((d) => x(d))}\r\n              y1={0 - topMargin}\r\n              y2={graphHeight + margin.bottom}\r\n              styles={{\r\n                gridLines: styles?.xAxis?.gridLines,\r\n                labels: styles?.xAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: classNames?.xAxis?.gridLines,\r\n                labels: classNames?.xAxis?.labels,\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='secondary'\r\n              showGridLines\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n          ) : null}\r\n          <AxisTitle\r\n            x={graphWidth / 2}\r\n            y={0 - margin.top + 15}\r\n            style={styles?.xAxis?.title}\r\n            className={classNames?.xAxis?.title}\r\n            text={barAxisTitle}\r\n          />\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <AnimatePresence>\r\n            {dataWithId.map((d) =>\r\n              !checkIfNullOrUndefined(y(d.id)) ? (\r\n                <motion.g\r\n                  className='undp-viz-g-with-hover'\r\n                  key={d.label}\r\n                  variants={{\r\n                    initial: {\r\n                      opacity: selectedColor\r\n                        ? d.color\r\n                          ? barColor[colorDomain.indexOf(d.color)] === selectedColor\r\n                            ? 1\r\n                            : dimmedOpacity\r\n                          : dimmedOpacity\r\n                        : highlightedDataPoints\r\n                          ? highlightedDataPoints.indexOf(d.label) !== -1\r\n                            ? 0.85\r\n                            : dimmedOpacity\r\n                          : 0.85,\r\n                    },\r\n                    whileInView: {\r\n                      opacity: selectedColor\r\n                        ? d.color\r\n                          ? barColor[colorDomain.indexOf(d.color)] === selectedColor\r\n                            ? 1\r\n                            : dimmedOpacity\r\n                          : dimmedOpacity\r\n                        : highlightedDataPoints\r\n                          ? highlightedDataPoints.indexOf(d.label) !== -1\r\n                            ? 0.85\r\n                            : dimmedOpacity\r\n                          : 0.85,\r\n                      transition: { duration: animate.duration },\r\n                    },\r\n                  }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                  onMouseEnter={(event) => {\r\n                    setMouseOverData(d);\r\n                    setEventY(event.clientY);\r\n                    setEventX(event.clientX);\r\n                    onSeriesMouseOver?.(d);\r\n                  }}\r\n                  onClick={() => {\r\n                    if (onSeriesMouseClick || detailsOnClick) {\r\n                      if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n                        setMouseClickData(undefined);\r\n                        onSeriesMouseClick?.(undefined);\r\n                      } else {\r\n                        setMouseClickData(d);\r\n                        onSeriesMouseClick?.(d);\r\n                      }\r\n                    }\r\n                  }}\r\n                  onMouseMove={(event) => {\r\n                    setMouseOverData(d);\r\n                    setEventY(event.clientY);\r\n                    setEventX(event.clientX);\r\n                  }}\r\n                  onMouseLeave={() => {\r\n                    setMouseOverData(undefined);\r\n                    setEventX(undefined);\r\n                    setEventY(undefined);\r\n                    onSeriesMouseOver?.(undefined);\r\n                  }}\r\n                >\r\n                  {trackColor && (\r\n                    <motion.rect\r\n                      height={y.bandwidth()}\r\n                      variants={{\r\n                        initial: {\r\n                          width: graphWidth,\r\n                          x: 0,\r\n                          y: y(`${d.id}`),\r\n                          fill: trackColor,\r\n                        },\r\n                        whileInView: {\r\n                          width: graphWidth,\r\n                          x: 0,\r\n                          y: y(`${d.id}`),\r\n                          fill: trackColor,\r\n                        },\r\n                      }}\r\n                      rx={cornerRadius}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                    />\r\n                  )}\r\n                  {d.size ? (\r\n                    <motion.rect\r\n                      rx={cornerRadius}\r\n                      variants={{\r\n                        initial: {\r\n                          width: 0,\r\n                          x: x(0),\r\n                          y: y(`${d.id}`),\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                        },\r\n                        whileInView: {\r\n                          width: d.size >= 0 ? x(d.size) - x(0) : x(0) - x(d.size),\r\n                          x: d.size >= 0 ? x(0) : x(d.size),\r\n                          y: y(`${d.id}`),\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      exit={{\r\n                        width: 0,\r\n                        x: x(0),\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                      height={y.bandwidth()}\r\n                    />\r\n                  ) : null}\r\n                  {showLabels ? (\r\n                    <YAxesLabels\r\n                      value={\r\n                        typeof showLabels === 'function'\r\n                          ? showLabels(d)\r\n                          : `${d.label}`.length < truncateBy\r\n                            ? `${d.label}`\r\n                            : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={y(d.id) || 0}\r\n                      x={(d.size || 0) < 0 ? x(0) : 0 - margin.left}\r\n                      width={(d.size || 0) < 0 ? width - x(0) : x(0) + margin.left}\r\n                      height={y.bandwidth()}\r\n                      alignment={d.size ? (d.size < 0 ? 'left' : 'right') : 'right'}\r\n                      style={styles?.yAxis?.labels}\r\n                      className={classNames?.yAxis?.labels}\r\n                      animate={animate}\r\n                      isInView={isInView}\r\n                    />\r\n                  ) : null}\r\n                  {showValues ? (\r\n                    <motion.text\r\n                      style={{\r\n                        textAnchor: d.size ? (d.size < 0 ? 'end' : 'start') : 'start',\r\n                        ...(styles?.graphObjectValues || {}),\r\n                      }}\r\n                      className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                      dx={d.size ? (d.size < 0 ? -5 : 5) : 5}\r\n                      dy='0.33em'\r\n                      variants={{\r\n                        initial: {\r\n                          x: x(0),\r\n                          y: (y(`${d.id}`) as number) + y.bandwidth() / 2,\r\n                          opacity: 0,\r\n                          fill: valueColor\r\n                            ? valueColor\r\n                            : data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                        },\r\n                        whileInView: {\r\n                          x: d.size ? x(d.size) : x(0),\r\n                          opacity: 1,\r\n                          y: (y(`${d.id}`) as number) + y.bandwidth() / 2,\r\n                          fill: valueColor\r\n                            ? valueColor\r\n                            : data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      exit={{\r\n                        opacity: 0,\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                    >\r\n                      {numberFormattingFunction(\r\n                        d.size,\r\n                        naLabel,\r\n                        precision,\r\n                        prefix,\r\n                        suffix,\r\n                        locale,\r\n                        padZeros,\r\n                      )}\r\n                    </motion.text>\r\n                  ) : null}\r\n                </motion.g>\r\n              ) : null,\r\n            )}\r\n            <Axis\r\n              hideAxisLine={hideAxisLine}\r\n              x1={x(minValue < 0 ? 0 : minValue)}\r\n              x2={x(minValue < 0 ? 0 : minValue)}\r\n              y1={-2.5}\r\n              y2={graphHeight + margin.bottom}\r\n              classNames={{ axis: classNames?.yAxis?.axis }}\r\n              styles={{ axis: styles?.yAxis?.axis }}\r\n            />\r\n            {refValues?.map((el) => (\r\n              <RefLineX\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                x={x(el.value as number)}\r\n                y1={0 - margin.top}\r\n                y2={graphHeight + margin.bottom}\r\n                textSide={x(el.value as number) > graphWidth * 0.75 || rtl ? 'left' : 'right'}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n          </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        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n\r\nexport function VerticalGraph(props: Props) {\r\n  const {\r\n    leftMargin = 20,\r\n    rightMargin = 20,\r\n    topMargin = 20,\r\n    bottomMargin = 25,\r\n    data,\r\n    width,\r\n    height,\r\n    barColor,\r\n    suffix,\r\n    prefix,\r\n    barPadding,\r\n    showLabels,\r\n    showValues,\r\n    showTicks,\r\n    colorDomain,\r\n    truncateBy,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    selectedColor,\r\n    maxValue,\r\n    minValue,\r\n    highlightedDataPoints,\r\n    onSeriesMouseClick,\r\n    labelOrder,\r\n    maxBarThickness,\r\n    minBarThickness,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    valueColor,\r\n    noOfTicks,\r\n    styles,\r\n    classNames,\r\n    dimmedOpacity,\r\n    animate,\r\n    precision,\r\n    customLayers,\r\n    naLabel,\r\n    trackColor,\r\n    hideAxisLine,\r\n    locale,\r\n    padZeros,\r\n    cornerRadius,\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 margin = {\r\n    top: topMargin,\r\n    bottom: bottomMargin,\r\n    left: barAxisTitle ? leftMargin + 30 : leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: event payload defined by user based on undefined data type\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 { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n\r\n  const dataWithId = useMemo(() => {\r\n    const idSet = new Set<string | number>();\r\n\r\n    const dataWithIdWithoutMissingIds = data.map((d, i) => {\r\n      const id = labelOrder ? d.label : `${i}`;\r\n      idSet.add(id);\r\n      return { ...d, id };\r\n    });\r\n\r\n    const missingIds = labelOrder ? labelOrder.filter((id) => !idSet.has(id)) : [];\r\n\r\n    return [\r\n      ...dataWithIdWithoutMissingIds,\r\n      ...missingIds.map((id) => ({\r\n        id,\r\n        label: id,\r\n        color: null,\r\n        size: null,\r\n      })),\r\n    ];\r\n  }, [data, labelOrder]);\r\n\r\n  const barOrder = useMemo(() => {\r\n    return labelOrder ?? dataWithId.map((d) => `${d.id}`);\r\n  }, [labelOrder, dataWithId]);\r\n\r\n  const y = scaleLinear().domain([minValue, maxValue]).range([graphHeight, 0]).nice();\r\n\r\n  const x = scaleBand<string | number>()\r\n    .domain(barOrder)\r\n    .range([\r\n      0,\r\n      minBarThickness\r\n        ? Math.max(graphWidth, minBarThickness * barOrder.length)\r\n        : maxBarThickness\r\n          ? Math.min(graphWidth, maxBarThickness * barOrder.length)\r\n          : graphWidth,\r\n    ])\r\n    .paddingInner(barPadding);\r\n  const yTicks = y.ticks(noOfTicks);\r\n  return (\r\n    <>\r\n      <motion.svg\r\n        ref={svgRef}\r\n        width={`${width}px`}\r\n        height={`${height}px`}\r\n        viewBox={`0 0 ${width} ${height}`}\r\n        direction='ltr'\r\n      >\r\n        <g transform={`translate(${margin.left},${margin.top})`}>\r\n          <Axis\r\n            hideAxisLine={hideAxisLine}\r\n            y1={y(minValue < 0 ? 0 : minValue)}\r\n            y2={y(minValue < 0 ? 0 : minValue)}\r\n            x1={0 - leftMargin}\r\n            x2={graphWidth + margin.right}\r\n            label={\r\n              showTicks\r\n                ? numberFormattingFunction(\r\n                    minValue < 0 ? 0 : minValue,\r\n                    naLabel,\r\n                    precision,\r\n                    prefix,\r\n                    suffix,\r\n                    locale,\r\n                    padZeros,\r\n                  )\r\n                : undefined\r\n            }\r\n            labelPos={{\r\n              x: 0 - leftMargin,\r\n              dx: 0,\r\n              dy: maxValue < 0 ? '1em' : -5,\r\n              y: y(minValue < 0 ? 0 : minValue),\r\n            }}\r\n            classNames={{\r\n              axis: classNames?.xAxis?.axis,\r\n              label: classNames?.yAxis?.labels,\r\n            }}\r\n            styles={{ axis: styles?.xAxis?.axis, label: styles?.yAxis?.labels }}\r\n          />\r\n          {showTicks ? (\r\n            <YTicksAndGridLines\r\n              values={yTicks.filter((d) => d !== 0)}\r\n              y={yTicks.filter((d) => d !== 0).map((d) => y(d))}\r\n              x1={0 - leftMargin}\r\n              x2={graphWidth + margin.right}\r\n              styles={{\r\n                gridLines: styles?.yAxis?.gridLines,\r\n                labels: styles?.yAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: classNames?.yAxis?.gridLines,\r\n                labels: classNames?.yAxis?.labels,\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='secondary'\r\n              showGridLines\r\n              labelPos='vertical'\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n          ) : null}\r\n          <AxisTitle\r\n            x={0 - leftMargin - 15}\r\n            y={graphHeight / 2}\r\n            style={styles?.yAxis?.title}\r\n            className={classNames?.yAxis?.title}\r\n            text={barAxisTitle}\r\n            rotate90\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              !checkIfNullOrUndefined(x(d.id)) ? (\r\n                <motion.g\r\n                  className='undp-viz-g-with-hover'\r\n                  key={d.label}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                  variants={{\r\n                    initial: {\r\n                      opacity: selectedColor\r\n                        ? d.color\r\n                          ? barColor[colorDomain.indexOf(d.color)] === selectedColor\r\n                            ? !highlightedDataPoints || highlightedDataPoints.indexOf(d.id) !== -1\r\n                              ? 1\r\n                              : dimmedOpacity\r\n                            : dimmedOpacity\r\n                          : dimmedOpacity\r\n                        : highlightedDataPoints\r\n                          ? highlightedDataPoints.indexOf(d.label) !== -1\r\n                            ? 0.85\r\n                            : dimmedOpacity\r\n                          : 0.85,\r\n                    },\r\n                    whileInView: {\r\n                      opacity: selectedColor\r\n                        ? d.color\r\n                          ? barColor[colorDomain.indexOf(d.color)] === selectedColor\r\n                            ? !highlightedDataPoints || highlightedDataPoints.indexOf(d.id) !== -1\r\n                              ? 1\r\n                              : dimmedOpacity\r\n                            : dimmedOpacity\r\n                          : dimmedOpacity\r\n                        : highlightedDataPoints\r\n                          ? highlightedDataPoints.indexOf(d.label) !== -1\r\n                            ? 0.85\r\n                            : dimmedOpacity\r\n                          : 0.85,\r\n                      transition: { duration: animate.duration },\r\n                    },\r\n                  }}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                  onMouseEnter={(event) => {\r\n                    setMouseOverData(d);\r\n                    setEventY(event.clientY);\r\n                    setEventX(event.clientX);\r\n                    onSeriesMouseOver?.(d);\r\n                  }}\r\n                  onClick={() => {\r\n                    if (onSeriesMouseClick || detailsOnClick) {\r\n                      if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n                        setMouseClickData(undefined);\r\n                        onSeriesMouseClick?.(undefined);\r\n                      } else {\r\n                        setMouseClickData(d);\r\n                        onSeriesMouseClick?.(d);\r\n                      }\r\n                    }\r\n                  }}\r\n                  onMouseMove={(event) => {\r\n                    setMouseOverData(d);\r\n                    setEventY(event.clientY);\r\n                    setEventX(event.clientX);\r\n                  }}\r\n                  onMouseLeave={() => {\r\n                    setMouseOverData(undefined);\r\n                    setEventX(undefined);\r\n                    setEventY(undefined);\r\n                    onSeriesMouseOver?.(undefined);\r\n                  }}\r\n                >\r\n                  {trackColor && (\r\n                    <motion.rect\r\n                      width={x.bandwidth()}\r\n                      variants={{\r\n                        initial: {\r\n                          height: graphHeight,\r\n                          y: 0,\r\n                          x: x(`${d.id}`),\r\n                          fill: trackColor,\r\n                        },\r\n                        whileInView: {\r\n                          height: graphHeight,\r\n                          y: 0,\r\n                          x: x(`${d.id}`),\r\n                          fill: trackColor,\r\n                        },\r\n                      }}\r\n                      rx={cornerRadius}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                    />\r\n                  )}\r\n                  {d.size ? (\r\n                    <motion.rect\r\n                      width={x.bandwidth()}\r\n                      initial='initial'\r\n                      rx={cornerRadius}\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      variants={{\r\n                        initial: {\r\n                          height: 0,\r\n                          x: x(`${d.id}`),\r\n                          y: y(0),\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                        },\r\n                        whileInView: {\r\n                          height: d.size ? Math.abs(y(d.size) - y(0)) : 0,\r\n                          y: d.size ? (d.size > 0 ? y(d.size) : y(0)) : y(0),\r\n                          x: x(`${d.id}`),\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      exit={{\r\n                        height: 0,\r\n                        y: y(0),\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                    />\r\n                  ) : null}\r\n                  {showLabels ? (\r\n                    <XAxesLabels\r\n                      value={\r\n                        typeof showLabels === 'function'\r\n                          ? showLabels(d)\r\n                          : `${d.label}`.length < truncateBy\r\n                            ? `${d.label}`\r\n                            : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={(d.size || 0) < 0 ? 0 : y(0) + 5}\r\n                      x={x(`${d.id}`) as number}\r\n                      width={x.bandwidth()}\r\n                      height={(d.size || 0) < 0 ? y(0) - 5 : margin.bottom}\r\n                      style={styles?.xAxis?.labels}\r\n                      className={classNames?.xAxis?.labels}\r\n                      alignment={(d.size || 0) < 0 ? 'bottom' : 'top'}\r\n                      animate={animate}\r\n                      isInView={isInView}\r\n                    />\r\n                  ) : null}\r\n                  {showValues ? (\r\n                    <motion.text\r\n                      style={{\r\n                        textAnchor: 'middle',\r\n                        ...(styles?.graphObjectValues || {}),\r\n                      }}\r\n                      className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                      dy={d.size ? (d.size >= 0 ? '-5px' : '1em') : '-5px'}\r\n                      variants={{\r\n                        initial: {\r\n                          x: (x(`${d.id}`) as number) + x.bandwidth() / 2,\r\n                          y: y(0),\r\n                          opacity: 0,\r\n                          fill: valueColor\r\n                            ? valueColor\r\n                            : data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\r\n                        },\r\n                        whileInView: {\r\n                          x: (x(`${d.id}`) as number) + x.bandwidth() / 2,\r\n                          y: y(d.size || 0),\r\n                          fill: valueColor\r\n                            ? valueColor\r\n                            : data.filter((el) => el.color).length === 0\r\n                              ? barColor[0]\r\n                              : !d.color\r\n                                ? Colors.gray\r\n                                : barColor[colorDomain.indexOf(d.color)],\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                        opacity: 0,\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                    >\r\n                      {numberFormattingFunction(\r\n                        d.size,\r\n                        naLabel,\r\n                        precision,\r\n                        prefix,\r\n                        suffix,\r\n                        locale,\r\n                        padZeros,\r\n                      )}\r\n                    </motion.text>\r\n                  ) : null}\r\n                </motion.g>\r\n              ) : null,\r\n            )}\r\n            {refValues?.map((el) => (\r\n              <RefLineY\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                y={y(el.value as number)}\r\n                x1={0 - leftMargin}\r\n                x2={graphWidth + margin.right}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n          </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        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n","import orderBy from 'lodash.orderby';\r\nimport { useRef, useState } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Timeline } from '@/Components/Elements/Timeline';\r\nimport { useElementSize } from '@/hooks/useElementSize';\r\nimport { useTimeline } from '@/hooks/useTimeline';\r\nimport type {\r\n  AnimateDataType,\r\n  BarGraphDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  Languages,\r\n  PadZerosTypes,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n  TimelineDataType,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ensureCompleteDataForBarChart } from '@/Utils/ensureCompleteData';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { HorizontalGraph, VerticalGraph } from './Graph';\r\n\r\ninterface Props {\r\n  data: BarGraphDataType[];\r\n  colors?: string | string[];\r\n  labelOrder?: (string | number)[];\r\n  graphTitle?: string | React.ReactNode;\r\n  graphDescription?: string | React.ReactNode;\r\n  footNote?: string | React.ReactNode;\r\n  width?: number;\r\n  height?: number;\r\n  minHeight?: number;\r\n  suffix?: string;\r\n  prefix?: string;\r\n  sources?: SourcesDataType[];\r\n  barPadding?: number;\r\n  showValues?: boolean;\r\n  showTicks?: boolean;\r\n  leftMargin?: number;\r\n  rightMargin?: number;\r\n  truncateBy?: number;\r\n  colorDomain?: string[];\r\n  colorLegendTitle?: string;\r\n  backgroundColor?: string | boolean;\r\n  padding?: string;\r\n  topMargin?: number;\r\n  bottomMargin?: number;\r\n  relativeHeight?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels?: boolean | ((_d: any) => React.ReactNode);\r\n  showColorScale?: boolean;\r\n  maxValue?: number;\r\n  minValue?: number;\r\n  trackColor?: string;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  refValues?: ReferenceDataType[];\r\n  graphID?: string;\r\n  highlightedDataPoints?: (string | number)[];\r\n  dimmedOpacity?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  graphDownload?: boolean;\r\n  dataDownload?: boolean;\r\n  sortData?: 'asc' | 'desc';\r\n  language?: Languages;\r\n  showNAColor?: boolean;\r\n  theme?: 'light' | 'dark';\r\n  maxBarThickness?: number;\r\n  maxNumberOfBars?: number;\r\n  minBarThickness?: number;\r\n  ariaLabel?: string;\r\n  resetSelectionOnDoubleClick?: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  barAxisTitle?: string;\r\n  noOfTicks?: number;\r\n  valueColor?: string;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  filterNA?: boolean;\r\n  animate?: boolean | AnimateDataType;\r\n  precision?: number;\r\n  customLayers?: CustomLayerDataType[];\r\n  timeline?: TimelineDataType;\r\n  naLabel?: string;\r\n  orientation?: 'horizontal' | 'vertical';\r\n  hideAxisLine?: boolean;\r\n  locale?: string;\r\n  padZeros?: PadZerosTypes;\r\n  cornerRadius?: number;\r\n}\r\n\r\nexport function SimpleBarGraphEl(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors,\r\n    suffix = '',\r\n    sources,\r\n    prefix = '',\r\n    graphDescription,\r\n    barPadding = 0.25,\r\n    showValues = true,\r\n    showTicks = true,\r\n    truncateBy = 999,\r\n    height,\r\n    width,\r\n    footNote,\r\n    colorDomain,\r\n    colorLegendTitle,\r\n    highlightedDataPoints,\r\n    padding,\r\n    backgroundColor = false,\r\n    topMargin,\r\n    bottomMargin,\r\n    leftMargin,\r\n    rightMargin,\r\n    showLabels = true,\r\n    relativeHeight,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    showColorScale = true,\r\n    graphID,\r\n    maxValue,\r\n    minValue,\r\n    onSeriesMouseClick,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    sortData,\r\n    labelOrder,\r\n    language = 'en',\r\n    showNAColor = true,\r\n    minHeight = 0,\r\n    theme = 'light',\r\n    maxBarThickness,\r\n    maxNumberOfBars,\r\n    minBarThickness,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick = true,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks = 5,\r\n    valueColor,\r\n    styles,\r\n    classNames,\r\n    filterNA = true,\r\n    animate = false,\r\n    dimmedOpacity = 0.3,\r\n    precision = 2,\r\n    customLayers = [],\r\n    timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n    naLabel = 'NA',\r\n    orientation = 'vertical',\r\n    trackColor,\r\n    hideAxisLine = false,\r\n    locale = 'en',\r\n    padZeros = 'none',\r\n    cornerRadius = 0,\r\n  } = props;\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\r\n  const { uniqDatesSorted, index, setIndex, play, setPlay, markObj, activeDate, dateFormat } =\r\n    useTimeline(data, timeline);\r\n  const Comp = orientation === 'horizontal' ? HorizontalGraph : VerticalGraph;\r\n  const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\r\n  return (\r\n    <GraphContainer\r\n      className={classNames?.graphContainer}\r\n      style={styles?.graphContainer}\r\n      id={graphID}\r\n      ref={graphParentDiv}\r\n      aria-label={ariaLabel}\r\n      backgroundColor={backgroundColor}\r\n      theme={theme}\r\n      language={language}\r\n      minHeight={minHeight}\r\n      width={width}\r\n      height={height}\r\n      relativeHeight={relativeHeight}\r\n      padding={padding}\r\n    >\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 : 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      {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n        <Timeline\r\n          play={play}\r\n          setPlay={setPlay}\r\n          uniqDatesSorted={uniqDatesSorted}\r\n          markObj={markObj}\r\n          index={index}\r\n          setIndex={setIndex}\r\n          color={timeline.color}\r\n        />\r\n      ) : null}\r\n      {showColorScale && data.filter((el) => el.color).length !== 0 && data.length > 0 ? (\r\n        <ColorLegendWithMouseOver\r\n          width={width}\r\n          colorLegendTitle={colorLegendTitle}\r\n          colors={(colors as string[] | undefined) || Colors[theme].categoricalColors.colors}\r\n          colorDomain={colorDomain || (uniqBy(data, 'color', true) as (string | number)[])}\r\n          setSelectedColor={setSelectedColor}\r\n          showNAColor={showNAColor}\r\n          className={classNames?.colorLegend}\r\n        />\r\n      ) : null}\r\n      <GraphArea ref={graphDiv}>\r\n        {data.length === 0 && <EmptyState />}\r\n        {svgWidth && svgHeight && data.length > 0 ? (\r\n          <Comp\r\n            hideAxisLine={hideAxisLine}\r\n            data={\r\n              sortData\r\n                ? orderBy(\r\n                    ensureCompleteDataForBarChart(data, dateFormat)\r\n                      .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                      .filter((d) => (filterNA ? !checkIfNullOrUndefined(d.size) : d)),\r\n                    [\r\n                      (d) =>\r\n                        d.size === undefined\r\n                          ? sortData === 'asc'\r\n                            ? (orientation === 'horizontal' ? 1 : -1) * Infinity\r\n                            : (orientation === 'horizontal' ? -1 : 1) * Infinity\r\n                          : d.size,\r\n                    ],\r\n                    [sortData],\r\n                  ).filter((_d, i) => (maxNumberOfBars ? i < maxNumberOfBars : true))\r\n                : ensureCompleteDataForBarChart(data, dateFormat)\r\n                    .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                    .filter((d) => (filterNA ? !checkIfNullOrUndefined(d.size) : d))\r\n                    .filter((_d, i) => (maxNumberOfBars ? i < maxNumberOfBars : true))\r\n            }\r\n            barColor={\r\n              data.filter((el) => el.color).length === 0\r\n                ? colors\r\n                  ? [colors as string]\r\n                  : [Colors.primaryColors['blue-600']]\r\n                : (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n            }\r\n            colorDomain={\r\n              data.filter((el) => el.color).length === 0\r\n                ? []\r\n                : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n            }\r\n            selectedColor={selectedColor}\r\n            trackColor={trackColor}\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            suffix={suffix}\r\n            prefix={prefix}\r\n            barPadding={barPadding}\r\n            showValues={showValues}\r\n            showTicks={showTicks}\r\n            leftMargin={leftMargin}\r\n            rightMargin={rightMargin}\r\n            topMargin={topMargin}\r\n            bottomMargin={bottomMargin}\r\n            truncateBy={truncateBy}\r\n            showLabels={showLabels}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            refValues={refValues}\r\n            maxValue={\r\n              !checkIfNullOrUndefined(maxValue)\r\n                ? (maxValue as number)\r\n                : Math.max(\r\n                      ...data\r\n                        .filter((d) => !checkIfNullOrUndefined(d.size))\r\n                        .map((d) => d.size as number),\r\n                    ) < 0\r\n                  ? 0\r\n                  : Math.max(\r\n                      ...data\r\n                        .filter((d) => !checkIfNullOrUndefined(d.size))\r\n                        .map((d) => d.size as number),\r\n                    )\r\n            }\r\n            minValue={\r\n              !checkIfNullOrUndefined(minValue)\r\n                ? (minValue as number)\r\n                : Math.min(\r\n                      ...data\r\n                        .filter((d) => !checkIfNullOrUndefined(d.size))\r\n                        .map((d) => d.size as number),\r\n                    ) >= 0\r\n                  ? 0\r\n                  : Math.min(\r\n                      ...data\r\n                        .filter((d) => !checkIfNullOrUndefined(d.size))\r\n                        .map((d) => d.size as number),\r\n                    )\r\n            }\r\n            highlightedDataPoints={highlightedDataPoints}\r\n            onSeriesMouseClick={onSeriesMouseClick}\r\n            labelOrder={labelOrder}\r\n            rtl={language === 'he' || language === 'ar'}\r\n            maxBarThickness={maxBarThickness}\r\n            minBarThickness={minBarThickness}\r\n            resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n            detailsOnClick={detailsOnClick}\r\n            barAxisTitle={barAxisTitle}\r\n            noOfTicks={noOfTicks}\r\n            valueColor={valueColor}\r\n            classNames={classNames}\r\n            styles={styles}\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            dimmedOpacity={dimmedOpacity}\r\n            precision={precision}\r\n            customLayers={customLayers}\r\n            naLabel={naLabel}\r\n            locale={locale}\r\n            padZeros={padZeros}\r\n            cornerRadius={cornerRadius}\r\n          />\r\n        ) : null}\r\n      </GraphArea>\r\n      {sources || footNote ? (\r\n        <GraphFooter\r\n          sources={sources}\r\n          footNote={footNote}\r\n          width={width}\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        />\r\n      ) : null}\r\n    </GraphContainer>\r\n  );\r\n}\r\n","import { cn } from '@undp/design-system-react/cn';\r\nimport { scaleBand, scaleLinear } from 'd3-scale';\r\nimport isEqual from 'fast-deep-equal';\r\nimport sum from 'lodash.sum';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { useMemo, useRef, useState } from 'react';\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\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { YAxesLabels } from '@/Components/Elements/Axes/YAxesLabels';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { RefLineX, RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  GroupedBarGraphDataType,\r\n  PadZerosTypes,\r\n  ReferenceDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getGraphDimensions } from '@/Utils/getGraphDimensions';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\n\r\ninterface Props {\r\n  data: GroupedBarGraphDataType[];\r\n  barColors: string[];\r\n  barPadding: number;\r\n  showTicks: boolean;\r\n  leftMargin?: number;\r\n  truncateBy: number;\r\n  width: number;\r\n  height: number;\r\n  rightMargin?: number;\r\n  topMargin?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels: boolean | ((_d: any) => React.ReactNode);\r\n  bottomMargin?: number;\r\n  suffix: string;\r\n  prefix: string;\r\n  showValues: boolean;\r\n  showTotalValue: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  refValues?: ReferenceDataType[];\r\n  maxValue: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  selectedColor?: string;\r\n  rtl: boolean;\r\n  labelOrder?: (string | number)[];\r\n  maxBarThickness?: number;\r\n  minBarThickness?: number;\r\n  resetSelectionOnDoubleClick: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  barAxisTitle?: string;\r\n  noOfTicks: number;\r\n  valueColor?: string;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  animate: AnimateDataType;\r\n  colorDomain: string[];\r\n  precision: number;\r\n  customLayers: CustomLayerDataType[];\r\n  naLabel: string;\r\n  hideAxisLine: boolean;\r\n  locale: string;\r\n  padZeros: PadZerosTypes;\r\n  minLabelSize: number;\r\n  cornerRadius: number;\r\n}\r\n\r\nexport function HorizontalGraph(props: Props) {\r\n  const {\r\n    data,\r\n    barColors,\r\n    barPadding,\r\n    showTicks,\r\n    topMargin = 25,\r\n    bottomMargin = 10,\r\n    leftMargin = 100,\r\n    rightMargin = 40,\r\n    truncateBy,\r\n    width,\r\n    height,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    showLabels,\r\n    suffix,\r\n    prefix,\r\n    showValues,\r\n    refValues,\r\n    maxValue,\r\n    onSeriesMouseClick,\r\n    selectedColor,\r\n    rtl,\r\n    labelOrder,\r\n    maxBarThickness,\r\n    minBarThickness,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    valueColor,\r\n    noOfTicks,\r\n    styles,\r\n    classNames,\r\n    animate,\r\n    colorDomain,\r\n    precision,\r\n    customLayers,\r\n    naLabel,\r\n    hideAxisLine,\r\n    locale,\r\n    padZeros,\r\n    showTotalValue,\r\n    minLabelSize,\r\n    cornerRadius,\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 margin = {\r\n    top: barAxisTitle ? topMargin + 25 : topMargin,\r\n    bottom: bottomMargin,\r\n    left: leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n\r\n  const dataWithId = useMemo(() => {\r\n    const idSet = new Set<string | number>();\r\n\r\n    const dataWithIdWithoutMissingIds = data.map((d, i) => {\r\n      const id = labelOrder ? d.label : `${i}`;\r\n      idSet.add(id);\r\n      return { ...d, id };\r\n    });\r\n\r\n    const missingIds = labelOrder ? labelOrder.filter((id) => !idSet.has(id)) : [];\r\n\r\n    return [\r\n      ...dataWithIdWithoutMissingIds,\r\n      ...missingIds.map((id) => ({\r\n        id,\r\n        label: id,\r\n        size: Array(data[0].size.length).fill(null),\r\n      })),\r\n    ];\r\n  }, [data, labelOrder]);\r\n\r\n  const barOrder = useMemo(() => {\r\n    return labelOrder ?? dataWithId.map((d) => `${d.id}`);\r\n  }, [labelOrder, dataWithId]);\r\n\r\n  const x = scaleLinear().domain([0, maxValue]).range([0, graphWidth]).nice();\r\n  const y = scaleBand<string | number>()\r\n    .domain(barOrder)\r\n    .range([\r\n      0,\r\n      minBarThickness\r\n        ? Math.max(graphHeight, minBarThickness * barOrder.length)\r\n        : maxBarThickness\r\n          ? Math.min(graphHeight, maxBarThickness * barOrder.length)\r\n          : graphHeight,\r\n    ])\r\n    .paddingInner(barPadding);\r\n  const xTicks = x.ticks(noOfTicks);\r\n\r\n  return (\r\n    <>\r\n      <motion.svg\r\n        ref={svgRef}\r\n        width={`${width}px`}\r\n        height={`${height}px`}\r\n        viewBox={`0 0 ${width} ${height}`}\r\n        direction='ltr'\r\n      >\r\n        <g transform={`translate(${margin.left},${margin.top})`}>\r\n          {showTicks ? (\r\n            <XTicksAndGridLines\r\n              values={xTicks.filter((d) => d !== 0)}\r\n              x={xTicks.filter((d) => d !== 0).map((d) => x(d))}\r\n              y1={0 - topMargin}\r\n              y2={graphHeight + margin.bottom}\r\n              styles={{\r\n                gridLines: styles?.xAxis?.gridLines,\r\n                labels: styles?.xAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: classNames?.xAxis?.gridLines,\r\n                labels: classNames?.xAxis?.labels,\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='secondary'\r\n              showGridLines\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n          ) : null}\r\n          <AxisTitle\r\n            x={graphWidth / 2}\r\n            y={0 - margin.top + 15}\r\n            style={styles?.xAxis?.title}\r\n            className={classNames?.xAxis?.title}\r\n            text={barAxisTitle}\r\n          />\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <AnimatePresence>\r\n            {dataWithId.map((d) =>\r\n              !checkIfNullOrUndefined(y(d.id)) ? (\r\n                <motion.g\r\n                  className='undp-viz-low-opacity undp-viz-g-with-hover'\r\n                  key={d.label}\r\n                  variants={{\r\n                    initial: { x: 0, y: y(`${d.id}`) },\r\n                    whileInView: {\r\n                      x: 0,\r\n                      y: y(`${d.id}`),\r\n                      transition: { duration: animate.duration },\r\n                    },\r\n                  }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                >\r\n                  {d.size.map((el, j) => (\r\n                    <motion.g\r\n                      key={`${d.label}-${colorDomain[j] || j}`}\r\n                      opacity={selectedColor ? (barColors[j] === selectedColor ? 1 : 0.3) : 1}\r\n                      onMouseEnter={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\r\n                        setEventY(event.clientY);\r\n                        setEventX(event.clientX);\r\n                        onSeriesMouseOver?.({ ...d, sizeIndex: j });\r\n                      }}\r\n                      onMouseMove={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\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                      onClick={() => {\r\n                        if (onSeriesMouseClick || detailsOnClick) {\r\n                          if (\r\n                            isEqual(mouseClickData, { ...d, sizeIndex: j }) &&\r\n                            resetSelectionOnDoubleClick\r\n                          ) {\r\n                            setMouseClickData(undefined);\r\n                            onSeriesMouseClick?.(undefined);\r\n                          } else {\r\n                            setMouseClickData({ ...d, sizeIndex: j });\r\n                            if (onSeriesMouseClick) onSeriesMouseClick({ ...d, sizeIndex: j });\r\n                          }\r\n                        }\r\n                      }}\r\n                    >\r\n                      {el ? (\r\n                        <motion.rect\r\n                          // biome-ignore lint/suspicious/noArrayIndexKey: index is the identifier here\r\n                          key={j}\r\n                          y={0}\r\n                          style={{ fill: barColors[j] }}\r\n                          height={y.bandwidth()}\r\n                          rx={cornerRadius}\r\n                          exit={{\r\n                            width: 0,\r\n                            x: x(0),\r\n                            transition: { duration: animate.duration },\r\n                          }}\r\n                          variants={{\r\n                            initial: {\r\n                              width: 0,\r\n                              x: x(0),\r\n                              fill: barColors[j],\r\n                            },\r\n                            whileInView: {\r\n                              width: x(el || 0),\r\n                              x: x(\r\n                                j === 0 ? 0 : sum(d.size.filter((element, k) => k < j && element)),\r\n                              ),\r\n                              fill: barColors[j],\r\n                              transition: { duration: animate.duration },\r\n                            },\r\n                          }}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                        />\r\n                      ) : null}\r\n                      {showValues && minLabelSize <= x(el || 0) ? (\r\n                        <motion.text\r\n                          y={y.bandwidth() / 2}\r\n                          style={{\r\n                            textAnchor: 'middle',\r\n                            ...(styles?.graphObjectValues || {}),\r\n                          }}\r\n                          dy='0.33em'\r\n                          className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                          exit={{\r\n                            opacity: 0,\r\n                            transition: { duration: animate.duration },\r\n                          }}\r\n                          variants={{\r\n                            initial: {\r\n                              x: x(0),\r\n                              opacity: 0,\r\n                              fill: getTextColorBasedOnBgColor(barColors[j]),\r\n                            },\r\n                            whileInView: {\r\n                              x:\r\n                                x(\r\n                                  j === 0\r\n                                    ? 0\r\n                                    : sum(d.size.filter((element, k) => k < j && element)),\r\n                                ) +\r\n                                x(el || 0) / 2,\r\n                              opacity:\r\n                                el &&\r\n                                x(el) /\r\n                                  numberFormattingFunction(\r\n                                    el,\r\n                                    naLabel,\r\n                                    precision,\r\n                                    prefix,\r\n                                    suffix,\r\n                                    locale,\r\n                                    padZeros,\r\n                                  ).length >\r\n                                  12\r\n                                  ? 1\r\n                                  : 0,\r\n                              fill: getTextColorBasedOnBgColor(barColors[j]),\r\n                              transition: { duration: animate.duration },\r\n                            },\r\n                          }}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                        >\r\n                          {numberFormattingFunction(\r\n                            el,\r\n                            naLabel,\r\n                            precision,\r\n                            prefix,\r\n                            suffix,\r\n                            locale,\r\n                            padZeros,\r\n                          )}\r\n                        </motion.text>\r\n                      ) : null}\r\n                    </motion.g>\r\n                  ))}\r\n                  {showLabels ? (\r\n                    <YAxesLabels\r\n                      value={\r\n                        typeof showLabels === 'function'\r\n                          ? showLabels(d)\r\n                          : `${d.label}`.length < truncateBy\r\n                            ? `${d.label}`\r\n                            : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={0}\r\n                      x={0 - margin.left}\r\n                      width={0 + margin.left}\r\n                      height={y.bandwidth()}\r\n                      style={styles?.yAxis?.labels}\r\n                      className={classNames?.yAxis?.labels}\r\n                      animate={animate}\r\n                      isInView={isInView}\r\n                    />\r\n                  ) : null}\r\n                  {showTotalValue ? (\r\n                    <motion.text\r\n                      className={cn(\r\n                        'graph-value graph-value-total text-sm',\r\n                        !valueColor ? ' fill-content-primary' : '',\r\n                        classNames?.graphObjectValues,\r\n                      )}\r\n                      style={{\r\n                        ...(valueColor ? { fill: valueColor } : {}),\r\n                        textAnchor: 'start',\r\n                        ...(styles?.graphObjectValues || {}),\r\n                      }}\r\n                      y={y.bandwidth() / 2}\r\n                      dx={5}\r\n                      dy='0.33em'\r\n                      variants={{\r\n                        initial: {\r\n                          x: x(0),\r\n                          opacity: 0,\r\n                          ...(valueColor ? { fill: valueColor } : {}),\r\n                        },\r\n                        whileInView: {\r\n                          x: x(sum(d.size.map((el) => el || 0))),\r\n                          opacity: 1,\r\n                          ...(valueColor ? { fill: valueColor } : {}),\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      exit={{\r\n                        opacity: 0,\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                    >\r\n                      {numberFormattingFunction(\r\n                        sum(d.size.filter((element) => element)),\r\n                        naLabel,\r\n                        precision,\r\n                        prefix,\r\n                        suffix,\r\n                        locale,\r\n                        padZeros,\r\n                      )}\r\n                    </motion.text>\r\n                  ) : null}\r\n                </motion.g>\r\n              ) : null,\r\n            )}\r\n            <Axis\r\n              hideAxisLine={hideAxisLine}\r\n              x1={x(0)}\r\n              x2={x(0)}\r\n              y1={-2.5}\r\n              y2={graphHeight + margin.bottom}\r\n              classNames={{ axis: classNames?.yAxis?.axis }}\r\n              styles={{ axis: styles?.yAxis?.axis }}\r\n            />\r\n            {refValues?.map((el) => (\r\n              <RefLineX\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                x={x(el.value as number)}\r\n                y1={0 - margin.top}\r\n                y2={graphHeight + margin.bottom}\r\n                textSide={x(el.value as number) > graphWidth * 0.75 || rtl ? 'left' : 'right'}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n          </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        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n\r\nexport function VerticalGraph(props: Props) {\r\n  const {\r\n    data,\r\n    leftMargin = 20,\r\n    rightMargin = 20,\r\n    topMargin = 20,\r\n    bottomMargin = 25,\r\n    width,\r\n    height,\r\n    barColors,\r\n    barPadding,\r\n    showLabels,\r\n    showTicks,\r\n    truncateBy,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    suffix,\r\n    prefix,\r\n    showValues,\r\n    refValues,\r\n    maxValue,\r\n    onSeriesMouseClick,\r\n    selectedColor,\r\n    labelOrder,\r\n    maxBarThickness,\r\n    minBarThickness,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    valueColor,\r\n    noOfTicks,\r\n    styles,\r\n    classNames,\r\n    animate,\r\n    colorDomain,\r\n    precision,\r\n    customLayers,\r\n    naLabel,\r\n    hideAxisLine,\r\n    locale,\r\n    padZeros,\r\n    showTotalValue,\r\n    minLabelSize,\r\n    cornerRadius,\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 margin = {\r\n    top: topMargin,\r\n    bottom: bottomMargin,\r\n    left: barAxisTitle ? leftMargin + 30 : leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n\r\n  const dataWithId = useMemo(() => {\r\n    const idSet = new Set<string | number>();\r\n\r\n    const dataWithIdWithoutMissingIds = data.map((d, i) => {\r\n      const id = labelOrder ? d.label : `${i}`;\r\n      idSet.add(id);\r\n      return { ...d, id };\r\n    });\r\n\r\n    const missingIds = labelOrder ? labelOrder.filter((id) => !idSet.has(id)) : [];\r\n\r\n    return [\r\n      ...dataWithIdWithoutMissingIds,\r\n      ...missingIds.map((id) => ({\r\n        id,\r\n        label: id,\r\n        size: Array(data[0].size.length).fill(null),\r\n      })),\r\n    ];\r\n  }, [data, labelOrder]);\r\n\r\n  const barOrder = useMemo(() => {\r\n    return labelOrder ?? dataWithId.map((d) => `${d.id}`);\r\n  }, [labelOrder, dataWithId]);\r\n\r\n  const y = scaleLinear().domain([0, maxValue]).range([graphHeight, 0]).nice();\r\n\r\n  const x = scaleBand<string | number>()\r\n    .domain(barOrder)\r\n    .range([\r\n      0,\r\n      minBarThickness\r\n        ? Math.max(graphWidth, minBarThickness * barOrder.length)\r\n        : maxBarThickness\r\n          ? Math.min(graphWidth, maxBarThickness * barOrder.length)\r\n          : graphWidth,\r\n    ])\r\n    .paddingInner(barPadding);\r\n  const yTicks = y.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          <Axis\r\n            hideAxisLine={hideAxisLine}\r\n            y1={y(0)}\r\n            y2={y(0)}\r\n            x1={0 - leftMargin}\r\n            x2={graphWidth + margin.right}\r\n            label={\r\n              showTicks\r\n                ? numberFormattingFunction(0, naLabel, precision, prefix, suffix, locale, padZeros)\r\n                : undefined\r\n            }\r\n            labelPos={{\r\n              x: 0 - leftMargin,\r\n              y: y(0),\r\n              dx: 0,\r\n              dy: -5,\r\n            }}\r\n            classNames={{\r\n              axis: classNames?.xAxis?.axis,\r\n              label: classNames?.yAxis?.labels,\r\n            }}\r\n            styles={{ axis: styles?.xAxis?.axis, label: styles?.yAxis?.labels }}\r\n          />\r\n          {showTicks ? (\r\n            <YTicksAndGridLines\r\n              values={yTicks.filter((d) => d !== 0)}\r\n              y={yTicks.filter((d) => d !== 0).map((d) => y(d))}\r\n              x1={0 - leftMargin}\r\n              x2={graphWidth + margin.right}\r\n              styles={{\r\n                gridLines: styles?.yAxis?.gridLines,\r\n                labels: styles?.yAxis?.labels,\r\n              }}\r\n              classNames={{\r\n                gridLines: classNames?.yAxis?.gridLines,\r\n                labels: classNames?.yAxis?.labels,\r\n              }}\r\n              suffix={suffix}\r\n              prefix={prefix}\r\n              labelType='secondary'\r\n              showGridLines\r\n              labelPos='vertical'\r\n              precision={precision}\r\n              locale={locale}\r\n              padZeros={padZeros}\r\n            />\r\n          ) : null}\r\n          <AxisTitle\r\n            x={0 - leftMargin - 15}\r\n            y={graphHeight / 2}\r\n            style={styles?.yAxis?.title}\r\n            className={classNames?.yAxis?.title}\r\n            text={barAxisTitle}\r\n            rotate90\r\n          />\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <AnimatePresence>\r\n            {dataWithId.map((d) =>\r\n              !checkIfNullOrUndefined(x(d.id)) ? (\r\n                <motion.g\r\n                  className='undp-viz-low-opacity undp-viz-g-with-hover'\r\n                  key={d.label}\r\n                  variants={{\r\n                    initial: { x: x(`${d.id}`), y: 0 },\r\n                    whileInView: {\r\n                      x: x(`${d.id}`),\r\n                      y: 0,\r\n                      transition: { duration: animate.duration },\r\n                    },\r\n                  }}\r\n                  transition={{ duration: animate.duration }}\r\n                  initial='initial'\r\n                  animate={isInView ? 'whileInView' : 'initial'}\r\n                  exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                >\r\n                  {d.size.map((el, j) => (\r\n                    <motion.g\r\n                      key={`${d.label}-${colorDomain[j] || j}`}\r\n                      opacity={selectedColor ? (barColors[j] === selectedColor ? 1 : 0.3) : 1}\r\n                      onMouseEnter={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\r\n                        setEventY(event.clientY);\r\n                        setEventX(event.clientX);\r\n                        onSeriesMouseOver?.({ ...d, sizeIndex: j });\r\n                      }}\r\n                      onMouseMove={(event) => {\r\n                        setMouseOverData({ ...d, sizeIndex: j });\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                      onClick={() => {\r\n                        if (onSeriesMouseClick || detailsOnClick) {\r\n                          if (\r\n                            isEqual(mouseClickData, { ...d, sizeIndex: j }) &&\r\n                            resetSelectionOnDoubleClick\r\n                          ) {\r\n                            setMouseClickData(undefined);\r\n                            onSeriesMouseClick?.(undefined);\r\n                          } else {\r\n                            setMouseClickData({ ...d, sizeIndex: j });\r\n                            if (onSeriesMouseClick) onSeriesMouseClick({ ...d, sizeIndex: j });\r\n                          }\r\n                        }\r\n                      }}\r\n                    >\r\n                      <motion.rect\r\n                        x={0}\r\n                        width={x.bandwidth()}\r\n                        rx={cornerRadius}\r\n                        variants={{\r\n                          initial: {\r\n                            height: 0,\r\n                            fill: barColors[j],\r\n                            y: y(0),\r\n                          },\r\n                          whileInView: {\r\n                            height: Math.abs(\r\n                              y(sum(d.size.filter((element, k) => k <= j && element))) -\r\n                                y(sum(d.size.filter((element, k) => k < j && element))),\r\n                            ),\r\n                            y: y(sum(d.size.filter((element, k) => k <= j && element))),\r\n                            fill: barColors[j],\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                          height: 0,\r\n                          y: y(0),\r\n                          transition: { duration: animate.duration },\r\n                        }}\r\n                      />\r\n                      {showValues &&\r\n                      minLabelSize <=\r\n                        Math.abs(\r\n                          y(sum(d.size.filter((element, k) => k <= j && element))) -\r\n                            y(sum(d.size.filter((element, k) => k < j && element))),\r\n                        ) ? (\r\n                        <motion.text\r\n                          x={x.bandwidth() / 2}\r\n                          style={{\r\n                            textAnchor: 'middle',\r\n                            ...(styles?.graphObjectValues || {}),\r\n                          }}\r\n                          className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n                          dy='0.33em'\r\n                          variants={{\r\n                            initial: {\r\n                              y: y(0),\r\n                              opacity: 0,\r\n                              fill: getTextColorBasedOnBgColor(barColors[j]),\r\n                            },\r\n                            whileInView: {\r\n                              y:\r\n                                y(sum(d.size.filter((element, k) => k <= j && element))) +\r\n                                Math.abs(\r\n                                  y(sum(d.size.filter((element, k) => k <= j && element))) -\r\n                                    y(sum(d.size.filter((element, k) => k < j && element))),\r\n                                ) /\r\n                                  2,\r\n                              opacity:\r\n                                el &&\r\n                                Math.abs(\r\n                                  y(sum(d.size.filter((element, k) => k <= j && element))) -\r\n                                    y(sum(d.size.filter((element, k) => k < j && element))),\r\n                                ) > 20\r\n                                  ? 1\r\n                                  : 0,\r\n                              fill: getTextColorBasedOnBgColor(barColors[j]),\r\n                              transition: { duration: animate.duration },\r\n                            },\r\n                          }}\r\n                          initial='initial'\r\n                          animate={isInView ? 'whileInView' : 'initial'}\r\n                          exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n                        >\r\n                          {numberFormattingFunction(\r\n                            el,\r\n                            naLabel,\r\n                            precision,\r\n                            prefix,\r\n                            suffix,\r\n                            locale,\r\n                            padZeros,\r\n                          )}\r\n                        </motion.text>\r\n                      ) : null}\r\n                    </motion.g>\r\n                  ))}\r\n                  {showLabels ? (\r\n                    <XAxesLabels\r\n                      value={\r\n                        typeof showLabels === 'function'\r\n                          ? showLabels(d)\r\n                          : `${d.label}`.length < truncateBy\r\n                            ? `${d.label}`\r\n                            : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={y(0) + 5}\r\n                      x={0}\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                  {showTotalValue ? (\r\n                    <motion.text\r\n                      style={{\r\n                        textAnchor: 'middle',\r\n                        ...(styles?.graphObjectValues || {}),\r\n                      }}\r\n                      x={x.bandwidth() / 2}\r\n                      dy={-10}\r\n                      className={cn(\r\n                        'graph-value graph-value-total text-sm',\r\n                        !valueColor ? 'fill-content-primary' : '',\r\n                        classNames?.graphObjectValues,\r\n                      )}\r\n                      variants={{\r\n                        initial: {\r\n                          y: y(0),\r\n                          opacity: 0,\r\n                          ...(valueColor && { fill: valueColor }),\r\n                        },\r\n                        whileInView: {\r\n                          y: y(sum(d.size.map((el) => el || 0))),\r\n                          opacity: 1,\r\n                          ...(valueColor && { fill: valueColor }),\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      exit={{\r\n                        opacity: 0,\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                    >\r\n                      {numberFormattingFunction(\r\n                        sum(d.size.filter((element) => element)),\r\n                        naLabel,\r\n                        precision,\r\n                        prefix,\r\n                        suffix,\r\n                        locale,\r\n                        padZeros,\r\n                      )}\r\n                    </motion.text>\r\n                  ) : null}\r\n                </motion.g>\r\n              ) : null,\r\n            )}\r\n            {refValues?.map((el) => (\r\n              <RefLineY\r\n                key={el.text}\r\n                text={el.text}\r\n                color={el.color}\r\n                y={y(el.value as number)}\r\n                x1={0 - leftMargin}\r\n                x2={graphWidth + margin.right}\r\n                classNames={el.classNames}\r\n                styles={el.styles}\r\n                animate={animate}\r\n                isInView={isInView}\r\n              />\r\n            ))}\r\n          </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        <DetailsModal\r\n          body={detailsOnClick}\r\n          data={mouseClickData}\r\n          setData={setMouseClickData}\r\n          className={classNames?.modal}\r\n        />\r\n      ) : null}\r\n    </>\r\n  );\r\n}\r\n","import orderBy from 'lodash.orderby';\r\nimport sum from 'lodash.sum';\r\nimport { useRef, useState } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Timeline } from '@/Components/Elements/Timeline';\r\nimport { useElementSize } from '@/hooks/useElementSize';\r\nimport { useTimeline } from '@/hooks/useTimeline';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  GroupedBarGraphDataType,\r\n  Languages,\r\n  PadZerosTypes,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n  TimelineDataType,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ensureCompleteDataForStackedBarChart } from '@/Utils/ensureCompleteData';\r\nimport { HorizontalGraph, VerticalGraph } from './Graph';\r\n\r\ninterface Props {\r\n  data: GroupedBarGraphDataType[];\r\n  colors?: string[];\r\n  labelOrder?: (string | number)[];\r\n  graphTitle?: string | React.ReactNode;\r\n  graphDescription?: string | React.ReactNode;\r\n  footNote?: string | React.ReactNode;\r\n  width?: number;\r\n  height?: number;\r\n  sources?: SourcesDataType[];\r\n  barPadding?: number;\r\n  showTicks?: boolean;\r\n  leftMargin?: number;\r\n  rightMargin?: number;\r\n  truncateBy?: number;\r\n  colorDomain: string[];\r\n  colorLegendTitle?: string;\r\n  backgroundColor?: string | boolean;\r\n  padding?: string;\r\n  topMargin?: number;\r\n  bottomMargin?: number;\r\n  suffix?: string;\r\n  prefix?: string;\r\n  showValues?: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels?: boolean | ((_d: any) => React.ReactNode);\r\n  relativeHeight?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  refValues?: ReferenceDataType[];\r\n  graphID?: string;\r\n  maxValue?: number;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseClick?: (_d: any) => void;\r\n  graphDownload?: boolean;\r\n  dataDownload?: boolean;\r\n  language?: Languages;\r\n  minHeight?: number;\r\n  theme?: 'light' | 'dark';\r\n  maxBarThickness?: number;\r\n  sortParameter?: number | 'total';\r\n  sortData?: 'asc' | 'desc';\r\n  maxNumberOfBars?: number;\r\n  minBarThickness?: number;\r\n  ariaLabel?: string;\r\n  resetSelectionOnDoubleClick?: boolean;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  barAxisTitle?: string;\r\n  noOfTicks?: number;\r\n  valueColor?: string;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  filterNA?: boolean;\r\n  animate?: boolean | AnimateDataType;\r\n  precision?: number;\r\n  locale?: string;\r\n  showColorScale?: boolean;\r\n  customLayers?: CustomLayerDataType[];\r\n  timeline?: TimelineDataType;\r\n  naLabel?: string;\r\n  orientation?: 'horizontal' | 'vertical';\r\n  hideAxisLine?: boolean;\r\n  padZeros?: PadZerosTypes;\r\n  showTotalValue?: boolean;\r\n  minLabelSize?: number;\r\n  cornerRadius?: number;\r\n}\r\n\r\nexport function StackedBarGraphEl(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors = Colors.light.categoricalColors.colors,\r\n    sources,\r\n    graphDescription,\r\n    barPadding = 0.25,\r\n    showTicks = true,\r\n    truncateBy = 999,\r\n    height,\r\n    width,\r\n    footNote,\r\n    colorDomain,\r\n    colorLegendTitle,\r\n    padding,\r\n    backgroundColor = false,\r\n    topMargin,\r\n    bottomMargin,\r\n    leftMargin,\r\n    rightMargin,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    suffix = '',\r\n    prefix = '',\r\n    showLabels = true,\r\n    relativeHeight,\r\n    showValues = true,\r\n    showTotalValue,\r\n    refValues,\r\n    graphID,\r\n    maxValue,\r\n    onSeriesMouseClick,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    language = 'en',\r\n    labelOrder,\r\n    minHeight = 0,\r\n    theme = 'light',\r\n    maxBarThickness,\r\n    sortParameter,\r\n    maxNumberOfBars,\r\n    minBarThickness,\r\n    showColorScale = true,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick = true,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks = 5,\r\n    valueColor,\r\n    styles,\r\n    classNames,\r\n    filterNA = true,\r\n    animate = false,\r\n    precision = 2,\r\n    locale = 'en',\r\n    customLayers = [],\r\n    timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n    naLabel = 'NA',\r\n    sortData,\r\n    orientation = 'vertical',\r\n    hideAxisLine = false,\r\n    padZeros = 'none',\r\n    minLabelSize,\r\n    cornerRadius = 0,\r\n  } = props;\r\n\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\r\n  const { uniqDatesSorted, index, setIndex, play, setPlay, markObj, activeDate, dateFormat } =\r\n    useTimeline(data, timeline);\r\n  const Comp = orientation === 'horizontal' ? HorizontalGraph : VerticalGraph;\r\n  const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\r\n  return (\r\n    <GraphContainer\r\n      className={classNames?.graphContainer}\r\n      style={styles?.graphContainer}\r\n      id={graphID}\r\n      ref={graphParentDiv}\r\n      aria-label={ariaLabel}\r\n      backgroundColor={backgroundColor}\r\n      theme={theme}\r\n      language={language}\r\n      minHeight={minHeight}\r\n      width={width}\r\n      height={height}\r\n      relativeHeight={relativeHeight}\r\n      padding={padding}\r\n    >\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 : 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      {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n        <Timeline\r\n          play={play}\r\n          setPlay={setPlay}\r\n          uniqDatesSorted={uniqDatesSorted}\r\n          markObj={markObj}\r\n          index={index}\r\n          setIndex={setIndex}\r\n          color={timeline.color}\r\n        />\r\n      ) : null}\r\n      {showColorScale && data.length > 0 ? (\r\n        <ColorLegendWithMouseOver\r\n          width={width}\r\n          colorDomain={colorDomain}\r\n          colors={colors}\r\n          colorLegendTitle={colorLegendTitle}\r\n          setSelectedColor={setSelectedColor}\r\n          showNAColor={false}\r\n          className={classNames?.colorLegend}\r\n        />\r\n      ) : null}\r\n      <GraphArea ref={graphDiv}>\r\n        {data.length === 0 && <EmptyState />}\r\n        {svgWidth && svgHeight && data.length > 0 ? (\r\n          <Comp\r\n            hideAxisLine={hideAxisLine}\r\n            showTotalValue={showTotalValue ?? showValues}\r\n            data={\r\n              sortParameter !== undefined\r\n                ? sortParameter === 'total'\r\n                  ? orderBy(\r\n                      ensureCompleteDataForStackedBarChart(data, dateFormat)\r\n                        .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                        .filter((d) => (filterNA ? !d.size.every((item) => item == null) : d)),\r\n                      (d) => sum(d.size.filter((el) => !checkIfNullOrUndefined(el))),\r\n                      [sortData || 'asc'],\r\n                    ).filter((_d, i) => (maxNumberOfBars ? i < maxNumberOfBars : true))\r\n                  : orderBy(\r\n                      ensureCompleteDataForStackedBarChart(data, dateFormat)\r\n                        .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                        .filter((d) => (filterNA ? !d.size.every((item) => item == null) : d)),\r\n                      (d) =>\r\n                        checkIfNullOrUndefined(d.size[sortParameter])\r\n                          ? -Infinity\r\n                          : d.size[sortParameter],\r\n                      [sortData || 'asc'],\r\n                    ).filter((_d, i) => (maxNumberOfBars ? i < maxNumberOfBars : true))\r\n                : ensureCompleteDataForStackedBarChart(data, dateFormat)\r\n                    .filter((d) => (timeline.enabled ? `${d.date}` === activeDate : d))\r\n                    .filter((d) => (filterNA ? !d.size.every((item) => item == null) : d))\r\n                    .filter((_d, i) => (maxNumberOfBars ? i < maxNumberOfBars : true))\r\n            }\r\n            barColors={colors}\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            barPadding={barPadding}\r\n            showTicks={showTicks}\r\n            leftMargin={leftMargin}\r\n            rightMargin={rightMargin}\r\n            topMargin={topMargin}\r\n            bottomMargin={bottomMargin}\r\n            truncateBy={truncateBy}\r\n            showLabels={showLabels}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            showValues={showValues}\r\n            suffix={suffix}\r\n            prefix={prefix}\r\n            refValues={refValues}\r\n            maxValue={\r\n              !checkIfNullOrUndefined(maxValue)\r\n                ? (maxValue as number)\r\n                : Math.max(\r\n                    ...data.map((d) => sum(d.size.filter((l) => !checkIfNullOrUndefined(l))) || 0),\r\n                  )\r\n            }\r\n            onSeriesMouseClick={onSeriesMouseClick}\r\n            selectedColor={selectedColor}\r\n            rtl={language === 'he' || language === 'ar'}\r\n            labelOrder={labelOrder}\r\n            maxBarThickness={maxBarThickness}\r\n            minBarThickness={minBarThickness}\r\n            resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n            detailsOnClick={detailsOnClick}\r\n            barAxisTitle={barAxisTitle}\r\n            noOfTicks={noOfTicks}\r\n            valueColor={valueColor}\r\n            classNames={classNames}\r\n            styles={styles}\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            colorDomain={colorDomain}\r\n            precision={precision}\r\n            customLayers={customLayers}\r\n            naLabel={naLabel}\r\n            locale={locale}\r\n            padZeros={padZeros}\r\n            minLabelSize={minLabelSize ?? (orientation === 'horizontal' ? 25 : 15)}\r\n            cornerRadius={cornerRadius}\r\n          />\r\n        ) : null}\r\n      </GraphArea>\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    </GraphContainer>\r\n  );\r\n}\r\n","import type {\r\n  AnimateDataType,\r\n  BarGraphDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  GroupedBarGraphDataType,\r\n  Languages,\r\n  NumberFormatOptions,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n  TimelineDataType,\r\n} from '@/Types';\r\nimport { GroupedBarGraphEl } from './GroupedBarGraph';\r\nimport { SimpleBarGraphEl } from './SimpleBarGraph';\r\nimport { StackedBarGraphEl } from './StackedBarGraph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: BarGraphDataType[];\r\n\r\n  /** Orientation of the graph */\r\n  orientation?: 'vertical' | 'horizontal';\r\n\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** Color or array of colors for bars */\r\n  colors?: string | string[];\r\n  /** Domain of colors for the graph */\r\n  colorDomain?: string[];\r\n  /** Title for the color legend */\r\n  colorLegendTitle?: string;\r\n  /** Color of value labels */\r\n  valueColor?: string;\r\n  /** Background color of the graph */\r\n  backgroundColor?: string | boolean;\r\n  /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n  styles?: StyleObject;\r\n  /** Custom class names */\r\n  classNames?: ClassNameObject;\r\n\r\n  // Size and Spacing\r\n  /** Width of the graph */\r\n  width?: number;\r\n  /** Height of the graph */\r\n  height?: number;\r\n  /** Minimum height of the graph */\r\n  minHeight?: number;\r\n  /** Relative height scaling factor. This overwrites the height props */\r\n  relativeHeight?: number;\r\n  /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n  padding?: string;\r\n  /** Left margin of the graph */\r\n  leftMargin?: number;\r\n  /** Right margin of the graph */\r\n  rightMargin?: number;\r\n  /** Top margin of the graph */\r\n  topMargin?: number;\r\n  /** Bottom margin of the graph */\r\n  bottomMargin?: number;\r\n  /** Padding between bars */\r\n  barPadding?: number;\r\n  /** Maximum thickness of bars */\r\n  maxBarThickness?: number;\r\n  /** Minimum thickness of bars */\r\n  minBarThickness?: number;\r\n  /** Maximum number of bars shown in the graph */\r\n  maxNumberOfBars?: number;\r\n\r\n  // Values and Ticks\r\n  /** Maximum value for the chart */\r\n  maxValue?: number;\r\n  /** Minimum value for the chart */\r\n  minValue?: number;\r\n  /** Value by which the label are truncated. Only applicable if showLabel is true */\r\n  truncateBy?: number;\r\n  /** Reference values for comparison */\r\n  refValues?: ReferenceDataType[];\r\n  /** Number of ticks on the axis */\r\n  noOfTicks?: number;\r\n\r\n  // Graph Parameters\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels?: boolean | ((_d: any) => React.ReactNode);\r\n  /** Toggle visibility of values */\r\n  showValues?: boolean;\r\n  /** Custom order for labels */\r\n  labelOrder?: (string | number)[];\r\n  /** Defines how “NA” values should be displayed/labelled in the graph */\r\n  naLabel?: string;\r\n  /** Toggle visibility of axis ticks */\r\n  showTicks?: boolean;\r\n  /** Corner radius of the bars */\r\n  cornerRadius?: number;\r\n  /** Toggle visibility of axis line for the  main axis */\r\n  hideAxisLine?: boolean;\r\n  /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n  showColorScale?: boolean;\r\n  /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n  showNAColor?: boolean;\r\n  /** Data points to highlight. Use the label value from data to highlight the data point */\r\n  highlightedDataPoints?: (string | number)[];\r\n  /** Defines the opacity of the non-highlighted data */\r\n  dimmedOpacity?: number;\r\n  /** Title for the bar axis */\r\n  barAxisTitle?: string;\r\n  /** Sorting order for data. This is overwritten by labelOrder prop. */\r\n  sortData?: 'asc' | 'desc';\r\n  /** Track color (i.e. the color of the bars background) of the bar chart */\r\n  trackColor?: string;\r\n  /** Toggles if data point which are undefined or has value null are filtered out.  */\r\n  filterNA?: boolean;\r\n  /** Configuration options for controlling number formatting, localization, prefixes/suffixes, precision, and zero padding. */\r\n  numberDisplayOptions?: NumberFormatOptions;\r\n  /** Toggles if the graph animates in when loaded.  */\r\n  animate?: boolean | AnimateDataType;\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  /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n  timeline?: TimelineDataType;\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  /** Callback for mouse click event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 SimpleBarGraph(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors,\r\n    barPadding,\r\n    showTicks,\r\n    leftMargin,\r\n    rightMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    truncateBy,\r\n    showLabels,\r\n    showValues,\r\n    backgroundColor,\r\n    sources,\r\n    graphDescription,\r\n    height,\r\n    width,\r\n    footNote,\r\n    colorDomain,\r\n    colorLegendTitle,\r\n    padding,\r\n    relativeHeight,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    showColorScale,\r\n    graphID,\r\n    maxValue,\r\n    minValue,\r\n    highlightedDataPoints,\r\n    onSeriesMouseClick,\r\n    graphDownload,\r\n    dataDownload,\r\n    language,\r\n    theme,\r\n    sortData,\r\n    labelOrder,\r\n    showNAColor,\r\n    minHeight,\r\n    maxBarThickness,\r\n    maxNumberOfBars,\r\n    minBarThickness,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks,\r\n    valueColor,\r\n    orientation = 'vertical',\r\n    styles,\r\n    classNames,\r\n    filterNA,\r\n    animate,\r\n    dimmedOpacity,\r\n    customLayers,\r\n    timeline,\r\n    naLabel,\r\n    trackColor,\r\n    hideAxisLine = false,\r\n    numberDisplayOptions,\r\n    cornerRadius,\r\n  } = props;\r\n  return (\r\n    <SimpleBarGraphEl\r\n      data={data}\r\n      graphTitle={graphTitle}\r\n      colors={colors}\r\n      barPadding={barPadding}\r\n      showTicks={showTicks}\r\n      leftMargin={leftMargin}\r\n      rightMargin={rightMargin}\r\n      topMargin={topMargin}\r\n      bottomMargin={bottomMargin}\r\n      truncateBy={truncateBy}\r\n      showLabels={showLabels}\r\n      showValues={showValues}\r\n      backgroundColor={backgroundColor}\r\n      suffix={numberDisplayOptions?.suffix}\r\n      prefix={numberDisplayOptions?.prefix}\r\n      sources={sources}\r\n      graphDescription={graphDescription}\r\n      height={height}\r\n      width={width}\r\n      footNote={footNote}\r\n      colorDomain={colorDomain}\r\n      colorLegendTitle={colorLegendTitle}\r\n      padding={padding}\r\n      relativeHeight={relativeHeight}\r\n      tooltip={tooltip}\r\n      onSeriesMouseOver={onSeriesMouseOver}\r\n      refValues={refValues}\r\n      showColorScale={showColorScale}\r\n      graphID={graphID}\r\n      maxValue={maxValue}\r\n      minValue={minValue}\r\n      highlightedDataPoints={highlightedDataPoints}\r\n      onSeriesMouseClick={onSeriesMouseClick}\r\n      graphDownload={graphDownload}\r\n      dataDownload={dataDownload}\r\n      language={language}\r\n      theme={theme}\r\n      sortData={sortData}\r\n      labelOrder={labelOrder}\r\n      showNAColor={showNAColor}\r\n      minHeight={minHeight}\r\n      maxBarThickness={maxBarThickness}\r\n      maxNumberOfBars={maxNumberOfBars}\r\n      minBarThickness={minBarThickness}\r\n      ariaLabel={ariaLabel}\r\n      resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n      styles={styles}\r\n      detailsOnClick={detailsOnClick}\r\n      barAxisTitle={barAxisTitle}\r\n      noOfTicks={noOfTicks}\r\n      valueColor={valueColor}\r\n      classNames={classNames}\r\n      filterNA={filterNA}\r\n      animate={animate}\r\n      dimmedOpacity={dimmedOpacity}\r\n      precision={numberDisplayOptions?.precision}\r\n      customLayers={customLayers}\r\n      timeline={timeline}\r\n      naLabel={naLabel}\r\n      orientation={orientation}\r\n      trackColor={trackColor}\r\n      hideAxisLine={hideAxisLine}\r\n      locale={numberDisplayOptions?.locale}\r\n      padZeros={numberDisplayOptions?.padZeros}\r\n      cornerRadius={cornerRadius}\r\n    />\r\n  );\r\n}\r\n\r\ninterface GroupedBarChartProps {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: GroupedBarGraphDataType[];\r\n\r\n  /** Orientation of the graph */\r\n  orientation?: 'vertical' | 'horizontal';\r\n\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** Array of colors for different bars in the group */\r\n  colors?: string[];\r\n  /** Domain of colors for the graph */\r\n  colorDomain: string[];\r\n  /** Title for the color legend */\r\n  colorLegendTitle?: string;\r\n  /** Color of value labels */\r\n  valueColor?: string;\r\n  /** Background color of the graph */\r\n  backgroundColor?: string | boolean;\r\n  /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n  styles?: StyleObject;\r\n  /** Custom class names */\r\n  classNames?: ClassNameObject;\r\n\r\n  // Size and Spacing\r\n  /** Width of the graph */\r\n  width?: number;\r\n  /** Height of the graph */\r\n  height?: number;\r\n  /** Minimum height of the graph */\r\n  minHeight?: number;\r\n  /** Relative height scaling factor. This overwrites the height props */\r\n  relativeHeight?: number;\r\n  /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n  padding?: string;\r\n  /** Left margin of the graph */\r\n  leftMargin?: number;\r\n  /** Right margin of the graph */\r\n  rightMargin?: number;\r\n  /** Top margin of the graph */\r\n  topMargin?: number;\r\n  /** Bottom margin of the graph */\r\n  bottomMargin?: number;\r\n  /** Padding between bars */\r\n  barPadding?: number;\r\n  /** Maximum thickness of bars */\r\n  maxBarThickness?: number;\r\n\r\n  // Values and Tick\r\n  /** Maximum value for the chart */\r\n  maxValue?: number;\r\n  /** Minimum value for the chart */\r\n  minValue?: number;\r\n  /** Value by which the label are truncated. Only applicable if showLabel is true */\r\n  truncateBy?: number;\r\n  /** Track color (i.e. the color of the bars background) of the bar chart */\r\n  trackColor?: string;\r\n  /** Toggles if data points which have all the values as undefined or null are filtered out.  */\r\n  filterNA?: boolean;\r\n  /** Parameter to sort the data. If a number is provided, it refers to the index of the size array to determine which value to sort by. If set to total, it sorts by the sum of all the values. */\r\n  sortParameter?: number | 'total';\r\n  /** Sorting order for data. This is overwritten by labelOrder prop. */\r\n  sortData?: 'asc' | 'desc';\r\n  /** Toggles if the graph animates in when loaded.  */\r\n  animate?: boolean | AnimateDataType;\r\n  /** Reference values for comparison */\r\n  refValues?: ReferenceDataType[];\r\n  /** Number of ticks on the axis */\r\n  noOfTicks?: number;\r\n\r\n  // Graph Parameters\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels?: boolean | ((_d: any) => React.ReactNode);\r\n  /** Corner radius of the bars */\r\n  cornerRadius?: number;\r\n  /** Toggle visibility of values */\r\n  showValues?: boolean;\r\n  /** Custom order for labels */\r\n  labelOrder?: (string | number)[];\r\n  /** Toggle visibility of axis ticks */\r\n  showTicks?: boolean;\r\n  /** Toggle visibility of axis line for the  main axis */\r\n  hideAxisLine?: boolean;\r\n  /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n  showColorScale?: boolean;\r\n  /** Title for the bar axis */\r\n  barAxisTitle?: string;\r\n  /** Defines how “NA” values should be displayed/labelled in the graph */\r\n  naLabel?: string;\r\n  /** Configuration options for controlling number formatting, localization, prefixes/suffixes, precision, and zero padding. */\r\n  numberDisplayOptions?: NumberFormatOptions;\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  /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n  timeline?: TimelineDataType;\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  /** Callback for mouse click event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 GroupedBarGraph(props: GroupedBarChartProps) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors,\r\n    sources,\r\n    graphDescription,\r\n    barPadding,\r\n    showTicks,\r\n    truncateBy,\r\n    height,\r\n    width,\r\n    footNote,\r\n    colorDomain,\r\n    colorLegendTitle,\r\n    showValues,\r\n    padding,\r\n    backgroundColor,\r\n    leftMargin,\r\n    rightMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    showLabels,\r\n    relativeHeight,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    refValues,\r\n    graphID,\r\n    maxValue,\r\n    minValue,\r\n    onSeriesMouseClick,\r\n    graphDownload,\r\n    dataDownload,\r\n    language,\r\n    labelOrder,\r\n    minHeight,\r\n    theme,\r\n    sortParameter,\r\n    sortData,\r\n    maxBarThickness,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks,\r\n    valueColor,\r\n    orientation = 'vertical',\r\n    styles,\r\n    classNames,\r\n    filterNA,\r\n    animate,\r\n    customLayers,\r\n    showColorScale,\r\n    timeline,\r\n    naLabel,\r\n    hideAxisLine = false,\r\n    numberDisplayOptions,\r\n    cornerRadius,\r\n    trackColor,\r\n  } = props;\r\n\r\n  return (\r\n    <GroupedBarGraphEl\r\n      orientation={orientation}\r\n      data={data}\r\n      graphTitle={graphTitle}\r\n      colors={colors}\r\n      sources={sources}\r\n      graphDescription={graphDescription}\r\n      barPadding={barPadding}\r\n      showTicks={showTicks}\r\n      truncateBy={truncateBy}\r\n      height={height}\r\n      width={width}\r\n      footNote={footNote}\r\n      colorDomain={colorDomain}\r\n      colorLegendTitle={colorLegendTitle}\r\n      suffix={numberDisplayOptions?.suffix}\r\n      prefix={numberDisplayOptions?.prefix}\r\n      showValues={showValues}\r\n      padding={padding}\r\n      backgroundColor={backgroundColor}\r\n      leftMargin={leftMargin}\r\n      rightMargin={rightMargin}\r\n      sortParameter={sortParameter}\r\n      sortData={sortData}\r\n      topMargin={topMargin}\r\n      bottomMargin={bottomMargin}\r\n      showLabels={showLabels}\r\n      relativeHeight={relativeHeight}\r\n      tooltip={tooltip}\r\n      onSeriesMouseOver={onSeriesMouseOver}\r\n      refValues={refValues}\r\n      graphID={graphID}\r\n      maxValue={maxValue}\r\n      minValue={minValue}\r\n      onSeriesMouseClick={onSeriesMouseClick}\r\n      graphDownload={graphDownload}\r\n      dataDownload={dataDownload}\r\n      language={language}\r\n      labelOrder={labelOrder}\r\n      minHeight={minHeight}\r\n      theme={theme}\r\n      maxBarThickness={maxBarThickness}\r\n      ariaLabel={ariaLabel}\r\n      resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n      styles={styles}\r\n      detailsOnClick={detailsOnClick}\r\n      barAxisTitle={barAxisTitle}\r\n      noOfTicks={noOfTicks}\r\n      valueColor={valueColor}\r\n      classNames={classNames}\r\n      filterNA={filterNA}\r\n      animate={animate}\r\n      precision={numberDisplayOptions?.precision}\r\n      customLayers={customLayers}\r\n      showColorScale={showColorScale}\r\n      timeline={timeline}\r\n      naLabel={naLabel}\r\n      hideAxisLine={hideAxisLine}\r\n      locale={numberDisplayOptions?.locale}\r\n      padZeros={numberDisplayOptions?.padZeros}\r\n      cornerRadius={cornerRadius}\r\n      trackColor={trackColor}\r\n    />\r\n  );\r\n}\r\n\r\ninterface StackedBarChartProps {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: GroupedBarGraphDataType[];\r\n\r\n  /** Orientation of the graph */\r\n  orientation?: 'vertical' | 'horizontal';\r\n\r\n  // Titles, Labels, and Sources\r\n  /** Title of the graph */\r\n  graphTitle?: string | React.ReactNode;\r\n  /** Description of the graph */\r\n  graphDescription?: string | React.ReactNode;\r\n  /** Footnote for the graph */\r\n  footNote?: string | React.ReactNode;\r\n  /** Source data for the graph */\r\n  sources?: SourcesDataType[];\r\n  /** Accessibility label */\r\n  ariaLabel?: string;\r\n\r\n  // Colors and Styling\r\n  /** Array of colors for different bars in the group */\r\n  colors?: string[];\r\n  /** Domain of colors for the graph */\r\n  colorDomain: string[];\r\n  /** Title for the color legend */\r\n  colorLegendTitle?: string;\r\n  /** Color of value labels */\r\n  valueColor?: string;\r\n  /** Background color of the graph */\r\n  backgroundColor?: string | boolean;\r\n  /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n  styles?: StyleObject;\r\n  /** Custom class names */\r\n  classNames?: ClassNameObject;\r\n\r\n  // Size and Spacing\r\n  /** Width of the graph */\r\n  width?: number;\r\n  /** Height of the graph */\r\n  height?: number;\r\n  /** Minimum height of the graph */\r\n  minHeight?: number;\r\n  /** Relative height scaling factor. This overwrites the height props */\r\n  relativeHeight?: number;\r\n  /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n  padding?: string;\r\n  /** Left margin of the graph */\r\n  leftMargin?: number;\r\n  /** Right margin of the graph */\r\n  rightMargin?: number;\r\n  /** Top margin of the graph */\r\n  topMargin?: number;\r\n  /** Bottom margin of the graph */\r\n  bottomMargin?: number;\r\n  /** Padding between bars */\r\n  barPadding?: number;\r\n  /** Maximum thickness of bars */\r\n  maxBarThickness?: number;\r\n  /** Minimum thickness of bars */\r\n  minBarThickness?: number;\r\n  /** Maximum number of bars shown in the graph */\r\n  maxNumberOfBars?: number;\r\n\r\n  // Values and Ticks\r\n  /** Maximum value for the chart */\r\n  maxValue?: number;\r\n  /** Value by which the label are truncated. Only applicable if showLabels is true */\r\n  truncateBy?: number;\r\n  /** Reference values for comparison */\r\n  refValues?: ReferenceDataType[];\r\n  /** Number of ticks on the axis */\r\n  noOfTicks?: number;\r\n\r\n  // Graph Parameters\r\n  /** Toggle visibility of labels or defines what is shown in the label */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  showLabels?: boolean | ((_d: any) => React.ReactNode);\r\n  /** Toggle visibility of values */\r\n  showValues?: boolean;\r\n  /** Minimum size of the value to be visible. Default value depends on the orientation of the graph */\r\n  minLabelSize?: number;\r\n  /** Corner radius of the bars */\r\n  cornerRadius?: number;\r\n  /** Toggle visibility of the total value. If not defined it takes the value or `showValues` */\r\n  showTotalValue?: boolean;\r\n  /** Custom order for labels */\r\n  labelOrder?: (string | number)[];\r\n  /** Toggle visibility of axis ticks */\r\n  showTicks?: boolean;\r\n  /** Toggle visibility of axis line for the  main axis */\r\n  hideAxisLine?: boolean;\r\n  /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n  showColorScale?: boolean;\r\n  /** Title for the bar axis */\r\n  barAxisTitle?: string;\r\n  /** Defines how “NA” values should be displayed/labelled in the graph */\r\n  naLabel?: string;\r\n  /** Configuration options for controlling number formatting, localization, prefixes/suffixes, precision, and zero padding. */\r\n  numberDisplayOptions?: NumberFormatOptions;\r\n  /** Parameter to sort the data. If a number is provided, it refers to the index of the size array to determine which value to sort by. If set to total, it sorts by the sum of all the values. */\r\n  sortParameter?: number | 'total';\r\n  /** Sorting order for data. This is overwritten by labelOrder prop. */\r\n  sortData?: 'asc' | 'desc';\r\n  /** Toggles if data points which have all the values as undefined or null are filtered out.  */\r\n  filterNA?: boolean;\r\n  /** Toggles if the graph animates in when loaded.  */\r\n  animate?: boolean | AnimateDataType;\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  /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n  timeline?: TimelineDataType;\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  /** Callback for mouse click event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\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 StackedBarGraph(props: StackedBarChartProps) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors,\r\n    sources,\r\n    graphDescription,\r\n    barPadding,\r\n    showTicks,\r\n    leftMargin,\r\n    rightMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    truncateBy,\r\n    showLabels,\r\n    showValues,\r\n    backgroundColor,\r\n    height,\r\n    width,\r\n    footNote,\r\n    colorDomain,\r\n    colorLegendTitle,\r\n    padding,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    relativeHeight,\r\n    refValues,\r\n    graphID,\r\n    maxValue,\r\n    onSeriesMouseClick,\r\n    graphDownload,\r\n    dataDownload,\r\n    language,\r\n    theme,\r\n    labelOrder,\r\n    minHeight,\r\n    maxBarThickness,\r\n    sortParameter,\r\n    sortData,\r\n    maxNumberOfBars,\r\n    minBarThickness,\r\n    ariaLabel,\r\n    resetSelectionOnDoubleClick,\r\n    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks,\r\n    valueColor,\r\n    orientation = 'vertical',\r\n    styles,\r\n    classNames,\r\n    filterNA,\r\n    animate,\r\n    customLayers,\r\n    showColorScale,\r\n    timeline,\r\n    naLabel,\r\n    hideAxisLine = false,\r\n    numberDisplayOptions,\r\n    showTotalValue,\r\n    minLabelSize,\r\n    cornerRadius,\r\n  } = props;\r\n\r\n  return (\r\n    <StackedBarGraphEl\r\n      data={data}\r\n      graphTitle={graphTitle}\r\n      colors={colors}\r\n      sources={sources}\r\n      graphDescription={graphDescription}\r\n      barPadding={barPadding}\r\n      showTicks={showTicks}\r\n      leftMargin={leftMargin}\r\n      rightMargin={rightMargin}\r\n      topMargin={topMargin}\r\n      bottomMargin={bottomMargin}\r\n      truncateBy={truncateBy}\r\n      showLabels={showLabels}\r\n      showValues={showValues}\r\n      backgroundColor={backgroundColor}\r\n      suffix={numberDisplayOptions?.suffix}\r\n      prefix={numberDisplayOptions?.prefix}\r\n      height={height}\r\n      width={width}\r\n      footNote={footNote}\r\n      colorDomain={colorDomain}\r\n      colorLegendTitle={colorLegendTitle}\r\n      padding={padding}\r\n      tooltip={tooltip}\r\n      onSeriesMouseOver={onSeriesMouseOver}\r\n      relativeHeight={relativeHeight}\r\n      refValues={refValues}\r\n      graphID={graphID}\r\n      maxValue={maxValue}\r\n      onSeriesMouseClick={onSeriesMouseClick}\r\n      graphDownload={graphDownload}\r\n      dataDownload={dataDownload}\r\n      language={language}\r\n      theme={theme}\r\n      labelOrder={labelOrder}\r\n      minHeight={minHeight}\r\n      maxBarThickness={maxBarThickness}\r\n      sortParameter={sortParameter}\r\n      sortData={sortData}\r\n      maxNumberOfBars={maxNumberOfBars}\r\n      minBarThickness={minBarThickness}\r\n      ariaLabel={ariaLabel}\r\n      resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n      styles={styles}\r\n      detailsOnClick={detailsOnClick}\r\n      barAxisTitle={barAxisTitle}\r\n      noOfTicks={noOfTicks}\r\n      valueColor={valueColor}\r\n      classNames={classNames}\r\n      filterNA={filterNA}\r\n      animate={animate}\r\n      precision={numberDisplayOptions?.precision}\r\n      customLayers={customLayers}\r\n      showColorScale={showColorScale}\r\n      timeline={timeline}\r\n      naLabel={naLabel}\r\n      orientation={orientation}\r\n      hideAxisLine={hideAxisLine}\r\n      locale={numberDisplayOptions?.locale}\r\n      padZeros={numberDisplayOptions?.padZeros}\r\n      showTotalValue={showTotalValue}\r\n      minLabelSize={minLabelSize}\r\n      cornerRadius={cornerRadius}\r\n    />\r\n  );\r\n}\r\n"],"mappings":"84CA6EA,SAAA,GAAA,EAAA,2pJA2WA,CAEA,SAAA,GAAA,EAAA,ywJAoYA,CC9tBA,SAAgB,EAAkB,EAAc,CAC9C,GAAM,CACJ,OACA,cACA,SAAS,EAAA,OAAO,MAAM,kBAAkB,OACxC,WACA,oBACA,aAAa,IACb,YAAY,GACZ,cAAa,IACb,UACA,SACA,YACA,eACA,oBACA,UAAS,GACT,UAAS,GACT,cAAa,GACb,kBAAiB,GACjB,WACA,mBAAkB,GAClB,cACA,eACA,aACA,eACA,aAAa,GACb,iBACA,UACA,oBACA,YACA,UACA,YACA,YACA,sBACA,gBAAgB,GAChB,eAAe,GACf,WAAW,KACX,aACA,YAAY,EACZ,QAAQ,QACR,kBACA,YACA,8BAA8B,GAC9B,iBACA,eACA,YAAY,EACZ,cACA,SACA,aACA,WAAW,GACX,UAAU,GACV,YAAY,EACZ,eAAe,CAAC,EAChB,WAAW,CAAE,QAAS,GAAO,SAAU,GAAO,mBAAoB,EAAK,EACvE,WAAU,KACV,gBACA,YACA,cAAc,WACd,eAAe,GACf,SAAS,KACT,YAAW,OACX,aACA,eAAe,GACb,EAEE,CAAE,WAAU,WAAU,aAAc,GAAA,EAA+B,EACnE,CAAE,kBAAiB,SAAO,YAAU,QAAM,WAAS,WAAS,cAAY,eAC5E,EAAA,EAAY,EAAM,CAAQ,EACtB,GAAO,IAAgB,aAAe,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ACC,IACU,GAEpB,CCzKA,SAAgB,GAAe,EAAc,CAC3C,GAAM,CACJ,OACA,aACA,SACA,aACA,YACA,cACA,cACA,YACA,eACA,aACA,aACA,cACA,kBACA,WACA,oBACA,SACA,QACA,YACA,eACA,oBACA,WACA,kBACA,WACA,qBACA,aACA,kBACA,WACA,YACA,YACA,yBACA,sBACA,gBACA,eACA,WACA,SACA,YACA,cACA,cACA,YACA,kBACA,kBACA,kBACA,YACA,+BACA,kBACA,gBACA,YACA,aACA,cAAc,WACd,SACA,aACA,WACA,UACA,gBACA,eACA,WACA,UACA,aACA,gBAAe,GACf,uBACA,gBACE,EACJ,OACE,EAAA,EAAA,KAAC,EAAD,CACQ,OACM,aACJ,SACI,aACD,YACC,cACC,cACF,YACG,eACF,aACA,aACA,cACK,kBACjB,OAAQ,GAAsB,OAC9B,OAAQ,GAAsB,OACrB,WACS,oBACV,SACD,QACG,YACG,eACK,oBACT,WACO,kBACP,WACU,qBACR,aACK,kBACP,WACC,YACA,YACa,yBACH,sBACL,gBACD,eACJ,WACH,SACG,YACE,cACC,cACF,YACM,kBACA,kBACA,kBACN,YACkB,+BACrB,SACQ,kBACF,gBACH,YACC,aACA,aACF,WACD,UACM,gBACf,UAAW,GAAsB,UACnB,eACJ,WACD,UACI,cACD,aACE,gBACd,OAAQ,GAAsB,OAC9B,SAAU,GAAsB,SAClB,cACf,CAAA,CAEL,CA2IA,SAAgB,GAAgB,EAA6B,CAC3D,GAAM,CACJ,OACA,aACA,SACA,UACA,mBACA,cACA,YACA,aACA,SACA,QACA,WACA,eACA,mBACA,cACA,WACA,kBACA,aACA,eACA,aACA,gBACA,cACA,kBACA,WACA,qBACA,aACA,WACA,YACA,YACA,sBACA,iBACA,gBACA,WACA,aACA,YACA,SACA,iBACA,YACA,kBACA,YACA,8BACA,iBACA,eACA,YACA,cACA,eAAc,WACd,UACA,aACA,WACA,UACA,eACA,iBACA,WACA,UACA,eAAe,GACf,uBACA,eACA,cACE,EAEJ,OACE,EAAA,EAAA,KAAC,EAAD,CACe,eACP,OACM,aACJ,SACC,UACS,mBACN,cACD,YACC,aACJ,SACD,QACG,WACG,eACK,mBAClB,OAAQ,GAAsB,OAC9B,OAAQ,GAAsB,OAClB,cACH,WACQ,kBACL,aACC,eACE,iBACL,YACC,aACG,gBACF,cACI,kBACP,WACU,qBACR,aACF,WACC,YACA,YACU,sBACL,iBACD,gBACJ,WACE,aACD,YACJ,SACU,kBACN,YACkB,8BACrB,UACQ,iBACF,eACH,YACC,cACA,aACF,WACD,UACT,UAAW,GAAsB,UACnB,eACE,iBACN,WACD,UACK,eACd,OAAQ,GAAsB,OAC9B,SAAU,GAAsB,SAClB,eACF,YACb,CAAA,CAEL,CAgJA,SAAgB,GAAgB,EAA6B,CAC3D,GAAM,CACJ,OACA,aACA,SACA,UACA,mBACA,cACA,YACA,aACA,cACA,YACA,eACA,cACA,aACA,cACA,mBACA,SACA,QACA,YACA,eACA,oBACA,WACA,WACA,qBACA,kBACA,aACA,WACA,YACA,sBACA,iBACA,gBACA,YACA,QACA,aACA,YACA,mBACA,iBACA,YACA,kBACA,kBACA,YACA,8BACA,iBACA,eACA,aACA,cACA,eAAc,WACd,SACA,aACA,WACA,UACA,eACA,iBACA,WACA,UACA,eAAe,GACf,uBACA,iBACA,eACA,iBACE,EAEJ,OACE,EAAA,EAAA,KAAC,EAAD,CACQ,OACM,aACJ,SACC,UACS,mBACN,cACD,YACC,aACC,cACF,YACG,eACF,cACA,aACA,cACK,mBACjB,OAAQ,GAAsB,OAC9B,OAAQ,GAAsB,OACtB,SACD,QACG,YACG,eACK,oBACT,WACA,WACU,qBACH,kBACL,aACF,WACC,YACU,sBACL,iBACD,gBACJ,YACH,QACK,aACD,YACM,mBACF,iBACL,YACO,kBACA,kBACN,YACkB,8BACrB,SACQ,iBACF,eACH,aACC,cACA,aACF,WACD,UACT,UAAW,GAAsB,UACnB,eACE,iBACN,WACD,UACI,eACC,eACd,OAAQ,GAAsB,OAC9B,SAAU,GAAsB,SAChB,iBACF,eACA,eACf,CAAA,CAEL"}