Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Nnaziafrin
Last edited Nov 10, 2019
Created on Nov 10, 2019

A D3.js animation builds a cartoon smiley face entirely from SVG primitives, with a yellow circular head, two eyes, and a curved mouth created using the `d3.arc` path generator. The eyebrows, drawn as rectangles, repeatedly move up and down via chained `transition` calls, each lasting two seconds, to create a winking or surprised expression. The code demonstrates fundamental DOM manipulation by selecting the root `<svg>`, appending groups and shapes, and transforming them with translation attributes, all without reading any external data source.

AI-generated description

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

MIT Licensed

Similar vizzes