Skip to main content
100%

Fork of React + D3 Viz Starter

✓ Published0🌍 Public
EElif Altundag
Last edited Aug 24, 2022
Created on Aug 24, 2022

This example demonstrates a minimal React and D3.js starter project, fetching a CSV file of CSS color names and their hex codes from a GitHub gist using `d3.csv`. The code sets up a fixed 960×500 SVG canvas with margin conventions and uses a reusable `VizContainer` component to render the SVG and a group element. While the visualization is not fully implemented, the structure includes a commented-out mapping of colors in the data to inline-styled `<div>` elements, and the container can display its margins via a `showMargins` prop. The program currently only outputs “Hello world” after loading the data.

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