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

The Circular layout somehow breaks the links #211

Open
postulkam opened this issue May 10, 2024 · 3 comments
Open

The Circular layout somehow breaks the links #211

postulkam opened this issue May 10, 2024 · 3 comments

Comments

@postulkam
Copy link

Hi,
the Circular layout encounters issues with rerouting links when used after another layout.

When computesBoundsIncludingLinks in a group is set to false and the user changes the layout type in groups, it attempts to change the link routing, but then it reverts them back to the previous layout route, while also laying out the nodes in the group correctly by Circular layout at the same time.
When computesBoundsIncludingLinks in a group is set to true and the user changes the layout type in groups, the Circular layout uses ports from the previous layout, causing the links to come out from the node in the direction of the previous layout, which is unexpected.

GoJS version: 3.0.1
Example with better explanation: https://jsfiddle.net/Mi_Po/8dvgsym2/126/

I noticed that the Circular layout lacks the setsPorts feature that other layout have. Could that be the problem?

@simonsarris
Copy link
Collaborator

Thanks for reporting this. We'll investigate and get back to you.

@simonsarris
Copy link
Collaborator

This has been fixed and will be out with the next release, though it may be some days before we release again, as we just released 3.0.2 yesterday.

Meanwhile, if you need a workaround immediately, you can add this to your code:

go.Group.prototype.ensureBounds = function () {
  const g = this;
  if (g.isSubGraphExpanded) {
    this.memberParts.each((p) => {
      p.ensureBounds();
    });
  }
  go.Node.prototype.ensureBounds.call(this);
};

@postulkam
Copy link
Author

Thank you for your quick response! Unfortunately, I can't figure out how and where to use these functions in my templates.

Meanwhile, I found another workaround - binding for the layout type and setting computesBoundsIncludingLinks to true only for the Cycle layout.

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

No branches or pull requests

2 participants