Skip to main content
Public

Share visualization

Loading preview…

Mouse Follower

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Mouse Follower

0
AAnthony Zornig
Last edited Oct 2, 2021
Created on Oct 2, 2021
Forked from Hello VizHub

A smiling face follows the mouse cursor across an SVG canvas, responding instantly to pointer movement. The example demonstrates a minimal React integration with D3, using React's `useState` and `useCallback` hooks to track mouse coordinates and re-render the circle's position. Rendered as a single SVG circle, it relies on D3 v5's `arc` import, though the visible shape is a simple circle rather than an arc. The code pairs React 16.9 with d3.min.js, updating the circle's `cx` and `cy` attributes via React state on every mousemove event.

AI-generated description

Smiley face implementation with React & D3.

Comments

Sign in to join the discussion.

MIT Licensed