Fix Players page KeyError + use_container_width deprecation

- Players page: fix regression_chart xg_col default (goals_p90 -> xg_p90)
- charts.py: make regression_chart defensive against missing columns
- All pages: replace use_container_width=True with width='stretch'
- Verified: all 5 pages render with zero errors via Playwright browser test
This commit is contained in:
ramseshk
2026-08-11 15:24:39 +08:00
parent 397078d635
commit 30d676517e
5 changed files with 25 additions and 23 deletions
+4 -4
View File
@@ -147,7 +147,7 @@ def run():
error_df = _build_error_data(preds, votes)
if not error_df.empty:
fig = error_violins(error_df)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("How prediction errors distribute across roles. Wider = more uncertainty.")
else:
st.info("No actual vote data available to compute errors.")
@@ -156,7 +156,7 @@ def run():
section("🔬 Feature Importance")
fig = _feature_importance_plot(players)
if fig.data:
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("Pearson correlation of each feature with season Fantavoto average.")
else:
st.info("Insufficient numeric features for correlation analysis.")
@@ -169,7 +169,7 @@ def run():
section("📐 Calibration Curve")
fig = _calibration_curve(preds)
if fig.data:
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("Ideal: points on diagonal → predicted uncertainty matches actual variance.")
else:
st.info("Bootstrap std not available for calibration.")
@@ -178,7 +178,7 @@ def run():
section("📈 Backtest: League Avg per GW")
fig = _backtest_chart(votes)
if fig.data:
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("Average Fantavoto across the 2025/26 season. Dashed line = 6.0 baseline.")
else:
st.info("No vote data available.")