Python 3.x 如何悬停网络节点属性(在python 3.5下使用bokeh和networkx)
我使用networkx和bokeh生成了一个交互式网络图。我希望节点的属性在鼠标悬停在节点上时悬停 我用了密码Python 3.x 如何悬停网络节点属性(在python 3.5下使用bokeh和networkx),python-3.x,attributes,nodes,networkx,bokeh,Python 3.x,Attributes,Nodes,Networkx,Bokeh,我使用networkx和bokeh生成了一个交互式网络图。我希望节点的属性在鼠标悬停在节点上时悬停 我用了密码 layout = nx.spring_layout(network, k=1.1/sqrt(network.number_of_nodes()), iterations=100) from bokeh.models import ColumnDataSource nodes, no
layout = nx.spring_layout(network,
k=1.1/sqrt(network.number_of_nodes()),
iterations=100)
from bokeh.models import ColumnDataSource
nodes, nodes_coordinates = zip(*sorted(layout.items()))
nodes_xs, nodes_ys = list(zip(*nodes_coordinates))
nodes_source = ColumnDataSource(dict(x=nodes_xs,
y=nodes_ys,
name=nodes,
))
但是,我在网络数据中也有一些节点属性。我想悬停这些节点属性。
有人可以帮忙吗?请查阅项目文档。有一个用户指南