Skip to main content
Public

Share visualization

Loading preview…

D3-1: Making a face

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

D3-1: Making a face

0
GGreenBreakers
Last edited Jan 9, 2023
Created on Jan 8, 2023

A smiling face is drawn using SVG shapes, with a yellow circle for the head, black circles for eyes, and a mouth created as an arc path. The example demonstrates basic SVG element creation and positioning through D3’s `select`, `append`, and `attr` methods, along with the `arc` generator to define the mouth’s shape. Coordinates are centered by translating a group element, and dimensions are read from the SVG attributes. The code uses D3 v5 and renders entirely in SVG.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed