Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
ZZhi Guangda
Last edited Jul 15, 2019
Created on Jul 15, 2019

This example demonstrates fundamental D3.js DOM manipulation by building a smiley face from circles whose eyebrows shift. It shows how the data-join pattern works step by step: first, five red apples are appended as circles using `selectAll`, `data`, and `enter`, then the array is mutated and re-joined to reveal how `exit` selects and recolors removed elements. The code uses D3 v5’s `select`, `range`, and the SVG coordinate system, rendering into an inline SVG canvas. It provides a hands-on introduction to enter, update, and exit selections without any real dataset.

AI-generated description

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

MIT Licensed

Similar vizzes