Skip to main content
100%

Moving circle

✓ Published0🌍 Public
SSubhendu Karmakar
Last edited Jan 19, 2024
Created on Jan 19, 2024
Forked from HTML Starter

A moving circle follows the mouse cursor across an SVG canvas, changing to a random RGB color with each click. The visualization uses D3's data join pattern, binding arrays of null values to create and update a single circle and svg element on every state change. Mouse and click event listeners call a setState function that updates the circle's x and y coordinates to the cursor position or assigns a new randomly generated color.

AI-generated description
MIT Licensed

Similar vizzes