Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Wwindwaver
Last edited Mar 19, 2021
Created on Mar 18, 2021

The example displays a single gray circle that tracks the mouse cursor across an SVG canvas. Mouse movement triggers a React state update, repositioning the circle’s center coordinates. The code uses React’s `useState` and `useCallback` hooks within an SVG `onMouseMove` handler, while D3 v5 is loaded but unused. Rendering is handled by ReactDOM, with a fixed viewport of 960 by 500 pixels and a circle radius of 30.

AI-generated description

A programm that follows you mouse with a circle.

MIT Licensed

Similar vizzes