adelhpour / SBMLNetwork

SBMLNetwork is a library designed to enable software developers and systems biologists to interact with the graphical representation of SBML (Systems Biology Markup Language) models.
MIT License
0 stars 2 forks source link

Auto-layout #61

Closed sanast22 closed 2 months ago

sanast22 commented 2 months ago

Is there a way to save an auto-layout that I like, and continue to set my model to that layout?

adelhpour commented 2 months ago

My suggestion would be to save the SBML model and load it again. you can use 'save' function and pass a file_name to it as an argument to save to your desired directory and file. Then, you can load it by passing the file_name as an argument to the 'load' file. Have you tried it before and looking for something different, or it is just the one you were looking for?

sanast22 commented 2 months ago

Makes sense! I just noticed some auto-layouts that I liked more than others, so wanted to keep track of those.

adelhpour commented 2 months ago

The best you can do now is saving the SBML model of those you like and loading them again to continue working on them. Another thing that might be helpful is passing the 'locked_nodes' parameter to autolayout function. Just pass the id of the nodes you want to be fixed as a list to the autolayout function and then they won't move once the function is called again.