Skip to main content
100%

Lets make a face with D3

✓ Published1🌍 Public
SSurendar
Last edited Mar 31, 2022
Created on Mar 29, 2022

This example demonstrates fundamental D3.js DOM manipulation by building a yellow smiley face whose eyebrows animate vertically. It uses SVG elements—circles for the face and eyes, rectangles for eyebrows, and a path with the `d3.arc` API for the mouth—all grouped and positioned within an SVG canvas. Eyebrow movement is driven by chained `transition().duration()` calls on the `<g>` container, shifting its `y` attribute back and forth. The code imports `select` and `arc` from D3 v5 to construct and manipulate the visualization dynamically.

AI-generated description

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

MIT Licensed

Similar vizzes