question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line jumps to visually clarify intersecting lines

See original GitHub issue

We’d like to add support for “line jumps” or “bridges” in order to guide the users’ eye in following intersecting edges, as e.g. below:

image

I’m wondering what would be the best way of implementing them in Sprotty, as an implementation for such line jumps would require awareness of the routes of all edges in a diagram.

Typically, for each SRoutableElement a RoutableView is invoked one after the other, which in turn runs the IEdgeRouter to obtain routes. These routes are then translated into a SVG path by the view. The routes of other edges, however, are not explicitly persistent or available to others during a rendering pass of the entire diagram, neither for the views nor the router. There would have to be a rendering context that is renewed for each rendering pass and that collects the routes of all edges rendered so far so that we could integrate a detection for intersections and subsequently rendering jumps for them. Also, it’d be nice to have these line jumps independently from the actual routers, as those jumps are not necessarily tied to the behavior of a router.

So another way could be to add a IVNodePostprocessor, which could pass through edges and find intersections and replace them with those line jumps. This would be nice because it would be independent of the actual router or even views (to some extent), however it would have to run the registered routers again for the model elements to compute their routes, which is inefficient, and then it would have to fiddle around with the path on SVG level, which seems a bit off too.

@spoenemann What do you think would be the best approach? Thanks a lot for your thoughts on that!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
plangercommented, Jul 21, 2021

FWIW, last year we added support for a new kind of “Jump Links” in GMF Runtime for rendering these intersections. Instead of rendering a semi-circle at the intersection, it simply creates a “gap” in the edge. See https://projects.eclipse.org/projects/modeling.sirius/releases/6.3.1 for a screenshot of what it looks like.

The result can be cleaner visually (IMO) on large diagrams with many intersections.

Thanks for the feedback! Sure that’s also an option.

The proposed implementation already renders a small gap for the line that doesn’t “jump” to avoid actually crossing it (see gif). If you’d want gaps only, we could easily provide an alternative view implementation that renders no jumps and but just a centered gap (see JumpingPolylineEdgeView of my PR).

1reaction
plangercommented, Jun 16, 2021

Finally, I got to work a bit on this issue and have a first prototype. I’ll share the code within the next couple of days. Here is how it looks like (intersections are indicated in the gif below by a red circle): intersection-detection

I use an enhanced version of https://github.com/rowanwins/sweepline-intersections (MIT). I had to change it in a few parts though to allow reporting the edge IDs and segment indizes as well. As it is MIT, I think we could further harmonize this enhancement of that library with the Sprotty types and even include it in Sprotty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add or remove connector line jumps - Microsoft Support
On the ribbon, select Design, in the Layout group select Connectors, and then do the following: To show jumps over crossing lines, select...
Read more >
Setting Line Jumps Options - Visual Paradigm
Visual Paradigm provides four line jumps options to help you to distinguish connectors. Let's learn how to set line jumps options.
Read more >
draw.io Now Supports Line Jumps
Line jumps, also known as edge jumps or bridges, are used to show that lines cross each other, but do not connect. They...
Read more >
How Many Ways Can Two Lines Intersect? - YouTube
Explain Numbers: What is a Number? jStrausMath ... Finding the vector equation for a line that intersects two planes - Linear Algebra -....
Read more >
Connector line jumps in draw.io for Confluence - YouTube
Perhaps to some just a mere styling touch, line jumps in draw.io can help you prevent visual chaos in diagrams with many intersecting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found