Bubble

@nivo/circle-packinghierarchysvgisomorphic

Bubble chart using circle packing with zooming ability. You can fully customize it using nodeComponent property to define your own node component, if you wish to do so you should have a look at native SVG node component for available properties.

The responsive alternative of this component is ResponsiveBubble. It also offers various implementations, see BubbleHtml and BubbleCanvas.

This component is available in the @nivo/api, see sample or try it using the API client. You can also see more example usages in the storybook.

Actions Logs
Start interacting with the chart to log actions
Base
objectrequired
The hierarchical data object.
string | Functionoptionaldefault:'id'
Define id accessor.
string | Functionoptionaldefault:'value'
Define value accessor.
numberrequired
Chart width.
numberrequired
Chart height.
numberoptionaldefault:'Depends on device'
Adjust pixel ratio, useful for HiDPI screens.
supportsvghtmlcanvasapi
booleanoptionaldefault:false
   Only render leaf nodes (skip parent nodes).
objectoptional
px
px
px
px
Chart margin.
numberoptionaldefault:1
px
Padding between each circle.
Style
string | Function | string[]optionaldefault:{"scheme":"nivo"}
nivo
Defines how to compute node color.
string | Functionoptionaldefault:'depth'
depth
Property used to determine node color.
numberoptionaldefault:0
px
Width of circle border.
string | object | Functionoptionaldefault:{"from":"color"}
inheritthemecustom
inherited property
color
modifiers
No modifier.
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 | Functionoptionaldefault:'id'
id
Label accessor.
string | Functionoptional
Labels formatting.
string | object | Functionoptionaldefault:{"from":"color","modifiers":[["darker",1]]}
inheritthemecustom
inherited property
color
modifiers
darker
Method to compute label text color.
numberoptionaldefault:8
px
Skip label rendering if node radius is lower than given value, 0 to disable.
Interactivity
booleanoptionaldefault:true
   Enable/disable interactivity.
supportsvghtmlcanvasapi
booleanoptionaldefault:true
   Enable/disable zooming ('isInteractive' must also be 'true').
supportsvghtmlcanvasapi
Functionoptional
onClick handler, it receives clicked node data and mouse event.
supportsvghtmlcanvasapi
Motion
booleanoptionaldefault:true
   Enable/disable transitions.
supportsvghtmlcanvasapi
numberoptionaldefault:90
Motion stiffness.
supportsvghtmlcanvasapi
numberoptionaldefault:15
Motion damping.
supportsvghtmlcanvasapi