Calm motion: animations on this site only fade, with no movement
Beeswarm
Each value as a dot on one axis, with no overlap
Shows every value of a set, so the spread and the clusters show. Dots with close values move up or down, so all of them stay in view. For a summary of the spread, use the box plot. For values in bins, use the histogram.
Basic
| Group | Count | Lowest | Median | Highest |
|---|---|---|---|---|
| Interviews | 20 | 44 min | 52 min | 66 min |
| Solo episodes | 15 | 18 min | 24 min | 33 min |
datais a list of numbers, or of points with avalue, an optionallabelfor the hover, and an optionalgroup.groupsgives each group akey, alabel, and an optionalcolor. A legend names them.- In order of value, each dot takes the free place nearest to the middle line. A dense part of the data makes a wide swarm.
radiussets the size of a dot in pixels (default 5), andheightsets the height of the chart (default 200). If the swarm is taller than the chart, make the chart taller or the dots smaller.- For screen readers, the chart is a table with the count, the lowest value, the median, and the highest value of each group.
labelnames the table. Change the words withlabelsor a label pack:group,count,min,median,max, andall.
Usage
ts
import { BlessBeeswarm } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
data* | (number | BlessSwarmPoint)[] | — | |
groups | { key: string; label: string; color?: string | undefined; }[] | [] | the names and colors of the groups |
radius | number | 5 | the radius of a dot in pixels |
height | number | 200 | |
format | ((v: number) => string) | — | |
label | string | "Chart" | names the chart and its table for screen readers |
labels | Partial<{ group: string; count: string; min: string; median: string; max: string; all: string; }> | — |