Brush Snapping III
✓ Published0🌍 Public
Mmbostock
Last edited Nov 15, 2016
Created on Sep 19, 2016
This example shows three clusters of 300 normally distributed points each, colored by cluster using `d3.schemeCategory10`, with visible x- and y-axes. A horizontal brush, created with `d3.brushX`, snaps its selection to integer coordinates on the x-axis. During a brush drag, the code maps the selection back to data space, rounds the values, and uses `d3.event.target.move` to reposition the brush, ensuring the selection always covers a complete unit interval.
AI-generated descriptionThis is another example of brush snapping.
gpl-3.0 Licensed