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

GridRouter.routeEdges outputs reversed paths? #327

Open
alexzherdev opened this issue Dec 18, 2021 · 0 comments
Open

GridRouter.routeEdges outputs reversed paths? #327

alexzherdev opened this issue Dec 18, 2021 · 0 comments

Comments

@alexzherdev
Copy link

I'm running into unexpected results when calling routeEdges and am trying to understand whether it works as expected or not. When called on a simple but particular graph layout, one of the edges returned from routeEdges is directed the wrong way (from target to source). One thing I can see that sets this particular edge apart is that its segments have their .i properties reversed:

0: (2) [{…}, {…}, edgeid: 0, i: 1]
1: (2) [{…}, {…}, edgeid: 0, i: 0]

Debugging through the code, this is the only edge that gets .reversed set to true in orderEdges, so while it starts off correct, it later gets incorrectly reversed in unreverseEdges.

I did see this comment in the code:

// warning: edge paths may be reversed such that common paths are ordered consistently within bundles!

Is that what's happening? If so, should I unreverse the edge myself based on the .i values? I looked through examples invoking routeEdges but none of them take this into account.

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

1 participant