first working prototype

This commit is contained in:
2022-05-19 10:32:02 +02:00
parent 6f33c8b16e
commit a6e4fdfdd3
9 changed files with 206 additions and 0 deletions

55
stand.py Normal file
View File

@ -0,0 +1,55 @@
import streamlit as st
from st_aggrid import AgGrid
import hacks
from restapi import api
from utils.st_utils import get_session_id, rerun
st.set_page_config(layout="wide")
api.sid = get_session_id() # rest api needs current session ID to trigger the next rerun
changed = api.changed
df = api.data
print(">>> start of streamlit run")
response = AgGrid(
df,
filter=True,
editable=True,
sortable=True,
resizable=True,
# defaultWidth=5,
fit_columns_on_grid_load=True,
reload_data=changed,
key="stand"
)
new_df = response.get("data")#, df)
if not new_df.equals(df) and not changed:
api.data = new_df
# print("old:")
# print(df)
# print("new:")
# print(new_df)
# print(">>> force rerun")
# rerun()
#st.dataframe(df.astype(str))
#st.dataframe(new_df.astype(str))
print(">>> end of streamlit run")