Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

be9f37c01c574e2c8f794d3b80ce7ea2

Mouse Follower

0 stars0🌍 Public
Llupica.matthew@gmail.com
Last edited Apr 9, 2021
Created on Apr 8, 2021

A circle tracks the mouse cursor across an SVG canvas, updating its position in real time as the user moves the pointer. The visualization demonstrates a simple interactive pattern where user input directly drives an element's location. Built with React, it uses `useState` to store the mouse coordinates and `useCallback` to attach a `mousemove` event handler to the SVG element. The circle's `cx` and `cy` attributes are bound to the state, causing the shape to follow the cursor.

AI-generated description

A program that follows your mouse with a circle