kuzudb / explorer

Browser-based user interface for Kùzu graph database
https://hub.docker.com/r/kuzudb/explorer
MIT License
29 stars 5 forks source link

Double arrowed and undirected relationship drawing in recursive query #157

Closed semihsalihoglu-uw closed 2 months ago

semihsalihoglu-uw commented 2 months ago

I have this query based on the repo here: https://github.com/kuzudb/cypher-workshop

MATCH (p1:Person)-[o1:Owns]->(a1:Account)-[r:Transfer* SHORTEST]-(a2:Account)<-[o2:Owns]-(p2:Person) 
WHERE p1.email = "georodaw366@hotmail.com" AND p2.email = "ezimmerman@yahoo.com" 
RETURN *;

The result graph viz that I get looks like this, where there is an undirected edge between 118.. and 082... Then there is a bi-directional edge between 082.. and 054... In fact there is an edge from 118.. to 054.. and from 054.. to 082..

Screen Shot 2024-07-04 at 2 45 51 PM

If you move one of the nodes a little bit with your mouse, you get the right view:

Screen Shot 2024-07-04 at 2 53 14 PM

Not sure what to do but seems like something the force layout should handle easily. It seems to happen because we're drawing all nodes in a straight line and we swap the positions of 054.. and 082..

mewim commented 2 months ago

@MSebanc will tweak the parameters defined at https://github.com/kuzudb/explorer/blob/48fa9f0cd0cb7dc1e0ad4b8d255cafabcf0f8c1a/src/components/ShellView/ResultGraph.vue#L368-L373

to see if there is a way to make the default layout look better.