File: edge_colourbar.R

package info (click to toggle)
r-cran-ggraph 2.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,832 kB
  • sloc: cpp: 1,630; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 1,321 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#' Colourbar legend for edges
#'
#' This function is equivalent to [ggplot2::guide_colourbar()] but
#' works for edge aesthetics.
#'
#' @inheritParams ggplot2::guide_colourbar
#' @inheritDotParams ggplot2::guide_colourbar
#'
#' @return A guide object
#'
#' @export
guide_edge_colourbar <- function(..., available_aes = c("edge_colour", "edge_fill")) {
  guide <- guide_colourbar(..., available_aes = available_aes)
  guide$params$name <- 'edge_colourbar'
  guide
}
#' @rdname guide_edge_colourbar
#' @export
guide_edge_colorbar <- guide_edge_colourbar

#' Coloursteps legend for edges
#'
#' This function is equivalent to [ggplot2::guide_coloursteps()] but
#' works for edge aesthetics.
#'
#' @inheritParams ggplot2::guide_coloursteps
#' @inheritParams ggplot2::guide_colourbar
#' @inheritDotParams ggplot2::guide_colourbar
#'
#' @return A guide object
#'
#' @export
guide_edge_coloursteps <- function(even.steps = TRUE, show.limits = NULL, ...,
                                   available_aes = c("edge_colour", "edge_fill")) {
  guide <- guide_coloursteps(even.steps = even.steps, show.limits = show.limits,
                             ..., available_aes = available_aes)
  guide$params$name <- 'edge_coloursteps'
  guide
}
#' @rdname guide_edge_coloursteps
#' @export
guide_edge_colorsteps <- guide_edge_coloursteps