-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature/graph layout #20
Conversation
#9 Backbone model are created from single attiributes/options instance. In order to support instantiation method, i.e. clone, we have to follow this guidelines. Therefore, required step parameter was moved to opts. Additionally, the inheritance of VisualGroup from VisualStep was added according to model's Group->Step inheritance.
New technique creates new temporary graph with all links moved to highest rank child of each adjacent cell. This approach handles the limitation covered in: dagrejs/dagre-d3#261.
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.
Looks very good!
Thank you so much for your "deep derived" effort
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.
Nice trick.
This commit is aimed to support embedded cells during the layout process. A complete graph instead of just cells array is required to make this happen.
In our trick with compound graphs layout links between parent and child is reassigned to some child - child link which will only confuse the layout algorithm. Therefore, such links should be removed from aux graph.
@voidest , could you please provide a full test sample for this fix? i.e. link to a full WDL script and expected results of it's usage. |
1. Dagre resizes nodes with embeds and fitEmbeds, that follows the layout, makes nodes overlap. 2. Layout algorithm does not take into account port captions. Thus, thay may overlap after sorting too. Therefore, we assign the bbox size to our aux graph nodes. These changes required additional constants tweaks.
@sidoruka, this pr does not actually fix any visible issue. It just enables the layouting of some specific compound graphs, which we avoided to use earlier due to dagre limitation. In particular, with these changes we can use group calls (e.g. scatter) with their own ports and connect them to child steps (of course, after proper changes are made in the Model and parser). |
@voidest , ok thanks for clarification. |
General idea
This pull request provides an opportunity to layout compound graphs via jointjs. At the moment the layouting is limited - links to nodes that have embeds were prohibited. Such behavour blocks our features like group steps with their own inputs (e.g. scatter, conditional calls) mentioned in #9. Provided changes allow us to layout diverse compound graphs.
Changes
Refactored Visual Step, Group and Link to fit the Backbone model. This refactoring enabled the usage of standard clone methods and allowed the creation of temporary graph that has modified links. When that temporary graph is arranged, the layout is applied to the elements of the current graph.
NOTE - please let me know before PR will be merged. I have to select suitable package.json version for npm registry.