# BubbleRow (/docs/charts/bubble-row)

BubbleRow sizes up a handful of magnitudes against each other: one circle per item, with **area** (not width)
proportional to value. That is `r ∝ √value`, with no exceptions, since a linear-radius map would overstate every
difference by roughly its square. Area is the weakest common channel, so this is the catalog's low-precision exemplar:
**for a precise comparison, use `MiniBar`.** The value numerals are on by default, because a bubble twice the diameter
is four times the area and the eye can't reliably invert that. The LOW precision rating and the MiniBar steer are
printed in the catalog, in `/catalog.json`, and in this page's header.

```tsx
<BubbleRow
  data={[
    { label: "EMEA", value: 1240 },
    { label: "AMER", value: 890 },
    { label: "APAC", value: 560 },
    { label: "LATAM", value: 210 },
  ]}
  title="Market size"
  height={36}
/>
```

## Install

```tsx
import { BubbleRow } from "@microcharts/react/bubble-row";

<BubbleRow data={regions} title="Market size" />
```

Setup (package + stylesheet): [Quickstart](/docs/quickstart#set-up-with-an-ai-agent) or paste [`/agent-setup.md`](/agent-setup.md) into your agent.

## Try it

```tsx
import { BubbleRow } from "@microcharts/react/bubble-row/interactive";

<BubbleRow
  data={regions}
/>
```

## When to use it

Use it for a few magnitudes with physical presence in a sentence, a market-size or segment impression in a KPI card, or
an editorial callout that prints the number too. For precise comparison use `MiniBar`; for trends, Sparkline. Keep it
under about eight items.

## Sizing

**the honesty comparison — same data as MiniBar**

```tsx
<BubbleRow data={regions} />  // area: low precision
// use MiniBar for a precise read
```

**baseline align — weights on a shelf**

```tsx
<BubbleRow data={regions} align="baseline" />
```

## Variants

There is no sorting prop. The row renders in your data's order, so sort the data yourself when you want a ranked row.

```tsx
<BubbleRow data={regions} align="baseline" />
<BubbleRow data={regions} label="both" />
```

## Edge cases

```tsx
<BubbleRow data={[]} title="No regions" />
```

```tsx
<BubbleRow data={[{ label: "EMEA", value: 1240 }, { label: "AMER", value: null }]} />
```

Empty data draws just the frame with "No data." as the summary. A `null` value keeps its slot with a small presence ring
and drops its numeral: it is neither removed from the row nor drawn as a zero-radius circle.

## Four homes

**In a sentence**

```tsx
<p>
  Market size by region{" "}
  <span className="mc-inline">
    <BubbleRow data={regions} summary={false} />
  </span>{" "}
  — EMEA leads at 1.24B.
</p>
```

**In a table cell**

```tsx
<td>
  <BubbleRow data={regions} />
</td>
```

**In a KPI card**

```tsx
<div className="kpi">
  <span className="figure">1.24B</span>
  <span className="unit">market size</span>
  <BubbleRow data={regions} />
</div>
```

**In a tab header**

```tsx
<button className="tab">
  EMEA <BubbleRow data={regions} />
</button>
```

## Accessibility

The accessible name names the extremes — **"4 items; largest EMEA at 1,240, smallest LATAM at 210."** The interactive
entry roves the bubbles with ←/→ (or hover), announcing each one's exact value — **"EMEA: 1,240."** — the number the
area itself can't carry.

The interactive entry follows the shared [interaction contract](/docs/accessibility#one-interaction-contract):
arrow keys rove between units on both axes, `Home` and `End` jump to the ends, and a click, tap, `Enter` or
`Space` selects a unit — pinning its readout so it survives blur, until you select it again, press `Escape`, or
press outside the chart. On touch, a tap pins and a drag scrubs.

## Props

| Prop | Type | Description |
| --- | --- | --- |
| `data` (required) | `{ label, value }[]` | A few non-negative magnitudes. |
| `align` | `"center" \| "baseline"` | center (specimen) or baseline (weights on a shelf). |
| `label` | `"value" \| "both" \| "none"` | value (default), both, or none. |
| `gap` | `number` | Gap between bubbles in viewBox units (default 2). |
| `fontSize` | `number` | Type size of the value numerals, in viewBox units. Defaults from `height`. |
| `animate` | `boolean` | (interactive) Opt-in entrance motion when the chart mounts client-side — add `import "@microcharts/react/motion"` once. Inert on the server, on hydrated server HTML, and under `prefers-reduced-motion`. |

Plus the shared grammar — `data`, `domain`, `color`, `title`, `summary`, `format` — and the layout props (`width`, `height`, `className`, `style`) that every chart accepts. Interactive entries also share `animate` and `live`, and — wherever a chart has more than one navigable unit — `onActive`, `onSelect`, `selectedIndex` and `defaultSelectedIndex`; and — wherever the chart shows a hover value — `readout`. See [the shared grammar](/docs/quickstart#the-shared-grammar).
