Skip to main content
100%

Rendering data with React

✓ Published0🌍 Public
FFrancisldn
Last edited Sep 11, 2022
Created on Sep 11, 2022

This example renders the CSS named color dataset as a circular pie chart, with each color represented by a slice whose fill matches its hex value. The React component uses the `useState` and `useEffect` hooks to asynchronously load the CSV via `d3.csv`, then maps each row to an SVG `<path>` element. The arcs are computed manually using `d3.arc` with start and end angles derived from the data index, and rendered inside a centered `<g>` transform within an SVG canvas.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes