Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
11godfrey
Last edited Mar 3, 2023
Created on Mar 3, 2023

This example shows a blank React + D3 starter template with a gray SVG background and a light inner rectangle that visualizes the margin convention. A `VizContainer` component abstracts the SVG group element and uses a `transform` attribute to translate content by the specified margins. The template includes `showMargins` prop to toggle the guide rectangles, and relies on React 16.13.1 and D3 v6.2.0 loaded via CDN, with dimensions defined in the main `index.js` file.

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