Skip to content

Commit d31dd27

Browse files
authored
Merge pull request #470 from ramnathv/upkeep
2 parents e234c0e + cab3f2a commit d31dd27

File tree

7 files changed

+118
-82
lines changed

7 files changed

+118
-82
lines changed

DESCRIPTION

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
Package: htmlwidgets
21
Type: Package
2+
Package: htmlwidgets
33
Title: HTML Widgets for R
44
Version: 1.6.2.9000
55
Authors@R: c(
66
person("Ramnath", "Vaidyanathan", role = c("aut", "cph")),
7-
person("Yihui", "Xie", role = c("aut")),
8-
person("JJ", "Allaire", role = c("aut")),
9-
person("Joe", "Cheng", role = c("aut"), email = "[email protected]"),
10-
person("Carson", "Sievert", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-4958-2844")),
7+
person("Yihui", "Xie", role = "aut"),
8+
person("JJ", "Allaire", role = "aut"),
9+
person("Joe", "Cheng", , "[email protected]", role = "aut"),
10+
person("Carson", "Sievert", , "[email protected]", role = c("aut", "cre"),
11+
comment = c(ORCID = "0000-0002-4958-2844")),
1112
person("Kenton", "Russell", role = c("aut", "cph")),
12-
person("Ellis", "Hughes", role = c("ctb")),
13-
person(family = "RStudio", role = "cph")
14-
)
13+
person("Ellis", "Hughes", role = "ctb"),
14+
person("Posit Software, PBC", role = c("cph", "fnd"))
15+
)
1516
Description: A framework for creating HTML widgets that render in various
1617
contexts including the R console, 'R Markdown' documents, and 'Shiny'
1718
web applications.
1819
License: MIT + file LICENSE
19-
VignetteBuilder: knitr
20+
URL: https://github.com/ramnathv/htmlwidgets
21+
BugReports: https://github.com/ramnathv/htmlwidgets/issues
2022
Imports:
2123
grDevices,
2224
htmltools (>= 0.5.4),
2325
jsonlite (>= 0.9.16),
24-
yaml,
2526
knitr (>= 1.8),
26-
rmarkdown
27+
rmarkdown,
28+
yaml
2729
Suggests:
2830
testthat
29-
Enhances: shiny (>= 1.1)
30-
URL: https://github.com/ramnathv/htmlwidgets
31-
BugReports: https://github.com/ramnathv/htmlwidgets/issues
32-
RoxygenNote: 7.2.3
31+
Enhances:
32+
shiny (>= 1.1)
33+
VignetteBuilder:
34+
knitr
3335
Encoding: UTF-8
36+
RoxygenNote: 7.2.3

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2016
1+
YEAR: 2016-2023
22
COPYRIGHT HOLDER: Ramnath Vaidyanathan, Joe Cheng, JJ Allaire, Yihui Xie, and Kenton Russell

NEWS.md

Lines changed: 22 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
htmlwidgets 1.6.2.9000
2-
------------------------------------------------------
1+
# htmlwidgets (development version)
32

43

5-
htmlwidgets 1.6.2
6-
------------------------------------------------------
4+
# htmlwidgets 1.6.2
75

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

10-
htmlwidgets 1.6.1
11-
------------------------------------------------------
8+
# htmlwidgets 1.6.1
129

1310
### Bug fixes
1411

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

17-
htmlwidgets 1.6.0
18-
-------------------------------------------------------
14+
# htmlwidgets 1.6.0
1915

2016
### Potentially breaking changes
2117

@@ -29,14 +25,12 @@ htmlwidgets 1.6.0
2925
* 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.
3026
* Closed #257 and #358: `saveWidget(selfcontained=TRUE)` now correctly prevents HTML from being interpreted as markdown. (#401)
3127

32-
htmlwidgets 1.5.4
33-
-------------------------------------------------------
28+
# htmlwidgets 1.5.4
3429

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

38-
htmlwidgets 1.5.3
39-
-------------------------------------------------------
33+
# htmlwidgets 1.5.3
4034

4135
### New features
4236

@@ -54,18 +48,15 @@ htmlwidgets 1.5.3
5448

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

57-
htmlwidgets 1.5.2
58-
-------------------------------------------------------
51+
# htmlwidgets 1.5.2
5952

6053
* 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)
6154

62-
htmlwidgets 1.5.1
63-
-------------------------------------------------------
55+
# htmlwidgets 1.5.1
6456

65-
* 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)
57+
* 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)
6658

67-
htmlwidgets 1.5
68-
-----------------------------------------------------------------------
59+
# htmlwidgets 1.5
6960

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

7667

77-
htmlwidgets 1.4 (unreleased)
78-
-----------------------------------------------------------------------
68+
# htmlwidgets 1.4
7969

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

8373

84-
htmlwidgets 1.3
85-
-----------------------------------------------------------------------
74+
# htmlwidgets 1.3
8675

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

9988

100-
htmlwidgets 1.2
101-
-----------------------------------------------------------------------
89+
# htmlwidgets 1.2
10290

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

11098

111-
htmlwidgets 1.1
112-
-----------------------------------------------------------------------
99+
# htmlwidgets 1.1
113100

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

117104

118-
htmlwidgets 1.0
119-
-----------------------------------------------------------------------
105+
# htmlwidgets 1.0
120106

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

124110

125-
htmlwidgets 0.9
126-
-----------------------------------------------------------------------
111+
# htmlwidgets 0.9
127112

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

135120

136-
htmlwidgets 0.8
137-
-----------------------------------------------------------------------
121+
# htmlwidgets 0.8
138122

139123
* Export getDependency function
140124

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

145129

146-
htmlwidgets 0.7
147-
-----------------------------------------------------------------------
130+
# htmlwidgets 0.7
148131

149132
* Pass knitr options to saveWidget
150133

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

165148

166-
htmlwidgets 0.6
167-
-----------------------------------------------------------------------
149+
# htmlwidgets 0.6
168150

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

194176

195-
htmlwidgets 0.5
196-
-----------------------------------------------------------------------
177+
# htmlwidgets 0.5
197178

198179
* Add background parameter to saveWidget function
199180

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

208189

209-
htmlwidgets 0.4
210-
-----------------------------------------------------------------------
190+
# htmlwidgets 0.4
211191

212192
* Use minified files while scaffolding widget wherever available
213193

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

224204

225-
htmlwidgets 0.3.2
226-
-----------------------------------------------------------------------
205+
# htmlwidgets 0.3.2
227206

228207
* Initial release to CRAN

R/htmlwidgets-package.R

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
#' HTML Widgets for R
3+
#'
4+
#' The \pkg{htmlwidgets} package provides a framework for easily creating R
5+
#' bindings to JavaScript libraries. Widgets created using the framework can
6+
#' be:
7+
#'
8+
#' * Used at the R console for data analysis just like conventional R plots (via RStudio Viewer)
9+
#' * Seamlessly embedded within [R Markdown](https://rmarkdown.rstudio.com/) documents and [Shiny](https://shiny.rstudio.com/) web applications.
10+
#' * Saved as standalone web pages for ad-hoc sharing via email, Dropbox, etc.
11+
#'
12+
#' To get started creating your own HTML widgets, see the documentation
13+
#' available in the package vignettes:
14+
#'
15+
#' ```
16+
#' vignette("develop_intro", package = "htmlwidgets")
17+
#' vignette("develop_sizing", package = "htmlwidgets")
18+
#' vignette("develop_advanced", package = "htmlwidgets")
19+
#' ```
20+
#'
21+
#' Source code for the package is available on GitHub:
22+
#'
23+
#' <https://github.com/ramnathv/htmlwidgets>
24+
#'
25+
#' @md
26+
#' @name htmlwidgets-package
27+
#' @aliases htmlwidgets htmlwidgets-package
28+
#' @docType package
29+
#' @author Ramnath Vaidyanathan, Joe Cheng, JJ Allaire, and Yihui Xie
30+
NULL
31+
32+
33+
## usethis namespace: start
34+
#' @import htmltools
35+
#' @importFrom utils browseURL file.edit packageVersion
36+
## usethis namespace: end
37+
NULL
38+
39+
40+
# For usethis::use_release_issue()
41+
release_bullets <- function() {
42+
c(
43+
"Update static imports: `staticimports::import()`"
44+
)
45+
}

R/imports.R

Lines changed: 0 additions & 5 deletions
This file was deleted.

R/staticimports.R

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,19 @@ get_package_version <- function(pkg) {
3030

3131
is_installed <- function(pkg, version = NULL) {
3232
installed <- isNamespaceLoaded(pkg) || nzchar(system_file_cached(package = pkg))
33+
3334
if (is.null(version)) {
3435
return(installed)
3536
}
37+
38+
if (!is.character(version) && !inherits(version, "numeric_version")) {
39+
# Avoid https://bugs.r-project.org/show_bug.cgi?id=18548
40+
alert <- if (identical(Sys.getenv("TESTTHAT"), "true")) stop else warning
41+
alert("`version` must be a character string or a `package_version` or `numeric_version` object.")
42+
43+
version <- numeric_version(sprintf("%0.9g", version))
44+
}
45+
3646
installed && isTRUE(get_package_version(pkg) >= version)
3747
}
3848

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

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

@@ -194,7 +202,9 @@ system_file_cached <- local({
194202
not_cached <- is.na(match(package, names(pkg_dir_cache)))
195203
if (not_cached) {
196204
pkg_dir <- system.file(package = package)
197-
pkg_dir_cache[[package]] <<- pkg_dir
205+
if (nzchar(pkg_dir)) {
206+
pkg_dir_cache[[package]] <<- pkg_dir
207+
}
198208
} else {
199209
pkg_dir <- pkg_dir_cache[[package]]
200210
}

man/htmlwidgets-package.Rd

Lines changed: 16 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)