From 579852e77f8872bc8689ed5cd2c56e216ac8d123 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Thu, 2 Feb 2017 21:25:39 -0600 Subject: [PATCH] Add after_widget argument for more explicit control over placing dependencies before/after htmlwidget dependencies --- R/html_dependency.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/R/html_dependency.R b/R/html_dependency.R index 9db94058..ca4b1795 100644 --- a/R/html_dependency.R +++ b/R/html_dependency.R @@ -26,6 +26,8 @@ #' dependency files. If \code{FALSE}, only the files specified in #' \code{script}, \code{stylesheet}, and \code{attachment} are treated as #' dependency files. +#' @param after_widget Should this dependency appear before or after +#' (the default) htmlwidget dependencies? #' #' @return An object that can be included in a list of dependencies passed to #' \code{\link{attachDependencies}}. @@ -71,7 +73,8 @@ htmlDependency <- function(name, head = NULL, attachment = NULL, package = NULL, - all_files = TRUE) { + all_files = TRUE, + after_widget = TRUE) { # This function shouldn't be called from a namespace environment with # absolute paths. @@ -104,7 +107,8 @@ htmlDependency <- function(name, head = head, attachment = attachment, package = package, - all_files = all_files + all_files = all_files, + after_widget = after_widget )) }