Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
CCameron Yick
Last edited Mar 7, 2019
Created on Mar 7, 2019

This example demonstrates fundamental DOM manipulation with D3.js by constructing a smiley face from SVG elements, including a polygon for the nose and animated eyebrows. It uses d3.select, append, and attr methods to build the face centered within an SVG canvas. The code imports the select and arc functions from D3 v5, and sets up a transformation group to position elements relative to the center of the 600×400 viewport. The result shows how D3’s data-driven approach can create simple, interactive graphics through direct SVG manipulation.

AI-generated description

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

MIT Licensed

Similar vizzes