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
+3 -3
View File
@@ -151,13 +151,13 @@ def run():
for r in ["P", "D", "C", "A"]:
allocations[r] = sum(s["estimated_price"] for s in selected if s["role"] == r)
fig = budget_waterfall(allocations)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("How your budget maps across roles. Aim for ~15% GK, ~35% DEF, ~30% MID, ~20% FWD.")
with c2:
section("📈 Value Scatter")
fig = value_scatter(players)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("Top-right: high FV, high price. Bottom-right: value steals. "
"Bubble size = games played. Dashed lines = cost-per-FV-point isolines.")
@@ -186,7 +186,7 @@ def run():
# ── Grid Auction Heatmap ──
section("🔢 Grid Auction Simulator")
fig = _grid_heatmap(players)
st.plotly_chart(fig, use_container_width=True)
st.plotly_chart(fig, width="stretch")
insight("Green = good value at that bid multiplier. Red = overpaying. "
"Bid at the 'green' multiplier for each player.")