-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N-Distance nodes & edges #3337
N-Distance nodes & edges #3337
Conversation
6f99cfb
to
c061982
Compare
c061982
to
f56d5f4
Compare
aa3a733
to
3e6319c
Compare
3e6319c
to
28071c2
Compare
28071c2
to
14c89bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good! Worked with no issues testing the Cylc UI + UI Server. Question on the response attributes (more out of curiosity, as I'm not using the nodesEdge/nodes for the tree component).
suicide
I believe is a boolean flag to say whether the node is representing a suicide task or not. What is thecond
boolean for? The GraphiQL interface gives no description for that field.
- What about
targetNode
andsourceNode
? They appear to only contain__typename
attribute, which will always beTaskProxy
I guess?
And a note, probably more useful to @MartinRyan, I hacked a bit the Graph.vue
locally to link the data returned from GraphQL and see if it would work with Cytoscape.
I had a few issues with the Graph.vue, and Cytoscape. But the only issue I had with the data returned, was that the edges returned contained nodes that were not in the list of nodes.
I hacked - some more - code to filter edges with nodes missing source
or target
from the list of nodesEdges.nodes
.
Alas, the best that I could get was:
Sometimes 5, sometimes 6 nodes. Which matches with what I normally get in the Tree view as well 🎉
No blocker from me, so +1. Thanks @dwsutherland !
Should we care about negative or zero distance? I tested to make sure the UI wouldn't crash, but it seems like it simply ignores the distance when |
Oh, would be nice to have some docs in GraphiQL too. Here's the But some fields in And Would be nice to have some text describing what the flag does/enables/disables/etc. Thanks! |
@dwsutherland, moved the part about documenting the returned data to: #3340 |
92773ea
to
8e3a015
Compare
Those are edge attributes (not node) .. So they describe something about the nature of the dependency between source and target nodes. (conditional relationship
They are
The only "nodes" that should be missing from the |
@dwsutherland brilliant! Thanks for the answers! I've still got some more homework to learn more about GraphQL 😞 but getting there! |
The boolean for "conditional dependency" is used to style edges differently (hollow arrow-head) in Cylc 7. |
8e3a015
to
609b129
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments. I am half way through looking at the changes by 👀.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now eyeballed the changes. Will have a go testing the branch tomorrow.
609b129
to
f5e976d
Compare
f5e976d
to
4fa6de0
Compare
4fa6de0
to
164bc02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problems found in playing with the branch, or seen today in the code ... LGTM 👍
That's three approvals. |
These changes close #3248
Accompanying UI Server PR: cylc/cylc-uiserver#70
Changes:
NodesEdges
: type and query added to the GraphQL schema.edges
field added to thePbTaskProxy
nodes: for efficient resolution of thenodesEdges
query.resolvers
now use the native data-store map structure, instead of theentire_workflow
protobuf message (attributes and lists), so all resolvers that useid
to directly retrieve data (not root queries) should be faster (in theory).BaseResolvers
class created: Contains all resolvers for import and/or use by both WS an UIS, with localResolvers
class inheriting this.get_nodes_edges
resolver created: (inBaseResolvers
) to gather the data elements fornodesEdges
query resolution.Resolver & Query
The resolver works by filtering for root or starting nodes with similar filter args as
taskProxies
:the one new argument is
distance
which, inline with graph theory, is the number of edges (in shortest path) between two nodes... To the resolver,distance
is how many iterations of the following:root/new nodes
(distancen-1
).new edges
.new edges
toedges
(edges should be unique).new nodes
(nodes should be unique after use of difference).new nodes
tonodes
.n
Notes:
distance
defaults to 1, a value of zero (or negative values) return the root nodes only, the algorithm will keep going until either:distance
is reachedBecause sets and set operations are used, then when new edges meet, the search won't overlap.. Only new node edges are used...
The GraphQL query looks like:
(nodes having
taskProxy
fields)Example:
Take the following suite:
The above query yields
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.