Created
July 8, 2017 03:20
-
-
Save SuddenDevelopment/1bc24110aa27f58a8e4091dd94c6a4de to your computer and use it in GitHub Desktop.
cytoscape : update node style on click event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//watch all nodes for a click | |
cy.on('click', 'node', function(evt){ | |
//add the labeling style to show the name on the specific one clicked | |
cy.$('#'+this.id()).style({ | |
"content": this[0]._private.data.name, | |
"font-size": "12px", | |
"text-valign": "top", | |
"text-halign": "center" | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment