Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a face with D3.js!

Public visualization

Let's make a face with D3.js!

0 stars0🌍 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.

Comments

Sign in to join the discussion.

MIT Licensed