Skip to main content
100%

Drag Multiples

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jan 3, 2012

A grid of sixteen small SVG circles, each in its own separate SVG element, can be dragged independently within the bounds of its cell. The example demonstrates the `d3.behavior.drag` API, using its `origin` accessor and `drag` event to update circle positions. Each circle is constrained to its local coordinate space, with position clamped between the radius and the SVG width or height. The code uses d3.v3 and renders the visuals as SVG, with the data derived from a static array of sixteen identical starting points.

AI-generated description
gpl-3.0 Licensed

Similar vizzes