-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Bending of edge from source #49
Comments
Hey @adarshsuresh12, thanks for reporting! To give you a bit of context on why this is happening: This package uses a path-finding algorithm behind the scenes. It works by generating a 2D grid representation of the graph, with "free" and "occupied" cells, and then it "walks" through these cells using A-star. The problem is, path-finding is very resource intensive, so treating every pixel on screen as a possible free/occupied cell would have made this Edge terribly slow. My solution was to work with 10x10 pixel cells instead of individual pixels by default, so the problem scope is 10x smaller. You can actually control the cell size with the So, what you're seeing as a "bend" in the edge at this position, is the edge being drawn to the start of one of those cells before it follows the computed path. To fix this, I'd need to add edge cases for the start/end of the computed path, which I didn't have the time to implement. It's similar to the issue described here: #45 As a palliative measure in the meantime, you could try to either decrease the |
@tisoap maybe you can just update the function that returns from to |
@brootle I'm happy to take pull requests! |
My solution, create a custom drawEdge method ( the same as the default ones) and set the first and last paths X positions to be the same as the next/prev ones, here are my options:
it works like a charm and there is no bend anymore |
Describe the Bug
The edge seems to have a bend when it origins from the source. After that it's coming as expected (I tried for smooth step edge). Is there any way to avoid that? Please help me out here
Even if you check in the codesandbox example(not mine) given below, you will be able to see the issue
Minimal Example
https://codesandbox.io/s/old-rgb-k9buls
Steps to Reproduce the Bug or Issue
Expected behavior
Expected to see no bend. If the line is a straight line, from the source itself, it should be straight
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: