I am trying to use a sunburst to display particular hierarchical data which are not exactly a tree because some of the leafs are actually the same object.
It works (https://observablehq.com/@ilogre/zoomable-sunburst) but there is one issue: the value of the inner layer segments is recalculated to be he sum of its children values instead of taking the value given in the json file.
For example, “Hierarchy” should have a value of 3, meaning that 3 widgets of our catalog satisfy it, even though:
• 2 widgets satisfy Hierarchy + Part of a Whole
• 2 satisfy Hierarchy + Proportion
• 1 satisfies Hierarchy + Extremum
• 1 satisfies Hierarchy + Comparison
But some of these children are actually the same widgets, so the value of Hierarchy should be 3, not 9 (its children values + its own value).
I know my problem is due to these non-tree data, but fixing it would open a way to display graph data through a Sunburst, and probably a TreeMap.
Unfortunately, I can’t find the line of code where this value is calculated to customize it.
Thank you !
PS : I will post a more detailed example below if this first post is not clear enough