Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Lets make a face with D3.js

Public visualization

Lets make a face with D3.js

0 stars4🌍 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.

Comments

Sign in to join the discussion.

MIT Licensed