@@ -434,8 +434,10 @@ as_widget <- function(x, ...) {
434434
435435typedArrayPolyfill <- function () {
436436 htmltools :: htmlDependency(
437- " typedarray" , " 0.1" ,
438- src = depPath(" typedarray" ),
437+ name = " typedarray" ,
438+ version = " 0.1" ,
439+ package = " plotly" ,
440+ src = dependency_dir(" typedarray" ),
439441 script = " typedarray.min.js" ,
440442 all_files = FALSE
441443 )
@@ -445,19 +447,21 @@ typedArrayPolyfill <- function() {
445447# and bundle size at print time.
446448plotlyMainBundle <- function () {
447449 htmltools :: htmlDependency(
448- " plotly-main" ,
450+ name = " plotly-main" ,
449451 version = " 1.41.3" ,
450- src = depPath(" plotlyjs" ),
452+ package = " plotly" ,
453+ src = dependency_dir(" plotlyjs" ),
451454 script = " plotly-latest.min.js" ,
452455 all_files = FALSE
453456 )
454457}
455458
456459plotlyHtmlwidgetsCSS <- function () {
457460 htmltools :: htmlDependency(
458- " plotly-htmlwidgets-css" ,
461+ name = " plotly-htmlwidgets-css" ,
459462 version = plotlyMainBundle()$ version ,
460- src = depPath(" plotlyjs" ),
463+ package = " plotly" ,
464+ src = dependency_dir(" plotlyjs" ),
461465 stylesheet = " plotly-htmlwidgets.css" ,
462466 all_files = FALSE
463467 )
@@ -468,8 +472,8 @@ locale_dependency <- function(locale) {
468472 stop(" locale must be a character string (vector of length 1)" , call. = FALSE )
469473 }
470474
471- locale_dir <- depPath (" plotlyjs" , " locales" )
472- locales_all <- sub(" \\ .js$" , " " , list.files(locale_dir ))
475+ locale_dir <- dependency_dir (" plotlyjs" , " locales" )
476+ locales_all <- sub(" \\ .js$" , " " , list.files(system.file( locale_dir , package = " plotly " ) ))
473477 if (! tolower(locale ) %in% locales_all ) {
474478 stop(
475479 " Invalid locale: '" , locale , " '.\n\n " ,
@@ -491,6 +495,7 @@ locale_dependency <- function(locale) {
491495 htmltools :: htmlDependency(
492496 name = paste0(" plotly-locale-" , locale ),
493497 version = plotlyMainBundle()$ version ,
498+ package = " plotly" ,
494499 src = list (file = locale_dir ),
495500 script = tolower(scripts ),
496501 all_files = FALSE
0 commit comments