James McCool
commited on
Commit
·
354d2df
1
Parent(s):
f481ff1
Update column layout in app.py for improved UI spacing
Browse files- Adjusted the column distribution for the submit and reset buttons to enhance the visual layout, providing a more balanced user interface.
- Added logic to clear session state variables related to player selection upon reset, ensuring a clean slate for user interactions.
app.py
CHANGED
@@ -251,7 +251,7 @@ with tab2:
|
|
251 |
unique_players = [p for p in unique_players if p != 'nan'] # Remove any NaN values
|
252 |
player_parse_var = st.selectbox("Do you want to view lineups with specific player(s)?", ['All', 'Specific'], key = 'player_parse_var')
|
253 |
player_names = st.multiselect("Select players", options=unique_players, default=[], key = 'player_names')
|
254 |
-
submit_col, reset_col, blank_col = st.columns([1, 1,
|
255 |
with submit_col:
|
256 |
submitted = st.form_submit_button("Submit")
|
257 |
with reset_col:
|
@@ -267,6 +267,9 @@ with tab2:
|
|
267 |
stack_parse_var = 'All'
|
268 |
stack_size_parse_var = 'All'
|
269 |
entry_parse_var = 'All'
|
|
|
|
|
|
|
270 |
|
271 |
if submitted:
|
272 |
if 'player_frame' in st.session_state:
|
|
|
251 |
unique_players = [p for p in unique_players if p != 'nan'] # Remove any NaN values
|
252 |
player_parse_var = st.selectbox("Do you want to view lineups with specific player(s)?", ['All', 'Specific'], key = 'player_parse_var')
|
253 |
player_names = st.multiselect("Select players", options=unique_players, default=[], key = 'player_names')
|
254 |
+
submit_col, reset_col, blank_col = st.columns([1, 1, 12])
|
255 |
with submit_col:
|
256 |
submitted = st.form_submit_button("Submit")
|
257 |
with reset_col:
|
|
|
267 |
stack_parse_var = 'All'
|
268 |
stack_size_parse_var = 'All'
|
269 |
entry_parse_var = 'All'
|
270 |
+
for each_var in [entry_names, stack_names, stack_size_names, player_names]:
|
271 |
+
if each_var in st.session_state:
|
272 |
+
del st.session_state[each_var]
|
273 |
|
274 |
if submitted:
|
275 |
if 'player_frame' in st.session_state:
|