Skip to content

Instantly share code, notes, and snippets.

View maciejkos's full-sized avatar
🐼

Maciej Kos maciejkos

🐼
View GitHub Profile
@maciejkos
maciejkos / extract_backbone.py
Created January 31, 2020 22:16 — forked from bagrow/extract_backbone.py
Extract the multiscale backbone of a weighted complex network
#!/usr/bin/env python
# extract_backbone.py
# Jim Bagrow
# Last Modified: 2010-11-18
import sys, os
import networkx as nx
@maciejkos
maciejkos / pyvis_for_networkx.py
Last active March 27, 2023 11:54 — forked from quadrismegistus/pyvis_for_networkx.py
Draw Networkx Graph with Pyvis
def draw_graph3(networkx_graph,notebook=True,output_filename='graph.html',show_buttons=True,only_physics_buttons=False,
height=None,width=None,bgcolor=None,font_color=None,pyvis_options=None):
"""
This function accepts a networkx graph object,
converts it to a pyvis network object preserving its node and edge attributes,
and both returns and saves a dynamic network visualization.
Valid node attributes include:
"size", "value", "title", "x", "y", "label", "color".