Skip to content

Commit

Permalink
Graph helper text (#4064)
Browse files Browse the repository at this point in the history
* Graph dashboard: Reset container data if task number is too large

* Add subtitle to relay empty or too many to the user

Co-authored-by: fjetter <[email protected]>
Co-authored-by: Benjamin Zaitlen <[email protected]>
  • Loading branch information
3 people authored Aug 24, 2020
1 parent 5a7eded commit 055bd64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,9 @@ def __init__(self, scheduler, **kwargs):
)

self.root = figure(title="Task Graph", **kwargs)
self.subtitle = Title(text=" ", text_font_style="italic")
self.root.add_layout(self.subtitle, "above")

self.root.multi_line(
xs="x",
ys="y",
Expand Down Expand Up @@ -1471,10 +1474,12 @@ def update(self):
# compoonents to not overload scheduler or client. Once we drop
# below the threshold, the data is filled up again as usual
if len(self.scheduler.tasks) > self.max_items:
self.subtitle.text = "Scheduler has too many tasks to display."
for container in [self.node_source, self.edge_source]:
container.data = {col: [] for col in container.column_names}
else:
# occasionally reset the column data source to remove old nodes
self.subtitle.text = " "
if self.invisible_count > len(self.node_source.data["x"]) / 2:
self.layout.reset_index()
self.invisible_count = 0
Expand All @@ -1490,6 +1495,9 @@ def update(self):

self.patch_updates()

if len(self.scheduler.tasks) == 0:
self.subtitle.text = "Scheduler is empty."

@without_property_validation
def add_new_nodes_edges(self, new, new_edges, update=False):
if new or update:
Expand Down

0 comments on commit 055bd64

Please sign in to comment.