-
Notifications
You must be signed in to change notification settings - Fork 239
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
Curved arrows #337
Comments
With straight arrows and reusing the existing code as much as possible*: https://github.com/notEvil/force-graph/tree/i337 * the first proposal replaced rotation using sin cos with normal vectors. It should be faster since sin and cos are more complex. |
The final proposal: https://github.com/notEvil/force-graph/tree/i337-2 Compared to the others:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
you probably know about this issue and that there isn't really a good solution to it (at least I couldn't find one): depending on link curvature and curve length, arrows look disconnected from nodes/links and get stretched/compressed.
I tried to fix it and eventually implemented curved arrows:
https://github.com/notEvil/force-graph/tree/curved_arrows
Bezier.getLUT()
is used to better approximate the relationship between distance andt
, andBezier.normal()
to bend arrows. Arrows on heavily curved links look strange of course, but this is easy to avoid by enforcing an upper limit on the curvature. If you really dislike the bend, its not difficult to draw them straight (let arrows look disconnected from links).The text was updated successfully, but these errors were encountered: