Link annotation with labels
Link annotation with labels
anno_link(at, labels, which = c("column", "row"), side = ifelse(which == "column", "top", "right"),
    lines_gp = gpar(), labels_gp = gpar(), padding = 0.25, link_width = NULL, extend = 0)

  \item{at}{numeric index in the original matrix}
  \item{labels}{corresponding labels}
  \item{which}{column annotation or row annotation}
  \item{side}{side of the labels. If it is a column annotation, permitted values are "top" and "bottom"; If it is a row annotation, permitted values are "left" and "right".}
  \item{lines_gp}{graphic settings for the segments}
  \item{labels_gp}{graphic settings for the labels}
  \item{padding}{padding between labels if they are attached to each other}
  \item{link_width,}{width of the segments.}
  \item{extend}{by default, the region for the labels has the same width (if it is a column annotation) or same height (if it is a row annotation) as the heatmap. The size can be extended by this options. The value can be a proportion number or  a \code{\link[grid]{unit}} object. The length can be either one or two.}

Sometimes there are many rows or columns in the heatmap and we want to mark some of the rows.
This annotation function is used to mark these rows and connect labels and corresponding rows
with links.
A graphic function which can be set in \code{\link{HeatmapAnnotation}} constructor method.
Zuguang Gu <z.gu@dkfz.de>
mat = matrix(rnorm(10000), nr = 1000)
labels = sample(letters, 20, replace = TRUE)
Heatmap(mat, show_row_dend = FALSE, show_column_dend = FALSE) + 
rowAnnotation(link = row_anno_link(at = sample(1000, 20), labels = labels),
    width = unit(1, "cm") + max_text_width(labels))