Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

8ac9951e101e433f82dfcf9c125a1729

Mouse Follower

0 stars1🌍 Public
SSophia Cofone
Last edited May 20, 2022
Created on May 20, 2022

This example displays a single black circle that follows the mouse cursor across an SVG canvas. The circle’s position updates live based on the cursor’s coordinates, which are tracked through React state. The code uses React’s `useState` and `useCallback` hooks, an SVG `<circle>` element, and D3.js version 5 for the underlying library. The rendering relies on ReactDOM to mount the component, with no additional data sources or animations beyond the direct mouse-following interaction.

AI-generated description

Program that follows your mouse with a circle.