{"version":3,"file":"WaterfallChart-q8_8JyTP.cjs","names":[],"sources":["../src/Components/Graphs/WaterfallChart/Graph.tsx","../src/Components/Graphs/WaterfallChart/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 { 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 { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\nimport { 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  PadZerosTypes,\r\n  ReferenceDataType,\r\n  StyleObject,\r\n  WaterfallChartDataType,\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: WaterfallChartDataType[];\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  showLabels: boolean;\r\n  truncateBy: number;\r\n  width: number;\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  selectedColor?: string;\r\n  maxValue?: number;\r\n  minValue?: number;\r\n  highlightedDataPoints?: (string | number)[];\r\n  // biome-ignore lint/suspicious/noExplicitAny: 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  // 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  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  hideAxisLine: boolean;\r\n  locale: string;\r\n  padZeros: PadZerosTypes;\r\n}\r\nfunction getWaterfallExtent(values: (number | null | undefined)[]) {\r\n  let cumulative = 0;\r\n  let max = 0;\r\n  let min = 0;\r\n\r\n  for (const v of values) {\r\n    cumulative += v || 0;\r\n    if (cumulative > max) max = cumulative;\r\n    if (cumulative < min) min = cumulative;\r\n  }\r\n\r\n  return {\r\n    max,\r\n    min,\r\n  };\r\n}\r\n\r\nexport function Graph(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    detailsOnClick,\r\n    barAxisTitle,\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    hideAxisLine,\r\n    locale,\r\n    padZeros,\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\r\n  const { max, min } = getWaterfallExtent(data.map((d) => d.size));\r\n\r\n  const maxVal = !checkIfNullOrUndefined(maxValue) ? (maxValue as number) : max;\r\n  const minVal = !checkIfNullOrUndefined(minValue) ? (minValue as number) : min;\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        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([minVal, maxVal]).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  let running = 0;\r\n\r\n  const waterfallData = dataWithId.map((d) => {\r\n    const start = running;\r\n    running += d.size || 0;\r\n    return {\r\n      ...d,\r\n      start,\r\n      end: running,\r\n    };\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          <Axis\r\n            y1={y(minVal < 0 ? 0 : minVal)}\r\n            y2={y(minVal < 0 ? 0 : minVal)}\r\n            x1={0 - leftMargin}\r\n            x2={graphWidth + margin.right}\r\n            hideAxisLine={hideAxisLine}\r\n            label={\r\n              showTicks\r\n                ? numberFormattingFunction(\r\n                    minVal < 0 ? 0 : minVal,\r\n                    undefined,\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: maxVal < 0 ? '1em' : -5,\r\n              y: y(minVal < 0 ? 0 : minVal),\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            {waterfallData.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                            ? 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                  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)) {\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                  {d.size ? (\r\n                    <motion.rect\r\n                      width={x.bandwidth()}\r\n                      initial='initial'\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(d.start),\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: Math.abs(y(d.start) - y(d.end)),\r\n                          y: y(Math.max(d.start, d.end)),\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(d.start),\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                    />\r\n                  ) : null}\r\n                  {showLabels ? (\r\n                    <XAxesLabels\r\n                      value={\r\n                        `${d.label}`.length < truncateBy\r\n                          ? `${d.label}`\r\n                          : `${`${d.label}`.substring(0, truncateBy)}...`\r\n                      }\r\n                      y={y(0) + 5}\r\n                      x={x(`${d.id}`) as number}\r\n                      width={x.bandwidth()}\r\n                      height={margin.bottom}\r\n                      style={styles?.xAxis?.labels}\r\n                      className={classNames?.xAxis?.labels}\r\n                      alignment='top'\r\n                      animate={animate}\r\n                      isInView={isInView}\r\n                    />\r\n                  ) : null}\r\n                  {showValues && Math.abs(y(d.start) - y(d.end)) > 16 ? (\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='0.33em'\r\n                      variants={{\r\n                        initial: {\r\n                          x: (x(`${d.id}`) as number) + x.bandwidth() / 2,\r\n                          y: (y(d.start) + y(d.end)) / 2,\r\n                          opacity: 0,\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? getTextColorBasedOnBgColor(barColor[0])\r\n                              : !d.color\r\n                                ? getTextColorBasedOnBgColor(Colors.gray)\r\n                                : getTextColorBasedOnBgColor(\r\n                                    barColor[colorDomain.indexOf(d.color)],\r\n                                  ),\r\n                        },\r\n                        whileInView: {\r\n                          x: (x(`${d.id}`) as number) + x.bandwidth() / 2,\r\n                          y: (y(d.start) + y(d.end)) / 2,\r\n                          fill:\r\n                            data.filter((el) => el.color).length === 0\r\n                              ? getTextColorBasedOnBgColor(barColor[0])\r\n                              : !d.color\r\n                                ? getTextColorBasedOnBgColor(Colors.gray)\r\n                                : getTextColorBasedOnBgColor(\r\n                                    barColor[colorDomain.indexOf(d.color)],\r\n                                  ),\r\n                          opacity: 1,\r\n                          transition: { duration: animate.duration },\r\n                        },\r\n                      }}\r\n                      initial='initial'\r\n                      animate={isInView ? 'whileInView' : 'initial'}\r\n                      exit={{\r\n                        opacity: 0,\r\n                        transition: { duration: animate.duration },\r\n                      }}\r\n                    >\r\n                      {numberFormattingFunction(\r\n                        d.size ? Math.abs(d.size) : 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 { 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 { useElementSize } from '@/hooks/useElementSize';\r\nimport type {\r\n  AnimateDataType,\r\n  ClassNameObject,\r\n  CustomLayerDataType,\r\n  Languages,\r\n  NumberFormatOptions,\r\n  ReferenceDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n  WaterfallChartDataType,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\nimport { Graph } from './Graph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: WaterfallChartDataType[];\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  /** 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  /** Truncate labels by specified length */\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 */\r\n  showLabels?: boolean;\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  /** 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  /** Toggles if data point which are undefined or has value 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  /** 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  /** Enable graph download option as png */\r\n  graphDownload?: boolean;\r\n  /** Enable data download option as a csv */\r\n  dataDownload?: boolean;\r\n\r\n  // Interactions and Callbacks\r\n  /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n  // 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 WaterfallChart(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    colors,\r\n    sources,\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    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    detailsOnClick,\r\n    barAxisTitle,\r\n    noOfTicks = 5,\r\n    styles,\r\n    classNames,\r\n    filterNA = true,\r\n    animate = false,\r\n    dimmedOpacity = 0.3,\r\n    customLayers = [],\r\n    naLabel = 'NA',\r\n    hideAxisLine = false,\r\n    numberDisplayOptions,\r\n  } = props;\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\r\n  const graphParentDiv = useRef<HTMLDivElement>(null);\r\n  const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\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      {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.filter((d) => (filterNA ? !checkIfNullOrUndefined(d.size) : d)).length === 0 && (\r\n          <EmptyState />\r\n        )}\r\n        {svgWidth &&\r\n        svgHeight &&\r\n        data.filter((d) => (filterNA ? !checkIfNullOrUndefined(d.size) : d)).length > 0 ? (\r\n          <Graph\r\n            hideAxisLine={hideAxisLine}\r\n            data={data\r\n              .filter((d) => (filterNA ? !checkIfNullOrUndefined(d.size) : d))\r\n              .filter((_d, i) => (maxNumberOfBars ? i < maxNumberOfBars : true))}\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            width={svgWidth}\r\n            height={svgHeight}\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={maxValue}\r\n            minValue={minValue}\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            detailsOnClick={detailsOnClick}\r\n            barAxisTitle={barAxisTitle}\r\n            noOfTicks={noOfTicks}\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            customLayers={customLayers}\r\n            naLabel={naLabel}\r\n            locale={numberDisplayOptions?.locale || 'en'}\r\n            padZeros={numberDisplayOptions?.padZeros || 'none'}\r\n            suffix={numberDisplayOptions?.suffix || ''}\r\n            prefix={numberDisplayOptions?.prefix || ''}\r\n            precision={numberDisplayOptions?.precision ?? 2}\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"],"mappings":"umCA0EA,SAAS,GAAmB,EAAuC,CACjE,IAAI,EAAa,EACb,EAAM,EACN,EAAM,EAEV,IAAK,IAAM,KAAK,EACd,GAAc,GAAK,EACf,EAAa,IAAK,EAAM,GACxB,EAAa,IAAK,EAAM,GAG9B,MAAO,CACL,MACA,KACF,CACF,CAEA,SAAgB,EAAM,EAAc,CAClC,GAAM,CACJ,aAAa,GACb,cAAc,GACd,aAAY,GACZ,eAAe,GACf,OACA,QACA,SACA,WACA,SACA,SACA,cACA,cACA,cACA,aACA,cACA,cACA,WACA,qBACA,aACA,gBACA,YACA,WACA,wBACA,qBACA,aACA,kBACA,kBACA,iBACA,eACA,YACA,SACA,aACA,gBACA,UACA,YACA,eACA,UACA,eACA,SACA,YACE,EACE,IAAA,EAAA,EAAA,QAAgB,IAAI,EACpB,EAAW,GAAA,EAAU,GAAQ,CACjC,KAAM,EAAQ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