添加一天内发帖热图

This commit is contained in:
NY 2025-03-05 11:21:37 +08:00
parent 60bbbd40d0
commit 3f36d5b781

View File

@ -114,18 +114,6 @@ def render_tab_content(tab, selected_dates, interval, time_zones, days_to_displa
hovertemplate='%{y} %{x} EST<br>Tweets: %{z}<extra></extra>' hovertemplate='%{y} %{x} EST<br>Tweets: %{z}<extra></extra>'
)) ))
# Add time zone annotations if selected
if 'PST' in time_zones:
pacific_2am_est = (2 + 3) * 60 // interval
pacific_7am_est = (7 + 3) * 60 // interval
fig.add_vline(x=pacific_2am_est, line_dash="dash", line_color="blue", annotation_text="CA 2AM PST")
fig.add_vline(x=pacific_7am_est, line_dash="dash", line_color="blue", annotation_text="CA 7AM PST")
if 'CST' in time_zones:
central_2am_est = (2 + 1) * 60 // interval
central_7am_est = (7 + 1) * 60 // interval
fig.add_vline(x=central_2am_est, line_dash="dash", line_color="green", annotation_text="TX 2AM CST")
fig.add_vline(x=central_7am_est, line_dash="dash", line_color="green", annotation_text="TX 7AM CST")
if tab in ['line', 'one_day_heatmap']: if tab in ['line', 'one_day_heatmap']:
fig.update_layout( fig.update_layout(
title=f'{"Line" if tab == "line" else "One-Day Heatmap"} Tweet Frequency (Interval: {interval} minutes, EST, {len(selected_dates)} days)', title=f'{"Line" if tab == "line" else "One-Day Heatmap"} Tweet Frequency (Interval: {interval} minutes, EST, {len(selected_dates)} days)',