A Jupyter widget using sigma.js to render interactive networks.
Project description
ipysigma
A Jupyter widget using sigma.js and graphology to render interactive networks directly within the result of a notebook cell.
ipysigma
has been designed to work with either networkx
or igraph
.
Summary
- Installation
- Quick start
- TODO: Examples
- TODO: Available visual variables
- TODO: What can be used as visual variable
- TODO: Visual variables and kwarg naming rationale
- TODO: Frequently asked questions
- TODO: API Reference
- Using in Google Colab
Installation
You can install using pip
:
pip install ipysigma
You will also need to install either networkx
or igraph
of course.
If you are using an older version of Jupyter, you might also need to enable the nbextension likewise:
jupyter nbextension enable --py --sys-prefix ipysigma
# You might need one of those other commands
jupyter nbextension enable --py --user ipysigma
jupyter nbextension enable --py --system ipysigma
Quick start
Using networkx
import networkx as nx
from ipysigma import Sigma
# Importing a gexf graph
g = nx.read_gexf('./my-graph.gexf')
# Displaying the graph with a size mapped on degree and
# a color mapped on a categorical attribute of the nodes
Sigma(g, node_size=g.degree, node_color='category')
Using igraph
import igraph as ig
from ipysigma import Sigma
# Generating a graph
g = ig.Graph.Famous('Zachary')
# Displaying the graph with a size mapped on degree and
# a color mapped on node betweenness centrality, using
# the a continuous color scale named "Viridis"
Sigma(g, node_size=g.degree, node_color=g.betweenness(), node_color_gradient='Viridis')
Examples
Frequently asked questions
How can I display more labels?
TODO...
Using in Google Colab
If you want to be able to use ipysigma
on Google Colab, you will need to enable widget output using the following code:
from google.colab import output
output.enable_custom_widget_manager()
Remember you can always install packages in Colab by executing the following command in a cell:
!pip install networkx ipysigma
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ipysigma-0.22.0.tar.gz
.
File metadata
- Download URL: ipysigma-0.22.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029af95e49b7cead8ca7fd767a8116dd51c04cc12032e27e13d433e4143c082a |
|
MD5 | 0813c967f6e9889284c40e01b008dff8 |
|
BLAKE2b-256 | 51841e760bd09427567f1385ab8134d5d18a2b476621fcb21e33a619ba099adc |
File details
Details for the file ipysigma-0.22.0-py2.py3-none-any.whl
.
File metadata
- Download URL: ipysigma-0.22.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05271ed92483601f394f3049e174bd50057419a9ec4623a93eb3e37803061b58 |
|
MD5 | 1522b725a313622f7342f6789e038c27 |
|
BLAKE2b-256 | 4a3f404f4f277439e64409d0d649f726b50e37f5cf7381d8d27d73928a07ee1c |