Metadata-Version: 2.1
Name: ipysigma
Version: 0.21.1
Summary: A Jupyter widget using sigma.js to render interactive networks.
Home-page: https://github.com/medialab/ipysigma
Author: Guillaume Plique
Author-email: guillaume.plique@sciencespo.fr
License: MIT
Keywords: Jupyter,Widgets,IPython,Sigma,graph
Platform: Linux
Platform: Mac OS X
Platform: Windows
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Framework :: Jupyter
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: ipywidgets (>=7.0.0)
Provides-Extra: examples
Provides-Extra: test
Requires-Dist: pytest (>=4.6) ; extra == 'test'
Requires-Dist: nbval ; extra == 'test'

# ipysigma

A [Jupyter](https://jupyter.org/) widget using [sigma.js](https://www.sigmajs.org/) and [graphology](https://graphology.github.io/) to render interactive networks directly within the result of a notebook cell.

`ipysigma` has been designed to work with either [`networkx`](https://networkx.org/) or [`igraph`](https://igraph.readthedocs.io).

<p align="center">
  <img alt="ipysigma" src="./docs/img/ipysigma.gif">
</p>

## Summary

- [Installation](#installation)
- [Quick start](#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](#)
  - [Sigma](#)
  - [SigmaGrid](#)
- [Using in Google Colab](#using-in-google-colab)

## Installation

You can install using `pip`:

```bash
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:

```bash
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*

```python
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*

```python
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')
```

## Using in Google Colab

If you want to be able to use `ipysigma` on [Google Colab](https://colab.research.google.com), you will need to enable widget output using the following code:

```python
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
```


