Skip to main content
100%

Let's make a face with D3.js!

✓ Published1🌍 Public
Sshungshung
Last edited Feb 11, 2020
Created on Feb 9, 2020

This example builds a cartoon face from basic SVG shapes using D3.js, with a yellow circle for the head, two eyes, and an arc-based mouth. The code uses `d3.select` to target the SVG, `d3.arc` to generate the mouth path, and chained `transition().duration()` calls to animate the right eyebrow rising and falling over two seconds. The face is centered by translating a group element, and all shapes are drawn with SVG attributes like `cx`, `cy`, and `r`.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes