Skip to main content
100%

Mouse Follower

✓ Published2🌍 Public
LLove Wessman
Last edited Jan 19, 2022
Created on Jan 19, 2022
Forked from Faces

An interactive SVG visualization renders a single circle that follows the mouse cursor across a 960-by-500 canvas. The React component tracks pointer movement via the `onMouseMove` event and updates the circle’s `cx` and `cy` attributes through `useState` and `useCallback`. Initially positioned at the canvas center, the circle moves smoothly with the cursor. The example demonstrates state-driven rendering in React 17 with D3 v7, using plain SVG elements rather than data joins or scales. No external data source is involved; the visualization purely reacts to user input.

AI-generated description

A program that follows your mouse.

MIT Licensed

Similar vizzes