Scatterplot filtering restricts visible points according to a selected criterion. In a D3 chart, filter buttons trigger a click handler, update the active button, and derive a reduced dataset. section 7.4.2
A practical filtering update typically:
- Listens for clicks on buttons with the filter class. section 7.4.2
- Marks the clicked filter active and deactivates the others. section 7.4.2
- Binds the result to circles and transitions their positions, sizes, colors, and visibility. section 7.4.2
Filtering by hemisphere
A filter handler can compute updatedData with data.filter(d => d.hemisphere === datum.id), then update the chart through a keyed join. The key preserves the identity of points that remain visible instead of matching circles only by DOM order.
