TreeMap HTTP API

POST /charts/treemap

The TreeMapcomponent is available in the nivo HTTP rendering API. The API generates a SVG and return a path to this SVG which can then be easily embedded.

The api accepts almost the same properties as the regular component, in json, however it's not interactive and you cannot use code in properties (functions).

Please note that the demo API server is installed on heroku using a free plan, so it might be unavailable from times to times.

Click the generate button in order to generate the chart.
You can customize settings by using dedicated controls.
generate
Response n/a
no response available
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
px

Chart width.

numberrequired
px

Chart height.

numberoptionaldefault:'Depends on device'

Adjust pixel ratio, useful for HiDPI screens.

supportsvghtmlcanvasapi
objectoptional
px
px
px
px

Chart margin.

Style
Themeoptional

Define style for common elements such as labels, axes…

OrdinalColorScaleConfigoptionaldefault:{"scheme":"nivo"}
Categorical: Nivo

Define chart's colors.

numberoptionaldefault:0.33

Node opacity (0~1).

numberoptionaldefault:1
px

Control node border width.

string | object | Functionoptionaldefault:{"from":"color","modifiers":[["darker",1]]}
inheritthemecustom
inherited property
color
modifiers
darker

Method to compute border color.

object[]optional

Define patterns and gradients.

supportsvghtmlcanvasapi
object[]optional

Define rules to apply patterns and gradients

supportsvghtmlcanvasapi
Labels
booleanoptionaldefault:true
   

Enable/disable labels.

string | Functionoptional
formattedValue

Label accessor.

numberoptional
px

Skip label rendering if node minimal side length is lower than given value, 0 to disable.

booleanoptionaldefault:true
   

Orient labels according to max node width/height.

string | object | Functionoptional
inheritthemecustom
inherited property
color
modifiers
darker

Method to compute label text color.

booleanoptionaldefault:true
   

Enable/disable labels.

supportsvghtmlcanvasapi
string | Functionoptional
id

Parent label accessor.

supportsvghtmlcanvasapi
numberoptionaldefault:20

Parent label size.

supportsvghtmlcanvasapi
'top' | 'right' | 'bottom' | 'left'optionaldefault:'top'
top

Parent label position.

supportsvghtmlcanvasapi
numberoptionaldefault:6

Parent label padding.

supportsvghtmlcanvasapi
string | object | Functionoptional
inheritthemecustom
inherited property
color
modifiers
darker

Method to compute parent label text color.

supportsvghtmlcanvasapi
Interactivity
booleanoptionaldefault:true

Enable/disable interactivity.

supportsvghtmlcanvasapi
(node, event) => voidoptional

onMouseEnter handler.

supportsvghtmlcanvasapi
(node, event) => voidoptional

onMouseMove handler.

supportsvghtmlcanvasapi
(node, event) => voidoptional

onMouseLeave handler.

supportsvghtmlcanvasapi
(node, event) => voidoptional

onClick handler.

supportsvghtmlcanvasapi
Customization
NodeComponentoptional

Override the default node component.

supportsvghtmlcanvasapi
('nodes' | CustomSvgLayer | CustomHtmlLayer | CustomCanvasLayer)[]optionaldefault:['nodes']

Define layers, please use the appropriate variant for custom layers.

supportsvghtmlcanvasapi
Accessibility
stringoptional

Main element role attribute.

stringoptional

Main element aria-label.

stringoptional

Main element aria-labelledby.

stringoptional

Main element aria-describedby.

Motion
booleanoptionaldefault:true

Enable/disable transitions.

supportsvghtmlcanvasapi
string | objectoptionaldefault:'gentle'

Motion config for react-spring, either a preset or a custom configuration.

supportsvghtmlcanvasapi