Skip to main content
100%

Make something, move and click mouse

✓ Published0🌍 Public
QQingyang Wang Profolio
Last edited Jan 14, 2023
Created on Jan 14, 2023

A small circle follows the mouse as it moves across an SVG canvas. Clicking the mouse drops a larger, randomly colored circle at the click position, with colors selected from a fixed palette of blue, red, yellow, green, and pink. The example uses D3.js v7 selection and event handling methods, including `svg.on('mousemove')` and `svg.on('click')`, to update circle attributes such as `cx`, `cy`, `r`, and `fill`. The SVG is sized to the full browser window.

AI-generated description

A circle that follows the mouse. When click the mouse, a random color, bigger circle will appear on the current position

MIT Licensed

Similar vizzes