Cheers,
the sunburst plot as it is sets the section width angle of a section on a given level to the sum of its children and their children recursively. This is why Seth in this plot
go.Figure(go.Sunburst(
labels= [ "Eve", "Cain", "Seth", "Enos", "Noam", "Abel", ],
parents=[ "", "Eve", "Eve", "Seth", "Seth", "Eve", ],
sort=False
))
… gets more real estate than his siblings.
And he “inherits” (backwards in time) this phenomenon from Enos:
go.Figure(go.Sunburst(
labels= [ "Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Eric", "Ellis", "Evan", "Emille" ],
parents=[ "", "Eve", "Eve", "Seth", "Seth", "Eve", "Enos", "Enos", "Enos", "Enos", ],
sort=False
))
However, what I want is for each member on their hierarchical level to get equal space. For the play dataset, we can hack our way there by adjusting the values (in my use case, values don’t matter, the plot should only make a hierarchy of categories browsable):
go.Figure(go.Sunburst(
labels= [ "Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Eric", "Ellis", "Evan", "Enzo" ],
parents=[ "", "Eve", "Eve", "Seth", "Seth", "Eve", "Enos", "Enos", "Enos", "Enos", ],
values= [ 24, 8, 8, 4, 4, 8, 1, 1, 1, 1, ],
branchvalues="total", sort=False
))
But is it possible to plot a larger (non-play) dataset in this way, or to compute the necessary numbers for this “hack” procedurally? In my use case, the display depth is 2, so users only ever see one category and its children, except when on “root”.