小编Jua*_*chr的帖子

使用 Dash-Cytoscape 更改单个节点大小

我已经使用 Dash-Cytoscape 两天了,我尝试了很多方法来单独更改节点大小。我试过这个,但没有用:

import dash
import dash_cytoscape as cyto
import dash_html_components as html

app = dash.Dash(__name__)
app.layout = html.Div([
    cyto.Cytoscape(
        id="cytospace",
        elements=[
            {'data': {'id': 'one', 'label': 'Node 1'}, 'position': {'x': 50, 'y': 50}, 'size':20},
            {'data': {'id': 'two', 'label': 'Node 2'}, 'position': {'x': 200, 'y': 200}, 'size':70},
            {'data': {'source': 'one', 'target': 'two','label': 'Node 1 to 2'}}
        ],
        layout={'name':'preset'},
        style={'height': '95vh',
               'width': '100%'}
    )
])

if __name__ == "__main__":
    app.run_server(debug=True)
Run Code Online (Sandbox Code Playgroud)

python cytoscape plotly plotly-dash

0
推荐指数
1
解决办法
1565
查看次数

标签 统计

cytoscape ×1

plotly ×1

plotly-dash ×1

python ×1