API reference: @salmonui/charts/tree-map
TreeMapcomponent
import { TreeMap } from '@salmonui/charts/tree-map';function TreeMap(props: TreeMapProps): ReactNode;
Props: TreeMapProps
| Name | Signature | Description |
|---|---|---|
data | readonly data: readonly unknown[]; | |
weightFieldoptional | readonly weightField?: string | undefined; | |
childrenFieldoptional | readonly childrenField?: string | undefined; | Hierarchical data: children of a record. |
levelsoptional | readonly levels?: readonly TreeMapLevel[] | undefined; | |
layoutoptional | readonly layout?: 'squarified' | 'sliceHorizontal' | 'sliceVertical' | 'sliceAuto' | undefined; | |
directionoptional | readonly direction?: 'topStart' | 'topEnd' | 'bottomStart' | 'bottomEnd' | undefined; | |
leavesoptional | readonly leaves?: TreeMapLeaves | undefined; | |
colorFieldoptional | readonly colorField?: string | undefined; | Data color field of a record. |
colorScaleoptional | readonly colorScale?: TreeMapColorScale | undefined; | |
paletteoptional | readonly palette?: readonly string[] | undefined; | Data colors per top-level group; default the derived palette. |
pathoptional | readonly path?: TreeMapPath | undefined; | |
defaultPathoptional | readonly defaultPath?: TreeMapPath | undefined; | |
onPathChangeoptional | readonly onPathChange?: ((path: TreeMapPath, event: TreeMapChangeEvent) => void) | undefined; | |
drilloptional | readonly drill?: 'click' | false | undefined; | Clicking a group drills into it. Default |
breadcrumbsoptional | readonly breadcrumbs?: boolean | undefined; | |
showParentLevelsoptional | readonly showParentLevels?: boolean | undefined; | Keep the ancestors of the drilled node as header bands. |
selectionoptional | readonly selection?: boolean | {
readonly mode?: 'item' | 'group' | undefined;
readonly multiple?: boolean | undefined;
} | undefined; | |
selectedItemsoptional | readonly selectedItems?: readonly TreeMapPath[] | undefined; | |
defaultSelectedItemsoptional | readonly defaultSelectedItems?: readonly TreeMapPath[] | undefined; | |
onSelectedItemsChangeoptional | readonly onSelectedItemsChange?: ((items: readonly TreeMapPath[], event: TreeMapChangeEvent) => void) | undefined; | |
highlightoptional | readonly highlight?: boolean | undefined; | Outline the hovered item. Default true. |
onItemHoveroptional | readonly onItemHover?: ((item: TreeMapItem | null) => void) | undefined; | |
onItemClickoptional | readonly onItemClick?: ((item: TreeMapItem, event: TreeMapChangeEvent) => void) | undefined; | |
getItemStyleoptional | readonly getItemStyle?: ((item: TreeMapItem) => {
readonly color?: string | undefined;
} | undefined) | undefined; | |
legendoptional | readonly legend?: boolean | {
readonly mode?: 'list' | 'interactive' | undefined;
readonly position?: 'top' | 'bottom' | 'start' | 'end' | undefined;
readonly title?: string | undefined;
} | undefined; | Legend of the top-level groups; |
tooltipoptional | readonly tooltip?: boolean | {
readonly render?: ((item: TreeMapItem) => ReactNode) | undefined;
} | undefined; | |
widthoptional | readonly width?: number | undefined; | |
heightoptional | readonly height?: number | undefined; | |
titleoptional | readonly title?: string | undefined; | |
subtitleoptional | readonly subtitle?: string | undefined; | |
descriptionoptional | readonly description?: string | undefined; | |
localeoptional | readonly locale?: string | undefined; | |
textoptional | readonly text?: Partial<TreeMapText> | undefined; | Built-in text (over the nearest |
rootLabeloptional | readonly rootLabel?: string | undefined; | Breadcrumb root label. Default |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
idoptional | readonly id?: string | undefined; | |
refoptional | readonly ref?: Ref<TreeMapApi> | undefined; | |
onResizeoptional | readonly onResize?: ((size: {
readonly width: number;
readonly height: number;
}) => void) | undefined; | |
animatedoptional | readonly animated?: boolean | undefined; | Entrance and update transitions, default |