Learn R Programming

RCy3 (version 1.2.0)

getCenter: getCenter

Description

This method returns the coordinates of the current center of the visible Cytoscape canvas, or drawing surface. The intial values are a little unpredictable, but seem to be on the order of 100 for both x and y.

Usage

getCenter(obj)

Arguments

obj
a CytoscapeWindowClass object.

Value

A names list, x and y.

See Also

getCenter getZoom setZoom

Examples

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

  window.title = 'getCenter demo'
  cw <- CytoscapeWindow (window.title, graph=makeSimpleGraph())
  displayGraph (cw)
  redraw (cw)
  layoutNetwork(cw, 'force-directed')
  print (getCenter (cw))

Run the code above in your browser using DataLab