From ed8ec9e96b7143f8be8ea82a7b3d21ace3e4bd95 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 27 Jan 2026 14:18:29 -0800 Subject: [PATCH] Simplify code to handle x-axis custom range --- dashboard/utils.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dashboard/utils.py b/dashboard/utils.py index 315d6432..2e822bff 100644 --- a/dashboard/utils.py +++ b/dashboard/utils.py @@ -360,21 +360,21 @@ def hover_section(title, cols, hover_data): ) # ---------------------------------------------------------------------- # figures style - if parameters_show_all[key]: - fig.update_xaxes( - exponentformat="e", - title_text=key, - row=this_row, - col=this_col, - ) - else: - fig.update_xaxes( - range=(parameters_min[key], parameters_max[key]), - exponentformat="e", - title_text=key, - row=this_row, - col=this_col, - ) + custom_range = ( + [None, None] + if parameters_show_all[key] + else [ + parameters_min[key], + parameters_max[key], + ] + ) + fig.update_xaxes( + range=custom_range, + exponentformat="e", + title_text=key, + row=this_row, + col=this_col, + ) # A bit of padding on either end of the y range so we can see all the data. padding = 0.05 * (global_ymax - global_ymin)