James McCool
commited on
Commit
·
3f2ff48
1
Parent(s):
30c163c
Refactor Range of Outcomes tab layout and improve UI organization
Browse filesRestructure the first tab's layout by:
- Moving the view type info text to a separate container
- Removing the fifth column in the options grid
- Simplifying slate selection logic by moving it out of a separate column
- Improving overall layout and readability of the data selection interface
app.py
CHANGED
@@ -118,14 +118,15 @@ with tab1:
|
|
118 |
if st.button("Load/Reset Data", key='reset2'):
|
119 |
st.cache_data.clear()
|
120 |
nba_dk_sd_raw, nba_fd_sd_raw, nfl_dk_sd_raw, nfl_fd_sd_raw, nba_timestamp, nfl_dk_timestamp, nba_dk_id_dict, nfl_dk_id_dict, nba_fd_id_dict, nfl_fd_id_dict = init_baselines()
|
121 |
-
|
|
|
|
|
122 |
options_container = st.container()
|
123 |
with options_container:
|
124 |
-
col1, col2, col3, col4
|
125 |
|
126 |
with col1:
|
127 |
view_var2 = st.radio("View Type", ("Simple", "Advanced"), key='view_var2')
|
128 |
-
st.info("Simple view is better for mobile and shows just the most valuable stats, Advanced view is better for desktop and shows all stats and thresholds")
|
129 |
|
130 |
with col2:
|
131 |
sport_var2 = st.radio("Sport", ('NFL', 'NBA'), key='sport_var2')
|
@@ -142,28 +143,27 @@ with tab1:
|
|
142 |
with col4:
|
143 |
site_var2 = st.radio("Site", ('Draftkings', 'Fanduel'), key='site_var2')
|
144 |
|
145 |
-
|
146 |
-
if
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #3']
|
167 |
|
168 |
hold_container = st.empty()
|
169 |
|
|
|
118 |
if st.button("Load/Reset Data", key='reset2'):
|
119 |
st.cache_data.clear()
|
120 |
nba_dk_sd_raw, nba_fd_sd_raw, nfl_dk_sd_raw, nfl_fd_sd_raw, nba_timestamp, nfl_dk_timestamp, nba_dk_id_dict, nfl_dk_id_dict, nba_fd_id_dict, nfl_fd_id_dict = init_baselines()
|
121 |
+
info_container = st.container()
|
122 |
+
with info_container:
|
123 |
+
st.info("Simple view is better for mobile and shows just the most valuable stats, Advanced view is better for desktop and shows all stats and thresholds")
|
124 |
options_container = st.container()
|
125 |
with options_container:
|
126 |
+
col1, col2, col3, col4 = st.columns(4)
|
127 |
|
128 |
with col1:
|
129 |
view_var2 = st.radio("View Type", ("Simple", "Advanced"), key='view_var2')
|
|
|
130 |
|
131 |
with col2:
|
132 |
sport_var2 = st.radio("Sport", ('NFL', 'NBA'), key='sport_var2')
|
|
|
143 |
with col4:
|
144 |
site_var2 = st.radio("Site", ('Draftkings', 'Fanduel'), key='site_var2')
|
145 |
|
146 |
+
if site_var2 == 'Draftkings':
|
147 |
+
if slate_var2 == 'Paydirt (Main)':
|
148 |
+
raw_baselines = dk_roo_raw
|
149 |
+
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #1']
|
150 |
+
elif slate_var2 == 'Paydirt (Secondary)':
|
151 |
+
raw_baselines = dk_roo_raw
|
152 |
+
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #2']
|
153 |
+
elif slate_var2 == 'Paydirt (Auxiliary)':
|
154 |
+
raw_baselines = dk_roo_raw
|
155 |
+
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #3']
|
156 |
+
|
157 |
+
elif site_var2 == 'Fanduel':
|
158 |
+
if slate_var2 == 'Paydirt (Main)':
|
159 |
+
raw_baselines = fd_roo_raw
|
160 |
+
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #1']
|
161 |
+
elif slate_var2 == 'Paydirt (Secondary)':
|
162 |
+
raw_baselines = fd_roo_raw
|
163 |
+
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #2']
|
164 |
+
elif slate_var2 == 'Paydirt (Auxiliary)':
|
165 |
+
raw_baselines = fd_roo_raw
|
166 |
+
raw_baselines = raw_baselines[raw_baselines['slate'] == 'Showdown #3']
|
|
|
167 |
|
168 |
hold_container = st.empty()
|
169 |
|