Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Bbobshen30
Last edited Jan 31, 2020
Created on Jan 31, 2020

This example shows a smiley face created with D3.js, where circles are dynamically added to an SVG canvas based on an array of values passed to an `updateVis` function. The circles change color—red for values under 30 and blue for values above—demonstrating data-driven styling. Using D3 v5’s `select`, `selectAll`, `data`, and `enter` methods, the code appends `<circle>` elements with attributes for radius, position, and fill. The included `q3.csv` file provides a year-based running total dataset, though it is not referenced in the JavaScript logic shown.

AI-generated description

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

MIT Licensed

Similar vizzes