block by mbostock 22994cc97fefaeede0d861e6815a847e

Circle Dragging I

Full Screen

This example demonstrates applying d3.drag for dragging circles in SVG. Each circle’s datum is an object with x and y properties. The data and the circle element’s position are updated during the drag event. The circle is raised to the foreground at the start of a drag, and a temporary stroke is applied during drag for visual feedback.

Compare this to dragging Canvas circles. Selection can be improved using a Voronoi overlay.

Updated Example →