Learn R Programming

RCy3 (version 1.2.0)

setNodeWidthDirect: setNodeWidthDirect

Description

In the specified CytoscapeWindow, set the width of the specified node(s). Note that the node dimensions (width and width) must be unlocked for this to work. If they are locked, then node and width change together, as specified by a node size rule, or the setNodeSize method.

Usage

setNodeWidthDirect(obj, node.names, new.widths)

Arguments

obj
a CytoscapeWindowClass object.
node.names
one or more String objects.
new.widths
one or more integer objects, in pixel units.

Value

None.

See Also

setNodeWidthRule lockNodeDimensions setNodeSizeDirect setNodeHeightDirect

Examples

Run this code
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  cw <- CytoscapeWindow ('setNodeWidthDirect.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork (cw, 'force-directed')
  # lockNodeDimensions (cw, 'default', FALSE) # --> not required anymore.
  # setNodeWidthDirect does this for you.
  setNodeWidthDirect (cw, 'A', 32)
  setNodeWidthDirect (cw, getAllNodes(cw), 15)
  setNodeWidthDirect (cw, c('A', 'B'), c(30, 40))

Run the code above in your browser using DataLab