Fork of React + D3 Viz Starter
✓ Published0🌍 Public
This example demonstrates a minimal React and D3.js visualization starter template. It establishes an SVG canvas with a configurable margin convention, rendering gray outer and inner rectangles to visualize the chart’s layout boundaries. The code defines a reusable `VizContainer` component that abstracts the SVG and group elements, accepting props for dimensions and margins. Using React 16.13.1 and D3 v6 via CDN, it provides a clean foundation for building custom charts, with a `showMargins` prop to toggle the visual guides.
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