Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 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.

MIT Licensed

Similar vizzes