https://github.com/cytoscape/cytoscape-jupyter-widget
Cytoscape.js based network visualizer for Jupyter Notebook
Science Score: 20.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: scholar.google -
✓Committers with academic emails
2 of 5 committers (40.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.2%) to scientific vocabulary
Repository
Cytoscape.js based network visualizer for Jupyter Notebook
Basic Info
Statistics
- Stars: 37
- Watchers: 11
- Forks: 14
- Open Issues: 25
- Releases: 0
Metadata Files
README.md
CyJupyter (cytoscape-jupyter-widget)
Overview
CyJupyter is a simple interactive network visualizer for Jupyter Notebook. For additional features and capabilities, we recommend you try the new ipycytoscape package instead.
Limitations
CyJupiter is not supported in JupyterLab. There is another visualizer specifically created for JupyterLab:
- https://github.com/idekerlab/cy-jupyterlab
This package is still under development, but we will add more features to it and release the final version once the JupyterLab extention API is finalized.
Introduction
With the CyJupyter widget, you can easily visualize network data in JSON / Python Dict using the built-in Cytoscape.js visualizer.

About Cytoscape
Cytoscape is a de-facto standard software for biological network analysis and visualization. It has a rich ecosystem for network analysis and visualization, and this Jupyter Widget is part of it. It was developed for biologists, but it core functions are domain-independent and you can use it for all types of network data.
In addition, you can use it from Jupyter Notebook via CyRest API. Since you are interested in Jupyter Notebook environment, combination of Jupyter, CyJupyter, and Cytoscape Desctop with CyREST will be a very powerful workbench for your network analysis workflows.
If you want to interactively edit (large) networks, create PDF/SVG, try the Cytoscape Desktop. It can read/write CX / Cytoscape.js JSON files and many standard network file formats. Please visit here for more information.
Status
- 10/10/2018 - First public version released (0.2.0)
Quick Start
```bash
pip install cyjupyter jupyter nbextension enable --py --sys-prefix cyjupyter jupyter notebook ```
Features
CyJupyter is a simple data visualization widget, but yet very powerful tool once you understand its engine, Cytoscape.js.
- Interactive network visualization using Cytoscape.js
- Full support for Cytoscape.js compatible Styles
- Mapping data points to color, size, shape, etc.

(Fig. 1: Betweenness cetrarity is mapped to node size, edge width, and node opacity)
- Support for complex network structures, including compound nodes

(Fig. 2: Network with hierachical struture, visualized as Compound Nodes)
- Support for built-in automatic layouts (circle, grid, cose, etc.)
- Support for Cytoscape.js and CX JSON formats
- You can easily converted network data from/to these formats using popular network analysis libraries, such as NetworkX
- Adjustable cell size
- Custom background

(Fig. 3: Network visualization with custom background using CSS gradient)
- Can be used with popular network analysis tools, such as NetworkX

(Fig. 4: Network generated with NetworkX, visualized with CyJupyer)
Installation
From PyPI
To install this widget, use pip:
```bash
Install the widget from PyPI repository
pip install cyjupyter
Enable it
jupyter nbextension enable --py --sys-prefix cyjupyter ```
Install from source
For a development installation (requires npm),
bash
$ git clone https://github.com/idekerlab/cytoscape-jupyter-widget.git
$ cd cytoscape-jupyter-widget
$ pip install -e .
$ jupyter nbextension install --py --symlink --sys-prefix cyjupyter
$ jupyter nbextension enable --py --sys-prefix cyjupyter
How to use the widget
Once you install this widget, you can use it by importing it to your notebook:
python
from cyjupyter import Cytoscape
Cytoscape is the only Class in this Widget. Basic usage is:
python
Cytoscape(data=network_data, format=cx)
where data is the actual network data in Python Dictionary or List (for CX) and format is the network data format name.
Supported Data Format
Currently, this Widget supports two network formats:
- cyjs - Cytoscape.js JSON
- cx - Cytoscape network eXchange format (CX)
If you have data in JSON file, you can use Python's standard json library to convert it into Python Dict/List.
Cytoscape.js JSON
The data should be in the following format:
json
{
"elements": {
"nodes":[],
"edges": []
}
}
for more information about this data model, please visit Cytoscape.js web site.
CX JSON Array
This is always a JSON Array and is a fairly complex data format, but you can use this Python library to simplify your work:
Also, for network biologists, NDEx is a great resource. All data sets are availabe in CX format.
Internally, it uses Cytoscape.js as the rendering engine, and if you provide your data in Cytoscape.js format, it is the most efficient way yo visualize your data. If you provide your data as CX, the Widget automatically convert the data into Cytoscape.js compatible data structure and then visualizes it.
Examples
The best way to learn this widget is actually visualize some network data. Please try this notebook to learn how to use this widget.
API Reference
(TBD)
- data
- format
- style
- background
- layout_name
- layout
License
Questions / Bugs / Feature Requests?
Please use GitHub Issue Tracker.
© 2018 Keiichiro ONO
University of California, San Diego: Trey Ideker Lab / The Cytoscape Consortium / National Resource for Network Biology
Owner
- Name: Cytoscape Consortium
- Login: cytoscape
- Kind: organization
- Website: http://www.cytoscape.org/
- Repositories: 153
- Profile: https://github.com/cytoscape
GitHub Events
Total
Last Year
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 21
- Total Committers: 5
- Avg Commits per committer: 4.2
- Development Distribution Score (DDS): 0.286
Top Committers
| Name | Commits | |
|---|---|---|
| Keiichiro Ono | k****o@g****m | 15 |
| rpillich | r****h@u****u | 3 |
| Dexter Pratt | d****t@A****l | 1 |
| Max Franz | m****z@g****m | 1 |
| Alexander Pico | a****o@g****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 11
- Total pull requests: 20
- Average time to close issues: 12 minutes
- Average time to close pull requests: 4 months
- Total issue authors: 9
- Total pull request authors: 2
- Average comments per issue: 0.91
- Average comments per pull request: 0.2
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 19
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- iwatobipen (2)
- kozo2 (2)
- alex-wenzel (1)
- sshameer (1)
- jingjingbic (1)
- iamjli (1)
- SylvainCorlay (1)
- llambourne (1)
- jamad (1)
Pull Request Authors
- dependabot[bot] (19)
- rpillich (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- 504 dependencies
- css-loader ^0.28.7 development
- file-loader ^0.11.2 development
- rimraf ^2.6.2 development
- style-loader ^0.18.1 development
- webpack ^3.5.5 development
- @jupyter-widgets/base ^1.2.2
- cytoscape ^3.2.17
- cytoscape-cx2js ^0.2.2
- lodash ^4.17.4
- 503 dependencies