Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1938,6 +1938,8 @@ class TaskGraph(DashboardComponent):
def __init__(self, scheduler, **kwargs):
self.scheduler = scheduler
self.layout = GraphLayout(scheduler)
if "graph_layout_name" in kwargs:
self.layout.name = kwargs.pop("graph_layout_name")
scheduler.add_plugin(self.layout)
self.invisible_count = 0 # number of invisible nodes

Expand Down Expand Up @@ -3400,7 +3402,11 @@ def tasks_doc(scheduler, extra, doc):

def graph_doc(scheduler, extra, doc):
with log_errors():
graph = TaskGraph(scheduler, sizing_mode="stretch_both")
graph = TaskGraph(
scheduler,
sizing_mode="stretch_both",
graph_layout_name="graph-doc-graph-layout",
)
doc.title = "Dask: Task Graph"
graph.update()
add_periodic_callback(doc, graph, 200)
Expand Down
4 changes: 3 additions & 1 deletion distributed/dashboard/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
TaskStream, 100, n_rectangles=1000, clear_interval="10s"
),
"/individual-progress": individual_doc(TaskProgress, 100, height=160),
"/individual-graph": individual_doc(TaskGraph, 200),
"/individual-graph": individual_doc(
TaskGraph, 200, graph_layout_name="indiv-graph-layout"
),
"/individual-groups": individual_doc(TaskGroupGraph, 200),
"/individual-group-progress": individual_doc(TaskGroupProgress, 200),
"/individual-workers-memory": individual_doc(WorkersMemory, 100),
Expand Down
4 changes: 1 addition & 3 deletions distributed/diagnostics/graph_layout.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import uuid

from .plugin import SchedulerPlugin


Expand All @@ -14,7 +12,7 @@ class GraphLayout(SchedulerPlugin):
"""

def __init__(self, scheduler):
self.name = f"graph-layout-{uuid.uuid4()}"
self.name = "graph-layout"
self.x = {}
self.y = {}
self.collision = {}
Expand Down