Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Wwusuowei60
Last edited Sep 28, 2020
Created on Sep 28, 2020

This example demonstrates fundamental DOM manipulation with D3.js by constructing a cheerful yellow smiley face from SVG primitives and animating its eyebrows. The code uses `d3.select`, `d3.append`, and `d3.arc` to build the face's circles, rectangles, and mouth path within a centered group. A `transition` with a two-second duration moves the eyebrow group up and down, creating a looping eyebrow-raising effect. The rendering is entirely SVG-based, with coordinate calculations in plain JavaScript driving the layout.

AI-generated description

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

MIT Licensed

Similar vizzes