File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -44,17 +44,14 @@ kaleido <- function(...) {
44
44
if (! reticulate :: py_available(initialize = TRUE )) {
45
45
stop(" `kaleido()` requires `reticulate::py_available()` to be `TRUE`. Do you need to install python?" )
46
46
}
47
- reticulate :: py_run_string(
48
- " from kaleido.scopes.plotly import PlotlyScope" ,
49
- convert = FALSE
50
- )
47
+
48
+ py <- reticulate :: py
51
49
scope_name <- paste0(" scope_" , new_id())
52
- reticulate :: py_run_string(
53
- sprintf(" %s = PlotlyScope(plotlyjs='%s')" , scope_name , plotlyMainBundlePath()),
54
- convert = FALSE
50
+ py [[scope_name ]] <- reticulate :: import(" kaleido" )$ scopes $ plotly $ PlotlyScope(
51
+ plotlyjs = plotlyMainBundlePath()
55
52
)
56
53
57
- scope <- reticulate :: py [[scope_name ]]
54
+ scope <- py [[scope_name ]]
58
55
59
56
mapbox <- Sys.getenv(" MAPBOX_TOKEN" , NA )
60
57
if (! is.na(mapbox )) {
You can’t perform that action at this time.
0 commit comments