Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Mouse Follower

Public visualization

Viewing a saved revision (read-only)

e54574c45835453daab93dcda3382531

Fork of Mouse Follower

0 stars1🌍 Public
Bbdfee
Last edited Nov 14, 2021
Created on Nov 13, 2021
Forked from Mouse Follower

This example shows a smiley-face circle that follows the mouse cursor across an SVG canvas, with its fill color changing dynamically based on the cursor's screen coordinates. The circle’s position is updated through React state managed by the `useState` hook, while two `d3.scaleLinear` instances map the X and Y coordinates to RGB color channels. Rendering is handled via React’s `ReactDOM.render` on a D3-selected SVG element, with the mouse-move event triggering a state update that re-renders the circle.

AI-generated description

Smiley face implementation with React.