Hi, I’m trying to react to clicks on a Plotly scatterplot inside a Panel app then update the scatterplot, using the clicked marker to display its associated text as an annotation (per the relevant dataframe row). However, being somewhat new to Panel, I can’t figure out how to deal with click event when I already have a @pn.depends reacting to selectbox changes and returning a Plotly graph in a pane (just too many moving parts coming from a Streamlit background). How would I modify this code below to accommodate and react to clicks on the rendered Plotly scatterplot graph? Thanks!
graph_options = ["Stat1", "Stat2", "Stat3", "Stat4"]
graph_option1 = pn.widgets.Select(name="x-axis Stat:",
options=graph_options, value="Stat1")
gui.sidebar.append(graph_option1)
graph_option2 = pn.widgets.Select(name="y-axis Stat:",
options=graph_options, value="Stat2")
gui.sidebar.append(graph_option2)
@pn.depends(league_selected.param.value, team_selected.param.value,
season_selected.param.value, graph_option1.param.value,
graph_option2.param.value)
def plot_pane(league_selected, team_selected, season_selected,
graph_option1, graph_option2):
fig = plot_scatter(sql_engine, league_selected, None, season_selected,
graph_option1, graph_option2)
return pn.pane.Plotly(fig, config={'responsive': True,
"displaylogo": False})
gui.main[0:4, 0:7] = plot_pane
gui.servable()