James McCool
commited on
Commit
·
d69a1b2
1
Parent(s):
7829724
Refactor layout for sport and game selection in app.py
Browse files- Updated the layout structure to improve organization by renaming columns for clarity.
- Enhanced user interaction by ensuring selection boxes for sport, date, and game type are clearly defined and accessible.
- Maintained existing functionality for contest data retrieval while improving overall user experience.
app.py
CHANGED
|
@@ -53,20 +53,20 @@ with tab1:
|
|
| 53 |
with col1:
|
| 54 |
if st.button('Clear data', key='reset1'):
|
| 55 |
st.session_state.clear()
|
| 56 |
-
|
| 57 |
-
with
|
| 58 |
parse_type = st.selectbox("Manual upload or DB search?", ['DB Search', 'Manual'], key='parse_type')
|
| 59 |
-
with
|
| 60 |
sport_select = st.selectbox("Select Sport", ['MLB', 'NBA', 'NFL'], key='sport_select')
|
| 61 |
contest_names, contest_id_map, curr_info = grab_contest_names(db, sport_select)
|
| 62 |
|
| 63 |
-
with
|
| 64 |
date_list = curr_info['Date'].sort_values(ascending=False).unique()
|
| 65 |
date_select = st.selectbox("Select Date", date_list, key='date_select')
|
| 66 |
|
| 67 |
name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name'].reset_index(drop=True)
|
| 68 |
date_select = date_select.replace('-', '')
|
| 69 |
-
with
|
| 70 |
type_var = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_var')
|
| 71 |
|
| 72 |
with col2:
|
|
|
|
| 53 |
with col1:
|
| 54 |
if st.button('Clear data', key='reset1'):
|
| 55 |
st.session_state.clear()
|
| 56 |
+
search_options, sport_options, date_options, game_options = st.columns(4)
|
| 57 |
+
with search_options:
|
| 58 |
parse_type = st.selectbox("Manual upload or DB search?", ['DB Search', 'Manual'], key='parse_type')
|
| 59 |
+
with sport_options:
|
| 60 |
sport_select = st.selectbox("Select Sport", ['MLB', 'NBA', 'NFL'], key='sport_select')
|
| 61 |
contest_names, contest_id_map, curr_info = grab_contest_names(db, sport_select)
|
| 62 |
|
| 63 |
+
with date_options:
|
| 64 |
date_list = curr_info['Date'].sort_values(ascending=False).unique()
|
| 65 |
date_select = st.selectbox("Select Date", date_list, key='date_select')
|
| 66 |
|
| 67 |
name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name'].reset_index(drop=True)
|
| 68 |
date_select = date_select.replace('-', '')
|
| 69 |
+
with game_options:
|
| 70 |
type_var = st.selectbox("Select Game Type", ['Classic', 'Showdown'], key='type_var')
|
| 71 |
|
| 72 |
with col2:
|