Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
TTatyana Milanova
Last edited Oct 4, 2023
Created on Oct 4, 2023
Forked from Hello VizHub

A mouse follower example renders a single SVG circle that tracks the cursor's position within a 960 by 500 viewport. Using React state hooks (`useState` and `useCallback`), the component updates the circle's `cx` and `cy` coordinates on every `mousemove` event. D3 version 7 is loaded for potential utilities, though the interaction relies solely on React's event handling and SVG rendering. The circle starts centered and moves fluidly, demonstrating simple interaction between DOM events and React's declarative UI updates.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes