Skip to main content
100%

Let's make a face with D3.js

✓ Published3🌍 Public
JJames Barbour, Jr.
Last edited Apr 8, 2020
Created on Apr 7, 2020

This example creates a simple cartoon face from geometric shapes, with a yellow circular head, two eyes, and a mouth drawn as an arc. Built with D3.js v5 and React, the visualization uses SVG elements including `circle`, `rect`, and `path` to compose the face. The code animates the right eyebrow using chained `.transition().duration(2000).attr('y', ...)` calls, moving it down and back up over four seconds. Static facial features are positioned using absolute pixel offsets, while the mouth is generated via the `arc()` API with specified inner and outer radii and angular range.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes