Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shridhar Kshirsagar's Fork.js!

Public visualization

Viewing a saved revision (read-only)

d7c7d177ccfe47d281b0c852e84ae5b8

Shridhar Kshirsagar's Fork.js!

1 star0🌍 Public
SShridhar Kshirsagar
Last edited Feb 24, 2023
Created on Feb 24, 2023

This example demonstrates fundamental DOM manipulation with D3.js by constructing a smiley face with animated eyebrows, hair, ears, a beard, and a nose, all rendered as SVG elements. The code imports `select` and `arc` from D3 v5, uses `transition().duration()` to move the eyebrows up and down, and employs `arc()` to create the mouth. SVG attributes such as `cx`, `cy`, `x`, `y`, `width`, and `height` position each shape, while the face is centered using a group translation based on the viewport dimensions.

AI-generated description

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