🌍 Public
Viewing a saved revision (read-only)
5ef4bcffc2804164a70eb611b2d6a5e6
Mouse Follower
A yellow circle follows the mouse cursor across an SVG canvas. The example demonstrates real-time interaction in a React application, using state management to track the cursor's coordinates. The code builds an SVG with React's `useState` and `useCallback` hooks, updating the circle's `cx` and `cy` attributes on every `onMouseMove` event. The React component renders directly into a `div` element, with the SVG's default styling coming from D3 v5 and React 16.9.0.
AI-generated descriptionA program that follows the mouse with a circle.