Skip to main content
100%

rendering data with react

✓ Published1🌍 Public
NNart Williamson
Last edited Apr 26, 2021
Created on Apr 26, 2021

This example displays a dataset of CSS named colors as a vertical strip of colored rows, one 4-pixel-tall rectangle per color. The visualization loads a CSV file from a GitHub gist using D3’s `d3.csv` method and renders each row as an SVG-friendly React `<div>` with a background color set to the CSS `RGB hex value`. React’s `useState` and `useEffect` hooks manage the asynchronous data fetch, while a loading message appears until the data arrives. The project combines React 16.9, D3 v5, and SVG-like divs for a simple data-driven 960-pixel-wide rendering.

AI-generated description

program that loads in some data using d3

MIT Licensed

Similar vizzes