Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
FFernando Godoy
Last edited Aug 19, 2019
Created on Aug 16, 2019

A D3.js selection demonstrates dynamic data binding by rendering fruit as SVG circles that appear, disappear, and change color. The data array starts with five apples, then removes one circle per second for three seconds, and finally replaces the first fruit with a lemon. The `data()`, `enter()`, and `exit()` methods manage the join, while `scaleOrdinal` maps fruit types to fill colors. The example uses `select`, `range`, and `attr` to manipulate the SVG canvas.

AI-generated description

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

MIT Licensed

Similar vizzes