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

Implement Junction Finder #434

Merged
merged 8 commits into from
Mar 8, 2024
Merged

Implement Junction Finder #434

merged 8 commits into from
Mar 8, 2024

Conversation

gfontorbe
Copy link
Contributor

@gfontorbe gfontorbe commented Feb 21, 2024

Solves #420

Adds a new feature to find junction points on edges with the same source or target.

Similar to the IntersectionFinder, we provide a ContainerModule that can be loaded when needed in the inversify container.

The JunctionFinder ultimately sets the isJunction flag to true on RoutingPoints where a junction point must be drawn.

The rendering is done in the PolylineEdgeView (and therefore views that inherit this view) in a new function renderFunctionPoints.

They are represented as circles with a class sprotty-junction for easy styling.

Screenshot 2024-02-21 at 10 28 01

Signed-off-by: Guillaume Fontorbe <[email protected]>
@gfontorbe gfontorbe linked an issue Feb 21, 2024 that may be closed by this pull request
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

In which example have you tested the new feature? Maybe we can extend the "Random Graph" example so that some edges are randomly assigned to the same port?

packages/sprotty/src/features/routing/routing.ts Outdated Show resolved Hide resolved
packages/sprotty/src/graph/views.tsx Outdated Show resolved Hide resolved
@gfontorbe
Copy link
Contributor Author

In which example have you tested the new feature? Maybe we can extend the "Random Graph" example so that some edges are randomly assigned to the same port?

I modified the random graph example to fit my needs, I could probably find time to work on modifying the example to include optional junction points

@gfontorbe gfontorbe requested a review from spoenemann February 22, 2024 09:10
Signed-off-by: Guillaume Fontorbe <[email protected]>
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing strange spider webs when I enable port merging:

Screenshot 2024-02-26 at 15 22 34

Do you know what's going on? Is it an issue in the example or in ELK?

@gfontorbe
Copy link
Contributor Author

gfontorbe commented Feb 28, 2024

I'm seeing strange spider webs when I enable port merging:

Screenshot 2024-02-26 at 15 22 34 Do you know what's going on? Is it an issue in the example or in ELK?

That's the same issue that has been reported in #427.

Bend points are not removed so you end up with funky edges. Usually happens when you show/hide junction points several times without reloading the page. First render seems to work fine most of the time on my end.

Signed-off-by: Guillaume Fontorbe <[email protected]>
@gfontorbe gfontorbe requested a review from spoenemann February 28, 2024 14:40
Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gfontorbe gfontorbe merged commit bbc550d into master Mar 8, 2024
2 checks passed
@gfontorbe gfontorbe deleted the gfontorbe/junction-finder branch March 8, 2024 12:56
@spoenemann spoenemann added this to the v1.2.0 milestone Mar 8, 2024
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

Successfully merging this pull request may close these issues.

Junction point edge routing
2 participants