Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
LLohithBlaze
Last edited Feb 11, 2019
Created on Feb 11, 2019

This example demonstrates basic DOM manipulation with D3.js by constructing a smiling face from SVG primitives and animating its eyebrows. Built with D3 v5, the code uses the `select` API to target the SVG element and `append` to create circles, rectangles, and a path for the mouth. The eyebrows are animated using chained `transition().duration()` calls, moving them vertically over two seconds before returning to their original position, with the mouth drawn via D3's `arc` function to create a crescent shape.

AI-generated description

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

MIT Licensed

Similar vizzes