Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
JJayesh Swami
Last edited Aug 30, 2019
Created on Aug 30, 2019

This example demonstrates fundamental DOM manipulation with D3.js by building a smiling face out of SVG shapes, then animating its eyebrows. A yellow circle forms the head, with two dark eyes and an arc-based mouth positioned around the center. The code uses `d3.select`, `append`, and attribute setters to construct elements, while `transition().duration()` moves the eyebrow group up and down over two-second intervals. The rendering relies on SVG elements within a 960-by-500 viewport, with all positioning handled through transform attributes and numerical constants.

AI-generated description

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

MIT Licensed

Similar vizzes