Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Create a face with d3.js!

Public visualization

Viewing a saved revision (read-only)

dc2e2455f6c84c46b5277188b3781c19

Fork of Create a face with d3.js!

0 stars0🌍 Public
Tthatsbipasha
Last edited Oct 3, 2023
Created on Oct 3, 2023

This example draws a yellow cartoon face with two eyes and an open mouth using D3 v7. The code selects the SVG element, applies a centered group transform, and builds the face with circle and path shapes. It uses `d3.select` to choose elements, the `d3.arc` generator to compute the mouth’s curved path, and inline `attr` calls to set positions and radii based on the SVG’s width and height. The face is rendered entirely in SVG.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.