Skip to main content
100%

Fork of Fork of Create a face with d3.js!

✓ Published0🌍 Public
PPKISHON
Last edited Sep 22, 2023
Created on Sep 22, 2023

This example builds a smiling face with D3.js on an SVG canvas, starting with a yellow head and then adding eyes, eyebrows, and a mouth. The code uses D3 v7 loaded via UNPKG, with the `select` and `arc` functions from the d3 module. A local module import structure is demonstrated through the ES6 code. The eyebrows are animated using chained `transition().duration()` calls, moving them down and back up over two-second intervals. The numeric attributes for geometry are hard-coded, and the face is centered within a 960-by-500 SVG.

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