Hide or no display the detail in sunburst chart if no click

Hi,

How to create a sunburst chart like the right-side chart, which it will hide its detail if no click?

(hide/ no display the outside two round, only the major [in here, the major is the region] if no click;
if click on the region, eg: North, then only zoom in into first level details which is country, eg: Motley, Dallam, etc
and if click on the Motley, then only zoom into the next level detail which is the salesperson, eg: NY, EH, etc)

Currently, the sunburst chart I able to create is same as left-side chart.

I am referring to Sunburst charts in Python > Sunburst chart with a continuous colorscale.


Had tried to use its script and amend according to my dataframe. But it will show blank.

FYI, its using go.Sunburst. For me, go.Sunburst also failed. So, can be px.sunburst create the same (right-side chart) ?

Please assist.

If I understood your issue correctly, I think you need to use these arguments:

In the example you are sharing, adding this line should work:

fig.update_traces(maxdepth=2, selector=dict(type='sunburst'))

@celia thanks for the help