Open mrkatey opened 1 year ago
Hey, If you have a problem with this function you can fix it like this code: ` def draw_graph(G, show_names=False, node_size=1, font_size=10, edge_width=0.5):
adjacency = nx.adjacency_matrix(G)
adjacency = csr_matrix(adjacency)
names = np.array(list(G.nodes()))
graph = Bunch(adjacency=adjacency, names=names)
pagerank = PageRank()
pagerank.fit(adjacency) # Compute PageRank scores
scores = pagerank.scores_
if show_names:
names = [str(name) for name in graph.names]
image = svg_graph(graph.adjacency, font_size=font_size, node_size=node_size, names=names, width=700, height=500, scores=scores, edge_width=edge_width)
else:
image = svg_graph(graph.adjacency, node_size=node_size, width=700, height=500, scores=scores, edge_width=edge_width)
return SVG(image)
`