Skip to main content
100%

smiley face

✓ Published0🌍 Public
Gginsmandarin
Last edited Aug 17, 2021
Created on Aug 17, 2021
Forked from Fork of Hello HTML

This example renders a classic smiley face as an SVG graphic using React components and D3’s `arc` generator. The face consists of a yellow circle for the head, two black circles for eyes positioned symmetrically via `eyeOffsetX` and `eyeOffsetY`, and a curved path for the mouth created with `arc().innerRadius(90).outerRadius(100)` spanning from PI/2 to 3PI/2. All shapes are centered using a `<g>` transform, with the head’s radius calculated from the viewport height minus stroke width. The code imports `arc` from D3 v7 and uses ReactDOM to mount the SVG into the page.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes