Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
PPatrickHennessey
Last edited Oct 31, 2019
Created on Oct 31, 2019

A smiley face is drawn as an SVG graphic, with animated eyebrows that move up and down. The example demonstrates fundamental DOM manipulation with D3.js by selecting an `svg` element and using the `arc` generator from the `d3` module to create the face’s shapes. The code reads the SVG’s height and width attributes via `attr` and parseFloat, and browses over a simple dataset to bind elements. Rendering uses SVG paths, with styles applied through an external stylesheet that hides page overflow.

AI-generated description

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

<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/-RQWC4I2I1s?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> -->
MIT Licensed

Similar vizzes