Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of React & D3 Starter

Public visualization

Fork of Fork of React & D3 Starter

0 stars1🌍 Public
SSanjayRamaSwamyAdla@my.unt.edu
Last edited Mar 30, 2026
Created on Mar 30, 2026

This example shows the distribution of four school subjects—Math, Science, English, and History—as a static pie chart rendered in SVG. It uses d3.pie and d3.arc to compute slice geometry and d3.scaleOrdinal with d3.schemeCategory10 to assign categorical colors. Labels are positioned at each slice’s centroid, and a custom legend is built with HTML spans in a separate div. The accompanying React component uses a useEffect hook to update text via d3.select, demonstrating a minimal integration of React with D3.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed