Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Smiley Face Part 6B - JAT

Public visualization

Viewing a saved revision (read-only)

eb2cf77cffd84127ab96c6d8923dc1c9

Smiley Face Part 6B - JAT

1 star0🌍 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.