🌍 Public
Viewing a saved revision (read-only)
cd7bc801a7194fe68bb169f2b4de1b5b
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.