-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix edge containment issue #901
Comments
Further investigation revealed that this is only a problem in elkjs. In the Java tests that the edge will actually be contained in the desired node. Testing the same graph in elkjs does not update the containment. Since bendpoints positions are always relative to the contained node, which is wrong in elkjs, the edge routes look as described in the issues. |
elkjs branch with test https://github.com/kieler/elkjs/tree/sdo/test177 |
@skieffer when implementing this fix, did you use elkjs to test it or did you import a JSON graph in Java? |
Pretty sure I was testing in elkjs. (It was a long time ago, but I found an old workspace that shows some elkjs build steps.) In any case, elkjs 0.8.1 is working perfectly in my application, and in that sense I am testing it all the time. I routinely generate JSON graphs in which hierarchy-crossing edges are defined in locations other than their true containing node. I pass these graphs to elkjs, and when it returns I use the |
Is the online demo page just not using the Here is an example graph that gets a very nice layout in my application, but has messed up edges in the online demo page. |
Okay, so, what to do about hierarchical edges in JSON graphs, for ELK and elkjs? I've gone back and reviewed the issue, and I write up my thoughts. I'm happy to help with coding, updating docs, etc, in resolving this. DefinitionsFor purposes of this discussion:
BackgroundIt seems to be generally agreed that it is inconvenient to force users to figure out for themselves what is the As the docs say, at the very end, under "Edge Containment" (emphasis added):
Indeed, as cases like kieler/elkjs#177 demonstrate, it is normal for users to want to define edges under owners that make more sense to them conceptually, or that work more naturally with their way of generating graphs. For example, in response to the burden of having to move edge definitions to their true container, this comment says:
So, some solution is needed, so that users can define JSON graphs in a way that makes sense, and that will also work with ELK/elkjs. However, unlike users of ELK, who have a chance to call ELK v0.7.xIn ELK v0.7.x, we had the following behavior:
ELK v0.8.xIn 0.8.1 we:
This means that
Current problemselk-liveelk-live has (I think) not been updated to use the I am not really familiar with Sprotty, but it seems that it will interpret edge route points relative to the node that owns the edge? docsThe docs, specifically the pages on have not been updated to say anything about the PossibilitiesOne way to move forward would be to keep the solution introduced in v0.8.1, and update both elk-live and the docs to reflect it. However, since both ELK and elkjs are still at major version I think there are various, competing desires, at least the following two:
As I begin to look at what Sprotty expects, and what elk-live will have to do in order to support v0.8.1, I begin to wonder if the I don't know what other graph drawing frameworks expect, but maybe the easiest thing for most users would be if the coordinates of an edge could be interpreted relative to the edge's owner, not its container (in the senses defined above).
|
Thank you for the detailed answer. I am not quite sure whether we should prefer
Your help is appreciated. I think these will be good additions to elk-live. I will try to contact you next year when I find time to tackle this issue. |
I agree that any of these options could be confusing, but I think that if we carefully manage it so that it is always an "opt-in" situation, then, theoretically, the user has chosen the behavior they are seeing, and they are aware and ready to interpret it correctly.
I think I prefer this as well. Both options have the same net effect that edge coordinates can be interpreted relative to the edge's parent/owner node. But |
In light of #1012, maybe the right thing is to have an In other words, I imagine the entry in the reference might look like this:
What do you think? |
This might be a good idea. I think this might be better than having options that potentially move around an edge in the hierarchy or have a different coordinate. |
See kieler/elkjs#177, kieler/elkjs#204, and others.
The text was updated successfully, but these errors were encountered: