Beeswarm

Pro

Every item as a dot, packed without overlap, that flows to its new place when the metric or rows change, with a brush to select a range.

Live · keyboard ready

Customers

300 customers, $880.4K MRR

Customers by MRR
NameCategoryMRRSeatsMonths
  • Showing all customers, deals, or requests by one measure, with the option to split into rows.
  • Finding outliers and selecting a band of items to act on.
  • Explaining how a population re-sorts when the lens changes.
  • Use bar-chart when only the aggregate per group matters.
  • Use a histogram for tens of thousands of items; dots stop being individually visible.
  • Use data-grid when people need to compare several fields at once.

Installation

Pro source and install commands unlock with a Pro plan.

example.tsx
import { useState } from "react";import { Beeswarm } from "@/components/arc/beeswarm/beeswarm"; const metrics = [{ key: "mrr", label: "MRR", scale: "log" as const, format: (v: number) => `$${v.toLocaleString()}` }, { key: "seats", label: "Seats", scale: "log" as const }];const categories = [{ key: "enterprise", label: "Enterprise" }, { key: "mid", label: "Mid-market" }, { key: "self", label: "Self-serve" }]; export function Customers({ customers }: { customers: { id: string; name: string; plan: string; mrr: number; seats: number; region: string }[] }) {  const [metric, setMetric] = useState("mrr");  const data = customers.map(c => ({ id: c.id, label: c.name, category: c.plan, values: { mrr: c.mrr, seats: c.seats }, groups: { region: c.region } }));  return <Beeswarm data={data} metrics={metrics} metric={metric} categories={categories} groupBy="region" label="Customers by MRR" />;}

Beeswarm

Every item as a dot, packed without overlap along one axis. Switching the metric or the rows sends each dot on its own spring to its new place in one sweeping wave. Drag to brush a range.

PropTypeDefaultDescription
dataRequired{ id: string; label: string; category: string; values: Record<string, number>; groups?: Record<string, string> }[]–One entry per dot. Stable ids let dots flow between layouts.
metricsRequired{ key: string; label: string; scale?: "linear" | "log"; format?; formatTick? }[]–The measures the x axis can show.
metricRequiredstring–Key of the metric on the x axis.
categoriesRequired{ key: string; label: string; color?: string }[]–Legend entries and dot colors. Colors follow the category, never its rank.
groupBystring | nullnullAttribute key in groups to split the swarm into rows.
groupOrderRecord<string, string[]>–Row order per attribute; unlisted values follow in order of appearance.
labelRequiredstring–Names the chart for assistive technology.
brush[number, number] | null–Controlled selection in metric units.
defaultBrush[number, number] | nullnullInitial selection when uncontrolled.
onBrushChange(range, selected) => void–Called while brushing and with null when cleared. Changing the metric clears it.
hiddenCategoriesstring[]–Controlled hidden categories. Hidden dots shrink away and the rest re-pack.
defaultHiddenCategoriesstring[]–Initial hidden categories when uncontrolled.
onHiddenCategoriesChange(hidden: string[]) => void–Called when a legend toggle is pressed.
summarize(items, brushed) => string–The live line above the plot. Receives the brushed items, or every shown item.
heightnumber340Plot height in pixels, shared by the rows.
emptyLabelstring"Nothing to show"Shown when every category is hidden.
classNamestring–Extra class on the figure.
Tab
Focuses the plot.
ArrowLeftorArrowRight
Moves to the previous or next dot in value order.
ArrowUporArrowDown
Moves to the nearest dot in the row above or below.
Shift+ArrowLeftorArrowRight
Extends a brush from where the selection started.
HomeorEnd
Jumps to the lowest or highest value.
Escape
Clears the highlighted dot and the brush.
  • The plot is a focusable group; the dot in focus is announced with its name, value, category, and row.
  • The summary line above the plot is a polite live region, so brushing reads its count and total.
  • Legend toggles are buttons with aria-pressed and a count; hovering or focusing one isolates its dots.
  • A visually hidden table lists every item with all metrics, in value order.
  • On first view the dots unfurl from each row's centre line, left to right.
  • Every dot runs its own interruptible spring, released left to right by its new x so a re-sort reads as one wave.
  • Hidden categories shrink away while the rest re-pack; the tooltip glides between dots.
  • Reduced motion places dots directly and swaps the summary with a fade.
  • The dot radius follows the width and shrinks until the densest row fits its band, down to 1.4px.
  • Hover targets are the nearest dot within 24px, so small dots stay easy to hit.
  • Touch taps a dot for details and drags horizontally to brush, while vertical page scroll stays free.
  • Packing runs once per metric, grouping, filter, and width change, scanning only neighbours within a diameter.
  • One requestAnimationFrame loop integrates every dot's spring and stops when all settle.
  • Dots are plain SVG circles updated by attribute; about 1,000 stay smooth on laptops.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Choose it to show every item in a distribution, up to about 1,000 dots, when outliers and clusters matter.
  • Use a log scale for money and counts that span orders of magnitude.
  • Pass summarize to make the live line speak your domain, such as count and total revenue.
  • Keep categories to three; each takes a series hue derived from the accent, and a ring in the same hue marks the dot in focus.
/components/beeswarm/markdown

The full library index for assistants is at /llms.txt.