Skip to main content
100%

Fork of Let's Make a Face Part I

✓ Published0🌍 Public
BBrian Blakely
Last edited Apr 11, 2021
Created on Apr 9, 2021

This example builds a smiley face from nested SVG shapes using React components, where a yellow background circle, two eyes, and an arc-shaped mouth are composed together. The face’s dimensions and proportions are driven by parameters like `eyeOffsetX`, `eyeR`, and `mouthRadius` passed from a top-level `Face` component. The mouth is drawn using D3’s `arc()` constructor to generate an SVG path, while the eyes and background are plain `<circle>` elements. The composition centers all children inside a transformed `<g>` group based on the container’s width and height.

AI-generated description

Half way towards a smiley face.

MIT Licensed

Similar vizzes