Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
JJuliaHsu
Last edited Mar 12, 2021
Created on Mar 12, 2021

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 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