Skip to main content
100%

Fork of Smiley Face Part V

✓ Published0🌍 Public
Yyungchiau
Last edited Jan 9, 2022
Created on Jan 9, 2022
Forked from Smiley Face Part V

This example renders a smiley face as a reusable set of React components, splitting the drawing across separate files for the background circle, eyes, and mouth. Each component receives its geometry through props, and the main SVG is assembled in `index.js` using React DOM. The mouth is generated with the `d3.arc()` generator, while the eyes and background are plain SVG circles. The code uses React 16.9.0 and d3 v5, with the face centered on a 960×500 viewport.

AI-generated description

Splitting React components into multiple files using ES6 modules. Bonus: React Fragments!

MIT Licensed

Similar vizzes