layout_arc: Layout Arc

Description Usage Arguments Examples

View source: R/graph.R

Description

Layout as arc using the alter package.

Usage

1
2
3
4
5
6
7
layout_arc(
  g,
  sourceWeight = NULL,
  targetWeight = NULL,
  thickness = 0.05,
  marginRatio = 0.1
)

Arguments

g

An object of class g2r or g2Proxy as returned by g2() or g2_proxy().

sourceWeight, targetWeight

Bare name of column containing weights of source and target in the edges data.frame.

thickness

Node height, between 0 and 1.

marginRatio

Space ratio, between 0 and 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ig <- igraph::erdos.renyi.game(100, 1 / 100)

g2(ig, asp(x, y)) %>%
  layout_arc() %>%
  fig_edge(asp(color = source, shape = "arc"), opacity = .3) %>%
  fig_point(asp(color = id, shape = "circle", size = value)) %>%
  coord_type("polar") %>%
  coord_reflect("y") %>%
  axis_hide()

g2(ig, asp(x, y)) %>%
  layout_arc() %>%
  fig_edge(asp(color = source, shape = "arc"), opacity = .3) %>%
  fig_point(asp(color = id, shape = "circle", size = value))

devOpifex/g2r documentation built on Jan. 16, 2022, 12:36 a.m.