-
Notifications
You must be signed in to change notification settings - Fork 7
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
New graph layout algorithm + ELK layout engine #5
Conversation
Closing and reopening to re-trigger CI. |
Ah - just took a peek at the failing tests from the CI build - I didn't realize they were there & my changes likely broke them because I changed which |
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.
Can you confirm that lib/elkjs
is an exact unaltered copy of elkjs
? Since the license here is the Eclipse license and it is weak copy left, we need to be sure this is unaltered or we'd need to change the fprime_visual license to Eclipse too...
@LeStarch yes that's correct, all of the files in Looking at it again, we may not need to include the |
Works nicely! |
This PR adds a new layout method for graphs which uses the open source ELK/elkjs graph layout library.
I've attached slides from a presentation I gave to the F' team describing the rationale for this effort: FPrimeVisualELKPresentation.pdf.
In short, this enables intelligent graph layout and edge routing, so that graphs may be rendered with fewer confusing visual artifacts, such as connection lines overlapping each other or drawn on top of boxes. Example old layout:
New layout:
Notes
src/fprime_visual/flask/static/js/renderers/render-elk.js
elkjs
is really the only dependency, I decided to just include a bundled version of it in our repo (insrc/fprime_visual/flask/static/js/lib/elkjs
) rather than introducenpm
dependency management.import
statements for more predictable scoping etc.render
function, so we can add additional future layouts with this pattern if we want.Future work
Things I didn't get to...
config
option passed to the renderer. The user should also be able to select between the different available color themes, which already exist.Please let me know if you have any questions, happy to discuss it further. Thanks!