caliper uidocs

Beeswarm chart

Pro

Every value as its own dot along one axis, packed so none overlap. Splitting by group moves each dot into its lane, so you watch the groups separate.

Installs components/ui/beeswarm-chart.tsxDepends on d3-shapeMotion shared motion tokens
pnpm dlx shadcn@latest add @caliper/beeswarm-chart
Closed deals by annual value ($k)

Closed deals by annual value ($k)
ItemGroupValue
Deal 1055Small business4
Deal 1064Small business4
Deal 1046Small business5
Deal 1073Small business5
Deal 1082Small business5
Deal 1091Small business5
Deal 1115Small business5
Deal 1124Small business5
Deal 1100Small business6
Deal 1106Small business6
Deal 1097Small business7
Deal 1109Small business7
Deal 1118Small business7
Deal 1040Small business8
Deal 1079Small business8
Deal 1088Small business8
Deal 1127Small business8
Deal 1049Small business9
Deal 1070Small business9
Deal 1052Small business10
Deal 1058Small business10
Deal 1061Small business10
Deal 1067Small business10
Deal 1043Small business11
Deal 1076Small business11
Deal 1085Small business11
Deal 1094Small business11
Deal 1121Small business11
Deal 1103Small business12
Deal 1112Small business12
Deal 1044Mid-market18
Deal 1113Mid-market18
Deal 1122Mid-market18
Deal 1053Mid-market19
Deal 1104Mid-market19
Deal 1095Mid-market20
Deal 1062Mid-market21
Deal 1086Mid-market22
Deal 1071Mid-market23
Deal 1077Mid-market24
Deal 1080Mid-market26
Deal 1068Mid-market27
Deal 1089Mid-market29
Deal 1059Mid-market30
Deal 1098Mid-market32
Deal 1050Mid-market34
Deal 1107Mid-market35
Deal 1128Mid-market36
Deal 1041Mid-market37
Deal 1116Mid-market38
Deal 1119Mid-market39
Deal 1125Mid-market41
Deal 1110Mid-market42
Deal 1047Mid-market43
Deal 1101Mid-market44
Deal 1056Mid-market45
Deal 1092Mid-market45
Deal 1065Mid-market46
Deal 1074Mid-market46
Deal 1083Mid-market46
Deal 1084Enterprise53
Deal 1093Enterprise53
Deal 1102Enterprise55
Deal 1075Enterprise56
Deal 1111Enterprise58
Deal 1066Enterprise60
Deal 1120Enterprise64
Deal 1057Enterprise66
Deal 1042Enterprise70
Deal 1129Enterprise71
Deal 1048Enterprise74
Deal 1051Enterprise78
Deal 1126Enterprise81
Deal 1060Enterprise87
Deal 1117Enterprise91
Deal 1069Enterprise96
Deal 1108Enterprise100
Deal 1078Enterprise106
Deal 1099Enterprise109
Deal 1087Enterprise115
Deal 1090Enterprise118
Deal 1096Enterprise123
Deal 1081Enterprise125
Deal 1105Enterprise129
Deal 1072Enterprise132
Deal 1114Enterprise134
Deal 1063Enterprise136
Deal 1123Enterprise138
Deal 1045Enterprise139
Deal 1054Enterprise139

When to use #

Use it for

  • Deal sizes, response times or salaries where each item matters.
  • Up to a few hundred items.

Skip it when

  • Thousands of values; use the histogram.
  • Values over time; use a line or scatter chart.

Installation #

terminal
pnpm dlx shadcn@latest add @caliper/beeswarm-chart

Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage #

Import it from your copy of the source. The example behind the preview comes with the source. It is built from swarmOffsets and BeeswarmChart.

example.tsx
import { swarmOffsets, BeeswarmChart } from "@/components/ui/beeswarm-chart"

The worked example comes with Pro

The 12-line example behind the preview opens here with a Pro or Team licence.

Checking your licence…

API reference #

swarmOffsets

component

No props of its own; it accepts the native props of its root element.

BeeswarmChart

component
PropTypeDefault
label *string—
points *readonly SwarmPoint[]—
categories *readonly ChartSeries[]—
unitstring""
formatValue((value: number) => string)numberText
radiusnumber4.5
loadingboolean—
errorstring—
classNamestring—

Accessibility #

It exposes group and status semantics, with aria-label, aria-busy and aria-hidden kept in step with state. Changes that matter are announced through a live region.

No custom key handling; Tab and the native activation keys do the work.

Motion #

Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.