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)

a94b75e579ea4b18b60d9deaf480c3ca

Let's make a face with D3.js!

0 stars0🌍 Public
EEL MAHI Moncef
Last edited Feb 7, 2019
Created on Feb 6, 2019

This example builds a cheerful yellow smiley face using D3.js v5, rendered as SVG elements. The face is composed of circles for the head and eyes, rectangles for eyebrows, and an arc-generated path for the mouth. The code demonstrates fundamental DOM manipulation with `d3.select` and `d3.append`, while `d3.arc` creates the mouth shape. An animation driven by chained `transition` and `attr` methods moves the eyebrows up and down over a four-second cycle, showcasing how D3 transitions can animate SVG attributes.

AI-generated description

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