Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
JjimacDS
Last edited Jun 19, 2020
Created on Jun 19, 2020

A D3.js v5 example demonstrates how to create and update a row of fruit circles in an SVG, transforming them into a smiley face whose eyebrows move. It shows the data join pattern by entering, updating, and exiting circles. The code imports `select`, `range`, and `scaleOrdinal` from D3, using ordinal scales to map fruit types to colors and radii. Over timed `setTimeout` calls, it removes a fruit and changes one apple to a lemon, re-rendering the visualization each time.

AI-generated description

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

MIT Licensed

Similar vizzes