Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
VVAbhiram99
Last edited Mar 8, 2023
Created on Mar 8, 2023

This example demonstrates a minimal React and D3.js visualization starter template. It establishes an SVG canvas with a configurable margin convention, rendering gray outer and inner rectangles to visualize the chart’s layout boundaries. The code defines a reusable `VizContainer` component that abstracts the SVG and group elements, accepting props for dimensions and margins. Using React 16.13.1 and D3 v6 via CDN, it provides a clean foundation for building custom charts, with a `showMargins` prop to toggle the visual guides.

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