I continue to have a bit of trouble figuring out data re-structuring and am reaching out for help.
I would like to make a Zoomable Sunburst chat showing the distribution of households across some different administrative areas. The challenge that I am having is how to access the value for household_total so that it is counted appropriately.
Previously, the community helped show me how to create a nesting function that returns an array from ‘rolled up’ data, and re-labels the attribute names in a manner expected of the Zoomable Sunburst:
However, in the case of my data, I still need to re-work the final value so that it’s interpreted as a number, rather than a name. Without this, the final count field is interpreted just a single leaf:
Try as I might, I haven’t figured out this final transformation. Here’s a notebook:
and change the nest function to just have value instead of value.length. I am likely completely off-base on what you are trying to achieve, but I shared a notebook with you, in case that helps.
Thank you Evan! This does help… I dropped the ward tier for simplicity for now (but intend to add it). Your final mapping looks right:
… unfortunately I still have an error when I try to supply the output of this rollup into the sunburst chart RuntimeError: Cannot read properties of undefined (reading 'length').
Essentially, I would like the final leaf in the sunburst to be settlement_name and its size within it’s group to be proportional according to households_total. (If that’s clearly stated? Maybe not )
… looks like, to use your rolled data, I simply need to find a way to re-assign the attribute names to the mapped values. I’ll keep trying!