Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

563845efa4764e67b35ec2bf6e797e4b

Mouse Follower

0 stars1🌍 Public
PPedro Henrique Vanali
Last edited Jun 15, 2023
Created on Jun 15, 2023

A small yellow circle tracks the mouse cursor across a blank SVG canvas in real time. The example demonstrates a simple interactive follower effect, where the circle’s center coordinates update on every mouse movement event. Built with React and D3.js v5, it uses `useState` to store cursor position and an SVG `onMouseMove` handler to trigger state changes. The rendering approach is purely declarative, with the circle’s `cx` and `cy` attributes directly bound to the current mouse coordinates, and D3 is imported but not used beyond the basic setup.

AI-generated description

Smiley face implementation with React & D3.