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

Fix node overlap issue by skipping the original node from AutoLayout repositioning #11414

Merged
merged 3 commits into from
Mar 2, 2021

Conversation

zeusongit
Copy link
Contributor

Purpose

Wider nodes tend to overlap the parent node, the fix is to include the parent node in the auto layout group, and then restrict original node's repositioning to prevent jumping effect.

Problem:
node_placement_bug

Fix:
ovrlp2

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.

Reviewers

@DynamoDS/dynamo

@QilongTang
Copy link
Contributor

Seems in certain case, it is still covering a little bit. More testing on the way
SliderAutoComplete

@QilongTang
Copy link
Contributor

This solution does come with an advantage that if user autocomplete not based on the order of the ports, they will see our auto layout clean up the sequence of the nodes for them instead of have the two result nodes mingled..
image

/// <summary>
/// This method pushes changes from the GraphLayout.Graph objects
/// back to the workspace models, but only for nodes placed by NodeAutocomplete.
/// </summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

Both versions of the function are missing comments for input params, do you mind adding them back?

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

LGTM with one comment. By comparing this solution with the other one by @aparajit-pratap, I see advantage for both. Due to the following reasons, I would like to ship this one for now:

  • Node auto complete no longer depending on the order of the ports
  • This solution is a bit simpler although less precise on the right amount to move, but do deliver a solution with less maintaining cost

@zeusongit zeusongit merged commit 6c94345 into DynamoDS:master Mar 2, 2021
@aparajit-pratap
Copy link
Contributor

IMHO this solution is not clean as it tampers with the original graph layout algorithm by adding a condition that if laying out for node-auto complete then do this other layout logic. Also, the placement of the nodes is not clean either as the nodes are placed on the top of the given node and not alongside it. I'm not sure if @Amoursol has any opinion on this but that's just me. Furthermore, I proposed a solution that I was hoping that the Morpheus team could take and continue working on/refining but it's unfortunate that no such attempt has not been made.

zeusongit added a commit to zeusongit/Dynamo that referenced this pull request Mar 2, 2021
zeusongit added a commit that referenced this pull request Mar 2, 2021
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.

4 participants