Skip to main content
100%

Let's make a face with D3.js

✓ Published0🌍 Public
WWhatTheFork85
Last edited Feb 24, 2020
Created on Feb 24, 2020

This D3.js example builds a cartoon face entirely out of SVG primitives—circles for eyes and the head, rectangles for eyebrows, and an arc path for the mouth. The face is centered in an SVG canvas using a group transform. The code animates the eyebrows with sequential `transition().duration(2000)` calls, moving them upward and back down. It relies on standard D3 v5 methods like `select`, `append`, and `attr`, using the `arc` helper to generate the mouth’s path data within the SVG.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes