Skip to main content
Public

Share visualization

Loading preview…

Fork of Smiley Face Part V

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

Fork of Smiley Face Part V

0
AAga Domanska
Last edited Nov 29, 2023
Created on Nov 29, 2023
Forked from Smiley Face Part V

A static smiley face rendered with React components and SVG shows how modular code can split a visualization into reusable pieces. The face’s background circle, eyes, and mouth are each defined in separate files, with constants like center position, eye offset, and radii passed as props from the main `App` component. D3’s `arc` generator creates the mouth path, while React fragments group the two eye circles. The code uses d3.v5 and React 16.9, with an SVG container that centers all elements via a transformed `<g>` group.

AI-generated description

Splitting React components into multiple files using ES6 modules. Bonus: React Fragments!

Comments

Sign in to join the discussion.

MIT Licensed