I am trying to embed a plotly sunburst plot into an HTML page.
For information, I have no problem embedding holoviews (with bokeh backend) plots.
When I use the code that follows, the HTML page renders without the plot. I see that the embedded div and associated script are in the page, but nothing shows. There are no errors in the console, nor server side.
Edit: I use panel version 0.9.5
import panel as pn pn.extension('plotly') import plotly.express as px from bokeh.embed import components def plots(): # ... # sunburst = sunburst_categ_quality(df_center.copy()) p = pn.pane.Plotly(sunburst).get_root() return components(p) def sunburst_categ_quality(df_center): df_center["count"] = 1 fig = px.sunburst(df_center, path=['mission_short', 'maximum_cyclone_category', 'analysis_center_quality_flag'], values='count', width=500, height=500) return fig
One thing that may seem wrong to me, but I’m not sure, is that the “components” function from Bokeh is adapted to bokeh code, and I have no idea if it is supposed to work when using a plotly plot.
Creating the sunburst plot worked flawlessly in a jupyter notebook.