Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yworks/yfiles-jupyter-graphs

The home of the Jupyter notebook graph visualization widget powered by yFiles for HTML
https://github.com/yworks/yfiles-jupyter-graphs

diagrams graphs igraph jupyter-notebook jupyter-notebooks jupyterlab neo4j networkx nodes-2022 python visualization widget

Last synced: about 2 hours ago
JSON representation

The home of the Jupyter notebook graph visualization widget powered by yFiles for HTML

Awesome Lists containing this project

README

        


yFiles Graphs for Jupyter logo

[![PyPI - Version](https://img.shields.io/pypi/v/yfiles-jupyter-graphs?label=pypi%20package&color=%234c1)](https://pypi.org/project/yfiles-jupyter-graphs/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/yfiles-jupyter-graphs)](https://pypi.org/project/yfiles-jupyter-graphs/)

A graph diagram visualization widget for Jupyter Notebooks and Labs powered by [yFiles for HTML](https://www.yworks.com/yfiles-overview?utm_campaign=yfiles4jupyter&utm_source=github&utm_medium=readme).

Easily visualize graphs from various sources: [Networkx](https://networkx.org/)✅, [igraph](https://igraph.org/python/)✅, [neo4j](https://pypi.org/project/neo4j/)✅, [pygraphviz](https://pygraphviz.github.io/)✅, and any structured Python dictionaries and lists. Many more formats supported indirectly via [Networkx imports](https://networkx.org/documentation/stable/reference/readwrite/index.html#reading-and-writing-graphs)!

The widget is supported in the default Jupyter environments, but also in other environments like VS Code or Google Colab.

[![yFiles Graphs for Jupyter](https://raw.githubusercontent.com/yWorks/yfiles-jupyter-graphs/main/screenshots/yfiles-jupyter-graphs.gif)](https://player.vimeo.com/video/715615671)

Try the [Introduction](https://github.com/yWorks/yfiles-jupyter-graphs/blob/main/examples/01_introduction.ipynb) notebook on Google Colab [here](https://colab.research.google.com/github/yWorks/yfiles-jupyter-graphs/blob/main/examples/01_introduction.ipynb).

## `yfiles-jupyter-graphs-for-neo4j`

For working with Neo4j databases, we
built [yfiles-jupyter-graphs-for-neo4j](https://github.com/yWorks/yfiles-jupyter-graphs-for-neo4j/), an open-source
extension on top of `yfiles-jupyter-graphs`. This extension provides an easier Python interface for the
driver and allows direct configuration of data mappings depending on the label or type of the node or relationship.

So if you are planning to use the extension with Neo4j databases, consider
using [yfiles-jupyter-graphs-for-neo4j](https://github.com/yWorks/yfiles-jupyter-graphs-for-neo4j/).

## Supported Environments
- [JupyterLab or Jupyter Notebook](https://jupyter.org/)
- [Visual Studio Code](https://code.visualstudio.com/)
- [Google Colaboratory](https://colab.research.google.com/)
- [Google Vertex AI Workbench](https://cloud.google.com/vertex-ai)
- [Google Dataproc](https://cloud.google.com/dataproc)
- [Azure Machine Learning Studio Notebooks](https://azure.microsoft.com/en-us/products/machine-learning/)
- [Amazon SageMaker](https://aws.amazon.com/sagemaker/)
- [Kaggle](https://www.kaggle.com)
- Just try it in your preferred platform for Jupyter notebooks

## Requirements
- [python](https://www.python.org/) >= 3.6
- [jupyter](https://jupyter.org/install) notebook or lab
- [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) >= 7.6.0

## Installation

If you already have Jupyter installed, just `pip install` the prebuilt extension from the [Python Package Index](https://pypi.org/).

```bash
pip install yfiles_jupyter_graphs
```

If you want to start clean and get a fresh new Jupyter Lab with the widget readily installed and available, you can use [`docker`](https://www.docker.com/), too:

Form a shell, create a docker image that contains all that is required:

```bash
mkdir yfiles-jupyter && cd yfiles-jupyter
echo -e "FROM jupyter/scipy-notebook\nRUN pip install yfiles-jupyter-graphs" > Dockerfile
docker build -t yfiles-jupyter-graphs-on-docker .
```

(the above has been tested successfully with `scipy-notebook:lab-3.4.7` and `yfiles-jupyter-graphs==1.2.1`), but we want to make sure that it will also work with upcoming versions - file an issue if it doesn't work for you!)

You can then create a fresh new instance of your server from this image like so:

```bash
docker run -it -p 8888:8888 --name yfiles-jupyter yfiles-jupyter-graphs-on-docker
```

## Usage

In a notebook which has the wiget installed in the server, in a Python cell, you can then do this:

```python
"""Execute in jupyter notebook or jupyter lab"""
from yfiles_jupyter_graphs import GraphWidget
# shows empty widget
GraphWidget()
```

You can find the full documentation [here](https://yworks.github.io/yfiles-jupyter-graphs/).

## Features


neighborhood sidebar
See Node Neighborhood
Open In Colab
layouts
Choose Graph Layout
Open In Colab


data sidebar
Investigate Nodes or Edges Data
Open In Colab
search sidebar
Search for Nodes or Edges
Open In Colab


importer
Import Graph Data
Open In Colab
element color mapping
Make Data Dependent Property Changes
Open In Colab


heat mapping
Define a Heatmap Background
Open In Colab
leaflet mapping
Use a Map Background
Open In Colab


nested graph
Visualize nested data
Open In Colab

For example code look [here](https://github.com/yWorks/yfiles-jupyter-graphs/tree/master/examples).

### Google Colab Examples
You can try the [example notebooks](https://github.com/yWorks/yfiles-jupyter-graphs/tree/master/examples) in Google Colab by
opening GitHub notebook URL: `https://colab.research.google.com/github/yWorks/yfiles-jupyter-graphs/blob/main/examples/`.

For example the [Introduction](https://github.com/yWorks/yfiles-jupyter-graphs/blob/main/examples/01_introduction.ipynb) notebook:

https://colab.research.google.com/github/yWorks/yfiles-jupyter-graphs/blob/main/examples/01_introduction.ipynb

## Documentation
You can find the documentation [here](https://yworks.github.io/yfiles-jupyter-graphs/).

## Code of Conduct
This project and everyone participating in it is governed by the [Code of Conduct](https://github.com/yWorks/yfiles-jupyter-graphs/blob/master/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code.
Please report unacceptable behavior to [[email protected]](mailto:[email protected]).

## Feedback
This widget is by no means perfect.
If you find something is not working as expected
we are glad to receive an issue report from you.
Please make sure to [search for existing issues](https://github.com/yWorks/yfiles-jupyter-graphs/search?q=is%3Aissue+repo%3AyWorks%2Fyfiles-jupyter-graphs&type=issues) first
and check if the issue is not an unsupported feature or known issue.
If you did not find anything related, report a new issue with necessary information.
Please also provide a clear and descriptive title and stick to the issue templates.
See [issues](https://github.com/yWorks/yfiles-jupyter-graphs/issues).

## Dependencies
- [yFiles for HTML](https://www.yworks.com/yfiles)
- [@ctrl/tinycolor](https://github.com/scttcper/tinycolor)
- [@jupyter-widgets/base](https://github.com/jupyter-widgets/ipywidgets)
- [@mdi/js](https://github.com/Templarian/MaterialDesign-JS)
- [Vue](https://vuejs.org/)
- [vue-json-viewer](https://github.com/chenfengjw163/vue-json-viewer)

## License
See [LICENSE](https://github.com/yWorks/yfiles-jupyter-graphs/blob/main/LICENSE.md) file.