{"version":3,"file":"CandlestickChart.mjs","names":["ReChartsComposedChart","Tooltip","classes"],"sources":["../../src/CandlestickChart/CandlestickChart.tsx"],"sourcesContent":["import {\n  Bar,\n  BarShapeProps,\n  CartesianGrid,\n  Label,\n  ComposedChart as ReChartsComposedChart,\n  ReferenceArea,\n  ReferenceDot,\n  ReferenceLine,\n  ResponsiveContainer,\n  Tooltip,\n  XAxis,\n  YAxis,\n} from 'recharts';\nimport {\n  Box,\n  BoxProps,\n  createVarsResolver,\n  ElementProps,\n  factory,\n  Factory,\n  getThemeColor,\n  MantineColor,\n  StylesApiProps,\n  useMantineTheme,\n  useProps,\n  useResolvedStylesApi,\n  useStyles,\n} from '@mantine/core';\nimport { ChartAnnouncer } from '../ChartAnnouncer/ChartAnnouncer';\nimport { ChartTooltip, ChartTooltipStylesNames } from '../ChartTooltip';\nimport type { BaseChartStylesNames, GridChartBaseProps } from '../types';\nimport { getCandleGeometry } from './get-candle-geometry/get-candle-geometry';\nimport {\n  getCandlestickDomain,\n  isRenderableValue,\n} from './get-candlestick-domain/get-candlestick-domain';\nimport classes from '../grid-chart.module.css';\n\nexport interface CandlestickChartDataKeys {\n  /** Key of the data object for the open value */\n  open: string;\n\n  /** Key of the data object for the high value */\n  high: string;\n\n  /** Key of the data object for the low value */\n  low: string;\n\n  /** Key of the data object for the close value */\n  close: string;\n}\n\nexport interface CandlestickChartLabels {\n  /** Label of the open value displayed in the tooltip */\n  open: string;\n\n  /** Label of the high value displayed in the tooltip */\n  high: string;\n\n  /** Label of the low value displayed in the tooltip */\n  low: string;\n\n  /** Label of the close value displayed in the tooltip */\n  close: string;\n}\n\nexport type CandlestickChartStylesNames =\n  | 'candle'\n  | Exclude<BaseChartStylesNames, 'brush'>\n  | ChartTooltipStylesNames;\n\nexport type CandlestickChartCssVariables = {\n  root: '--chart-text-color' | '--chart-grid-color';\n};\n\nexport interface CandlestickChartProps\n  extends\n    BoxProps,\n    Pick<\n      GridChartBaseProps,\n      | 'dataKey'\n      | 'withXAxis'\n      | 'withYAxis'\n      | 'xAxisProps'\n      | 'yAxisProps'\n      | 'gridProps'\n      | 'tickLine'\n      | 'strokeDasharray'\n      | 'gridAxis'\n      | 'unit'\n      | 'tooltipAnimationDuration'\n      | 'tooltipProps'\n      | 'withTooltip'\n      | 'textColor'\n      | 'gridColor'\n      | 'valueFormatter'\n      | 'xAxisLabel'\n      | 'yAxisLabel'\n      | 'referenceLines'\n      | 'referenceAreas'\n      | 'referenceDots'\n      | 'accessibilityLayer'\n    >,\n    StylesApiProps<CandlestickChartFactory>,\n    ElementProps<'div'> {\n  /** Data used to display chart */\n  data: Record<string, any>[];\n\n  /** Keys of the `data` object used to read open, high, low and close values @default `{ open: 'open', high: 'high', low: 'low', close: 'close' }` */\n  dataKeys?: CandlestickChartDataKeys;\n\n  /** Labels of open, high, low and close values displayed in the tooltip @default `{ open: 'Open', high: 'High', low: 'Low', close: 'Close' }` */\n  labels?: Partial<CandlestickChartLabels>;\n\n  /** Color of candles with `close >= open`, key of `theme.colors` or any valid CSS color @default 'teal.6' */\n  upColor?: MantineColor;\n\n  /** Color of candles with `close < open`, key of `theme.colors` or any valid CSS color @default 'red.6' */\n  downColor?: MantineColor;\n\n  /** Maximum candle width in px */\n  maxCandleWidth?: number;\n\n  /** Stroke width of the candle wick and body outline @default 1 */\n  candleStrokeWidth?: number;\n\n  /** Props passed down to recharts `ComposedChart` component */\n  composedChartProps?: React.ComponentProps<typeof ReChartsComposedChart>;\n\n  /** Additional components that are rendered inside recharts `ComposedChart` component */\n  children?: React.ReactNode;\n}\n\nexport type CandlestickChartFactory = Factory<{\n  props: CandlestickChartProps;\n  ref: HTMLDivElement;\n  stylesNames: CandlestickChartStylesNames;\n  vars: CandlestickChartCssVariables;\n}>;\n\nconst defaultProps = {\n  withXAxis: true,\n  withYAxis: true,\n  withTooltip: true,\n  tooltipAnimationDuration: 0,\n  tickLine: 'y',\n  strokeDasharray: '5 5',\n  gridAxis: 'x',\n  upColor: 'teal.6',\n  downColor: 'red.6',\n  candleStrokeWidth: 1,\n  dataKeys: { open: 'open', high: 'high', low: 'low', close: 'close' },\n  labels: { open: 'Open', high: 'High', low: 'Low', close: 'Close' },\n  accessibilityLayer: true,\n} satisfies Partial<CandlestickChartProps>;\n\nconst varsResolver = createVarsResolver<CandlestickChartFactory>(\n  (theme, { textColor, gridColor }) => ({\n    root: {\n      '--chart-text-color': textColor ? getThemeColor(textColor, theme) : undefined,\n      '--chart-grid-color': gridColor ? getThemeColor(gridColor, theme) : undefined,\n    },\n  })\n);\n\nexport const CandlestickChart = factory<CandlestickChartFactory>((_props) => {\n  const props = useProps('CandlestickChart', defaultProps, _props);\n  const {\n    classNames,\n    className,\n    style,\n    styles,\n    unstyled,\n    vars,\n    data,\n    dataKeys: dataKeysProp,\n    labels,\n    dataKey,\n    withTooltip,\n    withXAxis,\n    withYAxis,\n    gridAxis,\n    tickLine,\n    xAxisProps,\n    yAxisProps,\n    unit,\n    tooltipAnimationDuration,\n    strokeDasharray,\n    gridProps,\n    tooltipProps,\n    referenceLines,\n    referenceAreas,\n    referenceDots,\n    upColor,\n    downColor,\n    maxCandleWidth,\n    candleStrokeWidth,\n    dir,\n    valueFormatter,\n    children,\n    xAxisLabel,\n    yAxisLabel,\n    composedChartProps,\n    textColor,\n    gridColor,\n    mod,\n    attributes,\n    accessibilityLayer,\n    ...others\n  } = props;\n\n  const theme = useMantineTheme();\n  const seriesKeys = dataKeysProp!;\n  const seriesLabels = { open: 'Open', high: 'High', low: 'Low', close: 'Close', ...labels };\n  const tooltipSeries = [\n    { name: 'open', label: seriesLabels.open },\n    { name: 'high', label: seriesLabels.high },\n    { name: 'low', label: seriesLabels.low },\n    { name: 'close', label: seriesLabels.close },\n  ];\n  const withXTickLine = gridAxis !== 'none' && (tickLine === 'x' || tickLine === 'xy');\n  const withYTickLine = gridAxis !== 'none' && (tickLine === 'y' || tickLine === 'xy');\n\n  const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<CandlestickChartFactory>({\n    classNames,\n    styles,\n    props,\n  });\n\n  const getStyles = useStyles<CandlestickChartFactory>({\n    name: 'CandlestickChart',\n    classes,\n    props,\n    className,\n    style,\n    classNames,\n    styles,\n    unstyled,\n    attributes,\n    vars,\n    varsResolver,\n  });\n\n  const upColorResolved = getThemeColor(upColor, theme);\n  const downColorResolved = getThemeColor(downColor, theme);\n\n  const candleStyles = getStyles('candle');\n\n  const renderCandle = (shapeProps: BarShapeProps) => {\n    const { x, y, width, height, payload } = shapeProps as BarShapeProps & {\n      x: number;\n      y: number;\n      width: number;\n      height: number;\n      payload: Record<string, any>;\n    };\n\n    const geometry = getCandleGeometry({\n      x,\n      y,\n      width,\n      height,\n      open: payload[seriesKeys.open],\n      high: payload[seriesKeys.high],\n      low: payload[seriesKeys.low],\n      close: payload[seriesKeys.close],\n    });\n\n    if (geometry === null) {\n      return <g />;\n    }\n\n    const { centerX, bodyY, bodyHeight, isUp } = geometry;\n    const color = isUp ? upColorResolved : downColorResolved;\n\n    return (\n      <g {...candleStyles}>\n        <line\n          x1={centerX}\n          y1={y}\n          x2={centerX}\n          y2={y + height}\n          stroke={color}\n          strokeWidth={candleStrokeWidth}\n        />\n        <rect\n          x={x}\n          y={bodyY}\n          width={width}\n          height={bodyHeight}\n          fill={color}\n          stroke={color}\n          strokeWidth={candleStrokeWidth}\n        />\n      </g>\n    );\n  };\n\n  const domain = getCandlestickDomain({\n    data,\n    openKey: seriesKeys.open,\n    highKey: seriesKeys.high,\n    lowKey: seriesKeys.low,\n    closeKey: seriesKeys.close,\n  });\n\n  const referenceLinesItems = referenceLines?.map(\n    ({ color: lineColor, labelPosition, ...line }, index) => {\n      const color = getThemeColor(lineColor, theme);\n      return (\n        <ReferenceLine\n          key={index}\n          stroke={lineColor ? color : 'var(--chart-grid-color)'}\n          strokeWidth={1}\n          {...line}\n          label={{\n            fill: lineColor ? color : 'currentColor',\n            fontSize: 12,\n            position: labelPosition ?? 'insideBottomLeft',\n            ...(typeof line.label === 'object' ? line.label : { value: line.label }),\n          }}\n          {...getStyles('referenceLine')}\n        />\n      );\n    }\n  );\n\n  const referenceAreasItems = referenceAreas?.map(\n    ({ color: areaColor, labelPosition, ...area }, index) => {\n      const color = getThemeColor(areaColor, theme);\n      return (\n        <ReferenceArea\n          key={index}\n          fill={areaColor ? color : 'var(--chart-grid-color)'}\n          fillOpacity={0.2}\n          stroke={areaColor ? color : 'var(--chart-grid-color)'}\n          strokeOpacity={0.6}\n          {...area}\n          label={{\n            fill: areaColor ? color : 'currentColor',\n            fontSize: 12,\n            position: labelPosition ?? 'insideTop',\n            ...(typeof area.label === 'object' ? area.label : { value: area.label }),\n          }}\n          {...getStyles('referenceArea')}\n        />\n      );\n    }\n  );\n\n  const referenceDotsItems = referenceDots?.map(\n    ({ color: dotColor, labelPosition, ...dot }, index) => {\n      const color = getThemeColor(dotColor, theme);\n      return (\n        <ReferenceDot\n          key={index}\n          r={5}\n          fill={dotColor ? color : 'var(--chart-grid-color)'}\n          stroke=\"var(--mantine-color-body)\"\n          strokeWidth={2}\n          {...dot}\n          label={{\n            fill: dotColor ? color : 'currentColor',\n            fontSize: 12,\n            position: labelPosition ?? 'top',\n            ...(typeof dot.label === 'object' ? dot.label : { value: dot.label }),\n          }}\n          {...getStyles('referenceDot')}\n        />\n      );\n    }\n  );\n\n  return (\n    <Box {...getStyles('root')} dir={dir || 'ltr'} mod={mod} {...others}>\n      <ResponsiveContainer {...getStyles('container')}>\n        <ReChartsComposedChart\n          data={data}\n          maxBarSize={maxCandleWidth}\n          margin={{\n            bottom: xAxisLabel ? 30 : undefined,\n            left: yAxisLabel ? 10 : undefined,\n            right: yAxisLabel ? 5 : undefined,\n          }}\n          accessibilityLayer={accessibilityLayer}\n          {...composedChartProps}\n        >\n          {(composedChartProps?.accessibilityLayer ?? accessibilityLayer) && (\n            <ChartAnnouncer\n              series={Object.entries(seriesKeys).map(([key, name]) => ({\n                name,\n                label: seriesLabels[key as keyof CandlestickChartDataKeys],\n              }))}\n              valueFormatter={valueFormatter}\n              unit={unit}\n            />\n          )}\n          {referenceAreasItems}\n\n          <XAxis\n            hide={!withXAxis}\n            dataKey={dataKey}\n            tick={{ transform: 'translate(0, 10)', fontSize: 12, fill: 'currentColor' }}\n            stroke=\"\"\n            interval=\"preserveStartEnd\"\n            tickLine={withXTickLine ? { stroke: 'currentColor' } : false}\n            minTickGap={5}\n            {...getStyles('axis')}\n            {...xAxisProps}\n          >\n            {xAxisLabel && (\n              <Label position=\"insideBottom\" offset={-20} fontSize={12} {...getStyles('axisLabel')}>\n                {xAxisLabel}\n              </Label>\n            )}\n            {xAxisProps?.children}\n          </XAxis>\n\n          <YAxis\n            orientation=\"left\"\n            type=\"number\"\n            domain={domain}\n            axisLine={false}\n            tick={{ transform: 'translate(-10, 0)', fontSize: 12, fill: 'currentColor' }}\n            hide={!withYAxis}\n            tickLine={withYTickLine ? { stroke: 'currentColor' } : false}\n            allowDecimals\n            unit={unit}\n            tickFormatter={valueFormatter}\n            {...getStyles('axis')}\n            {...yAxisProps}\n          >\n            {yAxisLabel && (\n              <Label\n                position=\"insideLeft\"\n                angle={-90}\n                textAnchor=\"middle\"\n                fontSize={12}\n                offset={-5}\n                {...getStyles('axisLabel')}\n              >\n                {yAxisLabel}\n              </Label>\n            )}\n            {yAxisProps?.children}\n          </YAxis>\n\n          <CartesianGrid\n            strokeDasharray={strokeDasharray as string}\n            vertical={gridAxis === 'y' || gridAxis === 'xy'}\n            horizontal={gridAxis === 'x' || gridAxis === 'xy'}\n            {...getStyles('grid')}\n            {...gridProps}\n          />\n\n          {withTooltip && (\n            <Tooltip\n              animationDuration={tooltipAnimationDuration}\n              isAnimationActive={tooltipAnimationDuration !== 0}\n              position={{ y: 0 }}\n              cursor={{\n                stroke: 'var(--chart-grid-color)',\n                strokeWidth: 1,\n                strokeDasharray,\n                fill: 'var(--chart-cursor-fill)',\n              }}\n              content={({ label, payload, labelFormatter }) => {\n                const entry = payload?.[0]?.payload as Record<string, any> | undefined;\n\n                if (!entry) {\n                  return null;\n                }\n\n                const open = entry[seriesKeys.open];\n                const close = entry[seriesKeys.close];\n\n                // Rows the candle renderer skipped must not produce a tooltip either,\n                // otherwise `valueFormatter` is handed undefined or a string.\n                if (\n                  ![open, close, entry[seriesKeys.high], entry[seriesKeys.low]].every(\n                    isRenderableValue\n                  )\n                ) {\n                  return null;\n                }\n\n                const color = getThemeColor(close >= open ? upColor : downColor, theme);\n\n                const ohlcPayload = [\n                  { name: 'open', color, payload: { open } },\n                  { name: 'high', color, payload: { high: entry[seriesKeys.high] } },\n                  { name: 'low', color, payload: { low: entry[seriesKeys.low] } },\n                  { name: 'close', color, payload: { close } },\n                ];\n\n                return (\n                  <ChartTooltip\n                    label={labelFormatter && payload ? labelFormatter(label, payload) : label}\n                    payload={ohlcPayload}\n                    series={tooltipSeries}\n                    unit={unit}\n                    showColor={false}\n                    classNames={resolvedClassNames}\n                    styles={resolvedStyles}\n                    valueFormatter={valueFormatter}\n                    attributes={attributes}\n                  />\n                );\n              }}\n              {...tooltipProps}\n            />\n          )}\n\n          <Bar\n            dataKey={(entry: Record<string, any>) => {\n              const low = entry[seriesKeys.low];\n              const high = entry[seriesKeys.high];\n\n              // Recharts derives its own data domain from these values, so a row the\n              // candle renderer would skip must not be handed to it either.\n              return isRenderableValue(low) && isRenderableValue(high) ? [low, high] : null;\n            }}\n            isAnimationActive={false}\n            legendType=\"none\"\n            shape={renderCandle}\n          />\n\n          {referenceLinesItems}\n          {referenceDotsItems}\n          {children}\n        </ReChartsComposedChart>\n      </ResponsiveContainer>\n    </Box>\n  );\n});\n\nCandlestickChart.displayName = '@mantine/charts/CandlestickChart';\nCandlestickChart.classes = classes;\nCandlestickChart.varsResolver = varsResolver;\n\nexport namespace CandlestickChart {\n  export type Props = CandlestickChartProps;\n  export type CssVariables = CandlestickChartCssVariables;\n  export type Factory = CandlestickChartFactory;\n  export type Labels = CandlestickChartLabels;\n  export type DataKeys = CandlestickChartDataKeys;\n  export type StylesNames = CandlestickChartStylesNames;\n}\n"],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