Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
YYuqin
Last edited May 27, 2019
Created on May 27, 2019

This example builds a cartoon face using D3.js v5, rendered as SVG elements with animated eyebrows. It draws a yellow circle for the head, two blue eyes, and a mouth created with the `d3.arc()` path generator. The eyebrows, made of rectangles, move up and down through chained `transition().duration()` calls over two seconds each. The code uses `d3.select` to attach elements to an SVG container and positions them via transform attributes, demonstrating basic geometric shape composition and simple animation in D3.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes