Skip to main content
100%

Lets make a face with D3.js

✓ Published4🌍 Public
HHelenaShu
Last edited Sep 4, 2019
Created on Aug 24, 2019

This example builds a smiling face entirely from basic SVG shapes—circles for the head, eyes, and mouth, and rectangles for the eyebrows—using D3.js v5 selections and attribute setters. The code appends each element to an SVG canvas sized 960 by 500, positioning them relative to the viewport center. A transition on the right eyebrow animates it upward and back down over four seconds, demonstrating D3’s `transition().duration()` method for simple motion.

AI-generated description

An example showing the capabilities of VizHub.

MIT Licensed

Similar vizzes