如何使用NetworkX Spring_Layout使Bokeh的'PointDrawTool'工作

时间:2019-05-13 01:19:13

标签: python bokeh networkx

我正在使用NetworkX和Bokeh处理网络节点图。我正在使用NetworkX的spring_layout为每个节点自动生成位置。但是,我无法弄清楚如何在图上拖动节点(并且边缘也随拖动的节点一起移动)。

如何为NetworkX / Bokeh图启用节点拖动?

我尝试使用Bokeh的“ PointDrawTool”工具,即使该工具在图形旁边的工具栏中呈现并显示,也无法使用。

codes_as_list

我希望节点是可拖动的。我想单击一个节点并将其拖动以使其更改位置。

2019年5月14日编辑: 我的进口货:

list

1 个答案:

答案 0 :(得分:0)

来自:https://discourse.bokeh.org/t/networkx-import-and-pointdrawtool/3512

"The proximate cause of the problem is that the tool requires access to
 glyph.x.field and glyph.y.field but both of these are null for the Circle node
 renderer. The GraphRenderer is the only example of a “composite” renderer, so it’s
 entirely possible (probable) that there is some interaction problem specific to it
 with the PointDrawTool. The next appropriate step would be to make a bug report
 issue on GitHub 5 with details."

如果他们解决了,那就太好了。