-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
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
renderer.render method in jupyter-notebook shows an empty graph. #64
Comments
Hi @sharpy013 please give it a try with: from py2cytoscape import cyrest
cy=cyrest.cyclient()
cy.result() |
I'm trying to do something similar, and I too get a blank screen. After playing around with it, I suspect that the issue may be that py2cytoscape is still expecting a Cytoscape JS 2.1 data structure. For example, the following fails when using the data format specified following the most recent Cytoscape JS tutorial: import json
import py2cytoscape.cytoscapejs as renderer
network = {
'elements': [
{ 'data': { 'id': 'a' } },
{ 'data': { 'id': 'b' } },
{ 'data': { 'id': 'ab', 'source': 'a', 'target': 'b' } }
]
}
renderer.render(network=network, height=800, width=800, layout_algorithm='circle', background='#ccffff') When I turn this into a Cytoscape JS 2.x style format, it runs without exception, but renders nothing: import json
import py2cytoscape.cytoscapejs as renderer
network = { 'elements': {
'nodes' : [
{ 'data': { 'id': "a" } },
{ 'data': { 'id': "b" } }
],
'edges' : [
{ 'data': {
'id': 'ab',
'source': 'a',
'target': 'b'
}
}
]
}
}
renderer.render(network=network, height=800, width=800, layout_algorithm='circle', background='#ccffff') The code always uses the most recent implementation of Cytoscape JS:
But there's evidence elsewhere to suggest that the renderer expects Cytoscape JS 2.1:
That would explain why a blank canvas is happening. |
I also got an empty graph.
Is the URL of |
I checked, and tested, with the same result. I started my own fork and made enough changes to at least get a JS widget operational. You can see the changes in this commit: I'm not ready for a pull request yet; I'll be trying to get as much functionality as I can. |
Sample of a Jupyter notebook using the above fork: https://github.com/dotasek/py2cytoscapejs/blob/master/CX%20to%20JS%20Example.ipynb |
I'm still having the same problem. Will this problem get fixed soon on the master branch? |
Same problem with ipycytoscape |
When i print the nodes and edges, it shows all the edges, but the render method visualises a blank white screen.
Thank you
The text was updated successfully, but these errors were encountered: