setNodeColorRule: setNodeColorRule

Description Usage Arguments Details Value Examples

Description

setNodeColorRule control node color via values of the specified attribute

Usage

1
2
3
4
5
6
7
8
## 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

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

RCyjs documentation built on Nov. 8, 2020, 8:20 p.m.