Is it possible to show a colorbar next to the graph returned by hvnx.draw(). In my panel application, I’ve got a graph which has different colors assigned to edges and nodes bases on some attributes. Is there a way to display a colormap to indicate the value of the edge or an edge label.
G = nx.Graph()
G.add_edge('a', 'b', weight=0.6)
G.add_edge('a', 'c', weight=0.2)
G.add_edge('c', 'd', weight=0.1)
G.add_edge('c', 'e', weight=0.7)
G.add_edge('c', 'f', weight=0.9)
G.add_edge('a', 'd', weight=0.3)
G.add_node('a', size=20)
G.add_node('b', size=10)
G.add_node('c', size=12)
G.add_node('d', size=5)
G.add_node('e', size=8)
G.add_node('f', size=3)
pos = nx.spring_layout(G) # positions for all nodes
hvnx.draw(G, pos, edge_color='weight', edge_cmap='viridis',
edge_width=hv.dim('weight')*10, node_size=hv.dim('size')*20)
This code is from link NetworkX — hvPlot 0.8.2 documentation
Thank you.