Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering Data with React and D3 1

Public visualization

Rendering Data with React and D3 1

0 stars1🌍 Public
JJoseIGuzman
Last edited May 10, 2021
Created on May 10, 2021

This example displays a vertical stacked bar chart of CSS named colors, with each color rendered as a thin horizontal strip. The visualization loads a CSV dataset of named CSS colors from a remote URL using D3’s `csv` utility, then stores the parsed data in React state via the `useState` and `useEffect` hooks. Once loaded, the app maps each color record to a React `<div>` element, setting its background color from the `RGB hex value` column and fixing its dimensions to create the stacked effect. The code combines React 16.9 for component rendering and state management with D3 v5 for data fetching and parsing.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React state to keep track of the data.

Comments

Sign in to join the discussion.

MIT Licensed