Skip to main content
100%

Mouse Follwer 1

✓ Published0🌍 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.

MIT Licensed

Similar vizzes