Skip to content

Commit

Permalink
add docs for getDependency and export it.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramnathv committed Nov 4, 2016
1 parent 7454758 commit b759e05
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ S3method(print,suppress_viewer)
export(JS)
export(appendContent)
export(createWidget)
export(getDependency)
export(onRender)
export(onStaticRenderComplete)
export(prependContent)
Expand Down
5 changes: 5 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ toJSON <- function(x) {
structure(res, class = 'json')
}

#' Get js and css dependencies for a htmlwidget
#'
#' @param name name of the widget.
#' @param package name of the package, defaults to the widget name.
#' @export
getDependency <- function(name, package = name){
config = sprintf("htmlwidgets/%s.yaml", name)
jsfile = sprintf("htmlwidgets/%s.js", name)
Expand Down
17 changes: 17 additions & 0 deletions man/getDependency.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 comments on commit b759e05

@timelyportfolio
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramnathv, @jcheng5, @jjallaire When do we expect next CRAN release? I hope to use the new exported getDependency function in sparkline, and would like to submit to CRAN. Thanks!

@jjallaire
Copy link
Collaborator

@jjallaire jjallaire commented on b759e05 Nov 9, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timelyportfolio
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for now :) for this but most especially for #237

@jjallaire
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, any objections by others to rolling a CRAN release?

@yihui I ran an R CMD check and noticed this warning based on code that you added a while back:

Warning messages:
1: `cleanup` is deprecated 
2: In tryCatchList(expr, classes, parentenv, handlers) :
  Check shiny:::toJSON and make sure htmlwidgets:::toJSON is in sync

Not sure I understand the toJSON reference -- is this of concern and/or are there changes we need to make to eliminate this warning?

@yihui
Copy link
Contributor

@yihui yihui commented on b759e05 Nov 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what "cleanup is deprecated" means. I'll take a look at the toJSON issue #238 soon.

@ramnathv
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with a CRAN release.

@jjallaire
Copy link
Collaborator

@jjallaire jjallaire commented on b759e05 Nov 9, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjallaire
Copy link
Collaborator

@jjallaire jjallaire commented on b759e05 Nov 10, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.