Skip to main content
Public

Share visualization

Loading preview…

D3 textbook

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 textbook

0
Ppinlin0816157
Last edited Sep 27, 2022
Created on Sep 27, 2022

This example shows a simple SVG face built from two circles with a black border and eye, rendered on a yellow background. It demonstrates basic D3 v7 selection and attribute-setting methods, using `select` on the existing SVG element and appending circle shapes with explicit `cx`, `cy`, `r`, `fill`, and `stroke` attributes. The code reads the SVG’s height and width attributes to position the shapes relative to the viewport center. The visualization relies entirely on static SVG markup created programmatically, with no data binding or interactive behavior.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed