-
Notifications
You must be signed in to change notification settings - Fork 22
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
Different direction within the graph #27
Comments
You can have a separate layout direction for every hierarchy level. You can add layout options to every node of the graph as well. In the example below, see the
Usually this can be done using the
By row you mean to the left of Some further notes on your specified layout options. There's no need to change
|
Thanks for the quick help @uruuru! I eventually did figure out that the feedbackEdges option did the job within a layer, and cheers for clearing up some of the other options. I was using interactive, since I was trying to specify the order in which the nodes appear (using incremental X/Y values), but I've landed at a bit of a different configuration now: var defaultOptions = {
edgeRouting: 'POLYLINE',
direction: 'RIGHT',
crossMin: 'LAYER_SWEEP',
nodeLayering: 'NETWORK_SIMPLEX',
nodePlace: 'BRANDES_KOEPF',
fixedAlignment: 'BALANCED',
cycleBreaking: 'GREEDY',
spacing: 25,
borderSpacing: 35,
algorithm: 'de.cau.cs.kieler.klay.layered',
feedBackEdges: false,
layoutHierarchy: true
}; I've come a bit further now, essentially, I'm trying to automatically draw the following diagram: With Klay, I've been able to draw the following: One observation I've made, at least for the example above, is that I would like to be able to specify several directions for a given node. Specifically, I'd like edges within the same hierarchy/layer to be routed leftwards/rightwards, while edges between hierarchies would be routed upwards/downwards. I.e. these should go leftwards:
but the ones that cross hierarchies should go upwards/downwards
Is the only way of achieving this by specifying ports for every edge that crosses hierarchies? |
I'm not completely sure how the hierarchical edges are treated internally if they are not in accordance with the layout direction. Maybe @le-cds can comment on this. |
Sorry, this is quite an old ticket... Anyway, forcing two nodes that are part of different parents to be in the same layer is not possible since each parent has its own layering. The only thing that could perhaps be done here is to set the layout direction to SOUTH in the top-level graph, but that doesn't work with ELK Layered's hierarchical mode, which in turn will cause the hierarchy-crossing edges to not be laid out properly. |
Thanks for developing this library, its potential is huge!
I've been playing around with the options, and I'm wondering if it's possible to use multiple directions within the same layout?
I.e. in the following example:
The root level direction (between Chippy.. and Namespace) would ideally be downwards, then the direction within them should be rightwards, this way it'd be evenly spaced out down/rightwards.
The same goes for the edges, i.e. is it possible to have the edge from 'dqw' to 'Method 1' route to the left, so it doesn't have to go all the way around?
Lastly, I was wondering if it's possible to have 'Deb' show up on the same row as 'Method 1' and 'dqw'?
Thanks! My options are:
The text was updated successfully, but these errors were encountered: