Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Homework3_mousefollower

Public visualization

Viewing a saved revision (read-only)

b398e73c5d4048b5af18e3b09eaec9e5

Homework3_mousefollower

0 stars0🌍 Public
Hhuashe418
Last edited Mar 17, 2022
Created on Mar 16, 2022

A circle follows the mouse cursor across an SVG canvas, updating its center position in real time as the pointer moves. The visualization uses React's `useState` and `useCallback` hooks to track mouse coordinates via an `onMouseMove` event handler on the SVG element. The circle is rendered as an SVG `<circle>` element with a fixed radius, while the component imports the `arc` function from D3 v5, though it is not used in the displayed logic. The initial circle position is centered at (480, 250) on a 960×500 canvas.

AI-generated description

A program that follows your mouse with a circle.