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.
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.
numberrequired
Chart height.
numberoptionaldefault:'Depends on device'
Adjust pixel ratio, useful for HiDPI screens.
supportsvghtmlcanvasapi
objectoptional
px
px
px
px
Chart margin.
Style
string | Function | string[]optionaldefault:{"scheme":"nivo"}
nivo
Defines how to compute node color.
numberoptionaldefault:0
px
Control node border width.
string | object | Functionoptionaldefault:{"from":"color"}
inheritthemecustom
inherited property
color
modifiers
darker
Method to compute border color.
object[]optional
Defines patterns and gradients.
supportsvghtmlcanvasapi
object[]optional
Defines rules to apply patterns and gradients
supportsvghtmlcanvasapi
Labels
booleanoptionaldefault:true
   Enable/disable labels.
string | Functionoptional
loc
Label accessor.
numberoptional
px
Skip label rendering if node minimal side length is lower than given value, 0 to disable.
booleanoptional
   Orient labels according to max node width/height.
string | object | Functionoptional
inheritthemecustom
inherited property
color
modifiers
darker
Method to compute label text color.
Interactivity
booleanoptionaldefault:true
Enable/disable interactivity.
supportsvghtmlcanvasapi
Functionoptional
onClick handler, it receives clicked node data and style plus mouse event.
supportsvghtmlcanvasapi
Motion
booleanoptionaldefault:true
Enable/disable transitions.
supportsvghtmlcanvasapi
numberoptionaldefault:90
Motion stiffness.
supportsvghtmlcanvasapi
numberoptionaldefault:15
Motion damping.
supportsvghtmlcanvasapi