Fork of React + D3 Viz Starter
✓ Published0🌍 Public
This example renders a simple, smiley face composed of SVG shapes using React components and D3’s arc generator. A yellow background circle, two black eyes, and a curved mouth are centered within a fixed 960×500 viewport, with dimensions passed as props. The code imports `arc` from `d3` to compute the mouth path, while React handles component composition and state-free rendering. The face is drawn declaratively through reusable components like `BackgroundCircle`, `Eyes`, and `Mouth`, all nested inside a `FaceContainer` that applies a translation transform.
AI-generated descriptionBoilerplate code for a React + D3 visualization with:
- CDN links for React, ReactDOM, and D3
- Basic React boilerplate
- Variables for dimensions and margins
- A
VizContainercomponent that:- Abstracts SVG/group container elements
- Follows the margin convention
- Show the margins, which can be easily removed by deleting the
showMargins={true} prop
MIT Licensed