Is there a way to update images corresponding to a slider in real-time? Currently, I have the following code that is experiencing a lot of lag:
slider8 = record(st.select_slider, "Normal Trendline (After)") chart_to_show_normal_trend_after = slider8("Normal Trendline Chart (After)", [i for i in range(1,11) for _ in range(5)]) chart = "ny_trendlines/visualization" + str(int(chart_to_show_normal_trend_after) - 1) + ".png" st.image(chart) i+=1
I have a bunch of images if Altair charts, and I bind them to the slider, but when I move the slider it takes a long time for the new image to update. I also tried just generating the Altair chart natively inside Streamlit, but the slider is still really slow. Is there a way to get past this lag?