Skip to content

Commit

Permalink
fix hover and place interactive labels below graph
Browse files Browse the repository at this point in the history
  • Loading branch information
juannat7 committed Nov 13, 2024
1 parent f0aaa7e commit 6d990ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions scripts/generate_interactive_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def generate_trace(df, model_name, metric, headline_var, color):
name=f"{model_name} vs. ERA5",
customdata=[f"{metric}-{headline_var}"],
line=dict(width=3, color=color),
visible=(metric == 'rmse' and headline_var == 't-850')
visible=(metric == 'rmse' and headline_var == 't-850'),
hovertemplate="Score: %{y}<extra></extra>"
)


Expand Down Expand Up @@ -57,7 +58,13 @@ def configure_layout(fig, title, metrics, headline_vars):
}],
title=title,
xaxis_title="Number of Days Ahead",
hovermode="x unified"
hovermode="x unified",
legend=dict(
orientation="h",
yanchor="bottom",
y=-0.2,
xanchor="left",
)
)


Expand Down Expand Up @@ -94,7 +101,7 @@ def plot_metrics(metrics, headline_vars, model_names, data_path, output_dir, tit
def main():
"""
Main driver to generate interactive HTML for metrics display
Usage example: `python compute_climatology.py --dataset_name era5 --is_spatial 0`
Usage example: `python generate_interactive_html.py`
"""

output_dir = Path('../website/html')
Expand Down
2 changes: 1 addition & 1 deletion website/html/control.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion website/html/ensemble.html

Large diffs are not rendered by default.

0 comments on commit 6d990ad

Please sign in to comment.