Fork of React + D3 Viz Starter
✓ Published0🌍 Public
This example demonstrates a minimal React + D3 visualization starter template, showing a blank SVG canvas with visible margins. The code combines React 16.13.1 and D3 v6.2.0 via CDN links, using a `VizContainer` component that abstracts SVG and group elements following the margin convention. The component renders gray outer and inner rectangles when `showMargins` is true, with the main visualization area translated according to specified margin values. The example establishes reusable boilerplate with variables for dimensions and margins, ready for adding custom 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