Props
array
required
The source data. Each element should be an object. If the
children property is present on an element, it will be treated as a nested treemap.number | string
The width of chart container. Can be a number or a percent string like “100%”.
number | string
The height of chart container. Can be a number or a percent string like “100%”.
string | number | function
default:"'value'"
Decides how to extract value from the data. Can be a string key name, number index, or function that receives the data object and returns the value.
string | number | function
default:"'name'"
Name represents each sector in the tooltip. Can be a string key name, number index, or function that receives the data object and returns the name.
number
default:"0.5 * (1 + Math.sqrt(5))"
The treemap will try to keep every single rectangle’s aspect ratio near the aspectRatio given.
'flat' | 'nest'
default:"'flat'"
The type of treemap to render.
flat: Renders the entire treemap at once, with all leaf nodes visible.nest: Renders an interactive, nested treemap. Clicking on a parent node will zoom in to show its children.
ReactElement | function
If set to a React element, the option is the customized React element of rendering the content. If set to a function, the function will be called to render the content.
string
The fill color of treemap nodes.
string
The stroke color of treemap nodes.
array
Array of colors to use for the treemap nodes.
ReactElement | function
Customize nest index content for the breadcrumb navigation in nested treemaps.
boolean | 'auto'
default:"'auto'"
If set false, animation of treemap will be disabled. If set “auto”, the animation will be disabled in SSR and will respect the user’s prefers-reduced-motion system preference for accessibility.
boolean | 'auto'
If set false, animation of treemap will be disabled when data changes.
number
default:"0"
Specifies when the animation should begin, the unit of this option is ms.
number
default:"1500"
Specifies the duration of animation, the unit of this option is ms.
string
default:"'linear'"
The type of easing function.
function
The customized event handler of animation start.
function
The customized event handler of animation end.
function
The customized event handler of mouseenter on a node.
function
The customized event handler of mouseleave on a node.
function
The customized event handler of click on a node.
string
CSS class name for the chart container.
CSSProperties
Inline CSS styles for the chart container.
string
The unique id of chart.
number | 'raf'
default:"'raf'"
Decides the time interval to throttle events.