Skip to main content
Public

Share visualization

Loading preview…

Smiley Face Part 6B - JAT

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Smiley Face Part 6B - JAT

0
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.

Comments

Sign in to join the discussion.

MIT Licensed