setNodeColorRule,RCyjs-method {RCyjs} | R Documentation

## setNodeColorRule

### Description

`setNodeColorRule` control node color via values of the specified attribute

### Usage

    ## S4 method for signature 'RCyjs'
    setNodeColorRule(obj, attribute, control.points, colors,
      mode = c("interpolate", "lookup"))

### Arguments

`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"

### Details

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.

### Value

no return value

### Examples

    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)
       }

[Package RCyjs version 2.4.0 Index]