🌍 Public
Viewing a saved revision (read-only)
392f244c18454afc837acbbaf434b8af
Mouse Follower
A circle follows the mouse cursor inside an SVG canvas, updating its position in real time as the pointer moves. The example combines React state management with D3.js v7 for SVG rendering, using the `useState` hook to track mouse coordinates and a `useCallback` event handler to update them on `mousemove`. The circle is drawn with hardcoded width and height values, and the mouse position is captured via `clientX` and `clientY` from the native browser event.
AI-generated descriptionProgram that follows your mouse with circle.