Skip to main content
Public

Share visualization

Loading preview…

Let's Make a Face with D3.js

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Let's Make a Face with D3.js

0
Ccliffordcele
Last edited Sep 8, 2021
Created on Sep 8, 2021

This example builds a cartoon face from SVG primitives using D3.js v7, starting with a yellow circle for the head and adding eyes, eyebrows, and a mouth. The code leverages D3’s `select` and `arc` APIs to attach elements to the SVG canvas and generate the mouth’s path. Positioning relies on numeric attributes like `cx`, `cy`, and `r`, with a group transformation applied for eye placement. The result demonstrates basic SVG shape composition and coordinate manipulation within a fixed 960×500 viewport.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed