Skip to main content
100%

Brush & Zoom II

✓ Published0🌍 Public
Mmbostock
Last edited Jul 7, 2016
Created on Jul 6, 2016

This example demonstrates how brushing a scatterplot with d3.brush zooms to the selected region, while double-clicking resets the view. The code generates 900 random points in three gaussian clusters, rendering them as colored circles and using a linear scale to map coordinates. The brush’s `end` event updates the x and y domains, then animates the axes and points via `transition`. A 350ms idle timeout distinguishes a brush clear from a double-click reset.

AI-generated description

Using d3-brush to zoom to the brushed region. Double-click or double-tap to zoom out. Another approach is to use Focus + Context.

gpl-3.0 Licensed

Similar vizzes