Per hvnx.draw doc staement:
hvPlot NetworkX plotting API is meant as a drop-in replacement for the networkx.draw methods
So I assumed I should be able to simply use the same options for hvnx.draw() as nx.draw(), but it doesn’t work, nx.draw() works, no errors, whereas hvnx.draw() crashes.\
G is a NetworkX Graph with 442 nodes and 790 edges:
options = {
'with_labels': 'True',
'width':weights,
'nodelist': node_size,
'node_size': [node_size[k]*100 for k in node_size],
'edge_color':'lightblue',
'node_color':'red',
'node_shape':'o',
'alpha':0.8,
'font_size':5, #FIXME causing error in hvnx.draw????
'font_color':'grey',
'pos': nx.kamada_kawai_layout(G, scale=100000)
}
nx.draw(G,**options)
hvnx.draw(G,**options)
hvnx.draw errors:
ValueError Traceback (most recent call last)
c:\test-display-HOLOVIZ.ipynb Cell 9 in <cell line: 5>()
1 #USING HVpLOT -PYVIZ
2
3 #draw using prev options
4 #nx_opts =
----> 5 hvnx.draw(G, **options)
File c:\Users\alpha\miniconda3\envs\pyvis-testing\lib\site-packages\hvplot\networkx.py:231, in draw(G, pos, **kwargs)
...
894 )
896 n = self.shape[axis]
897 indexer = maybe_convert_indices(indexer, n, verify=verify)
ValueError: invalid literal for int() with base 10: 'ZTS'
Could it be because my Graph’s index col is made up of strings like ‘ZTS’ vs integers? (keep in mind that is allowed by networkx, per my knowledge)
PS hvnx.draw() works with minimal/no options