Skip to content

Commit 9383d2a

Browse files
authored
New roxygen tag: @aesthetics (#6437)
* implement `@aesthetics` roxy tag * Use new tag * redocument * add news bullet * add roxygen2 to Suggest * omit `ggplot2::` link prefix in ggplot2, but not extensions
1 parent 863cb95 commit 9383d2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+711
-665
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Suggests:
6363
ragg (>= 1.2.6),
6464
RColorBrewer,
6565
rmarkdown,
66+
roxygen2,
6667
rpart,
6768
sf (>= 0.7-3),
6869
svglite (>= 2.1.2),

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ S3method(element_grob,element_rect)
2828
S3method(element_grob,element_text)
2929
S3method(format,ggproto)
3030
S3method(format,ggproto_method)
31+
S3method(format,rd_section_aesthetics)
3132
S3method(fortify,"NULL")
3233
S3method(fortify,"function")
3334
S3method(fortify,Line)

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ggplot2 (development version)
22

3+
* New roxygen tag `@aesthetics` that takes a Geom, Stat or Position class and
4+
generates an 'Aesthetics' section.
35
* `annotation_borders()` replaces the now-deprecated `borders()`
46
(@teunbrand, #6392)
57
* New `make_constructor()` function that builds a standard constructor for

R/geom-bar.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ GeomBar <- ggproto(
6868
#'
6969
#' @eval rd_orientation()
7070
#'
71-
#' @eval rd_aesthetics("geom", "bar")
72-
#' @eval rd_aesthetics("geom", "col")
73-
#' @eval rd_aesthetics("stat", "count")
71+
#' @aesthetics GeomBar
72+
#' @aesthetics GeomCol
73+
#' @aesthetics StatCount
7474
#' @seealso
7575
#' [geom_histogram()] for continuous data,
7676
#' [position_dodge()] and [position_dodge2()] for creating side-by-side

R/geom-bin2d.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GeomBin2d <- ggproto("GeomBin2d", GeomTile)
1414
#' rectangle's fill. This is a useful alternative to [geom_point()]
1515
#' in the presence of overplotting.
1616
#'
17-
#' @eval rd_aesthetics("stat", "bin_2d")
17+
#' @aesthetics GeomBin2d
1818
#'
1919
#' @export
2020
#' @inheritParams layer

R/geom-boxplot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#' This gives a roughly 95% confidence interval for comparing medians.
2525
#' See McGill et al. (1978) for more details.
2626
#'
27-
#' @eval rd_aesthetics("geom", "boxplot")
27+
#' @aesthetics GeomBoxplot
2828
#'
2929
#' @seealso [geom_quantile()] for continuous `x`,
3030
#' [geom_violin()] for a richer display of the distribution, and

R/geom-contour.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ GeomContourFilled <- ggproto("GeomContourFilled", GeomPolygon)
2828
#' data, you'll need to first interpolate on to a grid before visualising,
2929
#' using `interp::interp()`, `akima::bilinear()`, or similar.
3030
#'
31-
#' @eval rd_aesthetics("geom", "contour")
32-
#' @eval rd_aesthetics("geom", "contour_filled")
31+
#' @aesthetics GeomContour
32+
#' @aesthetics GeomContourFilled
3333
#' @inheritParams layer
3434
#' @inheritParams geom_point
3535
#' @inheritParams geom_path

R/geom-count.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ NULL
77
#' observations at each location, then maps the count to point area. It
88
#' useful when you have discrete data and overplotting.
99
#'
10-
#' @eval rd_aesthetics("geom", "point")
10+
#' @aesthetics GeomPoint
1111
#' @param geom,stat Use to override the default connection between
1212
#' `geom_count()` and `stat_sum()`. For more information about overriding
1313
#' these connections, see how the [stat][layer_stats] and [geom][layer_geoms]

R/geom-density.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ GeomDensity <- ggproto(
2222
#' data that comes from an underlying smooth distribution.
2323
#'
2424
#' @eval rd_orientation()
25-
#'
26-
#' @eval rd_aesthetics("geom", "density")
25+
#' @aesthetics GeomDensity
2726
#' @seealso See [geom_histogram()], [geom_freqpoly()] for
2827
#' other methods of displaying continuous distribution.
2928
#' See [geom_violin()] for a compact density display.

R/geom-density2d.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#' draws contour lines, and `geom_density_2d_filled()` draws filled contour
77
#' bands.
88
#'
9-
#' @eval rd_aesthetics("geom", "density_2d")
10-
#' @eval rd_aesthetics("geom", "density_2d_filled")
9+
#' @aesthetics GeomDensity2d
10+
#' @aesthetics GeomDensity2dFilled
1111
#' @seealso [geom_contour()], [geom_contour_filled()] for information about
1212
#' how contours are drawn; [geom_bin_2d()] for another way of dealing with
1313
#' overplotting.

0 commit comments

Comments
 (0)