4
votes

I have a graph in Cytoscape.js in which users can switch between the default layout (a circle) and the cola layout. I also have a feature where they can search and filter the graph based on the node and edge ids. I want the application to be able to tell what layout the user is currently using and display their results using that layout. I am hiding the elements that do not match their query so I am rerunning the layout, so currently search only works with the layout I am calling with layout.run(). Does anyone know if it is possible to get what layout the graph is currently being displayed with and keep that? The documentation says that the layout is a cytoscape object but I am unsure how I can get that object.

1

1 Answers

0
votes

You should store your app's state in your app, i.e. you should be storing the information you need about the layout when your app runs it.