-
Notifications
You must be signed in to change notification settings - Fork 23
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
arrow_shift = :end works poorly with larger edge width #171
Comments
Do you mean the problem that the arrow is not really pointy anymore? Unfortunately that cannot be fixed by moving the arrowhead, as the underlying thick edge is drawn all the way to the center of the node position (as can be seen by choosing a transparent node Color, really ugly!). So we'd need to define new endpoints for the "edge lines", which do not coincide with the node position... |
If you move the arrows, they're not actually pointy, but it looks like a pointy is just behind the state, which to my eye is aesthetically fine. But I agree that the best fix would be to move the endpoints for the edge lines. Shouldn't it be pretty straightforward to move the endpoint to wherever the arrow ends up when using |
While I'm at it, maybe we should set the default endpoint to the edge of circle to allow for transparent nodes? |
Yes, internally the
That would be great! Unfortunatley, curvy lines, potential 3d plots, different node shapes and different canvases (dataspace vs. pixelspace) make it quite complex to calculate the intersection between node "surface" and edge path in general. @hdavid16 put quite some effort into the |
OK so it sounds like there's interest in a PR. I will first look into whether it's possible to straightforwardly apply the existing code for arrow positioning to also position the end of the line. I'll test curvy and straight lines, but I think I'll restrict myself to 2d (also true for the current |
The main code that calculates the edge of the destination node to land the arrowhead on its surface is: Lines 747 to 781 in 804da2d
You should be able to calculate the new endpoint for the edge in a similar fashion. However, note that this get's complicated with non-circular nodes: #115 |
better edges when arrow_shift = :end (fixes #171)
Here's an example with edge width 4.
Automatically handling this is probably too much to ask. But perhaps we could have an argument that allowed us to fine-tune the positions starting with
arrow_shift = :end
? I think the correct way to handle this would be to simply move the end point of the arrow by some fixed pixel value, (I don't think it should scale with the radius of the destination node).The text was updated successfully, but these errors were encountered: