Skip to main content
100%

FCC: Smiley w/ React components

✓ Published0🌍 Public
AAnup Mantri
Last edited Mar 16, 2021
Created on Mar 16, 2021
Forked from FCC: Smiley

A grid of eighteen randomly generated smiley faces, each built from React components and rendered as SVG, demonstrates how to compose and reuse visual elements programmatically. The `Face` component assembles a yellow `BackgroundCircle`, two `Eyes` circles, and a `Mouth` path created with the `d3.arc()` API for a curved smile. Each face’s dimensions—stroke width, eye offset and radius, and mouth properties—are randomized via `Math.random()` within the `App` component, producing unique variations across the grid while maintaining consistent facial structure. The example uses React’s `StrictMode` and `ReactDOM.render` to manage the SVG output, with D3 v6 providing the arc geometry for the mouth.

AI-generated description

Smiley face part 1 - using svg, React and d3

MIT Licensed

Similar vizzes