Skip to main content
Public

Share visualization

Loading preview…

Make something, move and click mouse

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Make something, move and click mouse

0
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

Comments

Sign in to join the discussion.

MIT Licensed