Fork of React + D3 Viz Starter
✓ Published0🌍 Public
This example demonstrates a reusable React component called `VizContainer` that abstracts SVG and group elements following the margin convention, rendering a dark outer rectangle, a light inner rectangle, and a pink circle. The code uses React 16 and D3 v6 via CDN links, with props controlling dimensions, margins, and colors. The `showMargins` boolean toggle visually highlights the chart’s margin area, which can be removed by deleting that prop. It serves as a minimal starter template for building React-based D3 visualizations.
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