Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
KKoustubhK2618
Last edited Apr 13, 2020
Created on Apr 13, 2020

This example constructs a smiley face out of SVG shapes and animates its eyebrows. Using D3.js v5, the code selects the SVG canvas, appends groups and primitive shapes like circles, rectangles, and an arc-based mouth, and positions them with transform attributes. The eyebrows are rectangles that use chained `transition` calls to move up and down over 2-second intervals. This demonstrates fundamental DOM manipulation and basic animation, where the underlying data is the hardcoded positional values and dimensions for each facial feature.

AI-generated description

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

MIT Licensed

Similar vizzes