Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Smily to Sad Face

Public visualization

Viewing a saved revision (read-only)

e23b891d03aa4b7fa05c0ac34477c8ba

Smily to Sad Face

0 stars1🌍 Public
Ppursho1999
Last edited Oct 5, 2023
Created on Oct 5, 2023

A yellow smiley face rendered in SVG with D3 v5 animates its eyebrows to shift between smiling and sad expressions. The face is built from circles for the eyes, rectangles for the eyebrows, and a path generated with the d3 `arc` helper for the mouth. A chained `transition().duration(2000)` moves the eyebrow group vertically over two seconds, then returns it, creating a looping mood change. The code uses `select`, `attr`, and `append` utilities for DOM manipulation.

AI-generated description

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