How to dynamically add nodes to cytoscape graph

心不动则不痛 提交于 2019-12-31 02:35:05

问题


Is there a way to add nodes and edges to Cytoscape graph with concentric layout? Cy.add() function adds the nodes and edges to the graph without the init styling. Only way I can this, is by building the graph everytime I add a new node or edge


回答1:


When you add a node, it is positioned where you specify -- in the position field in its JSON.

If you don't want to manually specify a position, then run a layout. In your specific case, you should probably be running the concentric layout again with the same options.



来源:https://stackoverflow.com/questions/38964733/how-to-dynamically-add-nodes-to-cytoscape-graph

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