Skip to main content
100%

Let's make a face with D3.js!

✓ Published3🌍 Public
Ookleinlux
Last edited Apr 23, 2020
Created on Apr 22, 2020
Forked from HTML Starter

This example uses D3.js v5 to construct a cartoon face from basic SVG shapes: a yellow circle for the head, black circles for eyes, and a mouth drawn with the `d3.arc` path generator. The eyebrows are rectangles that animate their vertical position using chained `transition` calls with `attr` tweens, giving the face a blinking or winking effect over time. The code selects the SVG element and appends shapes with explicit `attr` settings for coordinates, sizes, and fill colors, while the `<script>` tag loads D3 from a CDN. The rendering approach is purely declarative SVG construction with animated transitions.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes