Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-20-2022 10:10 PM
Hi all,
My name is Fong, I am currently learning to use yfiles with Jupyter notebooks but so far I have encountered issues.
I am currently using this link: https://www.youtube.com/watch?v=M_PbbMVg4ME as a guide but my GraphWidget is not displaying at all, I have attached a snapshot as shown below.
If anyone knows how to overcome this issue, do let me know in the comments. Below is the link to the yfiles github page
#https://github.com/yWorks/yfiles-jupyter-graphs
Solved! Go to Solution.
12-27-2022 02:41 AM
I can reproduce the same issue when I'm calling graph() twice, e.g.
result = session.run("MATCH (s)-[r]->(t) RETURN s,r,t LIMIT 20").graph()
w = GraphWidget(graph = result.graph())
So try to call graph() only once on the result.
12-21-2022 01:30 PM
Hi,
is the widget loading with an empty graph, or is the widget itself missing?
You could also check whether your queried graph actually contains nodes and relationships, e.g.
print(graph.nodes.__len__())
print(graph.relationships.__len__())
Other than that, you can try the import_from_neo4j.ipynb notebook in the samples of the yfiles-jupyter-graphs GitHub repository.
This should work out of the box, and with the latest release of yfiles-jupyter-graphs (v1.4.2) you can also easily run it in Visual Studio Code if you dislike JupyterLab.
12-23-2022 03:30 PM
Hi there @fskpf ,
The graph is not empty and has nodes and relationships
However I noticed something different, the graph widget itself is showing when using this code
When I try to use the widget to visualize my graph, the error is shown below
@fskpf wrote:
Hi,
is the widget loading with an empty graph, or is the widget itself missing?
You could also check whether your queried graph actually contains nodes and relationships, e.g.
print(graph.nodes.__len__()) print(graph.relationships.__len__())
Other than that, you can try the import_from_neo4j.ipynb notebook in the samples of the yfiles-jupyter-graphs GitHub repository.
This should work out of the box, and with the latest release of yfiles-jupyter-graphs (v1.4.2) you can also easily run it in Visual Studio Code if you dislike JupyterLab.
AttributeError Traceback (most recent call last) <ipython-input-11-32a4228e4dae> in <module> 3 4 #shows empty widgets ----> 5 graph_db=GraphWidget(graph = result.graph()) 6 graph_db.show() AttributeError: 'Graph' object has no attribute 'graph'
12-27-2022 02:41 AM
I can reproduce the same issue when I'm calling graph() twice, e.g.
result = session.run("MATCH (s)-[r]->(t) RETURN s,r,t LIMIT 20").graph()
w = GraphWidget(graph = result.graph())
So try to call graph() only once on the result.
All the sessions of the conference are now available online