From e0415451a979066aae4f90e47ec2715ada1247be Mon Sep 17 00:00:00 2001 From: Jacob Tomlinson Date: Wed, 16 Oct 2024 10:05:53 +0100 Subject: [PATCH 1/2] Dashboard worker table fit to page width --- distributed/dashboard/components/scheduler.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/distributed/dashboard/components/scheduler.py b/distributed/dashboard/components/scheduler.py index 3605945abdb..9e5c7979ada 100644 --- a/distributed/dashboard/components/scheduler.py +++ b/distributed/dashboard/components/scheduler.py @@ -4045,7 +4045,7 @@ class WorkerTable(DashboardComponent): "spilled_bytes", } - def __init__(self, scheduler, width=800, **kwargs): + def __init__(self, scheduler, **kwargs): self.scheduler = scheduler self.names = [ "name", @@ -4138,7 +4138,8 @@ def __init__(self, scheduler, width=800, **kwargs): columns=[columns[n] for n in table_names], reorderable=True, sortable=True, - width=width, + width=None, + width_policy="max", index_position=None, **_DATATABLE_STYLESHEETS_KWARGS, ) @@ -4158,7 +4159,8 @@ def __init__(self, scheduler, width=800, **kwargs): columns=[extra_columns[n] for n in extra_names], reorderable=True, sortable=True, - width=width, + width=None, + width_policy="max", index_position=None, **_DATATABLE_STYLESHEETS_KWARGS, ) @@ -4185,7 +4187,7 @@ def __init__(self, scheduler, width=800, **kwargs): x_range=(0, 1), y_range=(-0.1, 0.1), height=60, - width=width, + width=None, tools="", min_border_right=0, **kwargs, @@ -4215,7 +4217,7 @@ def __init__(self, scheduler, width=800, **kwargs): x_range=(0, 1), y_range=(-0.1, 0.1), height=60, - width=width, + width=None, tools="", min_border_right=0, **kwargs, @@ -4626,7 +4628,7 @@ def exceptions_doc(scheduler, extra, doc): @log_errors def workers_doc(scheduler, extra, doc): - table = WorkerTable(scheduler) + table = WorkerTable(scheduler, sizing_mode="stretch_width") table.update() add_periodic_callback(doc, table, 500) doc.title = "Dask: Workers" From 30fec1a74e7aa062a3e5abc26a9c55e17cc174f7 Mon Sep 17 00:00:00 2001 From: Jacob Tomlinson Date: Wed, 16 Oct 2024 10:06:47 +0100 Subject: [PATCH 2/2] Let width values be auto --- distributed/dashboard/components/scheduler.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/distributed/dashboard/components/scheduler.py b/distributed/dashboard/components/scheduler.py index 9e5c7979ada..7824319908b 100644 --- a/distributed/dashboard/components/scheduler.py +++ b/distributed/dashboard/components/scheduler.py @@ -4138,7 +4138,6 @@ def __init__(self, scheduler, **kwargs): columns=[columns[n] for n in table_names], reorderable=True, sortable=True, - width=None, width_policy="max", index_position=None, **_DATATABLE_STYLESHEETS_KWARGS, @@ -4159,7 +4158,6 @@ def __init__(self, scheduler, **kwargs): columns=[extra_columns[n] for n in extra_names], reorderable=True, sortable=True, - width=None, width_policy="max", index_position=None, **_DATATABLE_STYLESHEETS_KWARGS, @@ -4187,7 +4185,6 @@ def __init__(self, scheduler, **kwargs): x_range=(0, 1), y_range=(-0.1, 0.1), height=60, - width=None, tools="", min_border_right=0, **kwargs, @@ -4217,7 +4214,6 @@ def __init__(self, scheduler, **kwargs): x_range=(0, 1), y_range=(-0.1, 0.1), height=60, - width=None, tools="", min_border_right=0, **kwargs,