Skip to main content
100%

Create a face with d3.js!

✓ Published0🌍 Public
LLokesh Chennuru
Last edited Dec 8, 2023
Created on Dec 8, 2023

A smiling cartoon face is drawn entirely with D3.js SVG shapes, including a yellow circle head, eyes, rectangular eyebrows, and an arced mouth. The eyebrows animate upward and then back down over two seconds using chained `transition` calls. The code loads D3 v7 via UNPKG and uses `select`, `arc`, and SVG attribute manipulation to construct and position each facial feature relative to the center of the 960 by 500 viewport.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes