Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Let's make a face with D3.js!

Public visualization

Viewing a saved revision (read-only)

4717ab3c05dd431a828ad4cb7cedf6a1

Fork of Let's make a face with D3.js!

0 stars0🌍 Public
Ssaisreearibandi
Last edited Feb 9, 2023
Created on Feb 9, 2023

This example demonstrates how to build an interactive smiley face with D3.js, featuring eyebrows that shift position. The face is rendered as SVG elements, including a green circle for the head, yellow stroke, eyes, and a mouth created using the `d3.arc()` path generator. The code uses `d3.select` to manipulate the DOM, appending groups and shapes with attributes like `cx`, `cy`, and `r`, while positioning elements via transforms. The animation of the eyebrows is implied through the use of adjustable constants like `eyebrowYOffset`.

AI-generated description

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