Dash Cytoscape
Dash Cytoscape是一个图形可视化组件,用于创建易于定制,高性能,交互式和基于Web的网络。它扩展并呈现Cytoscape.js,并提供与Dash布局和回调的深度集成,可以与丰富的Dash组件集合以及已建立的计算生物学和网络科学库(如Biopython和networkX)一起创建强大的网络。
快速开始
准备工作
pip install dash-cytoscape==0.0.5
代码
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-two-nodes',
layout={'name': 'preset'},
style={'width': '100%', 'height': '400px'},
elements=[
{'data': {'id': 'one', 'label': 'Node 1'}, 'position': {'x': 75, 'y': 75}},
{'data': {'id': 'two', 'label': 'Node 2'}, 'position': {'x': 200, 'y': 200}},
{'data': {'source': 'one', 'target': 'two'}}
]
)
])
if __name__ == '__main__':
app.run_server(debug=True)
更多资料,请访问:https://dash.plot.ly/cytoscape