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!

1
TTiff
Last edited Jan 18, 2023
Created on Jan 18, 2023

This example creates a smiling face using basic SVG shapes—two circles for the eyes, a larger circle for the head, and an arc for the mouth—all positioned with fixed coordinates. The code uses D3.js v5 selection methods like `svg.append` and `.attr` to build the elements, alongside the `d3.arc` generator to define the mouth’s path based on inner and outer radii and start/end angles. The SVG canvas is 960 by 500 pixels, with styling applied via an external stylesheet.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed