π Public
Viewing a saved revision (read-only)
340c100da0774a3d8b9dc14267ed49bb
Read in JSON department files
This example reads course and department data from two JSON files and displays a sunburst chart using D3 v5. It loads the files with `Promise.all` and `d3.json`, then partitions the hierarchical data with `d3.partition` and renders it as SVG arcs via `d3.arc`. The visualization shows department and course names as labeled, colored slices, with interactive transitions on click using `transition.attrTween` to smoothly update the layout. Rotation logic in `computeTextRotation` orients labels to avoid upside-down text.
AI-generated description