@@ -434,8 +434,10 @@ as_widget <- function(x, ...) {
434
434
435
435
typedArrayPolyfill <- function () {
436
436
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" ),
439
441
script = " typedarray.min.js" ,
440
442
all_files = FALSE
441
443
)
@@ -445,19 +447,21 @@ typedArrayPolyfill <- function() {
445
447
# and bundle size at print time.
446
448
plotlyMainBundle <- function () {
447
449
htmltools :: htmlDependency(
448
- " plotly-main" ,
450
+ name = " plotly-main" ,
449
451
version = " 1.41.3" ,
450
- src = depPath(" plotlyjs" ),
452
+ package = " plotly" ,
453
+ src = dependency_dir(" plotlyjs" ),
451
454
script = " plotly-latest.min.js" ,
452
455
all_files = FALSE
453
456
)
454
457
}
455
458
456
459
plotlyHtmlwidgetsCSS <- function () {
457
460
htmltools :: htmlDependency(
458
- " plotly-htmlwidgets-css" ,
461
+ name = " plotly-htmlwidgets-css" ,
459
462
version = plotlyMainBundle()$ version ,
460
- src = depPath(" plotlyjs" ),
463
+ package = " plotly" ,
464
+ src = dependency_dir(" plotlyjs" ),
461
465
stylesheet = " plotly-htmlwidgets.css" ,
462
466
all_files = FALSE
463
467
)
@@ -468,8 +472,8 @@ locale_dependency <- function(locale) {
468
472
stop(" locale must be a character string (vector of length 1)" , call. = FALSE )
469
473
}
470
474
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 " ) ))
473
477
if (! tolower(locale ) %in% locales_all ) {
474
478
stop(
475
479
" Invalid locale: '" , locale , " '.\n\n " ,
@@ -491,6 +495,7 @@ locale_dependency <- function(locale) {
491
495
htmltools :: htmlDependency(
492
496
name = paste0(" plotly-locale-" , locale ),
493
497
version = plotlyMainBundle()$ version ,
498
+ package = " plotly" ,
494
499
src = list (file = locale_dir ),
495
500
script = tolower(scripts ),
496
501
all_files = FALSE
0 commit comments