🌍 Public
Viewing a saved revision (read-only)
e1c6bc0893944e7d8d20e55257df38b0
Interaction with React: Mouse follower
A circle follows the mouse cursor within an SVG canvas. The example uses React's `useState` and `useCallback` to track the cursor's `clientX` and `clientY` coordinates, updating the circle's `cx` and `cy` attributes on every `onMouseMove` event. The SVG and circle are rendered directly through ReactDOM, with no D3 visualization logic, though the D3 library is loaded in the page. The interaction is purely event-driven, with the initial circle position centered at width/2, height/2.
AI-generated descriptionA program that follows your mouth with a circle.