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

How to make links always attach to nodes orthogonally #417

Open
Phloog opened this issue Feb 21, 2024 · 5 comments
Open

How to make links always attach to nodes orthogonally #417

Phloog opened this issue Feb 21, 2024 · 5 comments

Comments

@Phloog
Copy link

Phloog commented Feb 21, 2024

If I'm using the Smooth PathGenerator with nodes without anchors, the links often attach to the node tangentially, not orthogonally:

image

How can I change this so that the links always attach orthogonally to the border of the node?

@zHaytam
Copy link
Collaborator

zHaytam commented Feb 24, 2024

Hello, can you show in that same screenshot how you want them to be? I'm afraid I don't understand what you mean

@Phloog
Copy link
Author

Phloog commented Feb 26, 2024

Hey, I tried to mock the desired behaviour:

image

The point being that all links leave their nodes orthogonally, not tangentially (see yellow markers and red links).

This becomes even more apparent it there are Arrows etc. at the ends of the links. If the links attach to the nodes tangentially, as in the first screenshot (yellow markers), the arrowheads don't point to the nodes, but sideways.

@zHaytam
Copy link
Collaborator

zHaytam commented Feb 26, 2024

Oh, I see now! It does look very ugly with arrowheads, you're right.

If you know your way around SVG/paths, you could try to create a custom path generator that returns the links the way you want them, until I have the chance to try to fix them myself

@Phloog
Copy link
Author

Phloog commented Feb 26, 2024

I'll have a look, thanks!

@Phloog
Copy link
Author

Phloog commented Mar 8, 2024

Hi, unfortunately I didn't manage to fix the link routing yet. What I found was that maybe the desired behaviour can be achieved without touching the routing logic, but instead by changing the rotation value on the anchors itself - am I right? This may be a bit easier to do.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants