Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Follow mouse with circle.

Public visualization

Viewing a saved revision (read-only)

124ac6fcfb204607be60e89cbaa8a596

Follow mouse with circle.

0 stars1🌍 Public
IIlia Katkovnik
Last edited Mar 13, 2021
Created on Mar 10, 2021

A circle follows the mouse as it moves across an SVG canvas. The demonstration uses React state to track cursor coordinates on mouse move and updates the circle’s position accordingly. Built with React 17 and D3 v6, the visualization relies on React’s `useState` and `useCallback` hooks, while the SVG circle’s `cx` and `cy` attributes are bound to the current mouse position.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.