setCenter: setCenter

Description Usage Arguments Value Author(s) See Also Examples

Description

This method can be used to pan and scroll the Cytoscape canvas, which is adjusted (moved) so that the specified x and y coordinates are at the center of the visible window.

Usage

1
setCenter(obj, x, y)

Arguments

obj

a CytoscapeWindowClass object.

x

a numeric object.

y

a numeric object.

Value

None.

Author(s)

Tanja Muetze, Georgi Kolishovski, Paul Shannon

See Also

getCenter getZoom setZoom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  ## Not run: 
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  window.title = 'setCenter demo'
  cw <- CytoscapeWindow (window.title, graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork(cw, 'force-directed')
  original.center <- getCenter (cw)  # named list, "x" and "y".
    # now pan the display to the left, by setting the the visual center
    # to increasing values of x, without changing the location of the
    # simple graph
  setCenter (cw, 200, 90)
  system ('sleep 0.1')
  setCenter (cw, 100, 90)
  system ('sleep 0.1')
  setCenter (cw, 0, 90)
  system ('sleep 0.1')
  setCenter (cw, -100, 90)
  system ('sleep 0.1')
    # and now pan back to the original position
  setCenter (cw, -100, 0)
  system ('sleep 0.1')
  setCenter (cw, original.center$x, original.center$y)

## End(Not run)

tmuetze/Bioconductor_RCy3_the_new_RCytoscape documentation built on May 31, 2019, 4:39 p.m.