st.subheader('Bernoulli Distribution')
p = st.slider('Probability of Success (p)', 0.0, 1.0, 0.5)
x = [0, 1]
y = [1 - p, p]
fig = figure(title='Bernoulli Distribution', x_axis_label='Outcome', y_axis_label='Probability')
fig.vbar(x=x, top=y, width=0.5)
st.bokeh_chart(fig, use_container_width=True)
I use python module streamlit to build a web about univariate distributions. I want the user can select different values to see the effect. But the problem now is that, when I use st.slider to choose value, the whole page will refresh and the view will go to the top.
Any solutions here?