Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars0🌍 Public
Aarorabaugh
Last edited Jan 4, 2023
Created on Jan 4, 2023

A circle follows the mouse cursor across an SVG canvas, updating its position in real time based on pointer movement. The visualization demonstrates mouse-event handling and state-driven rendering with React, using the `useState` hook to store the cursor coordinates and `onMouseMove` to update them. ReactDOM renders an SVG circle whose `cx` and `cy` attributes are bound to the tracked position, with the viewport dimensions fixed at 960 by 500 pixels. No data source or external computation is involved; the example relies solely on React's declarative update cycle.

AI-generated description

A program that follows your mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed