Packed Circle Chart
The Packed Circle Chart renders each datum as a circle whose area encodes its value, packed tightly and non-overlapping inside one large containing circle. It's a softer alternative to the treemap for showing many parts of a whole — proportions read at a glance without a rigid grid. Larger circles are labelled automatically.
NOTE
For the full API, see the Charts API Reference.
Example
Usage
ts
import {
createPackedCircleChart,
} from '@ripl/charts';
const chart = createPackedCircleChart('#container', {
data: [
{ name: 'Alpha',
size: 82 },
{ name: 'Bravo',
size: 45 },
{ name: 'Charlie',
size: 26 },
],
key: 'name',
value: 'size',
label: 'name',
});Data Format
Each item provides a unique key, a numeric value (encoded as the circle's area), and optionally a label:
ts
const data = [
{ name: 'Alpha',
size: 82 },
{ name: 'Bravo',
size: 45 },
];Options
data— The data arraykey— Unique key accessor for each circlevalue— Numeric value accessor; encoded as the circle's arealabel— Optional label accessor (defaults tokey)color— Optional per-circle color accessorformat— Value formatter for tooltipspadding,title,animation— Standard chart options