Spaces:
Build error
Build error
James McCool commited on
Commit ·
9ac987b
1
Parent(s): 7d2ca0f
Enhance Streamlit app layout by organizing display options into a three-column format, allowing users to select teams and positions alongside display preferences. This improves user experience and data interaction.
Browse files- src/streamlit_app.py +12 -1
src/streamlit_app.py
CHANGED
|
@@ -29,7 +29,18 @@ def init_baselines():
|
|
| 29 |
hr_frame = init_baselines()
|
| 30 |
st.title("HR Finder Table")
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
if disp_options == 'Basics':
|
| 34 |
st.session_state['disp_frame'] = hr_frame[['Player', 'xHR/PA', 'Opp_xHR/PA', 'BP_Binom_xHR', 'Binom_xHR']]
|
| 35 |
st.session_state['disp_frame'] = st.session_state['disp_frame'].rename(columns={'xHR/PA': 'Hitter', 'Opp_xHR/PA': 'SP', 'BP_Binom_xHR': 'BP', 'Binom_xHR': 'xHRs'})
|
|
|
|
| 29 |
hr_frame = init_baselines()
|
| 30 |
st.title("HR Finder Table")
|
| 31 |
|
| 32 |
+
with st.container():
|
| 33 |
+
col1, col2, col3 = st.columns(3)
|
| 34 |
+
with col1:
|
| 35 |
+
disp_options = st.radio("Display options:", options = ['Basics', 'Exclude DFS Info', 'Include DFS Info'], key='display_options')
|
| 36 |
+
with col2:
|
| 37 |
+
team_options = st.multiselect("Parse Teams:", options = hr_frame.Team.unique(), key = 'team_options')
|
| 38 |
+
with col3:
|
| 39 |
+
pos_options = st.multiselect("Parse Positions:", options = ['C', '1B', '2B', '3B', 'SS', 'OF'], key = 'pos_options')
|
| 40 |
+
|
| 41 |
+
st.write(team_options)
|
| 42 |
+
st.write(pos_options)
|
| 43 |
+
|
| 44 |
if disp_options == 'Basics':
|
| 45 |
st.session_state['disp_frame'] = hr_frame[['Player', 'xHR/PA', 'Opp_xHR/PA', 'BP_Binom_xHR', 'Binom_xHR']]
|
| 46 |
st.session_state['disp_frame'] = st.session_state['disp_frame'].rename(columns={'xHR/PA': 'Hitter', 'Opp_xHR/PA': 'SP', 'BP_Binom_xHR': 'BP', 'Binom_xHR': 'xHRs'})
|