Skip to main content
100%

practice1

✓ Published3🌍 Public
DDi Cui
Last edited May 17, 2023
Created on May 17, 2023

This example shows a yellow smiley face with animated eyebrows that move up and down repeatedly. Rendered in SVG, it uses D3.js v5 to build the face from primitive shapes: a circle for the head, circles for the eyes, rectangles for the eyebrows, and a path created with the `arc` generator for the mouth. The eyebrow animation relies on chained `transition().duration()` calls to toggle the group’s vertical position. The code explicitly selects the SVG element and sets attributes like `cx`, `r`, and `x` to define the layout.

AI-generated description

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

MIT Licensed

Similar vizzes