Spaces:
Runtime error
Runtime error
File size: 427 Bytes
231b6fa |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import networkx as nx
from pyvis.network import Network
class ImportsGraphVisualizer:
@classmethod
def visualize(
cls,
imports_graph: nx.Graph,
width: int = 100,
height: int = 100,
display_html_name: str = "nx.html",
):
_pyvis_network = Network(f"{width}%", f"{height}%")
_pyvis_network.from_nx(imports_graph)
_pyvis_network.show(display_html_name)
|