Skip to main content
Public

Share visualization

Loading preview…

Lets Make a face with d3

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

Lets Make a face with d3

1
Bbharatbobby
Last edited Feb 28, 2022
Created on Feb 28, 2022

This example builds a cartoon face from basic SVG shapes using D3 v7. It shows a yellow circle head with eyes, eyebrows, and a mouth, all positioned relative to the center of a 960×500 SVG canvas. The code uses D3 selections and method chaining to append and configure elements, including the `d3.arc` path generator for the smile. All styling and layout are handled through SVG attributes, with the face centered via a translation transform.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed