Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
OOlowogoke Seun
Last edited Sep 30, 2021
Created on Sep 30, 2021

A black circle follows the mouse as it moves across a blank SVG canvas. The example demonstrates React state management with the `useState` and `useCallback` hooks to track cursor coordinates. Each mouse movement updates the circle’s `cx` and `cy` attributes, while d3.v5 is loaded but not used in the visible logic. The SVG rendering is handled by React, with the circle’s position initialized at the canvas center.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed