Skip to main content
100%

Smiley Face Part 6

✓ Published2🌍 Public
Hhukbk
Last edited May 11, 2022
Created on Mar 31, 2021
Forked from Smiley Face Part 6

This example renders a grid of 18 procedurally generated smiley faces, each built from React components and SVG primitives. Each face’s properties—eye offset and radius, mouth radius and width, and stroke thickness—are randomly assigned via `Math.random()`, producing varied, cartoonish expressions. The code composes a `Face` from `BackgroundCircle`, `Eyes`, and `Mouth` components inside a `FaceContainer` SVG, while the mouth’s arc shape is generated using the `d3.arc` API. The faces are laid out by mapping over an array created with `d3.range`, with the entire collection rendered through React’s `ReactDOM.render`.

AI-generated description

Finished

MIT Licensed

Similar vizzes