如何使用同心布局将节点动态添加到cytoscape图 [英] How to dynamically add nodes to cytoscape graph with concentric layout

查看:216
本文介绍了如何使用同心布局将节点动态添加到cytoscape图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过同心布局向Cytoscape图添加节点和边? Cy.add()函数无需初始化样式即可将节点和边线添加到图中。我唯一能做到的,就是每次添加新节点或边时都要构建图

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

推荐答案

添加节点时,它位于您指定的位置-在其位置字段中= nofollow> JSON 。

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.

这篇关于如何使用同心布局将节点动态添加到cytoscape图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆