Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
MMinwoo Pak
Last edited Mar 13, 2023
Created on Mar 13, 2023

A single black circle follows the cursor across a full-screen SVG canvas, updating its position in real time. The visualization demonstrates a minimal state-driven D3 render loop, where a `mousemove` event listener calls a `setState` function to update the pointer coordinates. The `viz` function uses a data join to create and update the circle element, with `d3.select` handling the SVG selection and attribute updates for the x and y positions. The example relies on D3 v7 and a custom render pattern that re-renders the entire visualization on each state change.

AI-generated description
MIT Licensed

Similar vizzes