# Filter chips

> Use filter chips on a scatter when several groups overlap: each chip is both the legend and a switch that takes its group in or out.

- Data type: Several measures per item (`relationships`)
- Pro · not released yet: its code is not available; try it on its page, or use a free chart of the same data type (`relationships`)
- Example: **Transits catch planets that race round their stars in days; radial velocity reaches slower giants** (3,052 confirmed exoplanets with a measured mass: orbital period (days) and mass (Earths), by discovery method)
- How to read it: Each dot is a planet: further right takes longer to orbit, higher is heavier; switch methods off and on with the chips under the chart.
- Interactive: filter
- Phone: Not recommended for mobile (On a phone marks are too small to see or tap (checked by eye)) · Video formats: 9:16 (best 9:16)

## Use it when
- 2 to 6 groups share one scatter and hide each other
- readers want to compare one group with another, or see one alone
- the legend would otherwise sit far from the data

## Avoid it when
- more than six groups (fold the rest into Other, or use small multiples)
- one group is the whole story (just highlight it)
- readers will print or screenshot the chart

## Fields (data.json)
- `methods` (category): the groups, in colour order (any names; past six share the resting colour)
- `cols` (text): optional: the row columns' names; the x and y names title the axes when hints.xTitle and yTitle are absent
- `rows` (text): one point per row: [name, group index, x value (log scale, above zero), y value (log scale, above zero), optional year]; in the example a planet: orbital period in days, mass in Earth masses, discovery year

## Interactions, motion, sound
- click a chip to take that method in or out
- hover or tap a dot to read the planet
- Play shows one method at a time
- Motion: Methods arrive one after another, the crowded transit cloud first and the rare imaging finds last; filtered dots shrink away and grow back.
- Sound: A pop on every chip; a pop on hover pitched by method. Quiet while it draws; mute it from its card. (sound is off until the viewer turns it on)

## Example spec
```json
{
  "chart": "legend-filter-scatter",
  "title": "Transits catch planets that race round their stars in days; radial velocity reaches slower giants",
  "subtitle": "3,052 confirmed exoplanets with a measured mass: orbital period (days) and mass (Earths), by discovery method",
  "data": "/charts/legend-filter-scatter.data.json"
}
```

## Source
Planetary Systems Composite Parameters (pl_orbper, pl_bmasse, discoverymethod), NASA Exoplanet Archive, NASA Exoplanet Science Institute (Caltech/IPAC) (Public (NASA; acknowledgement requested)), retrieved 2026-12-01: https://exoplanetarchive.ipac.caltech.edu/docs/API_PS_columns.html

Note: Only planets whose mass is measured (true mass or minimum mass, M sin i), not estimated from radius. Median orbit: 5.4 days for transit planets, 308 days for radial-velocity planets. Earth and Jupiter markers use NASA's Planetary Fact Sheet.

Live: /charts/legend-filter-scatter · Manifest: /charts/legend-filter-scatter.json · Tags: filter, legend, chips, toggle, groups, space, exoplanets, astronomy
