Skip to main content
100%

practice11--hover

✓ Published0🌍 Public
DDi Cui
Last edited May 21, 2023
Created on May 21, 2023
Forked from practice10--click

A D3.js smiley face made of fruit-shaped circles demonstrates hover interactions, where each circle changes its stroke color when a fruit is selected and returns to normal when the mouse leaves. The visualization shows five apples that shrink, disappear, and transform into a lemon over time, with transitions animating radius and position changes. Using d3-selection, d3-scaleOrdinal, and transition.attr, the code binds data to circles, updates attributes via .merge(), and removes exiting elements with a collapsing radius animation.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

MIT Licensed

Similar vizzes