James McCool
commited on
Commit
·
9c68c67
1
Parent(s):
ffc75f9
Refactor combo analysis controls in 'Manage Portfolio' to use a form for submission, improving user interaction and streamlining the analysis process.
Browse files
app.py
CHANGED
|
@@ -2008,16 +2008,18 @@ if selected_tab == 'Manage Portfolio':
|
|
| 2008 |
st.subheader("Player Combinations")
|
| 2009 |
|
| 2010 |
# Add controls for combo analysis
|
| 2011 |
-
|
| 2012 |
-
|
| 2013 |
-
|
| 2014 |
-
|
| 2015 |
-
|
| 2016 |
-
|
| 2017 |
-
|
| 2018 |
-
|
| 2019 |
-
|
| 2020 |
-
|
|
|
|
|
|
|
| 2021 |
|
| 2022 |
# Display results
|
| 2023 |
if 'combo_analysis' in st.session_state:
|
|
|
|
| 2008 |
st.subheader("Player Combinations")
|
| 2009 |
|
| 2010 |
# Add controls for combo analysis
|
| 2011 |
+
with st.form("combo_analysis_form"):
|
| 2012 |
+
combo_size_col, columns_excluded_col, combo_analyze_col = st.columns(3)
|
| 2013 |
+
with combo_size_col:
|
| 2014 |
+
combo_size = st.selectbox("Combo Size", [2, 3], key='combo_size')
|
| 2015 |
+
with columns_excluded_col:
|
| 2016 |
+
excluded_cols_extended = st.multiselect("Exclude Columns?", st.session_state['display_frame'].drop(columns=excluded_cols).columns, key='excluded_cols_extended')
|
| 2017 |
+
with combo_analyze_col:
|
| 2018 |
+
submitted = st.form_submit_button("Analyze Combos")
|
| 2019 |
+
if submitted:
|
| 2020 |
+
st.session_state['combo_analysis'] = analyze_player_combos(
|
| 2021 |
+
st.session_state['display_frame'], excluded_cols + excluded_cols_extended, combo_size
|
| 2022 |
+
)
|
| 2023 |
|
| 2024 |
# Display results
|
| 2025 |
if 'combo_analysis' in st.session_state:
|