Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
Nnwhalen2
Last edited Apr 28, 2021
Created on Apr 28, 2021

This example demonstrates a minimal React and D3 visualization starter, displaying a blank SVG canvas with clearly outlined margin areas. The code uses React 16.13.1 and D3 v6, loaded via CDN, to construct a `VizContainer` component that abstracts SVG group elements following the margin convention. The container renders gray outer and inner rectangles to visualize the chart area, with the margins toggleable via a `showMargins` prop. The visualization itself contains no data or marks, serving purely as a foundation for building future charts.

AI-generated description

Boilerplate code for a React + D3 visualization with:

  • CDN links for React, ReactDOM, and D3
  • Basic React boilerplate
  • Variables for dimensions and margins
  • A VizContainer component 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

Similar vizzes