I would like to display node attributes when visualized with pyvis.
import networkx
import obonet
G = obonet.read_obo('https://ftp.ebi.ac.uk/pub/databases/chebi/ontology/chebi_core.obo')
# Create smaller subgraph
H = nx.ego_graph(G, 'CHEBI:36464', 15)
H.nodes['CHEBI:24669']
>>> {'name': 'p-block molecular entity', 'subset': ['3_STAR'], 'def': '"Amain group molecular entity that contains one or more atoms of a p-block element." []', 'is_a': ['CHEBI:33579'], 'relationship': ['has_part CHEBI:33560']}
This is the data that I would like to show. For example name
.
Then I plot the graph using pyvis:
from pyvis.network import Network
nt = Network('1500px', '1500px', notebook=True)
nt.from_nx(H)
nt.show('H.html')
And this is how the graph looks:
As you can see only the node labels are shown.