Skip to content

Commit

Permalink
Merge pull request #70 from selkamand/66-reorder-lazy_birdwatcher-col…
Browse files Browse the repository at this point in the history
…umns-so-by-default-numeric-is-top

66 reorder lazy birdwatcher columns so by default numeric is top
  • Loading branch information
selkamand authored Oct 22, 2024
2 parents 87810f5 + 3608da0 commit 3d74917
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 46 deletions.
5 changes: 5 additions & 0 deletions R/gg1d.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ choose_colours <- function(data, palettes, plottable, ndistinct, coltype, colour
#' @param legend_orientation_heatmap should legend orientation be "horizontal" or "vertical"
#' @param fontsize_barplot_y_numbers fontsize of the text describing numeric barplot max & min values (number)
#' @param cli_header Text used for h1 header. Included so it can be tweaked by packages that use gg1d, so they can customise how the info messages appear.
#' @param interactive_svg_width,interactive_svg_height width and height of the interactive graphic region (in inches). Only used when `interactive = TRUE`.
#' @return ggiraph interactive visualisation
#'
#' @examples
Expand Down Expand Up @@ -240,6 +241,8 @@ gg1d <- function(
fontsize_values_heatmap = 3,
colours_values_heatmap = "white",
fontsize_barplot_y_numbers = 8,
interactive_svg_width = NULL,
interactive_svg_height = NULL,
cli_header = "Running gg1d"
) {

Expand Down Expand Up @@ -557,6 +560,8 @@ gg1d <- function(
if(verbose >= 2) cli::cli_alert_info("Making plot interactive since `interactive = TRUE`")
ggpatch <- ggiraph::girafe(
ggobj = ggpatch,
width_svg = interactive_svg_width,
height_svg = interactive_svg_height,
options = list(
opts_hover = ggiraph::opts_hover(css = "stroke:black;cursor:pointer;r:5px;")
)
Expand Down
92 changes: 46 additions & 46 deletions inst/birdwatching.csv
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
Birdwatcher,Day,Magpies
Robert,Weekday,1
Robert,Weekday,4
Robert,Weekday,1
Robert,Weekday,2
Robert,Weekend,NA
Robert,Weekday,2
Robert,Weekday,3
Robert,Weekend,1
Robert,Weekday,2
Robert,Weekend,NA
Robert,Weekend,1
Robert,Weekday,3
Robert,Weekday,3
Robert,Weekend,1
Robert,Weekend,NA
Robert,Weekday,2
Robert,Weekend,1
Robert,Weekday,2
Robert,Weekday,1
Robert,Weekend,NA
Robert,Weekday,1
Robert,Weekend,1
Robert,Weekday,1
Robert,Weekday,4
Robert,Weekend,NA
Catherine,Weekday,1
Catherine,Weekday,1
Catherine,Weekend,1
Catherine,Weekday,2
Catherine,Weekday,2
Catherine,Weekend,6
Catherine,Weekday,1
Catherine,Weekday,1
Catherine,Weekend,2
Catherine,Weekday,1
Catherine,Weekday,1
Catherine,Weekend,2
Catherine,Weekday,4
Catherine,Weekday,1
Catherine,Weekend,1
Catherine,Weekday,1
Catherine,Weekday,1
Catherine,Weekend,1
Catherine,Weekday,1
Catherine,Weekday,1
Magpies,Day,Birdwatcher
1,Weekday,Robert
4,Weekday,Robert
1,Weekday,Robert
2,Weekday,Robert
NA,Weekend,Robert
2,Weekday,Robert
3,Weekday,Robert
1,Weekend,Robert
2,Weekday,Robert
NA,Weekend,Robert
1,Weekend,Robert
3,Weekday,Robert
3,Weekday,Robert
1,Weekend,Robert
NA,Weekend,Robert
2,Weekday,Robert
1,Weekend,Robert
2,Weekday,Robert
1,Weekday,Robert
NA,Weekend,Robert
1,Weekday,Robert
1,Weekend,Robert
1,Weekday,Robert
4,Weekday,Robert
NA,Weekend,Robert
1,Weekday,Catherine
1,Weekday,Catherine
1,Weekend,Catherine
2,Weekday,Catherine
2,Weekday,Catherine
6,Weekend,Catherine
1,Weekday,Catherine
1,Weekday,Catherine
2,Weekend,Catherine
1,Weekday,Catherine
1,Weekday,Catherine
2,Weekend,Catherine
4,Weekday,Catherine
1,Weekday,Catherine
1,Weekend,Catherine
1,Weekday,Catherine
1,Weekday,Catherine
1,Weekend,Catherine
1,Weekday,Catherine
1,Weekday,Catherine
4 changes: 4 additions & 0 deletions man/gg1d.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vignettes/gallery.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ gg1d(
df_lazy_birdatcher,
col_sort = "Magpies",
show_legend = TRUE,
fontsize_y_text = 18,
fontsize_barplot_y_numbers = 12,
legend_text_size = 16,
legend_key_size = 1,
legend_nrow = 1,
palettes = list(
Birdwatcher = c(Robert = "#E69F00", Catherine = "#999999"),
Day = c(Weekday = "#999999" ,Weekend = "#009E73")
Expand Down

0 comments on commit 3d74917

Please sign in to comment.