Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

21203e54ccc64864af96c4f0b9290b73

Making a bar chart

0 stars1🌍 Public
AAdam Usmani
Last edited Feb 17, 2021
Created on Feb 17, 2021

This example demonstrates fundamental DOM manipulation with D3.js by constructing a yellow smiley face whose eyebrows animate up and down. An SVG circle forms the face, with additional circles for eyes and a path created using the `d3.arc` function for the mouth. The eyebrows are rectangles that move via `transition.attr` to shift their vertical position over time. The code uses selections like `select` and `append` to build the SVG hierarchy, with a two-second duration for each eyebrow movement.

AI-generated description

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