-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
183 lines (152 loc) · 4.14 KB
/
main.py
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
from venv import create
import streamlit as st
from page1 import *
from src.utils_page1 import *
from page2 import *
from page5 import *
# --- MARKDOWN:
# Setting main page configurations
st.set_page_config(layout="wide",page_title="ScreenAid", page_icon="🔍")
# Setting main page configurations
st.markdown("""
<style>
.css-18e3th9 {
padding-top: 1rem;
padding-bottom: 10rem;
padding-left: 5rem;
padding-right: 5rem;
}
.css-1d391kg {
padding-top: 3.5rem;
padding-right: 1rem;
padding-bottom: 3.5rem;
padding-left: 1rem;
}
.css-1a7jz76 h3{
padding: 0rem 0px 0rem;
}
.css-1xv07vx hr{
margin: 0.5em 0px;
}
</style>
""", unsafe_allow_html=True)
# Setting button configurations
st.markdown(
"""
<style>
.css-1a7jz76 {
padding: 4rem 1rem;
}
div[data-testid="stToolbar"] {
visibility: hidden;
height: 0%;
position: fixed;
}
div[data-testid="stDecoration"] {
visibility: hidden;
height: 0%;
position: fixed;
}
div[data-testid="stStatusWidget"] {
visibility: hidden;
height: 0%;
position: fixed;
}
#MainMenu {
visibility: hidden;
}
footer {
visibility: hidden;
height: 0%
}
header {
visibility: hidden;
height: 0%;
}
div.stButton > button:first-child {
box-shadow: inset 0px 1px 0px 0px #5ca08e;
background: linear-gradient(to bottom, #5ca08e 5%, #69b8a3 100%);
background-color: #76b1a1;
border-radius: 10px;
border: 1px solid #5ca08e;
display: flex;
flex-direction: column;
cursor: pointer;
color: #ffffff;
height: 3.3em;
margin: auto;
width: 100%;
}
div.stButton > button:hover {
background:linear-gradient(to bottom, #74a397 80%, #7fb3a5 100%);
background-color:#8abaae;
}
div.stButton > button:active {
position:relative;
top:2px;
}
div.stTooltipIcon > button:first-child {
background-color:#5ca08e;
border-radius:28px;
border:1px solid #006a4e;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Verdana;
font-size:25px;
font-weight:bold;
padding:11px 16px;
text-decoration:none;
text-shadow:0px 1px 0px #006a4e;
}
div.stTooltipIcon > button:hover {
background-color:#2e856e;
}
</style>""", unsafe_allow_html=True)
# ------
#define style
#local_css("styles.css")
placeholder = st.empty()
if 'page' not in st.session_state:
st.session_state["page"] ='page1'
if 'back' not in st.session_state:
st.session_state['back'] = False
if 'next' not in st.session_state:
st.session_state['next'] = False
col1, col2 = st.columns(2)
next_button = col2.empty()
back_button = col1.empty()
with back_button.container():
st.session_state['back'] = st.button("Back")
with next_button.container():
st.session_state['next'] = st.button("Next")
if st.session_state['next']:
if st.session_state["page"] == 'page1':
st.session_state["page"] = 'page2'
#Save image output from page1
create_plots()
elif st.session_state["page"] == 'page2':
st.session_state["page"] = 'page5'
elif st.session_state["page"] == 'page5':
st.session_state["page"] = 'page1'
if st.session_state['back']:
if st.session_state["page"] == 'page2':
st.session_state["page"] = 'page1'
elif st.session_state["page"] == 'page5':
st.session_state["page"] = 'page2'
if st.session_state["page"] == 'page1':
with placeholder.container():
page1()
elif st.session_state["page"] == 'page2':
with placeholder.container():
page2()
st.session_state['output_from_page2'] = st.session_state['temp_df2'].iloc[st.session_state['yes_indexes']]
elif st.session_state["page"] == 'page5':
with placeholder.container():
page5()
if st.session_state["page"] == 'page1':
with back_button.container():
back = st.write('')
elif st.session_state["page"] == 'page5':
with next_button.container():
next = st.write('')