Skip to content

Add position nudgestack #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 131 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
a486906
Add position_nudgestack
Sep 3, 2019
01d7db0
Delete emtpy rows
Sep 3, 2019
23e3241
Clarify documentation in mpg: very minor (#3515)
MaraAlexeev Sep 3, 2019
bcc75a3
Add time series example
Sep 16, 2019
fedef93
Add new position to DESCRIPTION
Sep 16, 2019
e5e91ea
Add new position_nudgestack into NAMESPACE
Sep 16, 2019
971b110
Add position-nudgestack.R into man
Sep 16, 2019
99b4b5e
Add position_nudgestack into description
Sep 16, 2019
5ebe5d4
Add description of position_nudgestack
Sep 16, 2019
c1729d1
Add the zoo-package to Suggestions
Sep 17, 2019
def4755
Adjust filter criterion in examples
Sep 17, 2019
02f6be4
Delete packages from @examples
Sep 17, 2019
a681f59
Add new examples
Sep 17, 2019
e2c1fb6
Add test file with a doppelganger-test
Sep 17, 2019
2484f71
Update vdiffr version
Sep 17, 2019
015b2e3
Add validated svg for position_nudgestack
Sep 17, 2019
d5c58da
Delete packages from example
Sep 17, 2019
c32f856
Add tests for correct nudging and stacking
Sep 18, 2019
2782c9d
Add position_nudgestack
Sep 3, 2019
3d61c3a
Delete emtpy rows
Sep 3, 2019
8572437
Add time series example
Sep 16, 2019
c5022d3
Add new position to DESCRIPTION
Sep 16, 2019
9bd40d6
Add new position_nudgestack into NAMESPACE
Sep 16, 2019
7bb930c
Add position-nudgestack.R into man
Sep 16, 2019
548f313
Add position_nudgestack into description
Sep 16, 2019
42c0fa3
Add description of position_nudgestack
Sep 16, 2019
ef5aef7
Add the zoo-package to Suggestions
Sep 17, 2019
9291957
Adjust filter criterion in examples
Sep 17, 2019
3713420
Delete packages from @examples
Sep 17, 2019
f44e504
Add new examples
Sep 17, 2019
be91893
Add test file with a doppelganger-test
Sep 17, 2019
e6df407
Update vdiffr version
Sep 17, 2019
823c686
Add validated svg for position_nudgestack
Sep 17, 2019
4fb6996
Delete packages from example
Sep 17, 2019
10b5e24
Add tests for correct nudging and stacking
Sep 18, 2019
b027238
Merge branch 'Add_position_nudgestack' of https://github.com/TeddyLee…
Sep 18, 2019
696fe9d
Bugfix
ThomasKnecht Sep 27, 2019
fa000f7
Make position guides customizable (#3398, closes #3322)
paleolimbot Sep 29, 2019
0ee259c
default formula argument to NULL in geom_smooth() (#3307)
bfgray3 Sep 30, 2019
bde6844
Use tsbox for converting ts object to tibble
ThomasKnecht Sep 30, 2019
a290bb3
Add position_nudgestack
Sep 3, 2019
c8fa99f
Delete emtpy rows
Sep 3, 2019
4535be6
Clarify documentation in mpg: very minor (#3515)
MaraAlexeev Sep 3, 2019
56e9b3b
Add time series example
Sep 16, 2019
9d894a8
Add new position to DESCRIPTION
Sep 16, 2019
7fbc0f7
Add new position_nudgestack into NAMESPACE
Sep 16, 2019
c97d54d
Add position-nudgestack.R into man
Sep 16, 2019
327a6cd
Add position_nudgestack into description
Sep 16, 2019
f587fb8
Add description of position_nudgestack
Sep 16, 2019
87c00fa
Add the zoo-package to Suggestions
Sep 17, 2019
d35ea70
Adjust filter criterion in examples
Sep 17, 2019
dc6b78d
Delete packages from @examples
Sep 17, 2019
31cc104
Add new examples
Sep 17, 2019
0e80c8a
Add test file with a doppelganger-test
Sep 17, 2019
59d2b6e
Update vdiffr version
Sep 17, 2019
a1573b3
Add validated svg for position_nudgestack
Sep 17, 2019
da1e7be
Delete packages from example
Sep 17, 2019
771918d
Add tests for correct nudging and stacking
Sep 18, 2019
5271987
Resolve conflict
ThomasKnecht Oct 1, 2019
752e476
Bugfix
ThomasKnecht Sep 27, 2019
88f4a63
Use tsbox for converting ts object to tibble
ThomasKnecht Sep 30, 2019
02a038e
Resolve conflict
ThomasKnecht Oct 1, 2019
9a45cc8
scale_binned (#3096)
thomasp85 Oct 1, 2019
e688944
Style file
ThomasKnecht Oct 1, 2019
daeb34e
Style file
ThomasKnecht Oct 1, 2019
28ba9bf
Merge branch 'Add_position_nudgestack' of https://github.com/ThomasKn…
ThomasKnecht Oct 1, 2019
7214587
Add news
ThomasKnecht Oct 1, 2019
88c5bde
Minor updates to data docs (#3545)
mine-cetinkaya-rundel Oct 1, 2019
10fa001
Removing direction constraint from geoms (#3506)
thomasp85 Oct 1, 2019
0ff81cb
Merge remote-tracking branch 'upstream/master' into Add_position_nudg…
ThomasKnecht Oct 2, 2019
14fd33d
Add position_nudgestack
Sep 3, 2019
f67ae70
Delete emtpy rows
Sep 3, 2019
6d76c3a
Add time series example
Sep 16, 2019
1b7c4c0
Add new position to DESCRIPTION
Sep 16, 2019
9f6aa7d
Add new position_nudgestack into NAMESPACE
Sep 16, 2019
55602af
Add position-nudgestack.R into man
Sep 16, 2019
b1c8b1a
Add the zoo-package to Suggestions
Sep 17, 2019
d967b8e
Adjust filter criterion in examples
Sep 17, 2019
d443b80
Delete packages from @examples
Sep 17, 2019
e392ac8
Add new examples
Sep 17, 2019
37f1bd6
Add test file with a doppelganger-test
Sep 17, 2019
5b89b32
Add validated svg for position_nudgestack
Sep 17, 2019
a960ca8
Add tests for correct nudging and stacking
Sep 18, 2019
f891dbc
Bugfix
ThomasKnecht Sep 27, 2019
8642839
Use tsbox for converting ts object to tibble
ThomasKnecht Sep 30, 2019
5fa6969
Add the zoo-package to Suggestions
Sep 17, 2019
99eab52
Add new examples
Sep 17, 2019
7d23e89
Resolve conflict
ThomasKnecht Oct 1, 2019
9cdcf6a
Style file
ThomasKnecht Oct 1, 2019
083454a
Style file
ThomasKnecht Oct 1, 2019
0a89016
Add news
ThomasKnecht Oct 1, 2019
af4abb5
Resolve conflict
ThomasKnecht Oct 2, 2019
831d569
Add package spezifications
ThomasKnecht Oct 7, 2019
ccf0ee5
Add package spezifications
ThomasKnecht Oct 7, 2019
86dfea0
Add position_nudgestack
Sep 3, 2019
ce942ac
Delete emtpy rows
Sep 3, 2019
0750e55
Add time series example
Sep 16, 2019
621730d
Add new position to DESCRIPTION
Sep 16, 2019
d1c7ad8
Add new position_nudgestack into NAMESPACE
Sep 16, 2019
b1bb9d1
Add position-nudgestack.R into man
Sep 16, 2019
fc6ba5a
Add the zoo-package to Suggestions
Sep 17, 2019
32d2203
Adjust filter criterion in examples
Sep 17, 2019
5270a9d
Delete packages from @examples
Sep 17, 2019
fbf28dc
Add new examples
Sep 17, 2019
3ba06ab
Add test file with a doppelganger-test
Sep 17, 2019
f26bb90
Add validated svg for position_nudgestack
Sep 17, 2019
3a1c71f
Add tests for correct nudging and stacking
Sep 18, 2019
71d567b
Add time series example
Sep 16, 2019
59bc2a0
Add position-nudgestack.R into man
Sep 16, 2019
28640d5
Bugfix
ThomasKnecht Sep 27, 2019
8848fd9
Use tsbox for converting ts object to tibble
ThomasKnecht Sep 30, 2019
e5d61b5
Adjust filter criterion in examples
Sep 17, 2019
65e72fb
Add new examples
Sep 17, 2019
1b61750
Add test file with a doppelganger-test
Sep 17, 2019
4d66dad
Add tests for correct nudging and stacking
Sep 18, 2019
e4e7ee0
Resolve conflict
ThomasKnecht Oct 1, 2019
369a34b
Use tsbox for converting ts object to tibble
ThomasKnecht Sep 30, 2019
b61211d
Style file
ThomasKnecht Oct 1, 2019
6e4398c
Style file
ThomasKnecht Oct 1, 2019
415811c
Add news
ThomasKnecht Oct 1, 2019
90d1257
Add time series example
Sep 16, 2019
598b786
Add test file with a doppelganger-test
Sep 17, 2019
662a5da
Add validated svg for position_nudgestack
Sep 17, 2019
739ac7c
Add tests for correct nudging and stacking
Sep 18, 2019
3210061
Add the zoo-package to Suggestions
Sep 17, 2019
325456a
Add new examples
Sep 17, 2019
e0368b0
Resolve conflict
ThomasKnecht Oct 1, 2019
d9ec752
Style file
ThomasKnecht Oct 1, 2019
5de0449
Add package spezifications
ThomasKnecht Oct 7, 2019
e1846bc
Add package spezifications
ThomasKnecht Oct 7, 2019
b049018
Resolve conflict
ThomasKnecht Oct 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Suggests:
sf (>= 0.7-3),
svglite (>= 1.2.0.9001),
testthat (>= 2.1.0),
vdiffr (>= 0.3.0)
vdiffr (>= 0.3.0),
tsbox
Enhances: sp
License: GPL-2 | file LICENSE
URL: http://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2
Expand Down Expand Up @@ -153,11 +154,14 @@ Collate:
'grob-dotstack.r'
'grob-null.r'
'grouping.r'
'guide-bins.R'
'guide-colorbar.r'
'guide-colorsteps.R'
'guide-legend.r'
'guides-.r'
'guides-axis.r'
'guides-grid.r'
'guides-none.r'
'hexbin.R'
'labeller.r'
'labels.r'
Expand All @@ -179,12 +183,14 @@ Collate:
'position-jitter.r'
'position-jitterdodge.R'
'position-nudge.R'
'position-nudgestack.R'
'position-stack.r'
'quick-plot.r'
'range.r'
'save.r'
'scale-.r'
'scale-alpha.r'
'scale-binned.R'
'scale-brewer.r'
'scale-colour.r'
'scale-continuous.r'
Expand All @@ -199,6 +205,7 @@ Collate:
'scale-manual.r'
'scale-shape.r'
'scale-size.r'
'scale-steps.R'
'scale-type.R'
'scale-view.r'
'scale-viridis.r'
Expand Down
52 changes: 52 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,30 @@ S3method(grobWidth,absoluteGrob)
S3method(grobWidth,zeroGrob)
S3method(grobX,absoluteGrob)
S3method(grobY,absoluteGrob)
S3method(guide_gengrob,axis)
S3method(guide_gengrob,bins)
S3method(guide_gengrob,colorbar)
S3method(guide_gengrob,guide_none)
S3method(guide_gengrob,legend)
S3method(guide_geom,axis)
S3method(guide_geom,bins)
S3method(guide_geom,colorbar)
S3method(guide_geom,guide_none)
S3method(guide_geom,legend)
S3method(guide_merge,axis)
S3method(guide_merge,bins)
S3method(guide_merge,colorbar)
S3method(guide_merge,guide_none)
S3method(guide_merge,legend)
S3method(guide_train,axis)
S3method(guide_train,bins)
S3method(guide_train,colorbar)
S3method(guide_train,colorsteps)
S3method(guide_train,guide_none)
S3method(guide_train,legend)
S3method(guide_transform,axis)
S3method(guide_transform,default)
S3method(guide_transform,guide_none)
S3method(heightDetails,titleGrob)
S3method(heightDetails,zeroGrob)
S3method(interleave,default)
Expand Down Expand Up @@ -188,8 +204,11 @@ export(PositionIdentity)
export(PositionJitter)
export(PositionJitterdodge)
export(PositionNudge)
export(PositionNudgeStack)
export(PositionStack)
export(Scale)
export(ScaleBinned)
export(ScaleBinnedPosition)
export(ScaleContinuous)
export(ScaleContinuousDate)
export(ScaleContinuousDatetime)
Expand Down Expand Up @@ -298,6 +317,8 @@ export(facet_grid)
export(facet_null)
export(facet_wrap)
export(find_panel)
export(flip_data)
export(flipped_names)
export(fortify)
export(geom_abline)
export(geom_area)
Expand Down Expand Up @@ -358,14 +379,21 @@ export(ggproto)
export(ggproto_parent)
export(ggsave)
export(ggtitle)
export(guide_axis)
export(guide_bins)
export(guide_colorbar)
export(guide_colorsteps)
export(guide_colourbar)
export(guide_coloursteps)
export(guide_gengrob)
export(guide_geom)
export(guide_legend)
export(guide_merge)
export(guide_none)
export(guide_train)
export(guide_transform)
export(guides)
export(has_flipped_aes)
export(is.Coord)
export(is.facet)
export(is.ggplot)
Expand Down Expand Up @@ -405,6 +433,7 @@ export(position_identity)
export(position_jitter)
export(position_jitterdodge)
export(position_nudge)
export(position_nudgestack)
export(position_stack)
export(qplot)
export(quickplot)
Expand All @@ -424,12 +453,14 @@ export(scale_alpha_discrete)
export(scale_alpha_identity)
export(scale_alpha_manual)
export(scale_alpha_ordinal)
export(scale_color_binned)
export(scale_color_brewer)
export(scale_color_continuous)
export(scale_color_date)
export(scale_color_datetime)
export(scale_color_discrete)
export(scale_color_distiller)
export(scale_color_fermenter)
export(scale_color_gradient)
export(scale_color_gradient2)
export(scale_color_gradientn)
Expand All @@ -438,14 +469,19 @@ export(scale_color_hue)
export(scale_color_identity)
export(scale_color_manual)
export(scale_color_ordinal)
export(scale_color_steps)
export(scale_color_steps2)
export(scale_color_stepsn)
export(scale_color_viridis_c)
export(scale_color_viridis_d)
export(scale_colour_binned)
export(scale_colour_brewer)
export(scale_colour_continuous)
export(scale_colour_date)
export(scale_colour_datetime)
export(scale_colour_discrete)
export(scale_colour_distiller)
export(scale_colour_fermenter)
export(scale_colour_gradient)
export(scale_colour_gradient2)
export(scale_colour_gradientn)
Expand All @@ -454,17 +490,23 @@ export(scale_colour_hue)
export(scale_colour_identity)
export(scale_colour_manual)
export(scale_colour_ordinal)
export(scale_colour_steps)
export(scale_colour_steps2)
export(scale_colour_stepsn)
export(scale_colour_viridis_b)
export(scale_colour_viridis_c)
export(scale_colour_viridis_d)
export(scale_continuous_identity)
export(scale_discrete_identity)
export(scale_discrete_manual)
export(scale_fill_binned)
export(scale_fill_brewer)
export(scale_fill_continuous)
export(scale_fill_date)
export(scale_fill_datetime)
export(scale_fill_discrete)
export(scale_fill_distiller)
export(scale_fill_fermenter)
export(scale_fill_gradient)
export(scale_fill_gradient2)
export(scale_fill_gradientn)
Expand All @@ -473,22 +515,30 @@ export(scale_fill_hue)
export(scale_fill_identity)
export(scale_fill_manual)
export(scale_fill_ordinal)
export(scale_fill_steps)
export(scale_fill_steps2)
export(scale_fill_stepsn)
export(scale_fill_viridis_b)
export(scale_fill_viridis_c)
export(scale_fill_viridis_d)
export(scale_linetype)
export(scale_linetype_binned)
export(scale_linetype_continuous)
export(scale_linetype_discrete)
export(scale_linetype_identity)
export(scale_linetype_manual)
export(scale_radius)
export(scale_shape)
export(scale_shape_binned)
export(scale_shape_continuous)
export(scale_shape_discrete)
export(scale_shape_identity)
export(scale_shape_manual)
export(scale_shape_ordinal)
export(scale_size)
export(scale_size_area)
export(scale_size_binned)
export(scale_size_binned_area)
export(scale_size_continuous)
export(scale_size_date)
export(scale_size_datetime)
Expand All @@ -497,6 +547,7 @@ export(scale_size_identity)
export(scale_size_manual)
export(scale_size_ordinal)
export(scale_type)
export(scale_x_binned)
export(scale_x_continuous)
export(scale_x_date)
export(scale_x_datetime)
Expand All @@ -505,6 +556,7 @@ export(scale_x_log10)
export(scale_x_reverse)
export(scale_x_sqrt)
export(scale_x_time)
export(scale_y_binned)
export(scale_y_continuous)
export(scale_y_date)
export(scale_y_datetime)
Expand Down
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# ggplot2 (development version)

* Added `position_nudgestack()`, which allows to nudge stacked columns. (@ThomasKnecht )

* A new scale type has been added, that allows binning of aesthetics at the
scale level. It has versions for both position and non-position aesthetics and
comes with two new guides (`guide_bins` and `guide_coloursteps`) (@thomasp85, #3096)

* Position guides can now be customized using the new `guide_axis()`,
which can be passed to position `scale_*()` functions or via
`guides()`. The new axis guide (`guide_axis()`) comes with
arguments `check.overlap` (automatic removal of overlapping
labels), `angle` (easy rotation of axis labels), and
`n.dodge` (dodge labels into multiple rows/columns) (@paleolimbot, #3322).

* `Geom` now gains a `setup_params()` method in line with the other ggproto
classes (@thomasp85, #3509)

Expand Down
14 changes: 10 additions & 4 deletions R/axis-secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#' - A character vector giving labels (must be same length as `breaks`)
#' - A function that takes the breaks as input and returns labels as output
#'
#' @param guide A position guide that will be used to render
#' the axis on the plot. Usually this is [guide_axis()].
#'
#' @details
#' `sec_axis` is used to create the specifications for a secondary axis.
#' Except for the `trans` argument any of the arguments can be set to
Expand Down Expand Up @@ -79,7 +82,8 @@
#' labels = scales::time_format("%b %d %I %p")))
#'
#' @export
sec_axis <- function(trans = NULL, name = waiver(), breaks = waiver(), labels = waiver()) {
sec_axis <- function(trans = NULL, name = waiver(), breaks = waiver(), labels = waiver(),
guide = waiver()) {
# sec_axis() historically accpeted two-sided formula, so be permissive.
if (length(trans) > 2) trans <- trans[c(1,3)]

Expand All @@ -88,14 +92,15 @@ sec_axis <- function(trans = NULL, name = waiver(), breaks = waiver(), labels =
trans = trans,
name = name,
breaks = breaks,
labels = labels
labels = labels,
guide = guide
)
}
#' @rdname sec_axis
#'
#' @export
dup_axis <- function(trans = ~., name = derive(), breaks = derive(), labels = derive()) {
sec_axis(trans, name, breaks, labels)
dup_axis <- function(trans = ~., name = derive(), breaks = derive(), labels = derive(), guide = derive()) {
sec_axis(trans, name, breaks, labels, guide)
}

is.sec_axis <- function(x) {
Expand Down Expand Up @@ -148,6 +153,7 @@ AxisSecondary <- ggproto("AxisSecondary", NULL,
if (is.derived(self$breaks)) self$breaks <- scale$breaks
if (is.waive(self$breaks)) self$breaks <- scale$trans$breaks
if (is.derived(self$labels)) self$labels <- scale$labels
if (is.derived(self$guide)) self$guide <- scale$guide
},

transform_range = function(self, range) {
Expand Down
10 changes: 9 additions & 1 deletion R/coord-.r
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Coord <- ggproto("Coord",

aspect = function(ranges) NULL,

labels = function(panel_params) panel_params,
labels = function(labels, panel_params) labels,

render_fg = function(panel_params, theme) element_render(theme, "panel.border"),

Expand Down Expand Up @@ -91,6 +91,14 @@ Coord <- ggproto("Coord",
list()
},

setup_panel_guides = function(self, panel_params, guides, params = list()) {
panel_params
},

train_panel_guides = function(self, panel_params, layers, default_mapping, params = list()) {
panel_params
},

transform = function(data, range) NULL,

distance = function(x, y, panel_params) NULL,
Expand Down
Loading