Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering data with React and D3

Public visualization

Rendering data with React and D3

0 stars1🌍 Public
Fforcox43
Last edited Sep 2, 2020
Created on Sep 1, 2020

The example shows a React application that loads and renders CSS named colors from a CSV file as a vertical stack of 4-pixel-tall color swatches. It uses the `useState` and `useEffect` hooks to asynchronously fetch the data with `d3.csv`, then maps each row to a styled `div` element whose background color is set from the `RGB hex value` column. The code also includes a separate plain D3 version that parses the same CSV and reports its size, row count, and column count using `d3.csvParse` and `d3.csvFormat`.

AI-generated description

A program that loads and parses some CSV data: CSS Named Colors.

Comments

Sign in to join the discussion.

MIT Licensed