Description Usage Arguments Details Value Examples
setNodeColorRule
control node color via values of the specified attribute
1 2 3 | ## S4 method for signature 'RCyjs'
setNodeColorRule(obj, attribute, control.points, colors,
mode = c("interpolate", "lookup"))
|
obj |
an RCyjs instance |
attribute |
a character string, the node attribute category whose value controls color |
control.points |
a list of all possible values of the attribute |
colors |
the corresponding node color, one specified for each of the control.points |
mode |
a character string, either "interpolate" or "lookup" |
for interpolate mode, in which the node attribute should be a continusously varying numerical quantity in-between colors are calculated for in-between values. for lookup mode, in which the node attribute is a discrete string variable, simple color lookup is performed.
no return value
1 2 3 4 5 6 7 8 | if(interactive()){
g <- simpleDemoGraph()
rcy <- RCyjs(title="rcyjs demo", graph=g)
layout(rcy, "cose")
fit(rcy, 100)
setNodeColorRule(rcy, "count", c(0, 100), c("green", "red"), mode="interpolate")
redraw(rcy)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.