Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

follow_circle

Public visualization

follow_circle

0 stars0🌍 Public
AAndrew Fletcher
Last edited Apr 25, 2021
Created on Apr 25, 2021

A React application renders an SVG circle that follows the mouse cursor across a 960x500 canvas. The circle's position updates dynamically based on the user's pointer movement, using React's `useState` and `useCallback` hooks to manage and handle mouse events. The component tracks the clientX and clientY coordinates from the mouse move event and sets them as the new center of the circle. This example demonstrates state management and event handling in React while rendering a simple interactive SVG visualization.

AI-generated description

making a circle that follows your mouse

Comments

Sign in to join the discussion.

MIT Licensed