Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse círculo

Public visualization

More options

Embed on a websiteCopy iframe embed code

The embed preserves the visualization's visibility and project dataset permissions.

Download & exportHTML, source ZIP and authorized project data

Source ZIP contains editable visualization files; it does not include project datasets. Standalone HTML is available where authorized and packages readable referenced data for offline use. Dataset ZIP requires project read permission.

Standalone HTMLSource ZIP
Publishing & handoffCopy a client maintenance summary

Includes the canonical link, visibility, and available export formats. Confirm dataset attribution, licensing and maintenance responsibilities with the publisher.

Mouse círculo

0 stars0🌍 Public
Ffcordon@pin.upv.es
Last edited Feb 9, 2025
Created on Feb 9, 2025

This example demonstrates a single red circle that follows the mouse cursor across the visualization canvas. The circle's position updates directly in response to pointer movement, with the cursor’s coordinates captured from each mouse event. The implementation uses d3’s `select` and `pointer` functions within an interactive SVG, where a `mousemove` handler triggers state updates via a spread operator to maintain an immutable state object. The circle’s `cx` and `cy` attributes are then re-rendered from the updated state, showcasing a simple, reactive update pattern.

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

Comments

Sign in to join the discussion.

MIT Licensed