Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
SSillySuperhero21
Last edited Jun 29, 2019
Created on Jun 29, 2019

This example demonstrates how D3.js v5 can manipulate SVG elements to create an animated smiley face. It shows fundamental DOM selection and appending via `d3.select`, `d3.arc` for the mouth path, and `transition.attr` to animate the eyebrows by shifting their vertical offset over two 2-second intervals. The face is rendered as a yellow circle with black strokes, positioned using SVG transformations, with rectangles acting as eyebrows that move up and down while the eyes and mouth remain static.

AI-generated description

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

MIT Licensed

Similar vizzes