Skip to main content
100%

Fork of Mouse Follower

✓ Published0🌍 Public
Ssadhanasri125@gmail.com
Last edited Aug 12, 2024
Created on Aug 12, 2024
Forked from Mouse Follower

A circle follows the mouse across a light green canvas, changing its fill color to a randomly generated hexadecimal value on each click. The example demonstrates immutable state updates via a Redux-style pattern, where a `setState` callback creates a new state object rather than mutating the existing one. Built with d3.js (v7.8.5), it uses `d3.select`, `d3.pointer`, and SVG joins to handle mouse events and render the circle. The initial color is blue, and the circle’s position is updated with every `mousemove` event using the current pointer coordinates.

AI-generated description

A program that follows the mouse around and changes its color using immutable update patterns.

Challenge

  • Use this pattern to make something else respond to mouse events
MIT Licensed

Similar vizzes