You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I came across the following error when trying to visualize a subgraph of a graph with nk.vizbridges.widgetFromGraph(G):
File ~/.local/lib/python3.10/site-packages/networkit/vizbridges.py:188, in widgetFromGraph(G, dimension, nodeScores, nodePartition, nodePalette, showIds, customSize)
185 hcColors = _calculateNodeColoring(G, palette, nodeScores, nodePartition)
187 foriinG.iterNodes():
--> 188 n = ipycytoscape.Node(data={"id": i, "color": hcColors[i] })
189 nodes.append(n)
191 foru,vinG.iterEdges():
IndexError: list index out of range
It worked a bit better when I changed line 187 to for i in range(G.numberOfNodes()) but it still isn't ideal. I assume it has to do with the fact that subgraphs retain the original node indices from the graph, so my subgraph nodes could be indexed with 40, 41, 42, etc..., whereas hcColors might only have 10 options.
The text was updated successfully, but these errors were encountered:
Hello! I came across the following error when trying to visualize a subgraph of a graph with
nk.vizbridges.widgetFromGraph(G)
:It worked a bit better when I changed line 187 to
for i in range(G.numberOfNodes())
but it still isn't ideal. I assume it has to do with the fact that subgraphs retain the original node indices from the graph, so my subgraph nodes could be indexed with 40, 41, 42, etc..., whereashcColors
might only have 10 options.The text was updated successfully, but these errors were encountered: