The problem occurs when I try to save a static figure to a PDF file using the following code: save_figure(figure: go.Figure, file): I check and it works outside of the form using st.plotly_chart. Now, I generate figures using a form, resetting the state after each re-submission. Selected_file = st.selectbox('Select a file for download:', available_files, index=0) "Processed dataframe": st.session_state.processed_dataĪvailable_files = įile_name = st.text_input('', value='your_filename') "Feature dataframe": st.session_state.final_feature_table, If not st.session_state.processed_data and not st.session_state.final_feature_table: Return df.to_csv(sep='\t', index=False).encode('utf-8') I do a similar thing with saved data frames for which I have the following code: save_df(df: pandas.DataFrame): I’m trying to figure out the way to download my plotly figures saved in session state with the download button.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |