Skip to content

Commit 3eee99f

Browse files
committed
write out all non-standard arguments
1 parent 32a4a76 commit 3eee99f

32 files changed

+187
-20
lines changed

R/geom-bar.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ GeomBar <- ggproto("GeomBar", GeomRect,
9090
#' @param geom,stat Override the default connection between `geom_bar()` and
9191
#' `stat_count()`. For more information about overriding these connections,
9292
#' see how the [stat][layer_stats] and [geom][layer_geoms] arguments work.
93+
#' @param lineend Line end style (round, butt, square).
94+
#' @param linejoin Line join style (round, mitre, bevel).
9395
#' @examples
9496
#' # geom_bar is designed to make it easy to create bar charts that show
9597
#' # counts (or sums of weights)
@@ -136,5 +138,6 @@ GeomBar <- ggproto("GeomBar", GeomRect,
136138
#' ggplot(df, aes(x, y)) + geom_col(just = 1)
137139
geom_bar <- boilerplate(
138140
GeomBar, stat = "count", position = "stack",
139-
just = 0.5, orientation = NA
141+
just = 0.5, orientation = NA,
142+
lineend = "butt", linejoin = "mitre"
140143
)

R/geom-bin2d.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ NULL
1717
#' `geom_bin_2d()` and `stat_bin_2d()`. For more information about overriding
1818
#' these connections, see how the [stat][layer_stats] and [geom][layer_geoms]
1919
#' arguments work.
20+
#' @param lineend Line end style (round, butt, square).
21+
#' @param linejoin Line join style (round, mitre, bevel).
2022
#' @seealso [stat_bin_hex()] for hexagonal binning
2123
#' @examples
2224
#' d <- ggplot(diamonds, aes(x, y)) + xlim(4, 10) + ylim(4, 10)
@@ -29,7 +31,10 @@ NULL
2931
#'
3032
#' # Or by specifying the width of the bins
3133
#' d + geom_bin_2d(binwidth = c(0.1, 0.1))
32-
geom_bin_2d <- boilerplate(GeomTile, stat = "bin2d")
34+
geom_bin_2d <- boilerplate(
35+
GeomTile, stat = "bin2d",
36+
lineend = "butt", linejoin = "mitre"
37+
)
3338

3439
#' @export
3540
#' @rdname geom_bin_2d

R/geom-col.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#' @export
22
#' @rdname geom_bar
3-
geom_col <- boilerplate(GeomBar, position = "stack", just = 0.5)
3+
geom_col <- boilerplate(
4+
GeomBar, position = "stack",
5+
just = 0.5, lineend = "butt", linejoin = "mitre"
6+
)
47

58
#' @rdname ggplot2-ggproto
69
#' @format NULL

R/geom-contour.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ GeomContourFilled <- ggproto("GeomContourFilled", GeomPolygon)
4949
#'
5050
#' Overrides `binwidth` and `bins`. By default, this is a vector of length
5151
#' ten with [pretty()] breaks.
52+
#' @param rule Either `"evenodd"` or `"winding"`. If polygons with holes are
53+
#' being drawn (using the `subgroup` aesthetic) this argument defines how the
54+
#' hole coordinates are interpreted. See the examples in [grid::pathGrob()] for
55+
#' an explanation.
5256
#' @seealso [geom_density_2d()]: 2d density contours
5357
#' @export
5458
#' @examples
@@ -82,12 +86,15 @@ GeomContourFilled <- ggproto("GeomContourFilled", GeomPolygon)
8286
geom_contour <- boilerplate(
8387
GeomContour, stat = "contour",
8488
bins = NULL, binwidth = NULL, breaks = NULL,
85-
lineend = "butt", linejoin = "round", linemitre = 10
89+
lineend = "butt", linejoin = "round", linemitre = 10,
90+
arrow = NULL, arrow.fill = NULL
8691
)
8792

8893
#' @rdname geom_contour
8994
#' @export
9095
geom_contour_filled <- boilerplate(
9196
GeomContourFilled, stat = "contour_filled",
92-
bins = NULL, binwidth = NULL, breaks = NULL
97+
bins = NULL, binwidth = NULL, breaks = NULL,
98+
rule = "evenodd",
99+
lineend = "butt", linejoin = "round", linemitre = 10
93100
)

R/geom-crossbar.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,8 @@ GeomCrossbar <- ggproto("GeomCrossbar", Geom,
9393

9494
#' @export
9595
#' @rdname geom_linerange
96-
geom_crossbar <- boilerplate(GeomCrossbar, fatten = 2.5, orientation = NA)
96+
geom_crossbar <- boilerplate(
97+
GeomCrossbar,
98+
fatten = 2.5, orientation = NA, width = NULL,
99+
lineend = "butt", linejoin = "mitre"
100+
)

R/geom-errorbar.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@ GeomErrorbar <- ggproto("GeomErrorbar", Geom,
5858

5959
#' @export
6060
#' @rdname geom_linerange
61-
geom_errorbar <- boilerplate(GeomErrorbar, orientation = NA)
61+
geom_errorbar <- boilerplate(
62+
GeomErrorbar,
63+
orientation = NA, lineend = "butt"
64+
)

R/geom-errorbarh.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ GeomErrorbarh <- ggproto("GeomErrorbarh", Geom,
4949
#' @eval rd_aesthetics("geom", "errorbarh")
5050
#' @inheritParams layer
5151
#' @inheritParams geom_point
52+
#' @param lineend Line end style (round, butt, square).
5253
#' @export
5354
#' @examples
5455
#' df <- data.frame(
@@ -68,4 +69,4 @@ GeomErrorbarh <- ggproto("GeomErrorbarh", Geom,
6869
#' p +
6970
#' geom_point() +
7071
#' geom_errorbarh(aes(xmax = resp + se, xmin = resp - se, height = .2))
71-
geom_errorbarh <- boilerplate(GeomErrorbarh)
72+
geom_errorbarh <- boilerplate(GeomErrorbarh, lineend = "butt")

R/geom-hex.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ GeomHex <- ggproto("GeomHex", Geom,
8282
#' @export
8383
#' @inheritParams layer
8484
#' @inheritParams geom_point
85+
#' @param lineend Line end style (round, butt, square).
86+
#' @param linejoin Line join style (round, mitre, bevel).
87+
#' @param linemitre Line mitre limit (number greater than 1).
8588
#' @export
8689
#' @examples
8790
#' d <- ggplot(diamonds, aes(carat, price))
@@ -97,4 +100,7 @@ GeomHex <- ggproto("GeomHex", Geom,
97100
#' d + geom_hex(binwidth = c(1, 1000))
98101
#' d + geom_hex(binwidth = c(.1, 500))
99102
#' }
100-
geom_hex <- boilerplate(GeomHex, stat = 'binhex')
103+
geom_hex <- boilerplate(
104+
GeomHex, stat = 'binhex',
105+
lineend = "butt", linejoin = "mitre", linemitre = 10
106+
)

R/geom-histogram.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@
117117
#' geom_histogram(binwidth = function(x) 2 * IQR(x) / (length(x)^(1/3)))
118118
geom_histogram <- boilerplate(
119119
GeomBar, stat = "bin", position = "stack",
120-
binwidth = NULL, bins = NULL, orientation = NA
120+
binwidth = NULL, bins = NULL, orientation = NA,
121+
lineend = "butt", linejoin = "mitre"
121122
)

R/geom-linerange.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ GeomLinerange <- ggproto(
6060
#' @export
6161
#' @inheritParams layer
6262
#' @inheritParams geom_bar
63+
#' @param width Bar width. By default, set to 90% of the [`resolution()`] of
64+
#' the data.
6365
#' @examples
6466
#' # Create a simple example dataset
6567
#' df <- data.frame(
@@ -107,4 +109,4 @@ GeomLinerange <- ggproto(
107109
#' aes(ymin = lower, ymax = upper),
108110
#' position = position_dodge2(width = 0.5, padding = 0.5)
109111
#' )
110-
geom_linerange <- boilerplate(GeomLinerange, orientation = NA)
112+
geom_linerange <- boilerplate(GeomLinerange, orientation = NA, lineend = "butt")

0 commit comments

Comments
 (0)