Skip to main content
100%

Scatter plot with zoom

✓ Published0🌍 Public
EEfratVil
Last edited Nov 27, 2016
Created on Nov 11, 2016

This scatter plot visualizes 300 normally distributed data points and supports interactive zooming through a brushed region. Users can drag to select a rectangular area, which triggers a smooth animated transition that rescales the x and y axes to focus on the selected points. Double-clicking outside the brushed area resets the view to the full dataset. The implementation uses D3 v4’s `d3.brush` for selection handling, `d3.scaleLinear` for coordinate mapping, and `transition.attr` to animate the circles’ positions. The axes are updated via `d3.axisBottom` and `d3.axisLeft`, with a clip path preventing points from spilling outside the plotting area.

AI-generated description

Scatter plot zoom of the brushed region. Double-click to zoom out.

Similar vizzes