Cytoscape: update node positions not automatically but by clicking on a button

Hello,

I am using cytoscape to display a graph with nodes and edges, which is working well. I am using the algorithm ‘cose’ to choose how to place the nodes. I have a slider that allows the user to add or remove edges in the graph, and I put ‘autoRefreshLayout’ at False in order to not rerun automatically the algorithm when edges are added or removed.

However, I would like to update the positions of nodes with the algorithm ‘cose’ when the user decides to, by clicking on a button or something. Is it possible to do that ? I am sorry, maybe there are similar issues in the forum, but I didn’t find them.

Thank you,