Skip to content
Interactive network visualization in Python and Dash, powered by Cytoscape.js
Branch: master
Clone or download
mkcor Merge pull request #53 from plotly/dev
utils.Tree: Backward Compatibility, add properties props and edge props, remove add_child
Latest commit 5f19ee7 May 3, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Add new test runs to config, update flake8/pylint Mar 4, 2019
.github Update import statement `import dash_cytoscape` -> `import dash_cytsc… Jan 27, 2019
assets Add CSS file for testing purposes Jan 18, 2019
dash_cytoscape Use sentinel value rather than evaluation in condition Apr 25, 2019
demos Update gallery section of README.md and demos/README.md (#54) Apr 9, 2019
src Remove selected nodes after they are deleted (#49) Apr 5, 2019
tests Update test requirements to the latest Mar 8, 2019
.babelrc Added Cytoscape component, not working yet Aug 7, 2018
.eslintignore Added Cytoscape component, not working yet Aug 7, 2018
.eslintrc Added Cytoscape component, not working yet Aug 7, 2018
.gitignore Adding option to load external layouts (#46) Mar 31, 2019
.npmignore Add venv to npmignore Jan 25, 2019
.prettierrc Added Cytoscape component, not working yet Aug 7, 2018
.pylintrc Added Cytoscape component, not working yet Aug 7, 2018
CHANGELOG.md Log method removal in release notes Apr 25, 2019
CODE_OF_CONDUCT.md releasing v0.0.1 (#10) Nov 3, 2018
CONTRIBUTING.md Release v0.0.5 (#39) Mar 8, 2019
LICENSE Updated Readme Oct 25, 2018
MANIFEST.in Patch v0.1.1 - Fix error where dash_cytoscape.utils cannot be imported ( Apr 6, 2019
README.md Add CI status badge Apr 25, 2019
_config.yml Set theme jekyll-theme-cayman Apr 23, 2019
_validate_init.py Files added by dash-component-boilerplate refactoring Jan 18, 2019
package.json Patch v0.1.1 - Fix error where dash_cytoscape.utils cannot be imported ( Apr 6, 2019
requirements.txt Adding option to load external layouts (#46) Mar 31, 2019
setup.py Release v0.0.5 (#39) Mar 8, 2019
usage-advanced.py Optimize Imports for demos Jan 27, 2019
usage-elements.py ❄️ flake8 + pylint on usage apps Mar 4, 2019
usage-events.py Add 2 new demos, reoganize README, update Cytoscape wrapper default v… Apr 3, 2019
usage-stylesheet.py ❄️ flake8 + pylint on usage apps Mar 4, 2019
usage.py ❄️ Flake 8 on usage.py Feb 28, 2019
webpack.config.js Files updated by dash-component-boilerplate refactoring Jan 18, 2019
webpack.dev.extra.config.js Adding option to load external layouts (#46) Mar 31, 2019
webpack.prod.extra.config.js Adding option to load external layouts (#46) Mar 31, 2019
webpack.serve.config.js Added Cytoscape component, not working yet Aug 7, 2018
yarn.lock Adding option to load external layouts (#46) Mar 31, 2019

README.md

Dash Cytoscape GitHub license PyPi Version

CircleCI

A Dash component library for creating interactive and customizable networks in Python, wrapped around Cytoscape.js.

usage-stylesheet-demo

Getting Started

Prerequisites

Make sure that dash and its dependent libraries are correctly installed:

pip install dash dash-html-components

If you want to install the latest versions, check out the Dash docs on installation.

Usage

Install the library using pip:

pip install dash-cytoscape

Create the following example inside an app.py file:

import dash
import dash_cytoscape as cyto
import dash_html_components as html

app = dash.Dash(__name__)
app.layout = html.Div([
    cyto.Cytoscape(
        id='cytoscape',
        elements=[
            {'data': {'id': 'one', 'label': 'Node 1'}, 'position': {'x': 50, 'y': 50}},
            {'data': {'id': 'two', 'label': 'Node 2'}, 'position': {'x': 200, 'y': 200}},
            {'data': {'source': 'one', 'target': 'two','label': 'Node 1 to 2'}}
        ],
        layout={'name': 'preset'}
    )
])

if __name__ == '__main__':
    app.run_server(debug=True)

basic-usage

External layouts

You can also add external layouts. Use the cyto.load_extra_layouts() function to get started:

import dash
import dash_cytoscape as cyto
import dash_html_components as html

cyto.load_extra_layouts()

app = dash.Dash(__name__)
app.layout = html.Div([
    cyto.Cytoscape(...)
])

Documentation

The Dash Cytoscape User Guide contains everything you need to know about the library. It contains useful examples, functioning code, and is fully interactive. You can also use the component reference for a complete and concise specification of the API.

To learn more about the core Dash components and how to use callbacks, view the Dash documentation.

For supplementary information about the underlying Javascript API, view the Cytoscape.js documentation.

Contributing

Make sure that you have read and understood our code of conduct, then head over to CONTRIBUTING to get started.

License

Dash, Cytoscape.js and Dash Cytoscape are licensed under MIT. Please view LICENSE for more details.

Contact and Support

See https://plot.ly/dash/support for ways to get in touch.

Acknowledgments

Huge thanks to the Cytoscape Consortium and the Cytoscape.js team for their contribution in making such a complete API for creating interactive networks. This library would not have been possible without their massive work!

The Pull Request and Issue Templates were inspired from the scikit-learn project.

Gallery

Dynamically expand elements

Code | Demo View usage-elements on Github

Interactively update stylesheet

Code | Demo View usage-stylesheet on Github

Automatically generate interactive phylogeny trees

Code | Demo View usage-phylogeny on Github

Create your own stylesheet

Code | Demo View usage-advanced on Github

Use event callbacks

Code | Demo View usage-events on Github

Use external layouts

Code View usage-elements-extra on Github

For an extended gallery, visit the demos' readme.

You can’t perform that action at this time.