Skip to main content
100%

React Starter with Pie

✓ Published0🌍 Public
PPeter Maida
Last edited Oct 29, 2020
Created on Oct 29, 2020
Forked from React Starter

This example demonstrates a donut chart built with React and D3, displaying a small categorical dataset with five segments. It uses D3’s `pie` and `arc` functions to compute the angular positions and draw the SVG paths, while `scaleOrdinal` assigns a fixed color palette to each category. The chart is rendered inside a React component, with D3’s `select` and `append` methods managing the SVG elements directly within the React-rendered container. The code also includes a separate `useData` hook for loading CSV data, though the pie chart itself uses inline dummy data.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes