Skip to main content
100%

Let's make a face with D3.js!

✓ Published2🌍 Public
Llinh-pham-nz
Last edited Nov 8, 2019
Created on Oct 29, 2019

A smiling cartoon face is drawn with SVG shapes, including a yellow circle for the head, two eyes, and an arc-based mouth. The eyebrows are rectangles that repeatedly move up and down via chained `transition` calls, creating a subtle animation. The code uses D3.js v5 selection methods, the `arc` generator for the mouth path, and coordinates computed from the SVG dimensions. The face is centered using a `g` element with a translation transform, and all styling is applied through D3 attributes.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes