Skip to main content
Public

Share visualization

Loading preview…

React Components

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

React Components

0
NNicolás Troncoso
Last edited Mar 31, 2021
Created on Mar 31, 2021

A React component renders a yellow smiley face as an SVG, with the face centered on a 960 by 500 canvas. The example demonstrates composing D3's `arc` generator inside JSX to draw the mouth, while circles for the eyes and a reusable `BackgroundCircle` component handle the other shapes. React 16.9 and D3 v5 are loaded via UMD scripts, and `ReactDOM.render` mounts the component to the page. The code shows styling through SVG attributes like `stroke-width` and uses D3's `arc` for the path geometry.

AI-generated description

Smiley face implementation with React & D3, using a React component.

Comments

Sign in to join the discussion.

MIT Licensed