We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MRE:
import dash from dash import dcc, html,Input, Output, State, no_update import dash_cytoscape as cyto app = dash.Dash(__name__) app.layout = html.Div([ cyto.Cytoscape( id='cytoscape', elements=[ {'data': {'id': 'node1', 'label':"node1"}, 'positions': {'x': 0, 'y': 0}} ], layout={'name': 'preset'}, style={'width': '400px', 'height': '400px'} ), html.Button('Add Node', id='add-node-btn') ]) app.clientside_callback( ''' function (nClicks, currentElements){ if (!nClicks) { return dash_clientside.no_update; } let x=50; let y=100; let newNode = { 'data': { 'id': 'node2' }, 'position': { 'x': x, 'y': y } }; currentElements.push(newNode); console.log(currentElements); return JSON.parse(JSON.stringify(currentElements)); } ''', Output('cytoscape', 'elements'), Input('add-node-btn', 'n_clicks'), State('cytoscape', 'elements'), prevent_initial_call=True ) if __name__ == '__main__': app.run_server(debug=True)
Clientside Callbacks should be able to add elements.
It does not work.
Cytoscape 0.3.0 Dash 2,14.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
MRE:
Expected Results
Clientside Callbacks should be able to add elements.
Actual Results
It does not work.
Versions
Cytoscape 0.3.0
Dash 2,14.1
The text was updated successfully, but these errors were encountered: