Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of D3 and React Smiley

Public visualization

Viewing a saved revision (read-only)

389100a773dd42d18c805f881206d58f

Fork of D3 and React Smiley

0 stars1🌍 Public
GGordon Yang
Last edited Apr 7, 2021
Created on Apr 7, 2021

This example demonstrates a modular React component approach to rendering a smiley face using SVG. The `Face` component composes separate `BackgroundCircle`, `Eyes`, and `Mouth` sub-components, with the mouth drawn using D3’s `arc` generator with specified inner and outer radii and start/end angles. The face is positioned within an SVG container via a `<g>` transform, and all visual properties—such as eye offset, radius, and stroke width—are passed as props from the top-level `App` component. React renders the SVG declaratively, while D3 handles the geometric path calculation.

AI-generated description

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

See also React Starter.