Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of D3-1: Making a face

Public visualization

Viewing a saved revision (read-only)

c212521af87644d0ab854267a644b810

Fork of D3-1: Making a face

0 stars0🌍 Public
HHari Prashath
Last edited Sep 21, 2023
Created on Sep 21, 2023

This example uses D3 v7 to construct a simple cartoon face from SVG primitives. A yellow circle forms the head, two blue circles become the eyes, a path drawn with the `d3.arc` function creates the mouth, and two rectangles serve as eyebrows. The eyebrows animate repeatedly via chained `transition().duration(2000).attr()` calls, moving them up and down over time. The code demonstrates core D3 operations like `select`, `append`, and `attr` to build and manipulate SVG elements directly.

AI-generated description