Spaces:
Build error
Build error
James McCool
commited on
Commit
·
7c7d5e6
1
Parent(s):
72321a2
Add containers for displaying dataframes in pitcher, hitter, and team tabs of Streamlit app
Browse files- Introduced separate containers for displaying dataframes in each tab to enhance layout and organization.
- Updated dataframe rendering to occur within these new containers for improved user experience.
- src/streamlit_app.py +15 -3
src/streamlit_app.py
CHANGED
|
@@ -97,6 +97,9 @@ bp_data, hitter_agg, hitter_long, hitter_short, pitcher_agg, pitcher_long, pitch
|
|
| 97 |
pitcher_tab, hitter_tab, team_tab = st.tabs(['Pitchers', 'Hitters', 'Team'])
|
| 98 |
|
| 99 |
with pitcher_tab:
|
|
|
|
|
|
|
|
|
|
| 100 |
with st.expander('Info and Display Options'):
|
| 101 |
st.info('Note: Splits options are available for all baseline tables, they do not apply to True AVG, HWSr, or the Overview tables')
|
| 102 |
col1, col2, col3 = st.columns(3)
|
|
@@ -122,9 +125,13 @@ with pitcher_tab:
|
|
| 122 |
elif table_var_sp == 'League Long Term Baselines':
|
| 123 |
st.session_state['sp_disp_frame'] = pitcher_long
|
| 124 |
|
| 125 |
-
|
|
|
|
| 126 |
|
| 127 |
with hitter_tab:
|
|
|
|
|
|
|
|
|
|
| 128 |
with st.expander('Info and Display Options'):
|
| 129 |
st.info('Note: Splits options are available for all baseline tables')
|
| 130 |
col1, col2, col3 = st.columns(3)
|
|
@@ -146,9 +153,13 @@ with hitter_tab:
|
|
| 146 |
elif table_var_hitter == 'League Long Term Baselines':
|
| 147 |
st.session_state['hitter_disp_frame'] = hitter_long
|
| 148 |
|
| 149 |
-
|
|
|
|
| 150 |
|
| 151 |
with team_tab:
|
|
|
|
|
|
|
|
|
|
| 152 |
with st.expander('Info and Display Options'):
|
| 153 |
col1, col2, col3 = st.columns(3)
|
| 154 |
with col1:
|
|
@@ -161,4 +172,5 @@ with team_tab:
|
|
| 161 |
elif table_var_team == 'Bullpen Baselines':
|
| 162 |
st.session_state['team_disp_frame'] = bp_data
|
| 163 |
|
| 164 |
-
|
|
|
|
|
|
| 97 |
pitcher_tab, hitter_tab, team_tab = st.tabs(['Pitchers', 'Hitters', 'Team'])
|
| 98 |
|
| 99 |
with pitcher_tab:
|
| 100 |
+
sp_disp_container = st.container(border = True)
|
| 101 |
+
sp_disp_container = sp_disp_container.empty()
|
| 102 |
+
|
| 103 |
with st.expander('Info and Display Options'):
|
| 104 |
st.info('Note: Splits options are available for all baseline tables, they do not apply to True AVG, HWSr, or the Overview tables')
|
| 105 |
col1, col2, col3 = st.columns(3)
|
|
|
|
| 125 |
elif table_var_sp == 'League Long Term Baselines':
|
| 126 |
st.session_state['sp_disp_frame'] = pitcher_long
|
| 127 |
|
| 128 |
+
with sp_disp_container:
|
| 129 |
+
st.dataframe(st.session_state['sp_disp_frame'])
|
| 130 |
|
| 131 |
with hitter_tab:
|
| 132 |
+
hitter_disp_container = st.container(border = True)
|
| 133 |
+
hitter_disp_container = hitter_disp_container.empty()
|
| 134 |
+
|
| 135 |
with st.expander('Info and Display Options'):
|
| 136 |
st.info('Note: Splits options are available for all baseline tables')
|
| 137 |
col1, col2, col3 = st.columns(3)
|
|
|
|
| 153 |
elif table_var_hitter == 'League Long Term Baselines':
|
| 154 |
st.session_state['hitter_disp_frame'] = hitter_long
|
| 155 |
|
| 156 |
+
with hitter_disp_container:
|
| 157 |
+
st.dataframe(st.session_state['hitter_disp_frame'])
|
| 158 |
|
| 159 |
with team_tab:
|
| 160 |
+
team_disp_container = st.container(border = True)
|
| 161 |
+
team_disp_container = team_disp_container.empty()
|
| 162 |
+
|
| 163 |
with st.expander('Info and Display Options'):
|
| 164 |
col1, col2, col3 = st.columns(3)
|
| 165 |
with col1:
|
|
|
|
| 172 |
elif table_var_team == 'Bullpen Baselines':
|
| 173 |
st.session_state['team_disp_frame'] = bp_data
|
| 174 |
|
| 175 |
+
with team_disp_container:
|
| 176 |
+
st.dataframe(st.session_state['team_disp_frame'])
|