'Hide all unselected edges in pyvis network graph

I have built a network graph using pyvis and it's very cluttered, as most of its nodes are connected (like the one on the left image but with more nodes and edges). Is it possible to only display the edges that connect selected nodes in pyvis (something like the right image if the leftmost node is selected)?

EDIT: I found that there are options to tweak the behavior of edges when they are selected in vis.js documentation, but it doesn't seem like I can access these properties through python...

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source