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
Jjingzhi93
Last edited Aug 13, 2021
Created on Aug 13, 2021

This example demonstrates a blank React + D3 visualization starter template, displaying only the SVG container structure with visible margins highlighted in gray. The `VizContainer` component abstracts SVG and group elements following D3’s margin convention, rendering an outer and inner rectangle to visualize the layout. Built with React 16 and D3 v6, the code uses CDN-loaded libraries and a `showMargins` prop to toggle the rectangles, providing a clean foundation for adding custom charts.

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