Cytoscape position ignored if locked: false
Asked Answered
U

1

0

When I add a position property on a node, it is ignored unless I also specify locked: true. I would like to specify initial positions on some nodes, yet still allow the user to move those nodes around.

Related (I think) - is there a way to let Cytoscape use a layout to determine node positions, then do a second pass and change them for any nodes that have a position property specified? It would also work to have the layout ignore or not process any nodes that have positions specified. That's what currently happens when I have locked set to true, but I'd like for it to happen if I have locked set to false on a node.

Perhaps another solution would be, how can I manually alter the positions after the layout is finished rendering?

Unhorse answered 6/12, 2016 at 21:27 Comment(0)
A
0

Don't run a layout on nodes you don't want moved. Note that you have a layout specified in the init options.

Use preset at init, and make your own explicit cy.layout() and/or eles.layout() calls. (The preset layout acts pretty much like a nop if all you specify is { name: 'preset' }.)

Or keep your existing workflow and just unlock the nodes when the layout is done.

Absentminded answered 7/12, 2016 at 16:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.