pyvis icon indicating copy to clipboard operation
pyvis copied to clipboard

Fixed the node relabling issue

Open ddrous opened this issue 2 years ago • 0 comments

Hi,

You've really created a wonderful library. I'm using it in conjunction with Deep Graph Library (DGL) for my day-to-day operations.

The problem I'm attempting to solve is: How to visualize a graph created with DGL using PyVis? A concrete illustration of the problem with a MWE is presented here.

Given that there is no support to visualize graphs directly issued from DGL (and maybe other graph neural network libraries too), one must go through NetworkX before visualizing the results. A problem occurs as PyVis only accepts ints and strings as node ids. A solution I found is to attempt to convert the node ids to ints or strings when constructing the graphs for visualization in PyVis.

This solution offers a smoother transitions between the frameworks involved, and avoids iteratively re-mapping the node ids (which could be a problem for performance on large graphs).

I don't think this is an issue, rather a possible improvement to PyVis (hence the pull request). Do you find this helpful at all ? Please let me know :)

Cheers, Des

ddrous avatar Jun 26 '22 18:06 ddrous