James McCool commited on
Commit
daedb53
·
1 Parent(s): a14517f

Enhance user interaction in app.py by implementing a form for selecting variables to remove from lineups. This change allows users to apply their selections more intuitively, improving the overall lineup management experience.

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1302,7 +1302,12 @@ with tab2:
1302
  for col in st.session_state['working_frame'].columns:
1303
  if col not in excluded_cols:
1304
  player_names.update(st.session_state['working_frame'][col].unique())
1305
- st.write(st.selectbox("Remove: ", options=['Players', 'Stacks'], key='conditional_var_1'), "if lineup ", st.selectbox("contains: ", options=['Players', 'Stacks'], key='conditional_var_2'))
 
 
 
 
 
1306
  if st.session_state['conditional_var_1'] == 'Players':
1307
  conditional_remove = st.multiselect("Remove lineups containing players:", options=sorted(list(player_names)), default=[])
1308
  elif st.session_state['conditional_var_1'] == 'Stacks':
 
1302
  for col in st.session_state['working_frame'].columns:
1303
  if col not in excluded_cols:
1304
  player_names.update(st.session_state['working_frame'][col].unique())
1305
+ with st.form(key='conditional_manager_form_2'):
1306
+ conditional_var_1 = st.selectbox("Remove variable: ", options=['Players', 'Stacks'], key='conditional_var_1')
1307
+ conditional_var_2 = st.selectbox("Contains variable: ", options=['Players', 'Stacks'], key='conditional_var_2')
1308
+ if st.form_submit_button("Apply"):
1309
+ st.session_state['conditional_var_1'] = conditional_var_1
1310
+ st.session_state['conditional_var_2'] = conditional_var_2
1311
  if st.session_state['conditional_var_1'] == 'Players':
1312
  conditional_remove = st.multiselect("Remove lineups containing players:", options=sorted(list(player_names)), default=[])
1313
  elif st.session_state['conditional_var_1'] == 'Stacks':