Replies: 1 comment
-
you can do that in js const node = cy.add({..new node params...})
node.outgoers().union(node.incomers()).doSomething() have a look at this code I use in my project to highlight nodes and edges on hover cy.on('mouseover', 'node', (e) => {
if (e.target === null) return
if (e.target === cy) return
e.cy.startBatch()
const sel = e.target;
/*
e.cy.elements()
.difference(sel.outgoers()
.union(sel.incomers()))
.not(sel)
.addClass('semitransp');
*/
sel.addClass('highlight')
.outgoers()
.union(sel.incomers())
.addClass('highlight');
e.cy.endBatch()
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! Maybe I'm over thinking, however I'm trying to do a
cy.add('node.ClassName, edge[allEdgesConnectedToThoseNodes]')
If that makes sense. I've tried variations of the above, can't seem to get it to work though :/
Thanks for any and all help!
Beta Was this translation helpful? Give feedback.
All reactions