Skip to main content
100%

Fork of Let's make a face with D3.js

✓ Published0🌍 Public
TTejaswicmandava
Last edited Feb 25, 2023
Created on Feb 25, 2023

This example shows a simple animated face built with SVG, featuring yellow circular head, white eyes with black pupils, and a mouth drawn as an arc path. The code uses d3-selection to append elements and d3-shape’s `arc` generator to create the mouth. Eyebrows are rectangles that animate by chaining `transition().duration(2000)` calls, moving their group up and down via `attr('transform')`. The face is centered using a `g` element translated to the SVG’s midpoint, with coordinates derived from the SVG’s height and width attributes.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes