def network():
global network_graph
try:
graph_json = request.json
except IndexError:
pass
# some network nodes could be removed from the graph to avoid confusing the user
# the graph contains
network_json = loads(graph_json)
G = json_graph.node_link_graph(network_json)
fig = plt.figure()
plt.axis('off')
networkx.draw_networkx(G, node_size=80, node_color='c', font_size=8)
network_graph = BytesIO()
fig.savefig(network_graph, format='png')
# redirect any attempts to non-existing pages to the main page
评论列表
文章目录