Skip to main content
100%

Let' make a face with D3.js

✓ Published0🌍 Public
Kkokotchr
Last edited Nov 15, 2020
Created on Nov 15, 2020

This example shows a yellow smiley face built with D3.js v5 and React, rendered as animated SVG. The code uses D3 selections and the `arc` generator to draw the face, circles for eyes, and rectangles for eyebrows. A chained `transition().duration(2000)` animation moves the eyebrows up and down, while the mouth is an arc path. The face is centered using SVG transforms, with all shapes positioned relative to the viewport dimensions.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes