1 Star 0 Fork 0

samlet / dash-cytoscape

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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 (Python)

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.

Prerequisites (R)

install.packages(c("devtools", "dash"))

Usage (Python)

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

Usage (R)

Install the library using devtools:

devtools::install_github("plotly/dash-cytoscape")

Create the following example inside an app.R file:

library(dash)
library(dashHtmlComponents)
library(dashCytoscape)

app <- Dash$new()

app$layout(
  htmlDiv(
    list(
      cytoCytoscape(
        id = 'cytoscape-two-nodes',
        layout = list('name' = 'preset'),
        style = list('width' = '100%', 'height' = '400px'),
        elements = list(
          list('data' = list('id' = 'one', 'label' = 'Node 1'), 'position' = list('x' = 75, 'y' = 75)),
          list('data' = list('id' = 'two', 'label' = 'Node 2'), 'position' = list('x' = 200, 'y' = 200)),
          list('data' = list('source' = 'one', 'target' = 'two'))
        )
      )
    )
  )
)

app$run_server()

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

Make graph responsive

Code View usage-responsive-graph on Github

For an extended gallery, visit the demos' readme.

The MIT License (MIT) Copyright (c) 2017 Plotly, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/samlet/dash-cytoscape.git
git@gitee.com:samlet/dash-cytoscape.git
samlet
dash-cytoscape
dash-cytoscape
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891