Skip to main content
100%

make a face with d3.js

✓ Published1🌍 Public
ZZhipeng Xu
Last edited Jun 15, 2020
Created on Jun 15, 2020
Forked from SVG

Using d3.js v5 and SVG, this example renders a cartoon face from primitive shapes: a yellow circle head, two eyes, eyebrows, and a mouth arc. The face is centered and symmetrically positioned using coordinate transforms. The eyebrows animate vertically through chained `transition` calls with a 2000ms duration, moving up by 50 pixels and then returning to their original position. The code constructs the SVG programmatically via `select` and `append`, and uses the `arc` function to generate the mouth's path data from inner and outer radii and angular ranges.

AI-generated description
MIT Licensed

Similar vizzes