Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

follow the mouse

Public visualization

Viewing a saved revision (read-only)

cd7bc801a7194fe68bb169f2b4de1b5b

follow the mouse

0 stars0🌍 Public
Wwl328Weiminli
Last edited Aug 23, 2021
Created on Aug 22, 2021

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 description

A demonstration of SVG shapes.