Skip to content

Set node color based on source data #1114

Answered by mar10
aviramido asked this question in Q&A
Discussion options

You must be logged in to vote

Would calling mode.addClass("green") or

node.toggleClass("green", !node.data.connect)
node.toggleClass("red", node.data.connect)

whenever you set the node.data.connect property work for you?

Also extraClasses can be set per node with the JSON response.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@aviramido
Comment options

Answer selected by aviramido
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants