Skip to main content
100%

Interactions 1

✓ Published1🌍 Public
Jjbruzzo
Last edited Oct 26, 2022
Created on Oct 26, 2022
Forked from Line Transition

Four colored squares render in an SVG, initially gray. Hovering over a square fills it with its assigned color using D3's `mouseenter` and `mouseout` events, which call `d3.select(this).style` to change the fill. After three seconds, a `setTimeout` triggers the `dispatch` method to simulate a mouseout, and then removes both event listeners, leaving the squares interactive only briefly. The code binds an array of hex colors to `rect` elements using `d3.selectAll` and `data`.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes