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

Edges don't want to be orthogonal #204

Open
pavelvasev opened this issue Nov 29, 2022 · 10 comments
Open

Edges don't want to be orthogonal #204

pavelvasev opened this issue Nov 29, 2022 · 10 comments
Labels

Comments

@pavelvasev
Copy link

pavelvasev commented Nov 29, 2022

Describe the bug
I try to paint hierarchical view of my program using edges with rectangular routing (e.g. orthogonal).
For some reason edges often are painted as "straight" lines crossing nodes.
I tried to change "edgeRouting" option to "ORTHOGONAL", "SPLINE" and "POLYLINE" but with no effect.

Example graph: https://github.com/viewzavr/vrungel/blob/main/libs/dump2elk/graph.json

Expected behavior
I expect edges will be T-shaped, e.g. not diagonal but orthogonal (thus parallel to X and Y axes).
Expected: outlined with green pixels on the screenshot.
Current: outlined with red.

Screenshots
Screenshot from 2022-11-29 17-45-27

ELK Version
0.8.1 (launched from https://rtsys.informatik.uni-kiel.de/elklive/json.html)

Additional context
By the way in ELK 0.8.1. strange behavior appears, marked with yellow. Some edges become crazy, with their shapes going far from connected nodes. In versions of ELK < 0.8.1. there is no such strange behaviour.

Many thanks in advance!

@pavelvasev pavelvasev added the bug label Nov 29, 2022
@skieffer
Copy link

@pavelvasev , can you say what are the ids of the endpoints of the edges that are getting the crazy routing highlighted in yellow? I'm trying to determine if this might be related to #177 , but can't make out the ids from the image.

@pavelvasev
Copy link
Author

Dear @skieffer , the id of crazy edge of the stated graph highlighted on the screenshot with yellow is:

  • /root/_feature_3/tv//root/_feature_3/tv/4_4:edge_0

Some other crazy edges are:

  • /root/_feature_3/tv//root/_feature_3/tv/3_3:edge_0
  • /root/_feature_3/tv//root/_feature_3/tv/7_7:edge_0
  • /root/_feature_3/tv//root/_feature_3/tv/5_5:edge_0

@pavelvasev
Copy link
Author

Dear @skieffer, may be you may suggest me some ELK options to make lines not diagonal (red), but orthogonal to screen axes (green)?

Or may be you may suggest some GUI-based software where I may load JSON with elkjs-graph and try changing options in WYSIWYG mode? I tried to specify a lot of them in json, about ~20, and failed to achieve a solution for my task.

@soerendomroes
Copy link
Member

You need to set "hierarchyHandling": "INCLUDE_CHILDREN" if you have edges that span multiple hierarchies.

@pavelvasev
Copy link
Author

pavelvasev commented Dec 2, 2022

Wow, @soerendomroes thank you very much!!!!! It seems that option is what I need. Thank you!

BTW the system still behaves strange, but it seems related to the bug that was noted above. What is interesting, I get the following picture same on all current versions from 0.3.0 to 0.8.1. (I use the same graph as posted above plus an option for hierarchyHandling)
image

@soerendomroes
Copy link
Member

This may be a containment issue as already mentioned above. Do you have a minimal example were this occurs and I might be able to look into this?

@pavelvasev
Copy link
Author

pavelvasev commented Dec 6, 2022

Dear @soerendomroes here I prepared an example: small graph with strange diagonal edge. Is it what you asked for?

image

@skieffer
Copy link

skieffer commented Dec 6, 2022

Although I don't understand the software nearly as well as @soerendomroes , I will continue to chime in, as I'm interested in understanding this problem.

QUESTION: Among the following options, which is actually the desired routing for this edge?

Option 1: Take the example linked above, and revert the layout to version 0.7.1:

Screen Shot 2022-12-06 at 18 31 58

or

Option 2: Keep version 0.8.1, but move the edge definition up two levels, like this, resulting in:

Screen Shot 2022-12-06 at 18 35 33

or

Option 3: Something else

@pavelvasev
Copy link
Author

pavelvasev commented Dec 8, 2022

In my own taste, it should be option 3, like this (green line):
image

But at least option 2 looks not so bad too. @skieffer thank you for pointing that different edge placement in hierarchy entails different results in paintings. That is surprising for me - may try to use it to hack the system to obtain better results.. Thanks!

@skieffer
Copy link

skieffer commented Dec 8, 2022

that different edge placement in hierarchy entails different results in paintings

At the moment it does, yes, but I still think this is not supposed to be the case. That is what this comment is all about.

One change in v0.8.1 is that now, no matter where you define an edge in the JSON, its proper containment is computed for you. In other words, it shouldn't matter where the edge is defined -- at least as far as containment is concerned.

However, as the examples we've looked at above clearly show, the place where an edge is defined still does matter, in terms of the routing you get. So, something other than containment must be affecting this routing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants