Skip to main content
100%

Let's make a face with D3.js!

✓ Published0🌍 Public
DDy-Diana
Last edited Nov 7, 2020
Created on Nov 7, 2020

A yellow smiley face rendered in SVG demonstrates core D3.js DOM manipulation and transitions. The code builds the face from basic shapes—circles for the eyes and head, a rectangular eyebrow, and an arc-generated mouth—anchored within a centered group. Using d3-selection and d3-transition, the eyebrows animate upward and back down over two sequential two-second intervals. The example shows how D3’s select, append, attr, and transition methods compose to create dynamic, interactive-style visuals without external data, relying purely on hardcoded geometry and SVG coordinates.

AI-generated description

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

MIT Licensed

Similar vizzes