Spaces:
Running
Running
James McCool
commited on
Commit
·
b4fefd9
1
Parent(s):
32f717b
Restructure tab layout and exposure display in app.py
Browse filesReorganized the tab and container structure to improve code readability and maintain consistent display of player and team exposures. Adjusted the nested tab sections to ensure proper rendering of simulation results and exposure data.
app.py
CHANGED
@@ -575,37 +575,37 @@ with tab1:
|
|
575 |
'GPP_Proj': '{:.2f}'
|
576 |
}).background_gradient(cmap='RdYlGn', axis=0, subset=['Salary', 'Proj', 'Own', 'Fantasy', 'GPP_Proj']), use_container_width=True)
|
577 |
|
578 |
-
with tab2:
|
579 |
-
if 'Sim_Winner_Display' in st.session_state:
|
580 |
-
st.write("Yeah man that's crazy")
|
581 |
-
|
582 |
-
else:
|
583 |
-
st.write("Simulation data or position mapping not available.")
|
584 |
-
with st.container():
|
585 |
-
tab1, tab2 = st.tabs(['Overall Exposures', 'Team Exposures'])
|
586 |
-
with tab1:
|
587 |
-
if 'player_freq' in st.session_state:
|
588 |
-
|
589 |
-
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
590 |
-
st.download_button(
|
591 |
-
label="Export Exposures",
|
592 |
-
data=st.session_state.player_freq.to_csv().encode('utf-8'),
|
593 |
-
file_name='player_freq_export.csv',
|
594 |
-
mime='text/csv',
|
595 |
-
key='overall'
|
596 |
-
)
|
597 |
-
|
598 |
with tab2:
|
599 |
-
if '
|
|
|
600 |
|
601 |
-
|
602 |
-
st.
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
|
610 |
with tab2:
|
611 |
col1, col2 = st.columns([1, 7])
|
|
|
575 |
'GPP_Proj': '{:.2f}'
|
576 |
}).background_gradient(cmap='RdYlGn', axis=0, subset=['Salary', 'Proj', 'Own', 'Fantasy', 'GPP_Proj']), use_container_width=True)
|
577 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
578 |
with tab2:
|
579 |
+
if 'Sim_Winner_Display' in st.session_state:
|
580 |
+
st.write("Yeah man that's crazy")
|
581 |
|
582 |
+
else:
|
583 |
+
st.write("Simulation data or position mapping not available.")
|
584 |
+
with st.container():
|
585 |
+
tab1, tab2 = st.tabs(['Overall Exposures', 'Team Exposures'])
|
586 |
+
with tab1:
|
587 |
+
if 'player_freq' in st.session_state:
|
588 |
+
|
589 |
+
st.dataframe(st.session_state.player_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
590 |
+
st.download_button(
|
591 |
+
label="Export Exposures",
|
592 |
+
data=st.session_state.player_freq.to_csv().encode('utf-8'),
|
593 |
+
file_name='player_freq_export.csv',
|
594 |
+
mime='text/csv',
|
595 |
+
key='overall'
|
596 |
+
)
|
597 |
+
|
598 |
+
with tab2:
|
599 |
+
if 'team_freq' in st.session_state:
|
600 |
+
|
601 |
+
st.dataframe(st.session_state.team_freq.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(freq_format, precision=2), use_container_width = True)
|
602 |
+
st.download_button(
|
603 |
+
label="Export Exposures",
|
604 |
+
data=st.session_state.team_freq.to_csv().encode('utf-8'),
|
605 |
+
file_name='team_freq.csv',
|
606 |
+
mime='text/csv',
|
607 |
+
key='team'
|
608 |
+
)
|
609 |
|
610 |
with tab2:
|
611 |
col1, col2 = st.columns([1, 7])
|