Skip to main content

A Component Library for Dash aimed at facilitating network visualization in Python, wrapped around Cytoscape.js

Project description

Dash Cytoscape GitHub license PyPi Version

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

Interacting with the elements: usage-elements-demo

Using external layouts: usage-elements-extra

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_cytoscape-0.1.1.tar.gz (3.4 MB view details)

Uploaded Source

File details

Details for the file dash_cytoscape-0.1.1.tar.gz.

File metadata

  • Download URL: dash_cytoscape-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.3

File hashes

Hashes for dash_cytoscape-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0cb0d26ba39273cecbb95ee61ceb9faebb71fd6617b7d5f245a73afb9c308444
MD5 577f6f4ea07273467af2620cfaeeecf3
BLAKE2b-256 aa93d9db22331dcad4a055631372816bf4544a1a1a852fb2fa3a2905c6682198

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page