cylc / cylc-ui

Web app for monitoring and controlling Cylc workflows
https://cylc.github.io
GNU General Public License v3.0
37 stars 27 forks source link

Graph View #74

Closed kinow closed 1 year ago

kinow commented 5 years ago

The GraphQL data model is stable now, so we can create the initial views for the Vue.js app. The first one will be the Graph View, listing all the tasks found in the task pool.

It is important to list all the tasks, without filtering at this point.

It is also important to simulate the change in the tasks, as we need to confirm that the view can be used with a dynamic graph.

While other web interfaces may be used as reference, there are things in the Cylc 7 GUI that can be used for the initial implementation, like the task colors.

kinow commented 5 years ago

write mocked data

Python has a project called vcrpy: https://github.com/kevin1024/vcrpy, which I believe was based on the Ruby vcr: https://github.com/vcr/vcr.

And like the VCR, you can use it to record HTTP request/responses. It is used to record interactions client-server, and replay them later (like a VCR). Which is useful when writing integration tests for web applications.

Looks like there are JS ports too:

So we should be able to start a suite with some tasks and interaction (e.g. the old complex found in the tutorial or examples of Cylc 7 I think). That suite also takes a while to complete.

And then change the existing SuiteService to return the current workflow state. And write a setTimeout call, to advance the state every 5 or 10 seconds.

EDIT: moved to #77

oliver-sanders commented 5 years ago

he first one will be the Graph View

I would strongly advise implementing the Tree View first. It is the simplest view and for most users [here at least] it is "the Cylc GUI".

kinow commented 5 years ago

Cylc 7 Graph view:

gcylc-graph-and-dot-views

To the right of the screen shot, is the Dot view.

oliver-sanders commented 5 years ago

tldr; From a quick look I think dagre.js with a custom presentation layer is probably the way to go but some further research would be a good idea. Performance is likely to be poorer than the Cylc7 graphviz approach.

The graph view is a combination of:

I summarised the requirements of the layout and presentation layers and performed some analysis back in September.

kinow commented 5 years ago

That's an excellent and extremely helpful feedback!

I think dagre.js with a custom presentation layer is probably the way

Will do some further research, but having one option to start with is really helpful.

Performance is likely to be poorer than the Cylc7 graphviz approach.

Agreed. Though we may have more resources than with a desktop client, like caching in multiple on server and/or client.

I summarised the requirements of the layout and presentation layers and performed some analysis back in September

A ha, I remembered seeing that somewhere, but couldn't remembered where. I am hoping to have something to show in June and collect more requirements and constraints in person.

But if you have more pointers or links to share, please keep them coming :-D

oliver-sanders commented 5 years ago

But if you have more pointers or links to share, please keep them coming :-D

I think that's everything important, the only other bits I can think of which are/will-be in sketchups anyway:

hjoliver commented 5 years ago

Performance is likely to be poorer than the Cylc7 graphviz approach.

I'm hoping we can get around this problem by no longer displaying the full graph (at least not by default, for suites that are sufficiently big). For really big suites the full graph is not just slow, it's also useless as a monitoring and control interface. (Static visualization - like cylc graph - is another matter, because performance is less relevant there).

hjoliver commented 5 years ago

(I like the mini-map idea).

kinow commented 5 years ago

Re-assigning to @MartinRyan :+1:

Martin, not sure if you will be doing a small test project first, or changing directly here in cylc/cylc-ui. If the latter, this may be helpful I think:

If you have suggestions for improvements, feel free to file new issues. I created the current architecture/design without thinking too much, as I wanted to test other things (does it work with graphql? cors? what we needed for tornado. how much JS or TS would be helpful. etc).

Hope that helps Bruno

hjoliver commented 5 years ago

On graph edges etc.: https://cylc.discourse.group/t/meeting-notes-ui-workflow-views-and-graphql/44

oliver-sanders commented 5 years ago

Here is a quick dump of the work I had done on the graph view prior to Melbourne:

hjoliver commented 5 years ago

Efficient methods and readily customizable libraries for managing complexity of large networks - uses Cytoscape.js

(Same but better?): https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0197238

Outputs:

MartinRyan commented 5 years ago

https://github.com/cylc/cylc-ui/issues/187#issuecomment-547179333 expand and collapse

hjoliver commented 5 years ago

There is a Vue app for visualising CWL workflows:

And an all SVG library here:

oliver-sanders commented 5 years ago

(note this is a static SVG visualisation, interesting to learn from)

hjoliver commented 4 years ago

(Chat room convo on dagre edge routing):

the layout engine (dagre) will have to generate enough control points - and in the right places - to enable the renderer to make nice curves out of them. So the jury is still out IMO.

I would think edge routing layout (control point positions) might be as hard or harder than node layout.

A-ha: https://github.com/dagrejs/dagre/issues/239

Edge routing seems to be a bit extreme:...

That is an artifact of the Brandes-Kopf layout algorithm. I've gone over it a few times and believe it is working as expected. It would be interesting to someday to use the network simplex solution from graphviz, which would not have this problem, but would be slower.

Not a blocker obviously, but a bit disappointing. Most of the Cylc 8 UI is going to look like beautiful eye candy compared to the old GUI - but it seems we can't get graphs that look as good! (hierarchical ones, at least).

Context: dagre layouts seem to look a bit cheap compared to graphviz, because of sub-par edge routing.

hjoliver commented 4 years ago

(From meeting discussion and chat room)

hjoliver commented 4 years ago

Graphviz in the browser:

hjoliver commented 4 years ago

Notes from @oliver-sanders in Element chat:

A bit of investigation work:

  • I think the plan is now try to try an SVG implementation probably using Dagre as the layout engine. I wrote a quick demo a while back which went some way to suggesting that the performance of SVG in-browser should be sufficient, however, it would be good to confirm that. Our graph will potentially involve a lot of SVG elements (shapes, task icons, text, arrows), what's the scaling?
  • I'm guessing we would have to go with the SVG 1.1 standard?
  • SVG supports the concept of element re-use which could potentially be a big win for performance so it would be worth looking into whether/how that might work for the graph nodes.
  • Can we avoid re-implementing the task/job icons (would be good to share the same component with HTML/SVG).
  • Styling, I guess we would do this via CSS by modifying the class of SVG objects?
  • How best to implement arrows in SVG (SVG line endings are pretty useless 😠).
  • Finally the graph layout engine, Cytoscape provided us with not only the GUI but also the graph layout engine abstraction layer, which was really rather useful. It would be well worth investigating whether we can steal this or if there are other libraries which support it as this would save us having to individually implement different layout engines.
hjoliver commented 4 years ago

Graph library for interactive CWL editor: https://github.com/rabix/cwl-svg/

oliver-sanders commented 2 years ago

Review 2022:

Not a whole lot has changed, the front-runners remain:

ColemanTom commented 1 year ago

I think https://cylc.github.io/cylc-doc/latest/html/7-to-8/caveats.html#browser-based-ui needs updating as this Issue is closed?