Brush Handles
✓ Published0🌍 Public
Mmbostock
Last edited Aug 2, 2019
Created on Dec 20, 2012
This example shows a scatterplot of 800 random points on a linear x-scale, with a draggable d3.brushX selection. Custom semicircular path handles are attached to the brush’s west and east edges, letting users resize the selection by dragging these visible arcs instead of the invisible brush boundary. The brushmoved handler updates the handle positions and highlights points inside the selected range. It uses d3.brushX, d3.axisBottom, d3.randomNormal, and d3.arc for the handle shapes, rendering to SVG.
AI-generated descriptionThis example demonstrates how to add visible and draggable handles to d3-brush, rather than that relying on the invisible boundary of the brush extent. The handle sizes here are exaggerated for demonstration purposes!
gpl-3.0 Licensed