Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

3. Mouse follower

Public visualization

Viewing a saved revision (read-only)

3c0bfcad48f44fb8829c77ee1873d2cc

3. Mouse follower

0 stars1🌍 Public
DDenis Zjukow
Last edited Sep 14, 2021
Created on Sep 14, 2021
Forked from 1. Faces

A circle follows the mouse cursor across an SVG canvas. The visualization demonstrates interactive state management in React, where mouse movement events update the circle's position. The code uses React's `useState` and `useCallback` hooks to track cursor coordinates, and renders the result as an SVG circle element. The page loads React 17, ReactDOM, and D3 v7 from a CDN, with the application contained in a single `index.js` file. The circle starts at the center of the 960x500 viewport and moves responsively to user input.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.