You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on the current main branch of Panel and using plotly 5.13.0. I'm working on #4350 and experience that I cannot get click_data or hover_data working for a Plotly Pie plot. When I look in the browser console after hovering or clicking the plot I see the error
Uncaught Error: [object Undefined] is not serializable
importpandasaspdimportparamaspmimportpanelaspnimportplotly.expressaspxdf=pd.DataFrame({"ticker": ["A", "B", "C"], "value": [1, 2, 3]})
defportfolio_distribution(_=None, data=df):
"""Returns the distribution of the portfolio"""portfolio_total=data["value"].sum()
fig=px.pie(
data,
values="value",
names="ticker",
hole=0.3,
title=f"Portfolio Total ${portfolio_total:,.0f}",
)
fig.layout.autosize=Truereturnfigplot=pn.pane.Plotly(
portfolio_distribution(),
config={"responsive": True},
sizing_mode="stretch_both",
)
pn.Column(
plot.param.hover_data,
plot.param.click_data,
plot,
height=800,
sizing_mode="stretch_width",
).servable()
The text was updated successfully, but these errors were encountered:
I'm on the current
main
branch of Panel and using plotly 5.13.0. I'm working on #4350 and experience that I cannot getclick_data
orhover_data
working for a Plotly Pie plot. When I look in the browser console after hovering or clicking the plot I see the errorThe text was updated successfully, but these errors were encountered: