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
)A Layer to add with +.
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