-
Notifications
You must be signed in to change notification settings - Fork 326
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
aim: transform Neo4j Record to G6 , stuck at how to skip duplicate nodes #192
Comments
I don't think we actually skip duplicates, if I remember correctly we add everything to vis DataSet by id, so it should just override the last one in case of duplicates (same as using hashmap) (Neo4j node and relationship comes with unique id) |
Thanks for quick reply. OMG. I think I find the key to the problem, but I am still a little bit confused. _addNode(node) {
this._nodes[node.id] = node;
} Yes, It will override the node with the same id. As for the let nodes: Node[] = []; // Node from `neo4j-driver`
let startNode = buildNode(v.start);
nodes.push(startNode); Maybe the last line is equivalent to |
I would complete my |
Nope 😅 it looks like they have the same problem as you (also the code is a little bit different on 2.0.0 but it does the same thing) |
I think that if they use a network library most of them know as well to merge same id |
But in their data it most likely have duplicates |
I successfully implement it. The code is here I also combine it with Graphin in the my react-graphapp. Although it works fine with my local Neo4j Docker instances , it still needs to be developed for richer customization. I think the issue is solved. Thanks. |
Aim
neovis.js
avoid adding duplicate nodesProblem
Example Cypher:
MATCH (b)-[re]-(c) RETURN b, re, c LIMIT 10
As the case of
neovis
I use use-neo4j as a React wrapper to access Neo4j. It returns
Neo4jRecord
which is actuallyRecord
fromNeo4j-Driver
.Inevitably, I have to skip the duplicate nodes. I know
neovis
works well. I find a similar implementation at this developer blog, in which it saysThe text was updated successfully, but these errors were encountered: