Hi, I have a nice sunburst plot that is used to pick up value in javascript using plotly_sunburstclick
event, it works well.
When used multiple times I would like to reinitialize the sunburst so it is displayed from the root, like the first time.
I have tried to use redraw
, purge
and newPlot
but without success, the plot is always displayed from the previous position.
Is there a way to reset a sunburst plot in javascript?
Thanks for your help
ben
Ok I have a solution using redraw
and setting the level to ‘’ which means root according to the documentation:
data[0].level = '';
Plotly.redraw(plotDiv, data, layout);
Regards