Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

7b48051e17c54fdab3ed1a6c05d1452c

Mouse Follower

0 stars0🌍 Public
AAndy Curtis
Last edited Aug 28, 2023
Created on Aug 28, 2023

A smiley face follows the mouse cursor across a full-screen SVG canvas. Clicking anywhere increases the circle's radius by one pixel. The example uses React's `useState` and `useCallback` hooks to manage the cursor position and radius state, with event handlers on the SVG element updating the component. It renders a single SVG circle, updating its `cx`, `cy`, and `r` attributes in response to mouse events.

AI-generated description

Smiley face implementation with React.