-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
432 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
# thomasp85/ggraph https://github.com/thomasp85/ggraph/blob/master/R/aaa.R | ||
aes_intersect <- function(aes1, aes2) { | ||
structure( | ||
c(as.list(aes1), aes2[!names(aes2) %in% names(aes1)]), | ||
class = 'uneval' | ||
) | ||
structure( | ||
c(as.list(aes1), aes2[!names(aes2) %in% names(aes1)]), | ||
class = "uneval" | ||
) | ||
} | ||
|
||
aes_nudge_by_strand <- function(mapping, nudge_by_strand, keys = c("y", "yend")){ | ||
if(is.null(nudge_by_strand)) | ||
aes_nudge_by_strand <- function(mapping, nudge_by_strand, keys = c("y", "yend")) { | ||
if (is.null(nudge_by_strand)) { | ||
return(mapping) | ||
} | ||
|
||
# modify y/yend aes | ||
is_integer(nudge_by_strand) || is_double(nudge_by_strand) || | ||
stop("nudge_by_strand needs to be numeric") | ||
|
||
for(k in keys){ | ||
if(is.null(mapping[[k]])) stop("'", k, "' not defined, cannot modify") | ||
for (k in keys) { | ||
if (is.null(mapping[[k]])) stop("'", k, "' not defined, cannot modify") | ||
|
||
mapping[[k]] <- rlang::parse_expr(paste0(rlang::quo_text(mapping[[k]]),'+ display_strand * ',-nudge_by_strand)) | ||
mapping[[k]] <- rlang::parse_expr(paste0(rlang::quo_text(mapping[[k]]), "+ display_strand * ", -nudge_by_strand)) | ||
} | ||
mapping | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.