Skip to content

Commit

Permalink
Merge pull request #470 from ramnathv/upkeep
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Aug 14, 2023
2 parents e234c0e + cab3f2a commit d31dd27
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 82 deletions.
33 changes: 18 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
Package: htmlwidgets
Type: Package
Package: htmlwidgets
Title: HTML Widgets for R
Version: 1.6.2.9000
Authors@R: c(
person("Ramnath", "Vaidyanathan", role = c("aut", "cph")),
person("Yihui", "Xie", role = c("aut")),
person("JJ", "Allaire", role = c("aut")),
person("Joe", "Cheng", role = c("aut"), email = "joe@rstudio.com"),
person("Carson", "Sievert", role = c("aut", "cre"), email = "carson@rstudio.com", comment = c(ORCID = "0000-0002-4958-2844")),
person("Yihui", "Xie", role = "aut"),
person("JJ", "Allaire", role = "aut"),
person("Joe", "Cheng", , "joe@posit.co", role = "aut"),
person("Carson", "Sievert", , "carson@posit.co", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4958-2844")),
person("Kenton", "Russell", role = c("aut", "cph")),
person("Ellis", "Hughes", role = c("ctb")),
person(family = "RStudio", role = "cph")
)
person("Ellis", "Hughes", role = "ctb"),
person("Posit Software, PBC", role = c("cph", "fnd"))
)
Description: A framework for creating HTML widgets that render in various
contexts including the R console, 'R Markdown' documents, and 'Shiny'
web applications.
License: MIT + file LICENSE
VignetteBuilder: knitr
URL: https://github.com/ramnathv/htmlwidgets
BugReports: https://github.com/ramnathv/htmlwidgets/issues
Imports:
grDevices,
htmltools (>= 0.5.4),
jsonlite (>= 0.9.16),
yaml,
knitr (>= 1.8),
rmarkdown
rmarkdown,
yaml
Suggests:
testthat
Enhances: shiny (>= 1.1)
URL: https://github.com/ramnathv/htmlwidgets
BugReports: https://github.com/ramnathv/htmlwidgets/issues
RoxygenNote: 7.2.3
Enhances:
shiny (>= 1.1)
VignetteBuilder:
knitr
Encoding: UTF-8
RoxygenNote: 7.2.3
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2016
YEAR: 2016-2023
COPYRIGHT HOLDER: Ramnath Vaidyanathan, Joe Cheng, JJ Allaire, Yihui Xie, and Kenton Russell
65 changes: 22 additions & 43 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
htmlwidgets 1.6.2.9000
------------------------------------------------------
# htmlwidgets (development version)


htmlwidgets 1.6.2
------------------------------------------------------
# htmlwidgets 1.6.2

* Closed #452: `as.tag.htmlwidget()` now includes `...` in it's function signature (for compatibility with the `htmltools::as.tags` generic).

htmlwidgets 1.6.1
------------------------------------------------------
# htmlwidgets 1.6.1

### Bug fixes

* Closed #456: Fixed an issue where widgets were no longer being resized properly when rendered in a standalone fashion. (#458)

htmlwidgets 1.6.0
-------------------------------------------------------
# htmlwidgets 1.6.0

### Potentially breaking changes

Expand All @@ -29,14 +25,12 @@ htmlwidgets 1.6.0
* Closed #433 and #440: `saveWidget(selfcontained=TRUE)` now uses the `{rmarkdown}` package to discover and call pandoc, which fixes a couple existing issues and helps "future proof" this code path from future changes to pandoc.
* Closed #257 and #358: `saveWidget(selfcontained=TRUE)` now correctly prevents HTML from being interpreted as markdown. (#401)

htmlwidgets 1.5.4
-------------------------------------------------------
# htmlwidgets 1.5.4

* Closed #320: `getDependency()` no longer includes an absolute src path in its return value. (#384)
* Fixed #408: An error type-check did not work correctly because it was missing parentheses. (#409)

htmlwidgets 1.5.3
-------------------------------------------------------
# htmlwidgets 1.5.3

### New features

Expand All @@ -54,18 +48,15 @@ htmlwidgets 1.5.3

* Fixed an issue with passing named function declarations to `JS()` and `onRender()` (introduced by v1.4). (#356)

htmlwidgets 1.5.2
-------------------------------------------------------
# htmlwidgets 1.5.2

* Emergency patch release to fix an issue with rendering htmlwidgets in flexdashboard. More generally, this change implies that any htmlwidget is printed via a knitr code chunk with multiple values for fig.width/fig.height, only the first value is used for the widget's sizing policy. (#387)

htmlwidgets 1.5.1
-------------------------------------------------------
# htmlwidgets 1.5.1

* Fixed an issue with dynamically rendered widgets (i.e., using `shiny::uiOutput()` to render a widget) with any version of shiny prior to 1.4. This issue was introduced by htmlwidgets 1.5. (#351)
* Fixed an issue with dynamically rendered widgets (i.e., using `shiny::uiOutput()` to render a widget) with any version of shiny prior to 1.4. This issue was introduced by # htmlwidgets 1.5. (#351)

htmlwidgets 1.5
-----------------------------------------------------------------------
# htmlwidgets 1.5

* Fixed an incompatibility with Shiny v1.4.0: due to Shiny upgrading
from jQuery 1.x to 3.x, the timing of some initialization routines
Expand All @@ -74,15 +65,13 @@ htmlwidgets 1.5
versions of Shiny. (#345)


htmlwidgets 1.4 (unreleased)
-----------------------------------------------------------------------
# htmlwidgets 1.4

* JavaScript statements can now be passed along to `onRender()` and
`JS()` (#329).


htmlwidgets 1.3
-----------------------------------------------------------------------
# htmlwidgets 1.3

* All files and directories under the `inst/htmlwidgets/` directory of
a widget package will be copied when a widget is rendered due to an
Expand All @@ -97,8 +86,7 @@ htmlwidgets 1.3
See https://rstudio.github.io/promises for more about async Shiny.


htmlwidgets 1.2
-----------------------------------------------------------------------
# htmlwidgets 1.2

* htmlwidgets can be created without a package, without yaml, and/or
without JavaScript binding. (#304, #305)
Expand All @@ -108,22 +96,19 @@ htmlwidgets 1.2
* Fix #297: Setting background in saveWidget() is broken


htmlwidgets 1.1
-----------------------------------------------------------------------
# htmlwidgets 1.1

* The saveWidget's background parameter could not process hex color
codes, due to changes introduced in htmlwidgets 1.0. (#297)


htmlwidgets 1.0
-----------------------------------------------------------------------
# htmlwidgets 1.0

* Fix issues with self-contained mode when used with new versions of
pandoc. (#289)


htmlwidgets 0.9
-----------------------------------------------------------------------
# htmlwidgets 0.9

* Starting with R 3.4.0, a "Calling 'structure(NULL, *)' is deprecated"
warning would occur when shinyRenderWidget encountered a NULL value.
Expand All @@ -133,8 +118,7 @@ htmlwidgets 0.9
binding's JS factory function would fail.


htmlwidgets 0.8
-----------------------------------------------------------------------
# htmlwidgets 0.8

* Export getDependency function

Expand All @@ -143,8 +127,7 @@ htmlwidgets 0.8
* Widget IDs: only restore random.seed when non-NULL


htmlwidgets 0.7
-----------------------------------------------------------------------
# htmlwidgets 0.7

* Pass knitr options to saveWidget

Expand All @@ -163,8 +146,7 @@ htmlwidgets 0.7
* Modify advanced and sizing vignettes to use new style widget declarations


htmlwidgets 0.6
-----------------------------------------------------------------------
# htmlwidgets 0.6

* Introduce new scheme for defining JavaScript bindings that will make
it easier for widgets to gain access to other widget instances on
Expand Down Expand Up @@ -192,8 +174,7 @@ htmlwidgets 0.6
* Fix issue that prevented calling renderValue() from within resize()


htmlwidgets 0.5
-----------------------------------------------------------------------
# htmlwidgets 0.5

* Add background parameter to saveWidget function

Expand All @@ -206,8 +187,7 @@ htmlwidgets 0.5
* Sync vignettes with contents of htmlwidgets website


htmlwidgets 0.4
-----------------------------------------------------------------------
# htmlwidgets 0.4

* Use minified files while scaffolding widget wherever available

Expand All @@ -222,7 +202,6 @@ htmlwidgets 0.4
* Call widget.resize in more situations


htmlwidgets 0.3.2
-----------------------------------------------------------------------
# htmlwidgets 0.3.2

* Initial release to CRAN
45 changes: 45 additions & 0 deletions R/htmlwidgets-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

#' HTML Widgets for R
#'
#' The \pkg{htmlwidgets} package provides a framework for easily creating R
#' bindings to JavaScript libraries. Widgets created using the framework can
#' be:
#'
#' * Used at the R console for data analysis just like conventional R plots (via RStudio Viewer)
#' * Seamlessly embedded within [R Markdown](https://rmarkdown.rstudio.com/) documents and [Shiny](https://shiny.rstudio.com/) web applications.
#' * Saved as standalone web pages for ad-hoc sharing via email, Dropbox, etc.
#'
#' To get started creating your own HTML widgets, see the documentation
#' available in the package vignettes:
#'
#' ```
#' vignette("develop_intro", package = "htmlwidgets")
#' vignette("develop_sizing", package = "htmlwidgets")
#' vignette("develop_advanced", package = "htmlwidgets")
#' ```
#'
#' Source code for the package is available on GitHub:
#'
#' <https://github.com/ramnathv/htmlwidgets>
#'
#' @md
#' @name htmlwidgets-package
#' @aliases htmlwidgets htmlwidgets-package
#' @docType package
#' @author Ramnath Vaidyanathan, Joe Cheng, JJ Allaire, and Yihui Xie
NULL


## usethis namespace: start
#' @import htmltools
#' @importFrom utils browseURL file.edit packageVersion
## usethis namespace: end
NULL


# For usethis::use_release_issue()
release_bullets <- function() {
c(
"Update static imports: `staticimports::import()`"
)
}
5 changes: 0 additions & 5 deletions R/imports.R

This file was deleted.

22 changes: 16 additions & 6 deletions R/staticimports.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,19 @@ get_package_version <- function(pkg) {

is_installed <- function(pkg, version = NULL) {
installed <- isNamespaceLoaded(pkg) || nzchar(system_file_cached(package = pkg))

if (is.null(version)) {
return(installed)
}

if (!is.character(version) && !inherits(version, "numeric_version")) {
# Avoid https://bugs.r-project.org/show_bug.cgi?id=18548
alert <- if (identical(Sys.getenv("TESTTHAT"), "true")) stop else warning
alert("`version` must be a character string or a `package_version` or `numeric_version` object.")

version <- numeric_version(sprintf("%0.9g", version))
}

installed && isTRUE(get_package_version(pkg) >= version)
}

Expand Down Expand Up @@ -178,11 +188,9 @@ system_file <- function(..., package = "base") {
normalizePath(files, winslash = "/")
}

# A wrapper for `system.file()`, which caches the results, because
# `system.file()` can be slow. Note that because of caching, if
# `system_file_cached()` is called on a package that isn't installed, then the
# package is installed, and then `system_file_cached()` is called again, it will
# still return "".
# A wrapper for `system.file()`, which caches the package path because
# `system.file()` can be slow. If a package is not installed, the result won't
# be cached.
system_file_cached <- local({
pkg_dir_cache <- character()

Expand All @@ -194,7 +202,9 @@ system_file_cached <- local({
not_cached <- is.na(match(package, names(pkg_dir_cache)))
if (not_cached) {
pkg_dir <- system.file(package = package)
pkg_dir_cache[[package]] <<- pkg_dir
if (nzchar(pkg_dir)) {
pkg_dir_cache[[package]] <<- pkg_dir
}
} else {
pkg_dir <- pkg_dir_cache[[package]]
}
Expand Down
28 changes: 16 additions & 12 deletions man/htmlwidgets-package.Rd

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

0 comments on commit d31dd27

Please sign in to comment.