Spaces:
Sleeping
Sleeping
Update visualization/edge_strip.py
Browse files
visualization/edge_strip.py
CHANGED
|
@@ -46,10 +46,13 @@ def render_upcoming_edge_strip(rows: list[dict[str, Any]]) -> None:
|
|
| 46 |
|
| 47 |
body_rows = []
|
| 48 |
for row in rows:
|
|
|
|
|
|
|
|
|
|
| 49 |
body_rows.append(
|
| 50 |
f"""
|
| 51 |
<div class="grid-row">
|
| 52 |
-
<div>{row.get("slot", "")}: {row.get("batter_name", "")}</div>
|
| 53 |
<div>{_fmt_odds(row.get("fair_hr_odds"))}</div>
|
| 54 |
<div>{_fmt_odds(row.get("book_hr_odds"))}</div>
|
| 55 |
<div>{_fmt_edge(row.get("hr_edge"))}</div>
|
|
@@ -87,7 +90,7 @@ def render_upcoming_edge_strip(rows: list[dict[str, Any]]) -> None:
|
|
| 87 |
}}
|
| 88 |
.grid-header, .grid-row {{
|
| 89 |
display: grid;
|
| 90 |
-
grid-template-columns: 1.
|
| 91 |
gap: 8px;
|
| 92 |
}}
|
| 93 |
.grid-header {{
|
|
@@ -106,7 +109,7 @@ def render_upcoming_edge_strip(rows: list[dict[str, Any]]) -> None:
|
|
| 106 |
</head>
|
| 107 |
<body>
|
| 108 |
<div class="edge-strip">
|
| 109 |
-
<div class="title">UPCOMING BATTER HR EDGES</div>
|
| 110 |
|
| 111 |
<div class="grid-header">
|
| 112 |
<div>BATTER</div>
|
|
@@ -120,5 +123,5 @@ def render_upcoming_edge_strip(rows: list[dict[str, Any]]) -> None:
|
|
| 120 |
</body>
|
| 121 |
</html>
|
| 122 |
"""
|
| 123 |
-
height = 88 + (len(rows) *
|
| 124 |
components.html(html, height=height, scrolling=False)
|
|
|
|
| 46 |
|
| 47 |
body_rows = []
|
| 48 |
for row in rows:
|
| 49 |
+
ev90 = row.get("ev90")
|
| 50 |
+
ev90_text = f" | EV90 {float(ev90):.1f}" if ev90 is not None else ""
|
| 51 |
+
|
| 52 |
body_rows.append(
|
| 53 |
f"""
|
| 54 |
<div class="grid-row">
|
| 55 |
+
<div>{row.get("slot", "")}: {row.get("batter_name", "")}{ev90_text}</div>
|
| 56 |
<div>{_fmt_odds(row.get("fair_hr_odds"))}</div>
|
| 57 |
<div>{_fmt_odds(row.get("book_hr_odds"))}</div>
|
| 58 |
<div>{_fmt_edge(row.get("hr_edge"))}</div>
|
|
|
|
| 90 |
}}
|
| 91 |
.grid-header, .grid-row {{
|
| 92 |
display: grid;
|
| 93 |
+
grid-template-columns: 1.7fr 0.6fr 0.6fr 0.6fr;
|
| 94 |
gap: 8px;
|
| 95 |
}}
|
| 96 |
.grid-header {{
|
|
|
|
| 109 |
</head>
|
| 110 |
<body>
|
| 111 |
<div class="edge-strip">
|
| 112 |
+
<div class="title">UPCOMING BATTER HR EDGES • EV90 MODEL V1</div>
|
| 113 |
|
| 114 |
<div class="grid-header">
|
| 115 |
<div>BATTER</div>
|
|
|
|
| 123 |
</body>
|
| 124 |
</html>
|
| 125 |
"""
|
| 126 |
+
height = 88 + (len(rows) * 30)
|
| 127 |
components.html(html, height=height, scrolling=False)
|