Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
Ddanieldh206
Last edited Sep 15, 2020
Created on Sep 15, 2020

This example demonstrates fundamental DOM manipulation with D3.js by constructing a simple smiley face from basic SVG shapes. A yellow circle forms the face, centered within an SVG canvas using the `width` and `height` attributes. The code uses `d3.select` and `d3.append` to add the circle, setting its radius, position, fill, and stroke via `.attr()`. Though the README mentions moving eyebrows, the visible code only renders the static face. Data comes from hardcoded attribute values rather than an external dataset, showcasing D3’s core selection and chaining methods with d3.v6.

AI-generated description

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

MIT Licensed

Similar vizzes