cylc-ui icon indicating copy to clipboard operation
cylc-ui copied to clipboard

graph: family collapsing

Open oliver-sanders opened this issue 2 years ago • 4 comments

Follow on from #1108

Implement family expand/collapse in the graph view.

In the Cylc 7 graph view families were represented with a special node shape & expansion was available via a right-click menu. When a family was expanded the special node was removed and the tasks it represented were added in its place.

With the Cylc 8 graph view we have more power over rendering so can do something more advanced. One thing I'd like to consider is expanding families into subgraphs so that the family name is preserved which should make graphs easier to understand.

Pull requests welcome!

oliver-sanders avatar Nov 04 '22 16:11 oliver-sanders

Attempt along with https://github.com/cylc/cylc-ui/issues/1280

oliver-sanders avatar Apr 25 '23 12:04 oliver-sanders

For the time being - figure out a means of drawing a dotted box around families.

This can be done with graphviz subgraphs

The graphviz dot code is returned from the getDotCode function in Graph.vue view

Dot code can be rendered with dot foo.dot -Tpng -o foo.png

ultimately in the svg there will need to be a rect tag added... <rect x="" y="" width="" height="">

markgrahamdawson avatar Apr 11 '24 14:04 markgrahamdawson

When turning the dotcode into json objects - if two subgraphs are included with the exact same bounding box then the coordinate data is only contained in the first object

In the image below subgraph cluster_1 and subgraph cluster_2 have the same coordinates so they are not included in the object returned for cluster_2

image

Not sure if this is going to be an issue or not but thought it was worth making a note of.

I think its only really an issue if you wanted to do something along the lines of this... image

markgrahamdawson avatar Apr 19 '24 10:04 markgrahamdawson

Some ideas for a unified approach to grouping/collapsing cycles/families. I'm suggesting unifying the handling of cycles and families (note, cycles represent the "root" family so they are essentially the same thing).

Grouping/Ungrouping - Drawing dashed boxes around a cycle/family.

Collapsing/Expanding - Reducing a family down to a single node.

Limitations of the Cylc 7 approach:

  • Once you expand a family it's gone, the tasks which belong to the expanded family are mixed in with other tasks in the graph, you can not tell what family they belong to. This is an issue if the user wants to examine a component within the workflow.
  • No visibility of the inheritance hierarchy (i.e. what can we expand/collapse).
  • No visibility of what you have expanded/collapsed (i.e. where are we in the hierarchy).

Note, for simplicity, this approach groups/collapses all instances of selected families rather than managing this at a per-cycle level. I think this is probably more aligned with expectations, but does represent a minor limitation, e.g. there's no ability to collapse all but one cycle. The ability to expand/collapse specific cycle instances would be a reasonable enhancement.

Design Sketch

graph-grouping-and-collapsing


Had a quick discussion on this (more to come):

  • Can't really think of a valid use case for collapsing all cycles (users would do this in the tree view if they wanted to), so perhaps treat cycles differently (i.e. collapse per-cycle rather than all cycles) and remove from the menus.
  • Better expand/collapse icon (obviously).
  • The Cylc 7 default of only expanding the cycle point (i.e. show top-level families only) is a reasonable protection for viewing large workflows. We might want to continue with this, or perhaps do something smart (e.g. only collapse families if there are lots of tasks on load).

oliver-sanders avatar May 17 '24 09:05 oliver-sanders