layout.cytoscape: Layout

Description Usage Arguments Value Examples

View source: R/layouts.R

Description

Set network layout options

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
layout(cytoscape, name = NULL, fit = TRUE, padding = 30,
  boundingBox = NULL, avoidOverlap = TRUE, avoidOverlapPadding = 10,
  nodeDimensionsIncludeLabels = FALSE, spacingFactor = NULL,
  condense = FALSE, rows = NULL, cols = NULL, position = NULL,
  sort = NULL, animate = FALSE, animationDuration = 500,
  animationEasing = NULL, animateFilter = NULL, ready = NULL,
  stop = NULL, transform = NULL, ...)

## S3 method for class 'cytoscape'
layout(cytoscape, name = NULL, fit = TRUE,
  padding = 30, boundingBox = NULL, avoidOverlap = TRUE,
  avoidOverlapPadding = 10, nodeDimensionsIncludeLabels = FALSE,
  spacingFactor = NULL, condense = FALSE, rows = NULL, cols = NULL,
  position = NULL, sort = NULL, animate = FALSE,
  animationDuration = 500, animationEasing = NULL,
  animateFilter = NULL, ready = NULL, stop = NULL,
  transform = NULL, ...)

Arguments

cytoscape

object

name

character option, must b one of:

  • null

  • random

  • preset

  • grid

  • circle

  • concentric

  • breadthfirst

  • cose

fit

boolean whether to fit the viewport to the graph

padding

integer pixels padding used on fit

boundingBox

= undefined, // constrain layout bounds; x1, y1, x2, y2 or x1, y1, w, h

avoidOverlap

boolean prevents node overlap, may overflow boundingBox if not enough space

avoidOverlapPadding

integer pixels extra spacing around nodes when avoidOverlap = true

nodeDimensionsIncludeLabels

= false, // Excludes the label when calculating node bounding boxes for the layout algorithm

spacingFactor

= undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up

condense

boolean, uses all available space on false, uses minimal space on true

rows

integer force num of rows in the grid

cols

integer force num of columns in the grid

position

js function( node ), // returns row, col for element

sort

js a sorting function to order the nodes; e.g. function(a, b) return a.data('weight') - b.data('weight')

animate

boolean whether to transition the node positions

animationDuration

integer duration of animation in ms if enabled

animationEasing

= undefined, // easing of animation if enabled

animateFilter

= function ( node, i ) return true; , // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts

ready

= undefined, // callback on layoutready

stop

= undefined, // callback on layoutstop

transform

= 'function (node, position ) return position; '

...

additional parameters passed to the layout object

Value

cytoscape object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
df <- cytoscape::comtrade

nodes <- data.frame(id = unique(c(df$reporter, df$partner)))
edges <- df %>%
  dplyr::select(source = reporter,
                target = partner) %>%
  dplyr::mutate(id = paste(source, '_', target))

cytoscape(nodes = nodes, edges = edges) %>%
  cytoscape::layout(4)

mrjoh3/cytoscape documentation built on Nov. 14, 2020, 9:29 a.m.