Skip to main content
100%

Fork of Mouse Follower edited

✓ Published1🌍 Public
KKhatera Alizada
Last edited Jan 15, 2023
Created on Jan 11, 2023

A circle, rectangle, and text label all follow the mouse cursor across the screen, while a separate set of draggable circles is rendered using D3's data join and drag behavior. Clicking anywhere on the SVG appends a new circle with a random radius from the `d3.range` array, colored via `d3.schemePastel1`. The code uses D3 v7 selections and event handlers (`svg.on("mousemove")`) to update SVG attributes (`cx`, `cy`, `x`, `y`) in real time, with `d3.drag()` enabling interactive circle repositioning.

AI-generated description

A circle that follows the mouse.

MIT Licensed

Similar vizzes