🌍 Public
Viewing a saved revision (read-only)
e277dff7421049af9c800e4fe65de905
Mouse Follower
This example shows a simple interactive visualization where a gray circle follows the mouse cursor across an SVG canvas. The circle starts at the center of a 960 by 500 pixel viewport and repositions instantly whenever the pointer moves. The code uses React's `useState` and `useCallback` hooks to track mouse coordinates via the SVG `onMouseMove` event, updating the circle’s `cx` and `cy` attributes through ReactDOM rendering. It demonstrates basic state-driven SVG updates in a React application.
AI-generated descriptionA program that follows your mouse with a circle.