-
Notifications
You must be signed in to change notification settings - Fork 97
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
How to avoid the layout to change the children order when adding a new node? #122
Comments
Maybe one of the option at http://kieler.github.io/klayjs-d3/examples/interactive/ (mentioned in the README Not sure, kinda lost in what are the available options. I think it might be related to |
I believe you can find (unsatisfying) answers in #100 and the issues linked there. If not, let me know. |
@uruuru Thanks, it "helps". 😅 Is there a way to stop all automation (auto-layout, auto-placement of nodes and edges) anyhow? I believe changing the My ideal world: Having ELK place elements (nodes/edges) as automatically as possible, but not change the placement of things that've been positioned already. If it's not possible, then an alternative might be to disable all auto-placement and implement my own algorithm for this, but I'm not sure either of those 2 options are feasible. |
Other questions:
|
Answers:
In general, no. You can omit parts from the layout process using the
klayjs is the (deprecated) predecessor of elkjs. Hence, yes, it showcases features that should still be part of elkjs.
|
I might be dumb, but I don't get how the Why is it defined as Using |
How do you find options in the documentation? I'm looking at the reference page at https://www.eclipse.org/elk/reference/options.html and can't find options such as It'd be great to have some search feature there. Would you mind sharing the link for the documentation of the node "fixed" you mentioned earlier? I couldn't find it either 😢 |
|
Okay I see, you use https://www.eclipse.org/elk/reference/options.html page to perform searches. So, the Does the "algorithms" (such as https://www.eclipse.org/elk/reference/algorithms/org-eclipse-elk-fixed.html) apply to the layout only, or do they apply to nodes as well? Because you mentioned I could apply a |
Yes, It used to be a legacy id that was still evaluated. The legacy ids have been removed in the last release, though.
A layout algorithm is applied to the children of a node. See this example for an illustration.
I was implicitly referring to "parent nodes", i.e. if you configure |
Thank you, I understand better what I did wrong now. I guess a workaround for my use-case could be to have a global parent node containing all other nodes and edges as children, for those nodes to be able to use a fixed position. It's definitely a workaround, but still might help regarding manual node positioning. |
hi @Vadorequest, how did you ultimately solve this? How can I get in touch with you? Thanks! |
@meoyawn I didn't solve it, nor did I implement a workaround. |
@meoyawn @Vadorequest Were you able to solve it? or did a workaround or anything? |
@im-amir no 😕. I decided it's better to have manual layout by default and auto layout only on demand |
@meoyawn can you please share the link for how you implemented with manual layout? maybe that helps! |
@im-amir I do not, sorry |
How about the solution described here #187 |
I'm using
reaflow
which uses this library.When we add new nodes, the canvas redraw itself and somehow "optimize" things.
While it's nice at the beginning, it can also be confusing. For instance, in the below video, the last node added changes the order of the ascendant nodes (inverts them) and this is highly confusing for the end-user.
Is there a way to configure this behaviour anyhow? It seems to be related to the
LayoutOptions
but I don't understand how I could change the current behavior. Also, the typings for LayoutOptions weren't really useful to me.elkjs/typings/elk-api.d.ts
Line 10 in 76c9203
I plan on making a collaborative editor, I'd need to avoid the graph to "jump" as soon as somebody adds a new node. 😬
Basically, I'd want the graph not to reorder existing children (nodes).
While the order isn't really relevant to me, it's confusing for humans if things jump too often.
Video: https://youtu.be/4JPPXlyoRQ4
Before node added:
After node added:
The text was updated successfully, but these errors were encountered: