Skip to main content
100%

Smiley Face Part 6B - JAT

✓ Published0🌍 Public
JJason Tiller
Last edited Mar 1, 2021
Created on Feb 26, 2021

A grid of eighteen smiley faces, each rendered with random background and eye colors, demonstrates compartmentalized React components. The faces use a combination of SVG circles for the background and eyes, and a D3 arc path for the mouth. Each face’s stroke width, eye offset, eye radius, and mouth dimensions are randomized via JavaScript’s `Math.random()`. The React app maps over a D3 range to generate the faces, while the `randomColor.js` utility builds hex color strings for the fills.

AI-generated description

A finished smiley face using multiple files with ES6 modules.

Part 6: Compartmentalizing Complexity

Extra: Each face has a random background color and eye color.

MIT Licensed

Similar vizzes