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
JJames
Last edited Aug 9, 2022
Created on Aug 9, 2022

This example presents a minimal React and D3 visualization scaffold. It shows a blank SVG canvas with light gray inner and outer rectangles delineating chart margins, as defined by the margin convention. The code uses `VizContainer`, a React component that abstracts the SVG and group elements, and leverages ReactDOM to render the application. Data visualization code would be placed as children within the container, ready for D3 v6 integration.

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