How to reload graph in cytoscape.js?

孤街醉人 提交于 2019-12-01 05:23:46

问题


Is there a function that resets the graph to it's freshly loaded state? I've tried cy.reset() but that just resets zoom and pan, not restoring to the virgin graph.

Also is there a way to restore all removed elements?

Thanks!


回答1:


Call cy.elements().remove() and cy.add() with the same graph data.



来源:https://stackoverflow.com/questions/18391899/how-to-reload-graph-in-cytoscape-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!