Skip to content

Commit 7663d58

Browse files
author
Ryan Patrick Kyle
committed
🔪 exclude_plotly_bundle
1 parent 374d5f1 commit 7663d58

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

R/dash.R

+1-21
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@
4646
#' constructing their own authorization front-end or otherwise need to know
4747
#' where the application is making API calls.
4848
#' }
49-
#' \item{`exclude_plotly_bundle`}{
50-
#' Whether or not to exclude the plotly.js bundle when "core components" exist,
51-
#' but [dashCoreComponents::coreGraph] is not provided to the `layout_set()`
52-
#' method (i.e., the initial layout).
53-
#' The only time `exclude_plotly_bundle` should be `TRUE` is if you don't want
54-
#' a `coreGraph()` in the initial layout, but want to insert one via a callback.
55-
#' }
5649
#' }
5750
#'
5851
#' @section Methods:
@@ -121,8 +114,7 @@ Dash <- R6::R6Class(
121114
serve_locally = TRUE,
122115
routes_pathname_prefix = '/',
123116
requests_pathname_prefix = '/',
124-
suppress_callback_exceptions = FALSE,
125-
exclude_plotly_bundle = TRUE) {
117+
suppress_callback_exceptions = FALSE) {
126118

127119
# argument type checking
128120
assertthat::assert_that(is.character(name))
@@ -530,18 +522,6 @@ Dash <- R6::R6Class(
530522

531523
deps_layout <- unlist(deps_layout, recursive=FALSE)
532524

533-
# if core components are used, but no coreGraph() exists,
534-
# don't include the plotly.js bundle
535-
if (private$exclude_plotly_bundle) {
536-
hasCore <- "dashCoreComponents" %in% pkgs
537-
hasGraph <- component_contains_type(layout, "dashCoreComponents", "Graph")
538-
if (hasCore && !hasGraph) {
539-
idx <- which(pkgs %in% "dashCoreComponents")
540-
scripts <- deps_layout[[idx]][["script"]]
541-
deps_layout[[idx]][["script"]] <- scripts[!grepl("^plotly-*", scripts)]
542-
}
543-
}
544-
545525
# add on HTML dependencies we've identified by crawling the layout
546526
private$dependencies <- c(private$dependencies, deps_layout)
547527

0 commit comments

Comments
 (0)