Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Let's make a face with D3.js!

0 stars0🌍 Public
RRyan Fleming
Last edited Nov 7, 2018
Created on Aug 30, 2018

This example creates a smiley face in an SVG canvas using D3.js, with animated eyes that repeatedly expand and contract their pupils. It demonstrates fundamental DOM manipulation through D3 selections, appending circles, paths, and groups, while leveraging the arc generator to shape the eyes, eyebrows, and mouth. The code specifically uses d3.select and d3.arc from D3 v5, and the pupil animation is driven by chained transition calls that alternate the circles’ radii. The face is centered via a translated group, and positioning relies on hard-coded constants for eye spacing and offsets.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

Comments

Sign in to join the discussion.

MIT Licensed