Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
ZZhi Guangda
Last edited Jul 15, 2019
Created on Jul 15, 2019

This example demonstrates how to build an animated smiley face using D3.js, showing a yellow circle with eyes, eyebrows, and a mouth. The eyebrows first move upward over two seconds and then return to their original position, creating a simple raised-eyebrow animation. The code uses D3’s `select` and `append` methods to construct SVG elements, while the mouth is drawn with the `arc` shape generator. The eyebrow motion is driven by chained `transition` calls that animate the `transform` attribute.

AI-generated description

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

MIT Licensed

Similar vizzes