Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Mouse Follwer 1

Public visualization

Mouse Follwer 1

0 stars0๐ŸŒ Public
RRichard Hu
Last edited Jun 16, 2023
Created on Jun 16, 2023
Forked from D3 Starter

A single gray circle follows the mouse cursor across the full screen, responding instantly to every movement. The visualization uses D3 v7's selection and event handling, attaching a `mousemove` listener to the SVG element. On each event, the code updates the circle's `cx` and `cy` attributes with the cursor's coordinates, logging the position to the console. The SVG fills the entire browser window via `window.innerWidth` and `window.innerHeight`, with the body reset to no margin and hidden overflow.

AI-generated description

A demonstration of how to start using D3 version 6.

Comments

Sign in to join the discussion.

MIT Licensed