Gitlab Community Edition Instance

Skip to content
Snippets Groups Projects
Commit 7e3d2c28 authored by jens.preussner's avatar jens.preussner :ghost:
Browse files

Merge branch 'workaround_plotly_RDS' into 'master'

plotly dependency issue for RDS import

See merge request !15
parents 6c1ffd72 37405328
Branches fix_title
No related tags found
1 merge request!15plotly dependency issue for RDS import
Pipeline #123569 passed
......@@ -25,6 +25,7 @@ Imports:
Suggests:
highcharter,
plotly,
crosstalk,
gt,
ggplot2,
DT,
......
......@@ -7,7 +7,20 @@ if (!requireNamespace("<% package %>", quietly = TRUE)) {
stop('The package <% package %> is needed to embed objects of class <% class %>.', call. = FALSE)
}
readRDS(file.path(datadir, '<% component_id %>.rds'))
vis_<% component_id %> <- readRDS(file.path(datadir, '<% component_id %>.rds'))
# workaround for plotly dependencies issue (https://github.com/ropensci/plotly/issues/1044)
#
fix_dependency <- function(dependency){
if(dependency$name == "jquery") dependency$src$file <- file.path(system.file(package ="crosstalk"), "lib/jquery")
if(dependency$name == "crosstalk") dependency$src$file <- file.path(system.file(package ="crosstalk"), "www")
return(dependency)
}
if ("<% package %>" == "plotly"){
vis_<% component_id %>$dependencies <- lapply(vis_<% component_id %>$dependencies, fix_dependency)
}
vis_<% component_id %>
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment