Skip to main content
100%

D3 (Smiley Face)

✓ Published0🌍 Public
EEunSeon Ahn
Last edited Jan 9, 2022
Created on Jan 8, 2022
Forked from Hello HTML

This example builds a reusable smiley face from modular React components, using SVG circles for the face, eyes, and irises, and a D3 arc generator for the mouth. The face is defined by props like `centerX`, `centerY`, `eyeOffsetX`, and `mouthRadius`, allowing the composition to be parameterized and rearranged. The iris is drawn as a smaller green circle positioned over each eye, while the mouth uses `d3.arc` with specified start and end angles. The entire graphic is rendered inside an SVG container with a centered `<g>` transform, using React’s `ReactDOM.render` to mount the app.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes