-
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
Nodes gather in the middle after using neoViz.renderWithCypher() #333
Comments
I set an event-listener on "CompletionEvent", it takes a long time to finish the "CompletionEvent" , once "CompletionEvent" finishes, the nodes separate in a short time. |
The problem seems to be in the |
I don't fully understand what you did to test that, render function us the main function so likely you'll find it slow there, but I don't understand what you mean by print |
Also mind sending your configuration? A lot if cypher in the config may slow down the render |
Thank you for your reply! I have about 5000 pieces of data, and in future use, I need to query based on keywords. Therefore, I used When Here is my configuration config = {
containerId: "viz",
neo4j: {
serverUrl: "url",
serverUser: "user",
serverPassword: "password",
},
visConfig: {
nodes: {
shape: 'dot',
size: 10
},
edges: {
arrows: {
to: { enabled: false }
},
selectionWidth: 3,
color: {
color: "#00ffff",
highlight: "#ff0000",
},
},
physics: {
barnesHut: {
theta: 2,
springLength: 100,
springConstant: 0.02,
damping: 0.8,
avoidOverlap: 0.2
},
solver: "barnesHut",
timestep: 0.25,
minVelocity: 0.1
},
},
labels: {
NEW_DCYD: {
// label: ["CWE_ID"],
[NeoVis.NEOVIS_ADVANCED_CONFIG]: {
static: {
color: {
border: "#ffffff",
background: "#ffffff",
highlight: {
border: "#ffffff",
background: "#000000"
}
},
shape: "dot",
size: 50,
borderWidth: "1",
font: {
"background": "none",
"strokeWidth": "0",
"size": 30,
"color": "#464646"
}
},
function: {
color: {
background: (node) => node.properties.CVE_ID ? "#bd6962" : node.properties.CWE_ID ? "#a4cbfa" : node.properties.PUBLISH_DATE ? "#f7ce46" : "#a4cb9d",
},
title: (node) => NeoVis.objectToTitleString(node, ["CVE_ID", "YEAR", "CWE_ID", "CAUSE", "LOCATION", "VERSION", "ATTACKER", "CONSEQUENCE", "OPERATION"])
}
}
}
},
relationships: {
CWE_NUMBER: {
[NeoVis.NEOVIS_ADVANCED_CONFIG]: {
static: {
label: "CWE NUMBER",
color: "#ffffff",
font: {
"background": "none",
"strokeWidth": "0",
"size": edgeFontSize,
"color": "#f9dc73"
}
}
}
},
'LOCATION': {
[NeoVis.NEOVIS_ADVANCED_CONFIG]: {
static: {
label: "LOCATION",
color: "#64b687",
font: {
"background": "none",
"strokeWidth": "0",
"size": edgeFontSize,
"color": "#437ce5"
}
}
}
}
},
initialCypher: "MATCH (n:NEW_DCYD)-[r]->(m) WHERE n.YEAR >= '2022' RETURN *"
}; |
Most of the time is probably in the network, maybe try doing the same query in the neo4j console? |
Strangely, I am running on localhost, so maybe not the network problem. I just tried running in the neo4j console, it takes about 1 second. It is worth mentioning that the results of |
Didn't mean network as in network speed, meant db speed 😅 |
I have no idea, even simply call |
They all just call render, try putting in your config |
My bad, |
What do you mean by first time and second time? |
First time: enter the page. |
Does the query do somthing else? Like a different query? Did you test the same query in the neo4j console? |
It doesn't do something else, just a simple query. Yep, all the same. |
That's doesn't make any sense to me 😅 Ill have to test that myself 😅 |
Maybe the |
I have tried If you need, I can send my code to your e-mail and install a neo4j on my server so that you can test my code. |
Id love to, but I could only look at it in about few days |
That's OK, so can you tell me your e-mail? |
Umm... Is there any place I can dm you? |
Maybe facebook or Wechat? Or something else? |
Why github makes it hard 😅 I don't want to post it here but Im pretty sure I commited with my mail so you can check commit logs to get my mail |
Sorry about this 😵💫 Here is the download link: https://rissplat.dingdang.tech/DetectDataBunch/Neo4jDemo.zip |
Downloaded to my phone, you can now delete if you want to |
Okay, look forward to your reply later. |
Everything was fine during the first rendering.
When I use
neoViz.renderWithCypher()
to rerender the graph, nodes gather in the middle, it will take a long time to separate.Is there any way to solve this problem?
The text was updated successfully, but these errors were encountered: