Skip to main content
100%

Let's make a face with CSS and D3

✓ Published1🌍 Public
Ppaulboeck
Last edited May 20, 2019
Created on May 20, 2019

This example uses D3 v5 to draw a smiling face with SVG primitives: a yellow circle for the head, smaller circles for eyes, rectangles for eyebrows, and an arc path for the mouth. The code animates the eyebrows by using D3's `transition()` method to move the group element vertically over two seconds, then back. All shapes are positioned relative to the SVG's center using a translated group, and the mouth is created with D3's `arc()` function from the `d3` import.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes