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
AAlan Thompson
Last edited Jul 4, 2019
Created on Jul 4, 2019

This example demonstrates fundamental DOM manipulation with D3.js by building a smiley face from SVG primitives, including circles, rectangles, and an arc-based mouth. The face’s eyebrows animate upward and downward using chained `transition().duration()` calls on a group element’s `attr('transform')`. Code imports `select` and `arc` from the D3 v5 module, explicitly setting the SVG’s background color to red. All elements are positioned relative to a centered group, illustrating coordinate transforms and append/attr operations without external data.

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