Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
LLucian-jw
Last edited Jul 2, 2019
Created on Jul 2, 2019

This example demonstrates fundamental DOM manipulation with D3.js by constructing a smiley face on an SVG canvas. It draws a yellow circle at a specified coordinate using the `d3.select` and `svg.append` APIs, while setting attributes like `cx`, `cy`, and `fill` to position and style the shape. The code also defines the SVG dimensions (960x500) and starts to set the circle's radius, though the sketch is incomplete. It shows how D3’s selection and attribute methods directly create and modify SVG elements, offering a hands-on introduction to building graphics programmatically.

AI-generated description

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

MIT Licensed

Similar vizzes