Skip to main content
100%

Fork of Let's make a face with D3.js!

✓ Published0🌍 Public
JJoshuoYang
Last edited Sep 26, 2022
Created on Sep 26, 2022

This example shows a yellow smiley face centered in an SVG canvas, with two eyes and a mouth formed by an arc path, while its eyebrows animate by moving upward and then back down. Built with D3.js v5, the code uses `d3.select`, `svg.append`, and `.attr` to construct the face, and `transition().duration(2000)` to create the eyebrow motion. The face is drawn using SVG shapes, including circles for the eyes and a path generated by `d3.arc` for the mouth, with dimensions fixed to a 960×500 viewport.

AI-generated description

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

MIT Licensed

Similar vizzes