Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Mouse Follower

Public visualization

Fork of Mouse Follower

0 stars0🌍 Public
GGuo Ci
Last edited Jul 8, 2024
Created on Jul 8, 2024
Forked from Mouse Follower

This example demonstrates a mouse follower where a circle visually tracks the cursor’s position across the viewport, serving as a minimal illustration of unidirectional data flow in a React-driven D3 visualization. The code uses D3’s `select` and `join` API to incrementally build an SVG and circle element, updating their `cx` and `cy` attributes based on mouse events. State changes trigger a re-render through the `setState` callback, with the initial position defaulting to the center of the window.

AI-generated description

A circle that follows the mouse using unidirectional data flow. See also Mouse Follower with React.

Comments

Sign in to join the discussion.

MIT Licensed