🏠 back to Observable

How can I create a hierarchy without calling sum?

I’d like to create this: Zoomable Icicle / D3 / Observable

However, my data already has the sum precomputed, so I don’t want D3 to do that. The docs say I have to call sum / count though: https://github.com/d3/d3-hierarchy#node_sum

If you have the structure already defined then you might not need to sum the data.

Do you mind sharing your notebook so we can see the existing data structure and workout ways to passing it into hierarchy.

Reprocessing your data to this structure would help:

Using d3.group could help with that.

data4 = d3.group(data, d => d.parent)

Data wrangling is half the battle.