Skip to main content
100%

Mouse follower

✓ Published1🌍 Public
MmohitPassan
Last edited Apr 24, 2021
Created on Apr 24, 2021
Forked from React starter

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 description

Circle as a mouse follower

MIT Licensed

Similar vizzes