Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
DDifan Gu
Last edited Jul 11, 2020
Created on Jul 10, 2020

This example shows a fruit bowl visualization where apples and lemons are rendered as colored circles, with a face-like arrangement created through D3.js data joins. The code uses `d3.select`, `d3.range`, and `d3.scaleOrdinal` to map fruit types to red and yellow colors and different radii. It demonstrates enter, update, and exit selections, first removing an apple, then replacing one with a lemon via `setTimeout`. The SVG output is generated from a simple `fruitBowl` function that binds fruit data to circles.

AI-generated description
MIT Licensed

Similar vizzes