🌍 Public
Viewing a saved revision (read-only)
8a6743d9716346dab9a8875f2b8d6ae1
React + D3 Viz Starter
This example presents a blank React + D3 starter template that establishes the foundational structure for a visualization. It uses CDN-loaded React 16.13.1, ReactDOM, and D3 v6.2.0 to render an SVG via the `VizContainer` component, which applies the margin convention and abstracts the outer and inner rectangle elements. The code defines explicit width, height, and margin variables, and the component conditionally displays the margins based on a `showMargins` prop. The rendered output is an empty SVG with grey and light-grey rectangles, ready for chart content.
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