Skip to main content
100%

Smiley with React/ES6/Nesting

✓ Published0🌍 Public
Ppeterforberg
Last edited Dec 29, 2021
Created on Dec 29, 2021

This example shows a grid of 18 randomly generated smiley faces, each rendered as a yellow circle with black stroke, two eyes, and a D3 arc-based mouth. The faces vary in eye radius due to `Math.random()`. Built with React components (`Face`, `BackgroundCircle`, `Eyes`, `Mouth`, `FaceContainer`) and ES6 destructuring, it uses `d3.arc()` for the mouth path and `d3.range()` to generate the array of faces. All elements are SVG, nested inside a translated `<g>` group.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes