{"version":"1.0","type":"rich","title":"Create a pie chart with D3 and React","description":"Two React implementations of the same D3 pie chart render side-by-side, showing random data generated with `d3.range` and `Math.random`. The first version uses a function component with the `useEffect` and `useRef` hooks to manage D3 DOM updates, while the second renders SVG elements declaratively through React's JSX. Both use `d3.pie()`, `d3.arc()`, `d3.scaleOrdinal` with `schemeCategory10`, and `d3.format` for labels, with a button triggering new random data.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/73100837bae441089ae95ea324ecc49d?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}