Mouse follower
✓ Published1🌍 Public
A single gray circle follows the mouse pointer across an SVG canvas. The example uses React state to track the cursor’s clientX and clientY coordinates on every mousemove event, updating the circle’s cx and cy attributes accordingly. Rendered as an SVG circle with a fixed radius, it starts at the center of a 960×500 viewport. The implementation combines React’s useCallback and useState hooks with D3.js v6, though D3 is only loaded and not actively used in the logic.
AI-generated descriptionCircle as a mouse follower
MIT Licensed