Capturing sunburst on click events

I am trying to capture the mouse click events for Sunburst chart but have been unable to do it. Here’s an example of on-click and hover events for plotly.js https://codepen.io/etpinard/pen/eYYparg, is it possible to do the same with plotly.py

Hi @Qahan this is not possible yet from Python but one the next releases of plotly.js, probably the next, should expose a click event which you can capture from Python as in https://plot.ly/python/click-events/. Please stay tuned, the related issue is https://github.com/plotly/plotly.js/issues/4338

Thanks @Emmanuelle for your quick response.

click events are now available for all sectors in plotly.js 1.52, which is shipped with Dash 1.8.0. Enjoy!

Can this allow us to click on a sunburst leaf and launch a hyperlink? If yes, what is the link. At present I am only able to display the html url - and not click to access that page. I have 1500 leafs and so this capability would be a fantastic productivity addition.

I’m having a similar problem. Currently i’m pretty new to developing web applications. I prepared my data in Python using:

fig = px.sunburst(df, path=column_names)

fig.update_traces()

graphJson = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder)

In a custom made html file i’m plotting the sunburst file using:

        <div id="sunburst">
            <script type="text/javascript">
                var graphs = {{graphJson | safe}}
                Plotly.plot('sunburst',graphs,{});

            </script>
        </div>

Is it now possible to capture on click events? I want to use these events to send out API-calls and displaying the results next to the sunburst plot.