Dash Cytoscape - returning node positions from layout

You can try this, which works for me. ‘pip install visdcc’. import the module

import visdcc

in the app layout add this

dcc.Download(id='Get Data'),
html.Button('Export', id='export_button'),
visdcc.Run_js(id= 'javascript'),

in the callback section add this

@app.callback(
Output(‘javascript’, ‘run’),
Input(‘export_button’, ‘n_clicks’),
prevent_initial_call=True
)
def print_page(x):
return ‘’’
console.log(‘Nodes:’, cy.nodes().jsons());
console.log(‘Edges:’, cy.edges().jsons());
console.log(‘Elements:’, cy.elements().jsons());
‘’’

this will print the node and edge data to the console

image