Skip to main content
100%

Dataviz 2018 - 2. D3 starter, SVG DOM manipulation, transition(animation), Smile Face - Ep4

✓ Published4🌍 Public
MMinwoo Pak
Last edited Jun 15, 2021
Created on Oct 13, 2019

This example shows a yellow smiley face built from SVG elements, with animated eyebrows that move up and down in a looping transition. The code creates a circle for the face, two circles for eyes, a mouth drawn with `d3.arc`, and rectangles for eyebrows using D3 selections. It demonstrates SVG DOM manipulation by appending elements to groups, and animates the eyebrow group’s `transform` attribute with chained `transition().duration()` calls. The visualization runs in D3 v7 and renders to a 960×500 SVG canvas.

AI-generated description

Make a smiley face with d3

Getting started with D3 Handling SVG elements Transition

MIT Licensed

Similar vizzes