Skip to content
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

Merged
merged 8 commits into from
May 12, 2017
Merged

Feature/graph layout #20

merged 8 commits into from
May 12, 2017

Conversation

voidest
Copy link
Contributor

@voidest voidest commented May 5, 2017

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.

Alexey Terentjev added 3 commits May 5, 2017 18:19
#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.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 94.703% when pulling 9724952 on feature/graph-layout into 5537297 on dev.

Copy link
Collaborator

@daniilsavchuk daniilsavchuk left a 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

Copy link
Member

@paulsmirnov paulsmirnov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice trick.

Alexey Terentjev and others added 4 commits May 11, 2017 14:33
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.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.258% when pulling c256a9e on feature/graph-layout into de9992f on dev.

@sidoruka
Copy link
Contributor

@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.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.258% when pulling 36a8b92 on feature/graph-layout into de9992f on dev.

@voidest
Copy link
Contributor Author

voidest commented May 12, 2017

@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).

@sidoruka
Copy link
Contributor

@voidest , ok thanks for clarification.

@sidoruka sidoruka merged commit 81ba15a into dev May 12, 2017
@sidoruka sidoruka deleted the feature/graph-layout branch May 12, 2017 11:48
@sidoruka sidoruka mentioned this pull request May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants