class_docstr: Dynamic graph layout during computation
  
  This assigns (x, y) locations to all tasks quickly and dynamically as new
  tasks are added.  This scales to a few thousand nodes.
  
  It is commonly used with distributed/dashboard/components/scheduler.py::TaskGraph, which
  is rendered at /graph on the diagnostic dashboard.
code: def __init__(self, scheduler):
      self.name = f"graph-layout-{uuid.uuid4()}"
      self.x = {}
      self.y = {}
      self.collision = {}
      self.scheduler = scheduler
      self.index = {}
      self.index_edge = {}
      self.next_y = 0
      self.next_index = 0
      self.next_edge_index = 0
      self.new = []
      self.new_edges = []
      self.state_updates = []
      self.visible_updates = []
      self.visible_edge_updates = []
  
      if self.scheduler.tasks:
          dependencies = {
              k: [ds.key for ds in ts.dependencies]
              for k, ts in scheduler.tasks.items()
          }
          priority = {
              k: ts.priority for k, ts in scheduler.tasks.items()
          }
          self.update_graph(
              self.scheduler,
              tasks=self.scheduler.tasks,
              dependencies=dependencies,
              priority=priority,
          )
  
file_path: distributed/distributed/diagnostics/graph_layout.py
imports: from __future__ import annotations
  import uuid
  from distributed.diagnostics.plugin import SchedulerPlugin
  from distributed.utils import TupleComparable
label_desc: Use image node_id 1 to create a new GraphLayout object from inherited base classes: SchedulerPlugin with example: obj = GraphLayout(scheduler)