File: guide-none.R

package info (click to toggle)
r-cran-ggplot2 3.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 9,944 kB
  • sloc: sh: 15; makefile: 5
file content (41 lines) | stat: -rw-r--r-- 670 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
#' @include layer.R
NULL

#' Empty guide
#'
#' This guide draws nothing.
#'
#' @inheritParams guide_axis
#'
#' @export
#'
guide_none <- function(title = waiver(), position = waiver()) {
  new_guide(
    title = title,
    position = position,
    available_aes = "any",
    super = GuideNone
  )
}

#' @rdname ggplot2-ggproto
#' @format NULL
#' @usage NULL
#' @export
GuideNone <- ggproto(
  "GuideNone", Guide,

  # Perform no training
  train = function(self, params = self$params, scale, aesthetic = NULL, ...) {
    params
  },

  transform = function(self, params, coord, ...) {
    params
  },

  # Draw nothing
  draw = function(self, ...) {
    zeroGrob()
  }
)