🌍 Public
Viewing a saved revision (read-only)
1b8f35912103436398a2a16f74b804ac
follow the mouse
A single circle follows the mouse cursor across a 960 by 500 SVG canvas. The example demonstrates interactive SVG rendering in React, updating the circle's `cx` and `cy` attributes on every `MouseMove` event. It uses React’s `useState` hook to store the cursor's client coordinates and re-renders the circle accordingly. The code relies on React 17 and ReactDOM to manage the SVG element, with no D3 functions invoked beyond the imported `arc`, which is unused in the final visualization.
AI-generated descriptionA demonstration of SVG shapes.