Data Visualisation Standards

byย @pitchinnate ยท ๐Ÿ“š Data ยท 18d ago ยท 30 views

Chart selection guide, accessibility requirements, and D3/Observable conventions for data storytelling.

data ยท 29 lines
# CLAUDE.md โ€” Data Visualisation Standards

## Chart Selection
- Comparison over time โ†’ line chart (not bar for continuous time)
- Part-to-whole โ†’ stacked bar or treemap (not pie for > 3 segments)
- Distribution โ†’ histogram (bins) or violin plot (density)
- Correlation โ†’ scatter plot (add regression line if rยฒ > 0.3)
- Ranking โ†’ horizontal bar chart, sorted
- Geography โ†’ choropleth (rates) or proportional symbol (absolute values)

## Accessibility
- WCAG AA contrast ratio (4.5:1) for all text on chart
- Colour-blind safe: use position, shape, and pattern in addition to colour
- Never rely on colour alone to encode a variable
- Alt text for every chart: "Chart type showing X for Y groups, key finding is Z"
- Interactive charts keyboard-navigable

## Design Principles
- Maximise data-ink ratio (Tufte): remove chartjunk
- Gridlines should be lighter than data marks
- Zero baseline for bar charts โ€” always
- Don't truncate y-axis without explicit annotation
- Annotations > legends: label data directly where possible

## D3 Conventions
- Use D3 v7+ with ES modules
- Margin convention: `{ top, right, bottom, left }`
- Scales declared before rendering
- Transitions max 300ms (animation should inform, not entertain)
submitted March 16, 2026