Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-05-2021 03:14 PM
Hi! I'm trying to render a graph in cytoscape JS which requires a format like this, using python server.
elements: {
nodes: [
{
data: { id: 'a' }
},
{
data: { id: 'b' }
}
],
edges: [
{
data: { id: 'ab', source: 'a', target: 'b' }
}
]
},
For a simple graph I can convert it myself by walking through the results
As graphs get more complex, picking out the structures will end up getting convoluted to serialize the data in the right way.
I was thinking this should be a common requirement, maybe someone has a better way?
I was looking at the networkX cytoscape output source code as a reference.
Using subgraphs seems it would make all my queries twice as complex, I hope this isn't needed.
07-06-2021 01:25 PM
Can't you just use result.graph() and map the results into nodes and rels to be serialized?
https://neo4j.com/docs/api/python-driver/current/api.html#graph
10-18-2021 03:28 PM
Could you please elaborate more on your proposition? @michael.hunger
How to serialize this..
Please help.
11-16-2022 12:11 AM - edited 11-16-2022 12:13 AM
@michael.hunger and @gg_lionkhan and @D_C any solution on above issue, Anything work for you. I am looking for similar solution.
All the sessions of the conference are now available online