- Notifications
You must be signed in to change notification settings - Fork326
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
labels:{ID:{label:"name",identifier:"ID",[NeoVis.NEOVIS_ADVANCED_CONFIG]:{static:{color:"#97c2fc",shape:"dot",size:5,},function:{size:(node)=>{return// how to access node.reletioships so that I can count the properties.visits.length like below?}},},},},relationships:{TRAFFIC:{[NeoVis.NEOVIS_ADVANCED_CONFIG]:{static:{width:1,},function:{width:(node)=>{returnnode.properties.visits.length;}},},},}, |
BetaWas this translation helpful?Give feedback.
All reactions
Thank you very much for your help, here is the code that is working.
constviz=newNeoVis(config);viz.render();viz.registerOnEvent('completed',()=>{console.log("Graph visualization completed.");viz.nodes.forEach((node)=>{letnewSize=0;if(node.group=='ActiveDirectoryDomain'){viz.nodes.update({id:node.id,size:10});}elseif(node.group=='User'){viz.nodes.update({id:node.id,size:5});}else{viz.edges.forEach((edge)=>{ …
Replies: 1 comment 29 replies
-
You should do it in the cypher as neo4j doesn't return a way to get to the relationships in the object I didn't touch cypher in a long time so need to search how I did it back than |
BetaWas this translation helpful?Give feedback.
All reactions
-
Umm... Not really, but after the complete event you can to use it directly and if you get stuck you can continue ask here 😅 the tests kinda use it to get data, and |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
"complete event"
For some reason it is not working for me, theviz.node does not contain anything when the event is raised constviz=newNeoVis(config);viz.render();viz.registerOnEvent('completed',()=>{console.log("Graph visualization completed.");// Update node size based on relationship dataconsole.log(viz.edges);console.log(viz.nodes);for(letnodeIdinviz.nodes){// noting here}}); |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thats... Really weird, it makes no sense (I think maybe you can't iterate over it but it is not empty?) |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thank you very much for your help, here is the code that is working. constviz=newNeoVis(config);viz.render();viz.registerOnEvent('completed',()=>{console.log("Graph visualization completed.");viz.nodes.forEach((node)=>{letnewSize=0;if(node.group=='ActiveDirectoryDomain'){viz.nodes.update({id:node.id,size:10});}elseif(node.group=='User'){viz.nodes.update({id:node.id,size:5});}else{viz.edges.forEach((edge)=>{if(edge.from===node.id||edge.to===node.id){newSize+=JSON.parse(edge.raw.properties.visits??'[]').length;}});viz.nodes.update({id:node.id,size:newSize});}});}); |
BetaWas this translation helpful?Give feedback.
All reactions
-
That's really weird you need to parse the array, but other than that Im glad managed, also you can use vis.edges.get({to: node.id}) to get all edges instead of iterating over all of it 😅 |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Is it possible to use array type in neo4j, I don't see it on the list? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Not sure what app are you using, but in the cypher you can do things like MATCH (a)SETa.a= [1,2,3,4] And it should work |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Thanks, was able to fix it, the issue was with the data loading tool. |
BetaWas this translation helpful?Give feedback.
All reactions
😄 1
