{"version":3,"file":"SparkLine-tMGdhFAK.cjs","names":[],"sources":["../src/Components/Graphs/LineCharts/SparkLine/Graph.tsx","../src/Components/Graphs/LineCharts/SparkLine/index.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { pointer, select } from 'd3-selection';\r\nimport {\r\n  area,\r\n  curveLinear,\r\n  curveMonotoneX,\r\n  curveStep,\r\n  curveStepAfter,\r\n  curveStepBefore,\r\n  line,\r\n} from 'd3-shape';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport orderBy from 'lodash.orderby';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport type {\r\n  ClassNameObject,\r\n  CurveTypes,\r\n  CustomLayerDataType,\r\n  LineChartDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getGraphDimensions } from '@/Utils/getGraphDimensions';\r\n\r\ninterface Props {\r\n  data: LineChartDataType[];\r\n  lineColor: string;\r\n  width: number;\r\n  height: number;\r\n  dateFormat: string;\r\n  areaId?: string;\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  tooltip?: string | ((_d: any) => React.ReactNode);\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_d: any) => void;\r\n  maxValue?: number;\r\n  minValue?: number;\r\n  curveType: CurveTypes;\r\n  styles?: StyleObject;\r\n  classNames?: ClassNameObject;\r\n  customLayers: CustomLayerDataType[];\r\n  fillArea: number;\r\n}\r\n\r\ninterface FormattedDataType {\r\n  y: number;\r\n  date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n  const {\r\n    data,\r\n    width,\r\n    height,\r\n    lineColor,\r\n    dateFormat,\r\n    areaId,\r\n    leftMargin,\r\n    rightMargin,\r\n    topMargin,\r\n    bottomMargin,\r\n    tooltip,\r\n    onSeriesMouseOver,\r\n    minValue,\r\n    maxValue,\r\n    curveType,\r\n    styles,\r\n    classNames,\r\n    customLayers,\r\n    fillArea,\r\n  } = props;\r\n  const curve =\r\n    curveType === 'linear'\r\n      ? curveLinear\r\n      : curveType === 'step'\r\n        ? curveStep\r\n        : curveType === 'stepAfter'\r\n          ? curveStepAfter\r\n          : curveType === 'stepBefore'\r\n            ? curveStepBefore\r\n            : curveMonotoneX;\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n  const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n  const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n  const margin = {\r\n    top: topMargin,\r\n    bottom: bottomMargin,\r\n    left: leftMargin,\r\n    right: rightMargin,\r\n  };\r\n  const MouseoverRectRef = useRef(null);\r\n  const dataFormatted = orderBy(\r\n    data.map((d) => ({\r\n      ...d,\r\n      date: parse(`${d.date}`, dateFormat, new Date()),\r\n    })),\r\n    ['date'],\r\n    ['asc'],\r\n  );\r\n  const { graphHeight, graphWidth } = getGraphDimensions({ width, height }, margin);\r\n  const minYear = dataFormatted[0].date;\r\n  const maxYear = dataFormatted[dataFormatted.length - 1].date;\r\n  const minParam: number =\r\n    Math.min(...dataFormatted.map((d) => d.y).filter((d) => d !== undefined && d !== null)) !==\r\n    Infinity\r\n      ? Math.min(...dataFormatted.map((d) => d.y).filter((d) => d !== undefined && d !== null)) > 0\r\n        ? 0\r\n        : Math.min(...dataFormatted.map((d) => d.y).filter((d) => d !== undefined && d !== null))\r\n      : 0;\r\n  const maxParam: number =\r\n    Math.max(...dataFormatted.map((d) => d.y).filter((d) => d !== undefined && d !== null)) !==\r\n    Infinity\r\n      ? Math.max(...dataFormatted.map((d) => d.y).filter((d) => d !== undefined && d !== null))\r\n      : 0;\r\n\r\n  const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n  const y = scaleLinear()\r\n    .domain([\r\n      checkIfNullOrUndefined(minValue) ? minParam : (minValue as number),\r\n      checkIfNullOrUndefined(maxValue) ? (maxParam > 0 ? maxParam : 0) : (maxValue as number),\r\n    ])\r\n    .range([graphHeight, 0])\r\n    .nice();\r\n\r\n  const mainGraphArea = area<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y1((d) => y(d.y))\r\n    .y0(graphHeight)\r\n    .curve(curve);\r\n  const lineShape = line<FormattedDataType>()\r\n    .x((d) => x(d.date))\r\n    .y((d) => y(d.y))\r\n    .curve(curve);\r\n  useEffect(() => {\r\n    // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n    const mousemove = (event: any) => {\r\n      const selectedData =\r\n        dataFormatted[\r\n          bisectCenter(\r\n            dataFormatted.map((d) => d.date),\r\n            x.invert(pointer(event)[0]),\r\n            0,\r\n          )\r\n        ];\r\n      setMouseOverData(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n      onSeriesMouseOver?.(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n      setEventY(event.clientY);\r\n      setEventX(event.clientX);\r\n    };\r\n    const mouseout = () => {\r\n      setMouseOverData(undefined);\r\n      onSeriesMouseOver?.(undefined);\r\n      setEventX(undefined);\r\n      setEventY(undefined);\r\n    };\r\n    select(MouseoverRectRef.current).on('mousemove', mousemove).on('mouseout', mouseout);\r\n    onSeriesMouseOver?.(undefined);\r\n  }, [x, dataFormatted, onSeriesMouseOver]);\r\n  return (\r\n    <>\r\n      <svg\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        {areaId && (\r\n          <linearGradient id={areaId} x1='0' x2='0' y1='0' y2='1'>\r\n            <stop style={{ stopColor: lineColor }} stopOpacity='0.1' offset='0%' />\r\n            <stop style={{ stopColor: lineColor }} stopOpacity='0' offset='100%' />\r\n          </linearGradient>\r\n        )}\r\n        <g transform={`translate(${margin.left},${margin.top})`}>\r\n          {customLayers.filter((d) => d.position === 'before').map((d) => d.layer)}\r\n          <g>\r\n            <text\r\n              className={cn(\r\n                'xs:max-[360px]:hidden fill-content-primary text-[9px] md:text-2xs lg:text-xs',\r\n                classNames?.xAxis?.labels,\r\n              )}\r\n              y={graphHeight}\r\n              x={x(dataFormatted[dataFormatted.length - 1].date)}\r\n              style={{\r\n                textAnchor: 'end',\r\n                ...styles?.xAxis?.labels,\r\n              }}\r\n              dy='1em'\r\n            >\r\n              {format(dataFormatted[dataFormatted.length - 1].date, dateFormat)}\r\n            </text>\r\n            <text\r\n              y={graphHeight}\r\n              x={x(dataFormatted[0].date)}\r\n              style={{\r\n                textAnchor: 'start',\r\n                ...styles?.xAxis?.labels,\r\n              }}\r\n              className={cn(\r\n                'xs:max-[360px]:hidden fill-content-primary text-[9px] md:text-2xs lg:text-xs',\r\n                classNames?.xAxis?.labels,\r\n              )}\r\n              dy='1em'\r\n            >\r\n              {format(dataFormatted[0].date, dateFormat)}\r\n            </text>\r\n          </g>\r\n          <g>\r\n            {areaId && (\r\n              <path\r\n                d={mainGraphArea(dataFormatted) || ''}\r\n                style={{\r\n                  fill: `url(#${areaId})`,\r\n                  clipPath: 'url(#clip)',\r\n                  fillOpacity: fillArea,\r\n                  ...styles?.area,\r\n                }}\r\n                className={classNames?.area}\r\n              />\r\n            )}\r\n            <path\r\n              d={lineShape(dataFormatted) || ''}\r\n              style={{\r\n                stroke: lineColor,\r\n                fill: 'none',\r\n                strokeWidth: 2,\r\n              }}\r\n            />\r\n            {mouseOverData ? (\r\n              <circle\r\n                y1={0}\r\n                cy={y(mouseOverData.y)}\r\n                cx={x(mouseOverData.date)}\r\n                r={5}\r\n                style={{ fill: lineColor }}\r\n              />\r\n            ) : null}\r\n          </g>\r\n          {customLayers.filter((d) => d.position === 'after').map((d) => d.layer)}\r\n          <rect\r\n            ref={MouseoverRectRef}\r\n            style={{\r\n              fill: 'none',\r\n              pointerEvents: 'all',\r\n            }}\r\n            width={graphWidth}\r\n            height={graphHeight}\r\n          />\r\n        </g>\r\n      </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    </>\r\n  );\r\n}\r\n","import { useRef } from 'react';\r\nimport { Colors } from '@/Components/ColorPalette';\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  ClassNameObject,\r\n  CurveTypes,\r\n  CustomLayerDataType,\r\n  Languages,\r\n  LineChartDataType,\r\n  SourcesDataType,\r\n  StyleObject,\r\n} from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\nimport { Graph } from './Graph';\r\n\r\ninterface Props {\r\n  // Data\r\n  /** Array of data objects */\r\n  data: LineChartDataType[];\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  /** Colors of the lines */\r\n  lineColor?: string;\r\n  /** Background color of the graph */\r\n  backgroundColor?: string | boolean;\r\n  /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n  styles?: StyleObject;\r\n  /** Custom class names */\r\n  classNames?: ClassNameObject;\r\n\r\n  // Size and Spacing\r\n  /** Width of the graph */\r\n  width?: number;\r\n  /** Height of the graph */\r\n  height?: number;\r\n  /** Minimum height of the graph */\r\n  minHeight?: number;\r\n  /** Relative height scaling factor. This overwrites the height props */\r\n  relativeHeight?: number;\r\n  /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n  padding?: string;\r\n  /** Left margin of the graph */\r\n  leftMargin?: number;\r\n  /** Right margin of the graph */\r\n  rightMargin?: number;\r\n  /** Top margin of the graph */\r\n  topMargin?: number;\r\n  /** Bottom margin of the graph */\r\n  bottomMargin?: number;\r\n\r\n  // Values and Ticks\r\n  /** Maximum value for the chart */\r\n  maxValue?: number;\r\n  /** Minimum value for the chart */\r\n  minValue?: number;\r\n\r\n  // Graph Parameters\r\n  /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format)  */\r\n  dateFormat?: string;\r\n  /** Toggles the visibility of the area below the line. If the type is number then the number is used to define the opacity of the area */\r\n  fillArea?: boolean | number;\r\n  /** Curve type for the line */\r\n  curveType?: CurveTypes;\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  /** Callback for mouse over event */\r\n  // biome-ignore lint/suspicious/noExplicitAny: undefined data type\r\n  onSeriesMouseOver?: (_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 SparkLine(props: Props) {\r\n  const {\r\n    data,\r\n    graphTitle,\r\n    lineColor,\r\n    sources,\r\n    graphDescription,\r\n    height,\r\n    width,\r\n    footNote,\r\n    dateFormat = 'yyyy',\r\n    fillArea = 0,\r\n    padding,\r\n    backgroundColor = true,\r\n    leftMargin = 5,\r\n    rightMargin = 5,\r\n    topMargin = 10,\r\n    bottomMargin = 20,\r\n    tooltip,\r\n    relativeHeight,\r\n    onSeriesMouseOver,\r\n    graphID,\r\n    minValue,\r\n    maxValue,\r\n    graphDownload = false,\r\n    dataDownload = false,\r\n    language = 'en',\r\n    minHeight = 0,\r\n    theme = 'light',\r\n    ariaLabel,\r\n    curveType = 'curve',\r\n    styles,\r\n    classNames,\r\n    customLayers = [],\r\n  } = props;\r\n\r\n  const { graphDiv, svgWidth, svgHeight } = useElementSize<HTMLDivElement>();\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      <GraphArea ref={graphDiv}>\r\n        {svgWidth && svgHeight ? (\r\n          <Graph\r\n            data={data}\r\n            lineColor={lineColor || Colors.primaryColors['blue-600']}\r\n            width={svgWidth}\r\n            height={svgHeight}\r\n            dateFormat={dateFormat}\r\n            areaId={fillArea ? generateRandomString(8) : undefined}\r\n            leftMargin={leftMargin}\r\n            rightMargin={rightMargin}\r\n            topMargin={topMargin}\r\n            bottomMargin={bottomMargin}\r\n            tooltip={tooltip}\r\n            onSeriesMouseOver={onSeriesMouseOver}\r\n            minValue={minValue}\r\n            maxValue={maxValue}\r\n            curveType={curveType}\r\n            styles={styles}\r\n            classNames={classNames}\r\n            customLayers={customLayers}\r\n            fillArea={fillArea === true ? 0.3 : fillArea || 0}\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"],"mappings":"izBAyDA,SAAgB,EAAM,EAAc,CAClC,GAAM,CACJ,OACA,QACA,SACA,YACA,aACA,SACA,aACA,cACA,YACA,eACA,UACA,oBACA,WACA,WACA,YACA,SACA,aACA,eACA,YACE,EACE,EACJ,IAAc,SACV,EAAA,EACA,IAAc,OACZ,EAAA,EACA,IAAc,YACZ,EAAA,EACA,IAAc,aACZ,EAAA,EACA,EAAA,EAEN,CAAC,EAAe,IAAA,EAAA,EAAA,UAAkC,IAAA,EAAS,EAC3D,CAAC,EAAQ,IAAA,EAAA,EAAA,UAA0C,IAAA,EAAS,EAC5D,CAAC,EAAQ,IAAA,EAAA,EAAA,UAA0C,IAAA,EAAS,EAC5D,EAAS,CACb,IAAK,EACL,OAAQ,EACR,KAAM,EACN,MAAO,CACT,EACM,GAAA,EAAA,EAAA,QAA0B,IAAI,EAC9B,GAAA,EAAA,EAAA,SACJ,EAAK,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