Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
JJun Suzuki
Last edited Nov 15, 2021
Created on Nov 15, 2021
Forked from Smiley Face Part 1

A plain SVG circle follows the user's mouse cursor across a 960-by-500 canvas. The React component tracks `clientX` and `clientY` from a `mousemove` event handler, updating state to reposition the circle's `cx` and `cy` attributes. The example uses React's `useState` and `useCallback` hooks, with D3 v7 loaded for potential supplementary utilities, though rendering relies solely on SVG elements and React's declarative updates.

AI-generated description

A program that follows the user's mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed