Skip to main content
100%

Make a face with D3.js

✓ Published1🌍 Public
ZZachery2008
Last edited Oct 1, 2020
Created on Sep 29, 2020

This example builds a cartoon face entirely with D3.js shapes in an SVG. It uses `select` to target the SVG element and appends a yellow circle for the head, two black circles for eyes, and rectangles for eyebrows, all positioned with explicit pixel offsets. A mouth is created using the `arc` generator, which defines an annular sector with inner and outer radii and start/end angles. The face is centered by translating a group element to the middle of the 960 by 500 SVG canvas, demonstrating basic SVG shape construction and transformations in D3 v6.

AI-generated description
MIT Licensed

Similar vizzes