Skip to main content
100%

Let's make a face with D3

✓ Published1🌍 Public
Hhairibung
Last edited Mar 5, 2020
Created on Mar 5, 2020

A smiling face is drawn entirely with SVG shapes, rendered as a yellow circle with a black stroke, two eyes, and an arc-based mouth. The code uses D3 v5 selections to append elements to an SVG canvas, importing `select` and `arc` from the D3 module. The `arc` generator creates the mouth with specified inner and outer radii and start/end angles. All shapes are centered using a group translation, with eye positions calculated from fixed offsets.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes