Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
WWill Bainton
Last edited Jul 23, 2020
Created on Jul 22, 2020

This example uses D3.js to draw a simple, static cartoon face on an SVG canvas. It shows a yellow circular head, two colored eyes (dodger blue and tomato), and a black mouth created with an arc path. The code uses D3's `select` to target the SVG element, `append` with `circle` and `path`, and the `arc` generator to define the mouth’s geometry based on inner/outer radii and angle ranges. Positions are computed relative to the canvas center, and styling is applied via SVG attributes.

AI-generated description
MIT Licensed

Similar vizzes