unit
Configuration Structure
unit: {}plotOptions
Settings for the unit chart (chart.type: 'unit') and its waffle preset (chart.type: 'waffle'). A unit chart draws one discrete mark per unit of value, so a count reads as a countable quantity rather than a single bar or slice.
layout
'grouped'How the marks are placed.
Available Options:
- 'grouped' (default): each category is its own cluster (a phyllotaxis blob), laid out in a row.
- 'packed': one shared blob, coloured by group and (with
sortByGroup) ordered so the minority nests in the centre. - 'columns': each category is a vertical bar built from stacked dots (a unit / waffle column) whose height encodes the count.
- 'grid': one lattice of cells filled in category order, a part-to-whole square "pie".
chart.type: 'waffle'presets this layout. - 'scatter': a beeswarm (or 2D value-value plot) that places marks on real numeric value axes.
transition
'group'How marks are matched between renders on an update, which decides which previous mark each new mark tweens from.
Available Options:
- 'group' (default): keyed per category, so a mark stays in its group and category-level enters/exits fade in and out.
- 'flow': keyed by global draw order, so the anonymous crowd migrates and recolours across a regroup (the circles-to-bars transition).
- 'identity': keyed by each datum's
id/name, so a specific mark migrates across any regroup or relayout keeping its colour and size. Requires the per-unit object form with unique ids/names.
shape
'circle'Mark shape for each unit.
Available Options:
- 'circle' (default)
- 'square' (see
borderRadius) - 'image': render an icon (an isotype pictogram); configure it with
image.
image
The icon used when shape: 'image'.
src
Icon URL or data URI.
width
Icon width in pixels.
height
Icon height in pixels.
tint
falseRecolour a monochrome icon to the category colour (or a per-unit fillColor) so the pictogram matches the legend. Leave off (default) for multi-colour icons that should keep their own colours.
size
'auto'Mark radius in pixels, or 'auto' (default) to size marks so the largest cluster fits.
columns
Options for the columns layout.
size
'inherit'The columns layout can size its dots independently of size.
Available Options:
- 'inherit' (default): use
size. - 'auto': size dots to fill the plot height.
- a number: pin a columns-only size. Circle / square only (image icons keep their intrinsic size).
grid
The grid (waffle) layout: one lattice of cells filled in category order.
columns
10Cells per row. Defaults to 10.
total
Fixed cell budget (e.g. 100 for a percentage waffle); a largest-remainder rule allocates the cells to categories so they sum exactly to the budget. Leave undefined for one cell per unit (respects unitValue / maxUnits).
fillFrom
'bottom'First row of the fill.
Available Options:
- 'bottom' (default)
- 'top'
split
falseSmall multiples: render one mini-waffle per category in a trellis instead of a single shared lattice. Each tile has total cells (default 100) and fills value/max of them; the rest show as a faint trackColor backdrop, and each tile carries its own label.
tileColumns
Small-multiple tiles per row. Undefined = auto (near-square).
max
Small-multiple value → filled-cell denominator. Undefined = the largest count (the leader fills its tile). Set to 100 for true "of 100" percentage tiles.
trackColor
Small-multiple empty ("track") cell colour. Undefined = neutral grey.
scatter
The scatter layout places units on real value axes (needs the object-form data).
y
'lanes'Axis mode.
Available Options:
- 'lanes' (default): a beeswarm — an X value axis with one category lane per series on Y.
- 'value': a 2D value-value scatter — each datum's
x/yon two numeric axes, category = colour.
spread
'swarm'How equal values are separated within a lane.
Available Options:
- 'swarm' (default): anti-overlap packing off the lane centre.
- 'jitter': random lane spread.
tickAmount
5Approximate number of X-axis ticks. Defaults to 5.
xMin
Fixed X-axis minimum. Undefined = a nice-numbered value derived from the data.
xMax
Fixed X-axis maximum. Undefined = a nice-numbered value derived from the data.
xTitle
X-axis title drawn under the tick labels.
xFormatter
X tick-label formatter, (value) => string.
yTickAmount
5Approximate number of Y-axis ticks (2D mode). Defaults to 5.
yMin
Fixed Y-axis minimum (2D mode). Undefined = nice-numbered from the data.
yMax
Fixed Y-axis maximum (2D mode). Undefined = nice-numbered from the data.
yTitle
Y-axis title (2D mode), drawn rotated at the left.
yFormatter
Y tick-label formatter, (value) => string.
sizeField
'z'Datum key holding the bubble size value. Defaults to 'z'.
sizeRange
[minRadius, maxRadius] in pixels: turns dots into area-scaled bubbles.
laneLabelWidth
Left-gutter width reserved for lane (category) labels in lanes mode.
gridlines
trueDraw the faint gridlines. Defaults to true.
sizeByValue
Opt-in bubble sizing: scale each dot's radius by its per-unit value (requires the object-form data, series: [{ data: [{ value }] }]). Circle shape only; the lattice is spaced for the largest bubble so dots never overlap. Ignored when there are no per-unit values.
enabled
falseTurn per-unit bubble sizing on.
maxRadius
'auto'Radius (px) for the largest value, or 'auto' to fit it to the plot.
minRadius
Radius (px) for the smallest value. Defaults to ~35% of maxRadius.
scale
'area'How the value maps to size.
Available Options:
- 'area' (default): bubble area proportional to value.
- 'linear': radius proportional to value.
spacing
1.05Packing gap factor between spiral shells (1 = dots touch).
borderRadius
Corner radius for shape: 'square'.
unitValue
1One mark represents this many units of value (waffle scaling).
maxUnits
5000Safety cap on the total number of marks; counts scale down proportionally above it.
sortByGroup
truepacked layout: order categories smallest-first so the minority group is centred.
clusterLabels
A per-cluster label: a curved arc above a blob, or a straight label above / below a bar.
show
Render the per-cluster label.
position
'top'Label placement relative to the cluster / bar. Defaults to 'top'. A 'bottom' label is always straight (the curved arc rides the top crown only).
curved
Bend the label into an arc that follows the top of the blob.
color
Label colour. Defaults to the cluster's own colour.
offsetY
Vertical offset of the label in pixels.
formatter
Return the label text: (name, { seriesIndex, value, percent, w }) => string.
tooltip
Per-unit (per-dot) tooltip.
formatter
Return the tooltip body for a single hovered dot. The dot's category is seriesIndex and its index within that category is dataPointIndex, so the formatter can index into per-unit data. Return a string or HTML. Defaults to "#<dataPointIndex+1> of <count>".