CirclePacking

@nivo/circle-packinghierarchy

Hierarchical CirclePacking chart with zooming ability.

You can fully customize it using the circleComponent property to define your own, if you wish to do so you should have a look at the default SVG component to get started.

The responsive alternative of this component is ResponsiveCirclePacking. It also offers other implementations, see CirclePackingHtml and CirclePackingCanvas.

You can also see more example usages in storybook.

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

Chart data, which should be immutable.

string | Functionoptionaldefault:'id'

Id accessor.

string | Functionoptionaldefault:'value'

Value accessor

string | (value: number) => string | numberoptional
open editor

Optional formatter for values.

numberoptionaldefault:0
px

Padding between each circle.

booleanoptionaldefault:false
   

Only render leaf nodes (skip parent nodes).

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
Motion