Skip to content

Commit 46ed9dd

Browse files
committed
UI tweaks
1 parent c2fa3c7 commit 46ed9dd

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

main.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
TZ_UTC = ZoneInfo("UTC")
2929
TZ_PACIFIC = ZoneInfo("America/Los_Angeles")
3030

31+
DATETIME_FORMAT = "%a %b %d %H:%M (Pacific)"
32+
"""Format used when formatting datetimes."""
33+
3134
FEET_PER_METER = 3.28
3235

3336
NUM_FORECASTS = 145 # 1 + 24 * 6 hours
@@ -330,7 +333,7 @@ def main(
330333

331334
ax.set_ylim(0)
332335
ax.set_ylabel("Significant wave height (ft)")
333-
ax.set_xlabel("Pacific Time")
336+
ax.set_xlabel("Time (Pacific)")
334337
ax.legend(loc="upper right")
335338
ax.grid(linestyle=":")
336339

@@ -367,19 +370,19 @@ def main(
367370
plot_dir.mkdir(parents=True, exist_ok=True)
368371
for hour_i in tqdm(range(NUM_FORECASTS)):
369372
pacific_time = analysis_date_pacific + datetime.timedelta(hours=hour_i)
370-
pacific_time_str = pacific_time.strftime("%a %b %d %H:%M PT")
373+
pacific_time_str = pacific_time.strftime(DATETIME_FORMAT)
371374

372375
img.set_data(wave_height_ft[hour_i])
373376
update_arrows(arrow_heading_rad[hour_i], lats=lats, lons=lons, arrows=arrows, latlon_idxs=arrow_latlon_idxs)
374377

375-
plt.title(f"Significant wave height (ft) and primary wave direction\nHour {hour_i:03} ({pacific_time_str})")
378+
plt.title(f"Significant wave height (ft) and primary wave direction\nHour {hour_i:03} -- {pacific_time_str}")
376379
plt.savefig(plot_dir / f"{hour_i}.png")
377380

378381
# Get current time
379382

380383
now_utc = datetime.datetime.now(tz=TZ_UTC)
381384
now_pacific = now_utc.astimezone(tz=TZ_PACIFIC)
382-
now_pacific_str = now_pacific.strftime("%a %b %d %H:%M PT")
385+
now_pacific_str = now_pacific.strftime(DATETIME_FORMAT)
383386

384387
# Export HTML
385388

wavey/templates/index.html.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
margin-bottom: 1em;
2424
}
2525
input[type="range"] {
26-
width: 480px;
26+
width: 640px;
2727
max-width: 100%;
2828
}
2929
</style>
@@ -56,7 +56,7 @@
5656
{{ swell_graph }}
5757
</div>
5858

59-
<div><i>Last updated: {{ last_updated }}</i></div>
59+
<div><i>Last updated: {{ last_updated }}</i></div>
6060
<div><a href="https://github.com/kevinddchen/wavey">Github</a></div>
6161

6262
</body>

0 commit comments

Comments
 (0)