Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Rendering Data with React Part II

Public visualization

Viewing a saved revision (read-only)

41799b28762c498da7d42c8c5644aada

Rendering Data with React Part II

0 stars1🌍 Public
TTaweewat Somboonpanyakul
Last edited May 24, 2021
Created on May 24, 2021

This example shows a pie chart of all 148 named CSS colors, with each slice filled by its corresponding hex value. Built with React and D3 v6, it fetches color data from a CSV file using the `d3.csv` function. The chart is rendered as an SVG, where React manages the state and component lifecycle with `useState` and `useEffect`, while D3's `pie` and `arc` functions compute the slice geometries. A loading message displays until the asynchronous data fetch completes.

AI-generated description

Load data about named colors with React and D3