component-template icon indicating copy to clipboard operation
component-template copied to clipboard

plotly_event conflict with st.plotly_chart(fig, use_container_width=True)

Open b-y-f opened this issue 3 years ago • 0 comments

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)

b-y-f avatar Jun 20 '22 03:06 b-y-f