Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
Ppete0707
Last edited Nov 15, 2022
Created on Nov 14, 2022

This visualization demonstrates a blank SVG canvas with visible margin boundaries, ready for React and D3.js content. The `VizContainer` component abstracts the SVG and group elements, following the standard margin convention by translating the inner group. The code uses `ReactDOM.render` to mount the app, and shows the outer and inner rectangles as gray and light gray fills when `showMargins` is true. The example uses CDN-loaded React, ReactDOM, and D3 v6 libraries, with dimensions and margins defined as variables.

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