File size: 2,127 Bytes
1b200e2 a57843e 0cb707e a57843e 2adf5ba a57843e be43e65 5e75546 a57843e 3cd1caa f87c5a4 a57843e f87c5a4 a57843e 877f465 be43e65 877f465 f87c5a4 9edfd2b be43e65 0920762 a57843e be43e65 4458d2c a57843e cc60723 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
import streamlit as st
for k, v in st.session_state.items():
st.session_state[k] = v
# --- SHARED ON ALL PAGES ---
#st.logo(image=":material/medical_information:")
#st.logo(image="images/medical_information_24dp_1F1F1F_FILL0_wght400_GRAD0_opsz24.png")
st.logo(image="images/menu_book_60dp_75FBFD.png")
# --- PAGE SETUP ---
start_page = st.Page(
page="pages/chapter_index.py",
title="Saudi Billing System Chapter Index",
icon=":material/home:",
default=True,)
type_text_page = st.Page(
page="pages/type_text.py",
title="DEMO type text",
icon=":material/keyboard:",
default=False,)
upload_file_page = st.Page(
page="pages/upload_file.py",
title="DEMO upload file (not yet active)",
icon=":material/file_upload:",
default=False,)
about_page = st.Page(
page="pages/about.py",
title="About the app",
icon=":material/info:",
default=False)
#PAGES = {
# "Chapter Index": "pages/chapter_index.py" ,
# "DEMO type_text": "pages/type_text.py",
# "DEMO upload file (not yet active)": "pages/upload_file.py",
# "About": "pages/about.py",
#}
#selection = st.sidebar.radio("Pages", list(PAGES.keys()))
#selection = st.sidebar.radio("Pages", [start_page, type_text_page, upload_file_page, about_page])
#page = PAGES[selection]
# --- NAVIGATION SETUP ---
pg = st.navigation(pages=[start_page, type_text_page, upload_file_page, about_page]) # WITHOUT SECTIONS
#pg = st.navigation({"Chapter_Index": [start_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) # WITH SECTIONS
pg.run()
st.sidebar.text("Project by JA-RAD")
def filter_chapters_env(df, chapter_column_name):
chapter_names = st.sidebar.multiselect(
label="Chapter Name", options=df[chapter_column_name].unique(), default=st.session_state.get("chapter_names"), key='filter_chapters', on_change=update_chapters
)
st.session_state["chapter_names"] = chapter_names
if chapter_names:
df = df[df["chapter_name"].isin(chapter_names)]
return df
def update_chapters():
st.session_state["chapter_names"] = st.session_state.filter_chapters |