Hello,
Is it possible to have nodes at a fixed position, but still taken into the account for the layout of other nodes and links?
The closest option I came across is ‘isLayoutPositioned=false’, but then the node will be ignored by the layout algorithm.
After some research in the forum, I assume such feature is not implemented (yet?).
My intention is to use GoJS to generate our SW architecture documentation for various projects. In each project documentation, some nodes are meant to be fixed at particular position (‘MCAL’ node shall remain at the bottom of the layout, ‘CDD’ node shall remain at the right side etc.). The user shall be able to position any node and to fix its position, but still the layout shall be affected by the node.
What is your Diagram.layout? Could you please give us some examples of what you want after the user has moved some nodes manually and a layout that might happen afterwards?
Ah, so you don’t actually want the moved node to remain exactly where the user moved it – you want that the user has shifted the node to be in a different layer. Is that a better characterization of what you want the user to be able to do?
If so, in the case of LayeredDigraphLayout, that means overriding LayeredDigraphLayout.assignLayers to first call the super method and then update the vertexes to make sure they are in the desired layer.
No, indeed I would like the moved node (“MCAL”) to remain exactly where the user moved it (image #2).
This works nice with option ‘isLayoutPositioned=false’.
But I want the layout to keep this node into account when positioning theother nodes.
In image #3, we see node “CmpC” moved closer to other nodes whereas it should be placed at the left of “MCAL” (my example in image #4, which I made manually).
Note: I have updated the topic title to make it clearer
No, for the same reason that you are unable to precisely describe what the layout should do for all situations. And even if you could, what you would want is likely different from what someone else would want.