React Starter with Pie
✓ Published0🌍 Public
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 descriptionReact Starter code.
MIT Licensed