Spaces:
Sleeping
Sleeping
Fix empty bottom panel — panel_max_y was above panel_y
Browse filesThe bottom stat panel showed headers but no data rows because
panel_max_y (85% of height = 918px) was BELOW panel_y (bar_area_bottom
+ 6 = 934px), giving -16px of available space. Every row hit the
boundary check and was skipped.
Fix: panel_max_y now set to date_y - 10 (93% height - 10 = 994px),
giving 62px of usable space for 4 lines of data.
Also fix tenure unit: shows "yrs" only for age-based data (≤50
keyframes), omits unit for game-by-game data with many dates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- bar_race/animate.py +4 -1
- bar_race/render.py +4 -4
bar_race/animate.py
CHANGED
|
@@ -398,9 +398,12 @@ def populate_leader_overlays(
|
|
| 398 |
|
| 399 |
# Build tenure leaderboard column (top 3 by tenure).
|
| 400 |
if tenure_counts:
|
|
|
|
|
|
|
| 401 |
top_tenure = sorted(tenure_counts.items(), key=lambda x: -x[1])[:3]
|
| 402 |
f.tenure_leaders = [
|
| 403 |
-
f"{_abbrev(p)}: {t}
|
|
|
|
| 404 |
]
|
| 405 |
|
| 406 |
# Determine current leader.
|
|
|
|
| 398 |
|
| 399 |
# Build tenure leaderboard column (top 3 by tenure).
|
| 400 |
if tenure_counts:
|
| 401 |
+
# Use "yrs" only if total keyframes is small (age-based data).
|
| 402 |
+
unit = "yrs" if n_steps <= 50 else ""
|
| 403 |
top_tenure = sorted(tenure_counts.items(), key=lambda x: -x[1])[:3]
|
| 404 |
f.tenure_leaders = [
|
| 405 |
+
f"{_abbrev(p)}: {t}{' ' + unit if unit else ''}"
|
| 406 |
+
for p, t in top_tenure
|
| 407 |
]
|
| 408 |
|
| 409 |
# Determine current leader.
|
bar_race/render.py
CHANGED
|
@@ -1298,10 +1298,10 @@ class FrameRenderer:
|
|
| 1298 |
fill=(*accent_c, 200), font=self.font_watermark,
|
| 1299 |
anchor="rb")
|
| 1300 |
|
| 1301 |
-
# --- bottom panel: three columns
|
| 1302 |
-
panel_y = self._bar_area_bottom +
|
| 1303 |
-
panel_max_y = int(self.H * 0.
|
| 1304 |
-
line_h = max(
|
| 1305 |
header_c = (*text_c, 178)
|
| 1306 |
row_c = (*text2_c, 110)
|
| 1307 |
panel_w = int(self.W * 0.68)
|
|
|
|
| 1298 |
fill=(*accent_c, 200), font=self.font_watermark,
|
| 1299 |
anchor="rb")
|
| 1300 |
|
| 1301 |
+
# --- bottom panel: three columns between bars and date ---------------
|
| 1302 |
+
panel_y = self._bar_area_bottom + 4
|
| 1303 |
+
panel_max_y = int(self.H * 0.93) - 10 # stop above the date
|
| 1304 |
+
line_h = max(11, int(self.H * 0.014))
|
| 1305 |
header_c = (*text_c, 178)
|
| 1306 |
row_c = (*text2_c, 110)
|
| 1307 |
panel_w = int(self.W * 0.68)
|