Entities sit on a circle; each relationship is a ribbon whose ends are arcs proportional to the flow. Ribbon interiors are quadratic curves pulled toward the circle center.

geom_chord(
  mapping = NULL,
  data = NULL,
  alpha = NULL,
  label = TRUE,
  label_size = NULL
)

Arguments

mapping, data

Standard layer overrides. Requires x (source), xend (target), and y (flow value).

alpha

Ribbon opacity.

label, label_size

Entity labels around the rim.

Value

A Layer to add with +.

Examples

d <- data.frame(
  from = c("A", "A", "B", "C"), to = c("B", "C", "C", "A"),
  n = c(5, 3, 7, 2)
)
ggnext(d, aes(x = from, xend = to, y = n)) + geom_chord() + theme_void()
#> <ggnext plot>
#>   data:  4 x 3
#>   aes:   x = from, xend = to, y = n
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static