Spaces:
Running
Running
James McCool
commited on
Commit
·
011a604
1
Parent(s):
3f1e75b
Refactor subscription notice implementation in scoring percentages to use LinkColumn for better user experience in Simple view
Browse files
app.py
CHANGED
|
@@ -357,10 +357,33 @@ with tab1:
|
|
| 357 |
scoring_percentages = scoring_percentages[['Names', 'Runs', '8+ Runs', 'Win%', 'LevX', 'Own%']]
|
| 358 |
for col in ['Names', '8+ Runs', 'Own%']:
|
| 359 |
scoring_percentages[col] = '<div style="text-align: center;"><a href="https://paydirtdfs.com/subscriptions-choices/">$$ (subscription only)</a></div>'
|
| 360 |
-
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
elif view_var == "Advanced":
|
| 362 |
for col in ['Names', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage', 'Top Score', '8+ Runs', 'Own%']:
|
| 363 |
-
scoring_percentages[col] = '
|
| 364 |
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), height=750, use_container_width = True, hide_index = True)
|
| 365 |
|
| 366 |
with tab2:
|
|
|
|
| 357 |
scoring_percentages = scoring_percentages[['Names', 'Runs', '8+ Runs', 'Win%', 'LevX', 'Own%']]
|
| 358 |
for col in ['Names', '8+ Runs', 'Own%']:
|
| 359 |
scoring_percentages[col] = '<div style="text-align: center;"><a href="https://paydirtdfs.com/subscriptions-choices/">$$ (subscription only)</a></div>'
|
| 360 |
+
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2),
|
| 361 |
+
column_config={
|
| 362 |
+
"Names": st.column_config.LinkColumn(
|
| 363 |
+
"Teams",
|
| 364 |
+
help="The Team being projected",
|
| 365 |
+
validate="https://paydirtdfs.com/subscriptions-choices/",
|
| 366 |
+
max_chars=100,
|
| 367 |
+
display_text='Subscription Only ($$)'
|
| 368 |
+
),
|
| 369 |
+
"8+ Runs": st.column_config.LinkColumn(
|
| 370 |
+
"8+ Runs",
|
| 371 |
+
help="How often the team scores eight or more runs, a threshold that indicates upside for GPPs",
|
| 372 |
+
validate="https://paydirtdfs.com/subscriptions-choices/",
|
| 373 |
+
max_chars=100,
|
| 374 |
+
display_text='Subscription Only ($$)'
|
| 375 |
+
),
|
| 376 |
+
"Own%": st.column_config.LinkColumn(
|
| 377 |
+
"Own%",
|
| 378 |
+
help="The projected sum ownership of hitters on the Team",
|
| 379 |
+
validate="https://paydirtdfs.com/subscriptions-choices/",
|
| 380 |
+
max_chars=100,
|
| 381 |
+
display_text='Subscription Only ($$)'
|
| 382 |
+
)
|
| 383 |
+
}, height=750, use_container_width = True, hide_index = True)
|
| 384 |
elif view_var == "Advanced":
|
| 385 |
for col in ['Names', 'Avg Fifth Inning', 'Fifth Inning Lead Percentage', 'Top Score', '8+ Runs', 'Own%']:
|
| 386 |
+
scoring_percentages[col] = 'Subscription Only ($$)'
|
| 387 |
st.dataframe(scoring_percentages.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(game_format, precision=2), height=750, use_container_width = True, hide_index = True)
|
| 388 |
|
| 389 |
with tab2:
|