Bubble Chart

Pro

X/Y scatter with a third dimension carried by the bubble size. Multi-series, animated scale-in entrance, hover and keyboard selection. Pure SVG.

</>sv-bubble-chart chartbubblescatterthree-variable
import { SvBubbleChartComponent } from '@styloviz-pro/charts';

Demo & usage

Basic usage

Pro

Usage example — open the gallery for the full interactive demo.

Pro

An interactive demo for this component lives in the gallery.

Open live demo

More examples

Titled with a fixed height

Pro

Listen for selections

Pro

When to use

  • Three numeric variables at once, where the third is a magnitude rather than a category.
  • Spotting outliers in two dimensions while keeping a sense of weight.
  • For two variables, a scatter plot is more precise — a bubble adds an encoding the reader has to decode.

Async states

  • loading
  • empty
  • error
  • retry

Inputs

NameTypeDefaultDescription
loadingbooleanfalseTrue while the series are being fetched.
errorSvDataError | string | nullnullLoad failure. Use `toSvDataError()` from `@styloviz/core` to normalize an `HttpErrorResponse`.
emptyMessagestring'No data to plot'Copy for the empty state.
filteredbooleanfalseWhether a filter, not an absence of data, is why the chart is empty.
seriesBubbleSeries[][]Bubble series: each point carries x, y and a size value.
titlestring''Chart title.
heightnumber360Chart height in pixels.
optionsBubbleChartOptions{}Advanced chart options (axes, legend, colors…).
customClassstring''Extra CSS classes for the root element.

Outputs

EventPayload typeDescription
retryvoidThe host should re-run the failed load.
pointHoverBubblePointEventEmitted when a bubble is hovered or keyboard-focused.
pointSelectBubblePointEventEmitted when a bubble is clicked or activated via keyboard (Enter/Space).

Wire it to your API

This component is headless about transport: it renders what you give it and reports what the user asks for. Nothing below requires @styloviz/data — drive it from whatever you already use.

Template

Pro

Bound to the names this component actually exposes.

Host class

Pro

Drive the three async inputs from your own fetch.

  • This component does not emit a query, so it renders what you give it. Fetch on your own trigger and bind `series`, `loading` and `error`.
  • Set `filtered` when a search or filter is active. It is the difference between "you have no orders" and "no orders match this filter" — telling a customer with 4,000 orders the first one reads as a bug.
  • Normalize failures with `toSvDataError()` from `@styloviz/core`. It derives `retryable` from the status, so a 404 does not get a "Try again" button that can only fail again.

Full walkthrough: Connecting to a backend.

Customization & theming

  • Per-series colour and per-point size.
  • Configurable plot height.
  • Animated scale-in entrance, one bubble at a time.

Best practices

  • Do: Say what the bubble size means, in the legend or the title. It is the one channel with no axis to read it against.
  • Don't: Do not encode a difference the reader has to judge precisely as area. Area is the least precise encoding on the chart, and two bubbles a third apart look much closer than that.
  • Tip: Keep the series count low. Overlapping translucent circles in four colours stop being separable long before the data runs out.

Accessibility

  • Every bubble is a keyboard-focusable `role="button"` with an `aria-label` naming its series and all three of its values, so the size dimension is readable rather than only visible.
  • Hover and focus show the same tooltip, and Enter/Space emits `pointSelect`.

Feedback on Bubble Chart

Spotted a gap in this page, or something that didn't work as described? Comments are GitHub Discussions in the public styloviz/community repo, so posting needs a GitHub account.

Loads giscus.app and GitHub — nothing is fetched until you click.