Export Image
Export Code

D3 + React + useData

Minwoo Pak

Last edited Aug 10, 2021
Created on Aug 10, 2021

Boilerplate code for a React + D3 visualization with:

  • Example of D3 as React Component
  • CDN links for React, ReactDOM, and D3
  • Basic React boilerplate
  • Variables for width, height and margins
  • useData hook to fetch a CSV URL.
  • VizContainer component that:
    • Abstracts SVG/group container elements
    • Follows the margin convention
MIT Licensed