Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of React + D3 Viz Starter

Public visualization

Fork of React + D3 Viz Starter

0 stars0🌍 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

Comments

Sign in to join the discussion.

MIT Licensed