Coder Social home page Coder Social logo

kozo2 / dash-cytoscape Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plotly/dash-cytoscape

0.0 2.0 0.0 25.27 MB

Interactive network visualization in Python and Dash, powered by Cytoscape.js

Home Page: https://dash.plot.ly/cytoscape

License: MIT License

CSS 12.22% Python 59.45% JavaScript 26.51% R 1.82%

dash-cytoscape's Introduction

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://plotly.com/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

Use export graph as image

Code View usage-image-export on Github

For an extended gallery, visit the demos' readme.

dash-cytoscape's People

Contributors

akronix avatar dependabot[bot] avatar ivoleist avatar jackluo avatar marc-andre-rivet avatar mkcor avatar nicolaskruchten avatar rpkyle avatar shammamah-zz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.