Skip to main content
100%

Fork of Let's make a face with D3.js for practice!

✓ Published0🌍 Public
RRuanzhenglin
Last edited Mar 25, 2021
Created on Mar 25, 2021

A smiling face rendered in SVG animates its rectangular eyebrows upward and back downward in a looping motion. Built with D3.js v5, the example demonstrates fundamental DOM selection and manipulation, using `d3.select`, `circle` and `rect` elements, and a mouth path created with `d3.arc`. The eyebrow animation uses chained `transition.attr` calls with 2000-millisecond durations, shifting the group’s vertical transform. The code separates geometric constants for eye spacing, radius, and eyebrow placement, showing a clear, readable approach to constructing and animating SVG scenes.

AI-generated description

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

MIT Licensed

Similar vizzes