https://github.com/magabrielaa/CAPP30239_FA22/blob/1d54d3d04a874d421161649c28e07a89a9170afb/week_06/donut.js#L24
When you reshaped the data with d3.nest, we get an array [{key: key, value:value}, {key: key, value:value}] compared to the [{name: key, value:value}, {name: key, value:value}] in the example.
A simple way to fix this is to replace that line with:
name: d=>d.key