Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Kkavi-kumaran
Last edited Dec 31, 2019
Created on Dec 31, 2019

This example demonstrates basic DOM manipulation with D3.js by constructing a smiling face from SVG primitives and animating its eyebrows. A yellow circle forms the head, with two smaller circles for eyes, a path generated with `d3.arc()` creating the mouth, and two rectangles serving as eyebrows. The animation uses `transition().duration(2000)` to sequentially move each eyebrow vertically, creating a winking effect. The face is centered using a `transform` translation, and the rendered output is SVG.

AI-generated description

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

MIT Licensed

Similar vizzes