Skip to main content
๐ŸŒ Public

Share visualization

Send this visualization to others.

Smily to Sad Face

Public visualization

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.

Comments

Sign in to join the discussion.

MIT Licensed