Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse follower

Public visualization

Viewing a saved revision (read-only)

1c7c0e8110434d2382c2acfdbc8ba92b

Mouse follower

0 stars1🌍 Public
Vvijaytayal
Last edited Sep 6, 2021
Created on Sep 5, 2021

A smiley face drawn with SVG circles follows the cursor inside a 960 by 500 canvas. The React component tracks mouse movements via an `onMouseMove` handler, updating state to reposition a single circle. While the static markup comments include a complete face, the active code renders only the follower circle using React's `useState` and `useCallback`. The example demonstrates combining React's declarative updates with D3's SVG scene graph for interactive visualizations.

AI-generated description

Smiley face implementation with React & D3.