Skip to main content
100%

Fork of Create a face with d3.js!

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

This example uses D3.js v7 to construct a simple yellow face from SVG shapes, including circles for the eyes and rectangles for the eyebrows. The code imports `select` and `arc` from the D3 library, though `arc` is unused, and sets the face against a fixed 960×500 canvas. A chained `transition().duration(2000)` animation moves the eyebrow group up and down, creating a blinking or raising effect. The SVG elements are positioned relative to the center of the canvas using a translated group.

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