Skip to main content
Public

Share visualization

Loading preview…

Let's make a face: part 2

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: part 2

1
Rrvdv
Last edited Dec 20, 2021
Created on Dec 20, 2021

This example shows a yellow smiley face rendered as two eyes on a circular head, drawn entirely with SVG circles. It demonstrates how React manages declarative SVG attributes, using `cx`, `cy`, `r`, `fill`, and `stroke` properties. The code defines constants for width, height, center coordinates, and offsets, then computes eye positions from those values. It uses React 17 and ReactDOM to render the `<App />` component into the DOM, with all geometry derived from the same base variables to keep the layout consistent. The face is partially complete, omitting the mouth for a future step.

AI-generated description

Half way towards a smiley face

Comments

Sign in to join the discussion.

MIT Licensed