Have been looking into d3.hierarchy, but am having trouble wrangling my data to be in a nested format that matches the examples. I have a case similar to the tabular data, with nesting regions that ultimately define values (like the earnings by nation and sport)
I’d like to be able to plug in my data to the different tree formats, but the data used (flare.json) is nested Objects rather than tabular data. Is there a way to go from tabular data to a nested JSON object?
Would like to:
- convert tabular data to nested objects
- use d3.hierarchy to convert to a nested structure for a tree
Here is a notebook outlining it.
Another approach: I was thinking the easiest thing to do was to get my tabular data in the same format as the examples. Is there another way to modify the viz code?