Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Smiley Face Part III

Public visualization

Viewing a saved revision (read-only)

db8a42375c294536a09114a6bb2f16be

Fork of Smiley Face Part III

0 stars0🌍 Public
KKonstantinos Kotsiaridis
Last edited Jan 8, 2024
Created on Jan 8, 2024

This example shows a modular, reusable smiley face built as a React component hierarchy, composed of separate circle and arc elements for the background, eyes, and mouth. It demonstrates how to combine React’s declarative component model with D3’s `arc` generator to produce SVG shapes. The `Face` component assembles the `FaceContainer`, `BackgroundCircle`, `Eyes`, and `Mouth` subcomponents, with all geometry controlled via props such as `eyeOffsetX`, `eyeRadius`, and `mouthRadius`. The resulting SVG is rendered to the DOM using `ReactDOM.render` with fixed pixel dimensions.

AI-generated description

Smiley face implementation with React & D3.