Skip to main content
100%

mouse follower

✓ Published0🌍 Public
DDonald Bagwell
Last edited Apr 9, 2024
Created on Apr 9, 2024

This example shows a single green circle that follows the mouse pointer across an SVG canvas. Moving the mouse updates the circle’s position via `d3.pointer` and state management, while clicking changes its fill color to a random hex value. The code uses D3 v7, with `select`, `pointer`, and data joins to bind the circle’s coordinates and radius. The visualization demonstrates reactive updates through a `setState` callback, with the circle rendered at half opacity.

AI-generated description

Creating circles with D3.

Challenge

  • Fork this example
  • Modify it
  • Maybe make it Halloween themed
  • Maybe make it Christmas themed
  • Be creative
MIT Licensed

Similar vizzes