Skip to main content
100%

Fork of Create a face with d3.js!

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

This example draws a cartoon face in an SVG canvas using D3 v7, with a yellow circular head, two eyes, rectangular eyebrows, and an arc-based mouth. The code imports `select` and `arc` from D3 and constructs the face programmatically, centering it in a 960×500 viewport. The eyebrows are animated with chained `transition().duration(2000)` calls that move them downward and then back to their original position. The face is static apart from this repeating eyebrow movement, which demonstrates D3’s SVG rendering and transition API.

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