-
Notifications
You must be signed in to change notification settings - Fork 159
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
fix: allow HierarchicalLayout
to manage circular dependencies
#233
fix: allow HierarchicalLayout
to manage circular dependencies
#233
Conversation
…ph creaation using HierarchlyLlayout.ts
Hi @Franz-Ritter did you try to add automatic tests as I suggested in the issue? This would reproduce the initial problem and show that is now fixed. |
Hi @tbouffard, Sorry I oversaw your comment. I try to find time to check how you structure your tests, and add one to the PR as requested. |
@tbouffard I added a test which creates a cyclic Graph and a non-cyclic graph. If you have any questions or need more input, please let me know. Applying that fix on the code base would help me a lot. Atm i am forced to package and link the change locally. |
@tbouffard Do you need some additional input? |
Hi @Franz-Ritter |
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.
@Franz-Ritter It's all good to me. Thanks
- ✔️ reproduce the issue with newly introduced tests (prior the fix is applied)
- ℹ️ I push directly some lint fixes in the branch of this PR
HierarchicalLayout
to manage circular dependencies
Summary
Solved bug creating a graph with a circular dependency using the HiearchlLayout.ts algorithm.
Check this issue for more detailed information including an example to reproduce the bug
Solution:
Uncomment the isAncestor method GraphHierachyNode, which is used by HiearchlLayout. The uncommented implementation makes sure, that a circular dependency is detected and resolved. Using the default isAncestor does not work at this point, because the parent nodes of the child nodes in the graph are not set.
Closes #231