Skip to main content
100%

Ordinal Brushing

✓ Published0🌍 Public
Mmbostock
Last edited Aug 2, 2019
Created on Dec 20, 2012

A categorical scatterplot displays a set of SVG symbols representing `d3.svg.symbolTypes` along an ordinal x-axis. Brushing horizontally across the axis selects symbols by their categorical position, highlighting them with a red stroke while unselected symbols fade. The example uses an ordinal `d3.scale.ordinal()` and `d3.svg.brush()` to map brush extents to categorical values, demonstrating selection over a non-quantitative dimension. The code also relies on `d3.svg.axis()` for the ordinal scale, and applies CSS transitions to animate fill-opacity changes.

AI-generated description

Brushing makes more sense for quantitative dimensions. It’s possible to use a brush to select categorical values, as shown here, though I’d recommend using per-value toggles instead. This way, users can pick arbitrary sets of values, rather than being forced to pick contiguous ranges.

gpl-3.0 Licensed

Similar vizzes