Skip to main content
100%

Let's make a face with D3.js

✓ Published0🌍 Public
Bblueglasses1995
Last edited Jul 31, 2020
Created on Jul 31, 2020

This example draws a simple cartoon face using D3.js and SVG. It shows a yellow circle for the head with two smaller black circles as eyes, positioned symmetrically using predefined spacing offsets. The code uses D3’s `select` and `append` methods to create and configure SVG elements, reading the width and height attributes directly from the HTML. Styling is handled with CSS classes for stroke properties, though the face itself relies on inline attributes.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes