Skip to main content
100%

Fork of Raed

✓ Published0🌍 Public
RRayed12
Last edited Apr 1, 2022
Created on Apr 1, 2022
Forked from Raed

This example shows a blank SVG canvas created with React and D3 v6, framed by a visible margin area that highlights the layout convention. The `VizContainer` component abstracts the SVG and group elements, following the standard margin structure with dimensions set to 960 by 500 pixels. The code uses React 16.13.1, ReactDOM, and D3 v6, all loaded via CDN, and renders an empty container ready for future visualization content. The margin display can be toggled off by removing the `showMargins` prop.

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