pass ... from dyplot.prophet to dygraph::dygraph, addresses #1158 (#1177)

* Pass ... from dyplot.prophet to dygraph to be able to set additional parameters

* Add documentation for ... in dyplot.prophet

Co-authored-by: Ben Letham <bletham@gmail.com>
This commit is contained in:
Adriano Fantini 2020-02-04 22:39:17 +01:00 committed by GitHub
parent 9320ed1fb5
commit 187bf06bf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -405,7 +405,7 @@ add_changepoints_to_plot <- function(m, threshold = 0.01, cp_color = "red",
#' @param uncertainty Optional boolean indicating if the uncertainty interval for yhat #' @param uncertainty Optional boolean indicating if the uncertainty interval for yhat
#' should be plotted, which will only be done if x$uncertainty.samples > 0. Must be #' should be plotted, which will only be done if x$uncertainty.samples > 0. Must be
#' present in fcst as yhat_lower and yhat_upper. #' present in fcst as yhat_lower and yhat_upper.
#' @param ... additional arguments #' @param ... additional arguments passed to dygraph::dygraph
#' @importFrom dplyr "%>%" #' @importFrom dplyr "%>%"
#' @return A dygraph plot. #' @return A dygraph plot.
#' #'
@ -443,7 +443,7 @@ dyplot.prophet <- function(x, fcst, uncertainty=TRUE,
dfTS <- xts::xts(df %>% dplyr::select_(.dots=colsToKeep), order.by = df$ds) dfTS <- xts::xts(df %>% dplyr::select_(.dots=colsToKeep), order.by = df$ds)
# base plot # base plot
dyBase <- dygraphs::dygraph(dfTS) dyBase <- dygraphs::dygraph(dfTS, ...)
presAnnotation <- function(dygraph, x, text) { presAnnotation <- function(dygraph, x, text) {
dygraph %>% dygraph %>%