Skip to content

Commit

Permalink
fixes to let other packages to use showOutput.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramnathv committed Jul 8, 2014
1 parent ebd0fd7 commit 47e2c06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/showOutput.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
chartOutput <- showOutput <- function(outputId, lib = NULL, package = 'rCharts',
add_lib = TRUE){
if (!is.null(lib)){
LIB <- get_lib(lib)
LIB <- get_lib(lib, package = package)
} else if (exists(".rChart_object")) {
LIB <- .rChart_object$LIB
}
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ get_rCharts_assets <- function(lib){
assets[!grepl('jquery', assets)]
}

get_lib <- function(lib){
get_lib <- function(lib, package = 'rCharts'){
if (grepl("^http", lib)){
return(list(name = basename(lib), url = lib))
}
if (file.exists(lib)){
lib_url <- normalizePath(lib)
lib <- basename(lib_url)
} else {
lib_url <- system.file('libraries', lib, package = 'rCharts')
lib_url <- system.file('libraries', lib, package = package)
}
return(list(name = basename(lib), url = lib_url))
}
Expand Down

0 comments on commit 47e2c06

Please sign in to comment.