Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Sshallowater
Last edited Jul 11, 2019
Created on Jul 11, 2019

This example builds a cartoon face entirely from SVG primitives. It draws a yellow circular head, then adds two eyes and eyebrows as positioned circles and rectangles, and a mouth using an arc path. The code uses D3 v5’s `select` and `arc` APIs to construct the shapes, with a group element translated to the SVG center for easy placement. All sizing and offsets are computed from the SVG’s width and height attributes, demonstrating a structured, transform-based approach to assembling simple geometric components.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes