Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shapes with SVG and CSS

Public visualization

Viewing a saved revision (read-only)

6c20ecb275864364bbb6958b1a014596

Shapes with SVG and CSS

0 stars0🌍 Public
Nnaveena1405
Last edited Jun 9, 2023
Created on Jun 9, 2023
Forked from Mouse Follower

A circle follows the mouse cursor across a full-window SVG canvas, using unidirectional data flow to manage position state. The `index.js` file holds the state object and re-renders on every update, while `viz.js` uses D3's `select` and `join` methods to create the SVG element and bind circle attributes. The initial state centers the circle, and subsequent mouse movements trigger `setState` with new `x` and `y` coordinates, updating the circle's `cx` and `cy` attributes. The example is minimal, with only 50 pixels of radius.

AI-generated description

A circle that follows the mouse using unidirectional data flow.