import React from 'react'; import { TreemapProps as RechartsTreemapProps, TooltipProps } from 'recharts'; import { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '@mantine/core'; import { ChartTooltipStylesNames } from '../ChartTooltip/ChartTooltip'; export interface TreemapData { name: string; value?: number; color?: MantineColor; children?: TreemapData[]; [key: string]: unknown; } export type TreemapStylesNames = 'root' | ChartTooltipStylesNames; export type TreemapCssVariables = { root: '--chart-stroke-color' | '--chart-height'; }; export interface TreemapProps extends BoxProps, StylesApiProps, ElementProps<'div'> { /** Data used to render chart */ data: TreemapData[]; /** Key in data object for the value @default 'value' */ dataKey?: string; /** The treemap will try to keep every single rectangle's aspect ratio near the aspectRatio given @default 1.618033988749895 */ aspectRatio?: number; /** Determines whether the tooltip should be displayed when a node is hovered @default true */ withTooltip?: boolean; /** Tooltip animation duration in ms @default 0 */ tooltipAnimationDuration?: number; /** Props passed down to `Tooltip` recharts component */ tooltipProps?: Omit, 'ref'>; /** Props passed down to recharts `Treemap` component */ treemapProps?: Partial>; /** Controls color of the node stroke, by default depends on color scheme */ strokeColor?: MantineColor; /** Controls text color of labels @default dimmed */ textColor?: MantineColor; /** Controls chart height @default 300 */ height?: number; /** Controls width of node stroke @default 1 */ strokeWidth?: number; /** A function to format values inside the tooltip */ valueFormatter?: (value: number) => string; /** Determines whether text color should be adjusted based on background color to improve contrast */ autoContrast?: boolean; /** Additional elements rendered inside `Treemap` component */ children?: React.ReactNode; } export type TreemapFactory = Factory<{ props: TreemapProps; ref: HTMLDivElement; stylesNames: TreemapStylesNames; vars: TreemapCssVariables; }>; export declare const Treemap: import("@mantine/core").MantineComponent<{ props: TreemapProps; ref: HTMLDivElement; stylesNames: TreemapStylesNames; vars: TreemapCssVariables; }>;