component-template
component-template copied to clipboard
plotly_event conflict with st.plotly_chart(fig, use_container_width=True)
when use both together one more plot with be shown
Like this one two plot appears
fig = px.scatter_mapbox(df, lat="lat", lon="lon", zoom=4, height=800)
fig.update_layout(mapbox_style="open-street-map")
selected_points = plotly_events(fig)
if selected_points:
st.write(df.iloc[selected_points[0]['pointIndex']].astype(str))
st.write("Total points:", df.shape[0])
st.plotly_chart(fig, use_container_width=True)