TreeMapCanvas

@nivo/treemaphierarchycanvas

A variation around the TreeMap component. Well suited for large data sets as it does not impact DOM tree depth, however you'll lose the isomorphic ability and transitions.

The responsive alternative of this component is ResponsiveTreeMapCanvas, it also offers other implementations, see TreeMap and TreeMapHtml.

roll the dice
600 nodes
Actions Logs
Start interacting with the chart to log actions
Base
objectrequired

The hierarchical data object.

string | Functionoptionaldefault:'id'

The key or function to use to retrieve nodes identity.

string | Functionoptionaldefault:'value'

The key or function to use to retrieve nodes value.

string | Functionoptional
open editor

Value format supporting d3-format notation, this formatted value will then be used for labels and tooltips.

stringoptionaldefault:'squarify'
squarify

Strategy used to compute nodes.

booleanoptionaldefault:false
   

Only render leaf nodes (no parent).

numberoptionaldefault:0
px

Padding between parent and child node.

numberoptionaldefault:0
px

Padding between parent and child node.

numberrequired

Chart width for non-responsive component.

numberoptional

Chart default width for responsive component.

numberrequired

Chart height for non-responsive component.

numberoptional

Chart default height for responsive component.

number (ms)optional

Debounce width/height updates for responsive component.

(dimensions: { width: number; height: number }) => voidoptional

A callback for when responsive component is resized.

numberoptionaldefault:'Depends on device'

Adjust pixel ratio, useful for HiDPI screens.

supportsvghtmlcanvasapi
objectoptional
px
px
px
px

Chart margin.

Ref<SVGSVGElement | HTMLDivElement | HTMLCanvasElement>optional

Ref to the chart's container. Used on this page to generate/download the chart's image via html-to-image.

supportsvghtmlcanvasapi
Style
Labels
Interactivity
Customization
Accessibility
Motion