# TreeMapProps (@salmonui/charts/tree-map)

> The TreeMapProps interface of @salmonui/charts/tree-map.

Canonical: https://salmonui.dev/docs/reference/charts/tree-map/TreeMapProps

```ts
import type { TreeMapProps } from '@salmonui/charts/tree-map';
```

Entry index: https://salmonui.dev/docs/reference/charts/tree-map (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/charts/tree-map.md).

## Reference

Kind: interface

```ts
interface TreeMapProps extends TreeMapRootHandlers {
    readonly data: readonly unknown[];
    readonly weightField?: string | undefined;
    readonly childrenField?: string | undefined;
    readonly levels?: readonly TreeMapLevel[] | undefined;
    readonly layout?: 'squarified' | 'sliceHorizontal' | 'sliceVertical' | 'sliceAuto' | undefined;
    readonly direction?: 'topStart' | 'topEnd' | 'bottomStart' | 'bottomEnd' | undefined;
    readonly leaves?: TreeMapLeaves | undefined;
    readonly colorField?: string | undefined;
    readonly colorScale?: TreeMapColorScale | undefined;
    readonly palette?: readonly string[] | undefined;
    readonly path?: TreeMapPath | undefined;
    readonly defaultPath?: TreeMapPath | undefined;
    readonly onPathChange?: ((path: TreeMapPath, event: TreeMapChangeEvent) => void) | undefined;
    readonly drill?: 'click' | false | undefined;
    readonly breadcrumbs?: boolean | undefined;
    readonly showParentLevels?: boolean | undefined;
    readonly selection?: boolean | {
        readonly mode?: 'item' | 'group' | undefined;
        readonly multiple?: boolean | undefined;
    } | undefined;
    readonly selectedItems?: readonly TreeMapPath[] | undefined;
    readonly defaultSelectedItems?: readonly TreeMapPath[] | undefined;
    readonly onSelectedItemsChange?: ((items: readonly TreeMapPath[], event: TreeMapChangeEvent) => void) | undefined;
    readonly highlight?: boolean | undefined;
    readonly onItemHover?: ((item: TreeMapItem | null) => void) | undefined;
    readonly onItemClick?: ((item: TreeMapItem, event: TreeMapChangeEvent) => void) | undefined;
    readonly getItemStyle?: ((item: TreeMapItem) => {
        readonly color?: string | undefined;
    } | undefined) | undefined;
    readonly legend?: boolean | {
        readonly mode?: 'list' | 'interactive' | undefined;
        readonly position?: 'top' | 'bottom' | 'start' | 'end' | undefined;
        readonly title?: string | undefined;
    } | undefined;
    readonly tooltip?: boolean | {
        readonly render?: ((item: TreeMapItem) => ReactNode) | undefined;
    } | undefined;
    readonly width?: number | undefined;
    readonly height?: number | undefined;
    readonly title?: string | undefined;
    readonly subtitle?: string | undefined;
    readonly description?: string | undefined;
    readonly locale?: string | undefined;
    readonly text?: Partial<TreeMapText> | undefined;
    readonly rootLabel?: string | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly id?: string | undefined;
    readonly ref?: Ref<TreeMapApi> | undefined;
    readonly onResize?: ((size: {
        readonly width: number;
        readonly height: number;
    }) => void) | undefined;
    readonly animated?: boolean | undefined;
}
```

Members (40):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data: readonly unknown[];` |  |  |
| `weightField` | `readonly weightField?: string \| undefined;` | optional |  |
| `childrenField` | `readonly childrenField?: string \| undefined;` | optional | Hierarchical data: children of a record. |
| `levels` | `readonly levels?: readonly TreeMapLevel[] \| undefined;` | optional |  |
| `layout` | `readonly layout?: 'squarified' \| 'sliceHorizontal' \| 'sliceVertical' \| 'sliceAuto' \| undefined;` | optional |  |
| `direction` | `readonly direction?: 'topStart' \| 'topEnd' \| 'bottomStart' \| 'bottomEnd' \| undefined;` | optional |  |
| `leaves` | `readonly leaves?: TreeMapLeaves \| undefined;` | optional |  |
| `colorField` | `readonly colorField?: string \| undefined;` | optional | Data color field of a record. |
| `colorScale` | `readonly colorScale?: TreeMapColorScale \| undefined;` | optional |  |
| `palette` | `readonly palette?: readonly string[] \| undefined;` | optional | Data colors per top-level group; default the derived palette. |
| `path` | `readonly path?: TreeMapPath \| undefined;` | optional |  |
| `defaultPath` | `readonly defaultPath?: TreeMapPath \| undefined;` | optional |  |
| `onPathChange` | `readonly onPathChange?: ((path: TreeMapPath, event: TreeMapChangeEvent) => void) \| undefined;` | optional |  |
| `drill` | `readonly drill?: 'click' \| false \| undefined;` | optional | Clicking a group drills into it. Default `'click'`. |
| `breadcrumbs` | `readonly breadcrumbs?: boolean \| undefined;` | optional |  |
| `showParentLevels` | `readonly showParentLevels?: boolean \| undefined;` | optional | Keep the ancestors of the drilled node as header bands. |
| `selection` | `readonly selection?: boolean \| {     readonly mode?: 'item' \| 'group' \| undefined;     readonly multiple?: boolean \| undefined; } \| undefined;` | optional |  |
| `selectedItems` | `readonly selectedItems?: readonly TreeMapPath[] \| undefined;` | optional |  |
| `defaultSelectedItems` | `readonly defaultSelectedItems?: readonly TreeMapPath[] \| undefined;` | optional |  |
| `onSelectedItemsChange` | `readonly onSelectedItemsChange?: ((items: readonly TreeMapPath[], event: TreeMapChangeEvent) => void) \| undefined;` | optional |  |
| `highlight` | `readonly highlight?: boolean \| undefined;` | optional | Outline the hovered item. Default true. |
| `onItemHover` | `readonly onItemHover?: ((item: TreeMapItem \| null) => void) \| undefined;` | optional |  |
| `onItemClick` | `readonly onItemClick?: ((item: TreeMapItem, event: TreeMapChangeEvent) => void) \| undefined;` | optional |  |
| `getItemStyle` | `readonly getItemStyle?: ((item: TreeMapItem) => {     readonly color?: string \| undefined; } \| undefined) \| undefined;` | optional |  |
| `legend` | `readonly legend?: boolean \| {     readonly mode?: 'list' \| 'interactive' \| undefined;     readonly position?: 'top' \| 'bottom' \| 'start' \| 'end' \| undefined;     readonly title?: string \| undefined; } \| undefined;` | optional | Legend of the top-level groups; `interactive` highlights a group on hover. |
| `tooltip` | `readonly tooltip?: boolean \| {     readonly render?: ((item: TreeMapItem) => ReactNode) \| undefined; } \| undefined;` | optional |  |
| `width` | `readonly width?: number \| undefined;` | optional |  |
| `height` | `readonly height?: number \| undefined;` | optional |  |
| `title` | `readonly title?: string \| undefined;` | optional |  |
| `subtitle` | `readonly subtitle?: string \| undefined;` | optional |  |
| `description` | `readonly description?: string \| undefined;` | optional |  |
| `locale` | `readonly locale?: string \| undefined;` | optional |  |
| `text` | `readonly text?: Partial<TreeMapText> \| undefined;` | optional | Built-in text (over the nearest `LocaleProvider`'s `treeMap` entry). |
| `rootLabel` | `readonly rootLabel?: string \| undefined;` | optional | Breadcrumb root label. Default `text.all` ("All"). |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `id` | `readonly id?: string \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<TreeMapApi> \| undefined;` | optional |  |
| `onResize` | `readonly onResize?: ((size: {     readonly width: number;     readonly height: number; }) => void) \| undefined;` | optional |  |
| `animated` | `readonly animated?: boolean \| undefined;` | optional | Entrance and update transitions, default `true`: client only (never in server markup), off under `prefers-reduced-motion`. The CSS is the opt-in `@salmonui/charts/viz-animations.css`. |
