Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Circle Trail

Public visualization

Circle Trail

0 stars0🌍 Public
Jjjlaber
Last edited Jan 17, 2023
Created on Jan 17, 2023
Forked from Mouse Follower

A white circle follows the mouse cursor across a purple background, leaving a trail of its previous positions. The visualization uses d3-selection’s `select` and `selectAll` with a `.join()` pattern to append or update a single circle element on each `mousemove` event. The circle’s coordinates are stored in a state object and updated via a `setState` callback, while `window.innerWidth` and `window.innerHeight` set the SVG size. This demonstrates a simple, event-driven rendering loop with D3 v7.

AI-generated description

Leaves a trail of white circles

Comments

Sign in to join the discussion.

MIT Licensed