Skip to main content
100%

Rendering data with react

✓ Published1🌍 Public
EElliot Hill
Last edited Jul 8, 2021
Created on Jul 8, 2021

This example demonstrates how React can render data loaded with D3, displaying CSS named colors as horizontal stripes. The visualization maps each row from a CSV file containing color names and RGB hex values into a colored div element, with each stripe’s background color set to the corresponding hex value. The App component uses React’s useState and useEffect hooks to asynchronously fetch the CSV via d3.csv, showing a loading message until the data arrives. The resulting 960-pixel-wide bars stack vertically, creating a simple color spectrum across the viewport.

AI-generated description

Loading data with d3

MIT Licensed

Similar vizzes