🌍 Public
Viewing a saved revision (read-only)
8ac9951e101e433f82dfcf9c125a1729
Mouse Follower
This example displays a single black circle that follows the mouse cursor across an SVG canvas. The circle’s position updates live based on the cursor’s coordinates, which are tracked through React state. The code uses React’s `useState` and `useCallback` hooks, an SVG `<circle>` element, and D3.js version 5 for the underlying library. The rendering relies on ReactDOM to mount the component, with no additional data sources or animations beyond the direct mouse-following interaction.
AI-generated descriptionProgram that follows your mouse with a circle.