Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Viewing a saved revision (read-only)

15a2e8304cf747a29a0e8ce62fccdae5

Let's make a face with D3.js!

0 stars2🌍 Public
Jjulieducasse
Last edited Sep 27, 2019
Created on Sep 19, 2019

A smiley face rendered in SVG with D3.js v5 demonstrates fundamental DOM manipulation through animated eyebrow movement. The face, eyes, and eyebrows are drawn as SVG circles using d3.select and d3.append, with the eyebrow positions controlled by coordinate offsets. The face circle triggers a recursive animation via addEvents and transition.attr, moving the entire face group vertically over two seconds before reversing direction. The example uses D3's selection.transition with .duration and .on("end") callbacks to create a continuous bobbing motion, showing how to build and animate SVG elements without external data.

AI-generated description

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