Compare commits

..

60 Commits

Author SHA1 Message Date
Carson
f5723b2a4d revert man/ changes to reflect CRAN version of htmltools 2020-03-11 12:04:58 -05:00
Carson
212b33a0ce bump version 2020-03-03 18:50:41 -06:00
Carson
6b7a121161 yarn build 2020-03-03 18:50:34 -06:00
Carson Sievert
c89da718b1 Merge pull request #2777 from rstudio/fix-docs
Run tools/updateHtmltools.R
2020-03-03 18:40:27 -06:00
Carson
eef3ae8387 update news and update htmltools docs 2020-03-03 16:45:57 -06:00
Winston Chang
0c53d54347 Merge pull request #2776 from rstudio/grid-r-devel
Patches for grid 4.0
2020-03-03 16:12:39 -06:00
Carson
cbbb04cf69 yarn build 2020-03-03 15:52:25 -06:00
Carson
120baf0a6e review feedback 2020-03-03 15:34:32 -06:00
Carson
685dc7cc3a Updates for new grid in r-devel 2020-03-03 15:30:12 -06:00
Alan Dipert
116794ad77 Use pkgdown for reference page generation (#2651)
* Add _pkgdown.yml, remove inst/staticdocs/index.r

* Update pkgdown.yml

* Fix pkgdown (nee staticdocs) test so that it fails as it should

* Fix pkgdown test by adding shinyServer and shinyUI to list of intentionally unindexed functions

* Remove old staticdocs test

* Fix "Boilerplate" section of reference docs

* Fix CMD CHECK

* Fix typo

* Use file-based test in get_exported()

* Skip pkgdown check on CRAN

* Fix typo in pkgdown test
2019-10-07 15:18:26 -05:00
Winston Chang
89feba870d Don't use dependency release candidates in Travis 2019-10-07 14:51:36 -05:00
Winston Chang
2a980601c0 Use absolute URL for CONTRIBUTING.md 2019-10-07 12:26:37 -05:00
Winston Chang
e1fd8ae910 Fix CONTRIBUTING.md link 2019-10-07 12:24:54 -05:00
Joe Cheng
9cb415008c Update link 2019-10-04 16:16:32 -07:00
Winston Chang
fb091ca195 Restructure NEWS 2019-10-02 15:26:14 -05:00
Winston Chang
c8daa1730b Merge pull request #2643 from rstudio/wch-fix-stack-tests
Disable stack tests on CRAN
2019-09-26 16:59:58 -05:00
Winston Chang
d195b595dd Disable call stack tests on CRAN 2019-09-26 16:23:52 -05:00
Barret Schloerke
ff3f7adff2 Merge pull request #2637 from rstudio/rc-barret-utils-packageVersion
Namespace packageVersion
2019-09-24 18:13:24 -04:00
Barret Schloerke
37781a9df7 namespace packageVersion 2019-09-24 17:36:45 -04:00
Joe Cheng
ca1c60e00e Merge pull request #2632 from rstudio/carson/jquery-legacy
Opt-in to jQuery 1.12.1
2019-09-20 17:52:37 -07:00
Carson
649f382291 Library updates -> Potentially breaking changes 2019-09-20 15:43:38 -05:00
Carson
103a35c81b review feedback 2019-09-20 15:43:38 -05:00
Carson
5af341bfdb document 2019-09-20 15:43:38 -05:00
Carson
7c7110cd83 Do nothing if the package isn't installed or meets the version requirement 2019-09-20 15:43:38 -05:00
Carson
c4ea489bff news feedback 2019-09-20 15:43:38 -05:00
Carson
60b3b6ff03 jquery legacy is 1.12.4, not 1.12.1 2019-09-20 15:43:38 -05:00
Carson
1510dca065 update news 2019-09-20 15:43:38 -05:00
Carson
2c49375928 Provide an option, shiny.jquery.version, to opt-in into jQuery 1.12.1 2019-09-20 15:43:38 -05:00
Carson
f9fc22c48b Emit an upgrade message if an old version htmlwidgets is installed 2019-09-20 15:43:38 -05:00
Alan Dipert
8d14e7ab04 Merge pull request #2625 from rstudio/fix-selectize-update
Fix updateSelectizeInput(), fixes #2624
2019-09-20 12:35:47 -07:00
Alan Dipert
8f2a28a1f2 Fix #2624 by aligning select* input handling of groups with that of updateSelect* 2019-09-19 20:16:36 +00:00
Carson Sievert
e8fb1faec0 Merge pull request #2623 from rstudio/carson/rc-ci
Fix travis build for 1.4.0
2019-09-18 13:51:46 -05:00
Carson
0e4874c412 have appveyor run github versions as well 2019-09-18 13:36:22 -05:00
Carson
933630af28 Update stack call test expectation in light of https://github.com/rstudio/promises/commit/9ebad6#diff-1220ed154f06164c0a2d6cc053c1f3c1R134 2019-09-18 13:28:32 -05:00
Carson
ff87098102 Temporarily install rc branches to get Travis passing 2019-09-18 12:58:23 -05:00
Winston Chang
6513a86bbd Merge pull request #2621 from rstudio/carson/bugfix/avoid-offsetX
Use pageX/pageY instead of offsetX/offsetY
2019-09-18 12:42:58 -05:00
Carson
97e296c5d5 Use pageX/pageY instead of offsetX/offsetY to determine if a second click is too far away before triggering a double-click event. Closes #2620 2019-09-17 17:49:20 -05:00
Winston Chang
9f87adf4e8 Merge pull request #2619 from rstudio/wch/eslint-rules
Better checking for implicit globals in JS
2019-09-17 15:18:05 -05:00
Joe Cheng
6470b3f08c Fix 062-submitbutton-demo
1) In srcjs/input_rate.js line 284, the global variable `name` was
   being written to.
2) In a couple of other places in that file, the global variable
   `name` was being read instead of `nameType`--the result of an
   incomplete refactor.

Also added an eslint rule to prevent this and other globals from
being read implicitly.
2019-09-17 12:55:47 -07:00
Joe Cheng
d1ba84525e Update version number inserted by Grunt 2019-09-17 12:41:02 -07:00
Winston Chang
05ad66c464 Better checking for implicit globals 2019-09-17 14:09:11 -05:00
Joe Cheng
a8057b96f3 Update version dependencies 2019-09-13 13:45:45 -07:00
Joe Cheng
a89e809498 Bump version to 1.4.0 2019-09-13 13:01:25 -07:00
Winston Chang
02f7a4fdc9 Rebuild documentation 2019-09-12 18:40:35 -05:00
Carson Sievert
7c7c22a597 Document default values of shiny's options (#2597)
* Document default values of shiny's options, closes #2558

* A more general description of shiny.port's default
2019-09-12 18:31:07 -05:00
Winston Chang
860fa525a2 Merge pull request #2605 from hadley/notification-id
Clarify use of id argument
2019-09-12 18:20:17 -05:00
Carson Sievert
9f0e38a28a Merge pull request #2601 from rstudio/layoutFamily
Layout Rd family
2019-09-12 13:09:00 -07:00
Jeff Allen
f834b7befb Define what all input functions yield for server (#2600)
* adding section to roxygen docs for server value of input funcs

* add more server values to roxygen docs

* add more server values

* update more server values in documentation

* Address PR feedback

I reflowed the comments to have a max width of 80 on some files, so there were a flurry of line changes, but the only substantive changes were around Joe's comments.

* Update R/input-slider.R

Co-Authored-By: Hadley Wickham <h.wickham@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Carson Sievert <cpsievert1@gmail.com>

* PR feedback, regenerate docs.

* PR Feedback

* Eliminate extra newline

* passwordInput()'s server value

* varSelectInput()'s server value

* document
2019-09-12 20:02:44 +00:00
Winston Chang
7f3a45fb5b Merge pull request #2560 from rstudio/barret-reactlog-keybindings
Use ctrl/cmd + shift + f3 to mark reactlog and Return a 501 error code if reactlog disabled
2019-09-12 10:29:57 -05:00
Barret Schloerke
b0953e810b merge master 2019-09-12 10:26:38 -04:00
Hadley Wickham
52a86012e5 Update R/notifications.R
Co-Authored-By: Carson Sievert <cpsievert1@gmail.com>
2019-09-12 09:09:09 -05:00
Hadley Wickham
2a06fe6baf Clarify use of id argument 2019-09-12 08:28:27 -05:00
Carson
6e688d2175 add fillPage() to the family as well 2019-09-11 16:30:25 -05:00
Carson
b610fd1f56 Hadley's feedback 2019-09-11 16:29:48 -05:00
Carson
a4730096f4 code review 2019-09-11 15:23:41 -05:00
leslie-huang
6a02439944 add @ family to all layout functions 2019-09-11 15:15:38 -05:00
Barret Schloerke
1685e1c310 Merge branch 'master' into barret-reactlog-keybindings
* master: (22 commits)
  Fix upper-case test
  autload
  - update NEWS - only source global in server.R mode - only use intermediary environment if opted-in to autoloading.
  Only use loadSupport if opted-in to autload.r
  Fix default param
  Make loading helpers opt-in.
  Clarify docs
  Update to new signature in test.
  Move global.R sourcing into an exported load function
  Only load top-level R files in R/
  Require capitalized R/ dir.
  Correct mistake around app.R in global
  Add news
  Fix options test
  Test ui/server/app/global sourcing.
  Revert "DI the source function for testing."
  DI the source function for testing.
  Load helpers into isolated environment
  Fix expectations.
  Add dynamically-generated case-sensitive test.
  ...
2019-08-28 12:26:39 -04:00
Barret Schloerke
332f5a1266 add js for opening broken reactlog routes 2019-08-28 12:24:17 -04:00
Barret Schloerke
68d67a8194 Update NEWS.md 2019-08-27 17:51:10 -04:00
Barret Schloerke
756ac1514c Use ctrl/cmd + shift + f3 to mark reactlog; return a 501 error code for reactlog paths when reactlog is disabled
Open a new webpage even if only marking a time.
2019-08-27 17:50:46 -04:00
77 changed files with 12236 additions and 659 deletions

View File

@@ -19,6 +19,7 @@ matrix:
r: release
- name: "Development Release Check"
r: devel
sudo: false
cache: packages
notifications:

View File

@@ -1,7 +1,7 @@
Package: shiny
Type: Package
Title: Web Application Framework for R
Version: 1.3.2.9001
Version: 1.4.0.1
Authors@R: c(
person("Winston", "Chang", role = c("aut", "cre"), email = "winston@rstudio.com"),
person("Joe", "Cheng", role = "aut", email = "joe@rstudio.com"),
@@ -65,16 +65,16 @@ Depends:
Imports:
utils,
grDevices,
httpuv (>= 1.5.1.9002),
httpuv (>= 1.5.2),
mime (>= 0.3),
jsonlite (>= 0.9.16),
xtable,
digest,
htmltools (>= 0.3.6.9004),
htmltools (>= 0.4.0),
R6 (>= 2.0),
sourcetools,
later (>= 0.7.2),
promises (>= 1.0.1),
later (>= 1.0.0),
promises (>= 1.1.0),
tools,
crayon,
rlang (>= 0.4.0),
@@ -88,10 +88,8 @@ Suggests:
rmarkdown,
ggplot2,
reactlog (>= 1.0.0),
magrittr
Remotes:
rstudio/htmltools,
rstudio/httpuv
magrittr,
yaml
URL: http://shiny.rstudio.com
BugReports: https://github.com/rstudio/shiny/issues
Collate:

View File

@@ -84,7 +84,6 @@ export(fileInput)
export(fillCol)
export(fillPage)
export(fillRow)
export(findPort)
export(fixedPage)
export(fixedPanel)
export(fixedRow)

46
NEWS.md
View File

@@ -1,41 +1,51 @@
shiny 1.3.2.9001
=======
shiny 1.4.0.1
===========
## Changes
Minor patch release to account for changes to the grid package that will be upcoming in the R 4.0 release ([#2776](https://github.com/rstudio/shiny/pull/2776)).
* Resolved [#1433](https://github.com/rstudio/shiny/issues/1433): `plotOutput()`'s coordmap info now includes discrete axis limits for **ggplot2** plots. As a result, any **shinytest** tests that contain **ggplot2** plots with discrete axes (that were recorded before this change) will now report differences that can safely be updated. This new coordmap info was added to correctly infer what data points are within an input brush and/or near input click/hover in scenarios where a non-trivial discrete axis scale is involved (e.g., whenever `scale_[x/y]_discrete(limits = ...)` and/or free scales across multiple discrete axes are used). ([#2410](https://github.com/rstudio/shiny/pull/2410))
shiny 1.4.0
===========
## Full changelog
### Breaking changes
* Resolved [#2554](https://github.com/rstudio/shiny/issues/2554): Upgraded jQuery from v.1.12.4 to v3.4.1 and bootstrap from v3.3.7 to v3.4.1. ([#2557](https://github.com/rstudio/shiny/pull/2557)). Since the jQuery upgrade may introduce breaking changes to user code, there is an option to switch back to the old version by setting `options(shiny.jquery.version = 1)`. If you've hard-coded `shared/jquery[.min].js` in the HTML of your Shiny app, in order to downgrade, you'll have to change that filepath to `shared/legacy/jquery[.min].js`.
### Improvements
* Resolved [#1433](https://github.com/rstudio/shiny/issues/1433): `plotOutput()`'s coordmap info now includes discrete axis limits for **ggplot2** plots. As a result, any **shinytest** tests that contain **ggplot2** plots with discrete axes (that were recorded before this change) will now report differences that can safely be updated. This new coordmap info was added to correctly infer what data points are within an input brush and/or near input click/hover in scenarios where a non-trivial discrete axis scale is involved (e.g., whenever `scale_[x/y]_discrete(limits = ...)` and/or free scales across multiple discrete axes are used). ([#2410](https://github.com/rstudio/shiny/pull/2410))
* Resolved [#2402](https://github.com/rstudio/shiny/issues/2402): An informative warning is now thrown for mis-specified (date) strings in `dateInput()`, `updateDateInput()`, `dateRangeInput()`, and `updateDateRangeInput()`. ([#2403](https://github.com/rstudio/shiny/pull/2403))
* If the `shiny.autoload.r` option is set to `TRUE`, all files ending in `.r` or `.R` contained in a directory named `R/` adjacent to your application are sourced when your app is started. This will become the default Shiny behavior in a future release ([#2547](https://github.com/rstudio/shiny/pull/2547))
* Resolved [#2442](https://github.com/rstudio/shiny/issues/2442): The `shiny:inputchanged` JavaScript event now triggers on the related input element instead of `document`. Existing event listeners bound to `document` will still detect the event due to event bubbling. ([#2446](https://github.com/rstudio/shiny/pull/2446))
* Fixed [#1393](https://github.com/rstudio/shiny/issues/1393), [#2223](https://github.com/rstudio/shiny/issues/2223): For plots with any interactions enabled, the image is no longer draggable. ([#2460](https://github.com/rstudio/shiny/pull/2460))
* Resolved [#2469](https://github.com/rstudio/shiny/issues/2469): `renderText` now takes a `sep` argument that is passed to `cat`. ([#2497](https://github.com/rstudio/shiny/pull/2497))
* Added `resourcePaths()` and `removeResourcePaths()` functions. ([#2459](https://github.com/rstudio/shiny/pull/2459))
* Resolved [#2433](https://github.com/rstudio/shiny/issues/2433): An informative warning is now thrown if subdirectories of the app's `www/` directory are masked by other resource prefixes and/or the same resource prefix is mapped to different local file paths. ([#2434](https://github.com/rstudio/shiny/pull/2434))
* Resolved [#2478](https://github.com/rstudio/shiny/issues/2478): `cmd + shift + f3` and `ctrl + shift + f3` can now be used to add a reactlog mark. If reactlog keybindings are used and the reactlog is not enabled, an error page is displayed showing how to enable reactlog recordings. ([#2560](https://github.com/rstudio/shiny/pull/2560))
### Bug fixes
* Partially resolved [#2423](https://github.com/rstudio/shiny/issues/2423): Reactivity in Shiny leaked some memory, because R can leak memory whenever a new symbols is interned, which happens whenever a new name/key is used in an environment. R now uses the fastmap package, which avoids this problem. ([#2429](https://github.com/rstudio/shiny/pull/2429))
* Fixed [#2267](https://github.com/rstudio/shiny/issues/2267): Fixed a memory leak with `invalidateLater`. ([#2555](https://github.com/rstudio/shiny/pull/2555))
* Fixed [#1548](https://github.com/rstudio/shiny/issues/1548): The `reactivePoll` function leaked an observer; that is the observer would continue to exist even if the `reactivePoll` object was no longer accessible. [#2522](https://github.com/rstudio/shiny/pull/2522)
* Resolved [#2469](https://github.com/rstudio/shiny/issues/2469): `renderText` now takes a `sep` argument that is passed to `cat`. ([#2497](https://github.com/rstudio/shiny/pull/2497))
* Fixed [#2116](https://github.com/rstudio/shiny/issues/2116): Fixed an issue where dynamic tabs could not be added when on a hosted platform. ([#2545](https://github.com/rstudio/shiny/pull/2545))
* Added `resourcePaths()` and `removeResourcePaths()` functions. ([#2459](https://github.com/rstudio/shiny/pull/2459))
* Resolved [#2515](https://github.com/rstudio/shiny/issues/2515): `selectInput()` now deals appropriately with named factors. ([#2524](https://github.com/rstudio/shiny/pull/2524))
* Resolved [#2433](https://github.com/rstudio/shiny/issues/2433): An informative warning is now thrown if subdirectories of the app's `www/` directory are masked by other resource prefixes and/or the same resource prefix is mapped to different local file paths. ([#2434](https://github.com/rstudio/shiny/pull/2434))
* Resolved [#2515](https://github.com/rstudio/shiny/issues/2515): `selectInput()` and `selectizeInput()` now deal appropriately with named factors. Note that `updateSelectInput()` and `updateSelectizeInput()` **do not** yet handle factors; their behavior is unchanged. ([#2524](https://github.com/rstudio/shiny/pull/2524), [#2540](https://github.com/rstudio/shiny/pull/2540), [#2625](https://github.com/rstudio/shiny/pull/2625))
* Resolved [#2471](https://github.com/rstudio/shiny/issues/2471): Large file uploads to a Windows computer were slow. ([#2579](https://github.com/rstudio/shiny/pull/2579))
### Bug fixes
* Fixed [#2116](https://github.com/rstudio/shiny/issues/2116): Fixed an issue where dynamic tabs could not be added when on a hosted platform. ([#2545](https://github.com/rstudio/shiny/pull/2545))
* Fixed [#2387](https://github.com/rstudio/shiny/issues/2387): Updating a `sliderInput()`'s type from numeric to date no longer changes the rate policy from debounced to immediate. More generally, updating an input binding with a new type should (no longer) incorrectly alter the input rate policy. ([#2404](https://github.com/rstudio/shiny/pull/2404))
* Fixed [#868](https://github.com/rstudio/shiny/issues/868): If an input is initialized with a `NULL` label, it can now be updated with a string. Moreover, if an input label is initialized with a string, it can now be removed by updating with `label=character(0)` (similar to how `choices` and `selected` can be cleared in `updateSelectInput()`). ([#2406](https://github.com/rstudio/shiny/pull/2406))
@@ -56,10 +66,6 @@ shiny 1.3.2.9001
* Fixed [#2329](https://github.com/rstudio/shiny/issues/2329), [#1817](https://github.com/rstudio/shiny/issues/1817): These bugs were reported as fixed in Shiny 1.3.0 but were not actually fixed because some JavaScript changes were accidentally not included in the release. The fix resolves issues that occur when `withProgressBar()` or bookmarking are combined with the [networkD3](https://christophergandrud.github.io/networkD3/) package's Sankey plot.
### Library updates
* Resolved [#2554](https://github.com/rstudio/shiny/issues/2554): Upgraded bootstrap to v3.4.1 and jQuery to v3.4.1. ([#2557](https://github.com/rstudio/shiny/pull/2557))
shiny 1.3.2
===========
@@ -630,7 +636,7 @@ There are many more minor features, small improvements, and bug fixes than we ca
* **Code Diagnostics**: if there is an error parsing `ui.R`, `server.R`, `app.R`, or `global.R`, Shiny will search the code for missing commas, extra commas, and unmatched braces, parens, and brackets, and will print out messages pointing out those problems. ([#1126](https://github.com/rstudio/shiny/pull/1126))
* **Reactlog visualization**: by default, the [`showReactLog()` function](http://shiny.rstudio.com/reference/shiny/latest/showReactLog.html) (which brings up the reactive graph) also displays the time that each reactive and observer were active for:
* **Reactlog visualization**: by default, the [`showReactLog()` function](http://shiny.rstudio.com/reference/shiny/latest/reactlog.html) (which brings up the reactive graph) also displays the time that each reactive and observer were active for:
<p align="center">
<img src="http://shiny.rstudio.com/images/reactlog.png" alt="modal-dialog" width="75%"/>

View File

@@ -28,7 +28,8 @@
#' Shiny-Application-Layout-Guide](http://shiny.rstudio.com/articles/layout-guide.html) for additional details on laying out fluid
#' pages.
#'
#' @seealso [column()], [sidebarLayout()]
#' @family layout functions
#' @seealso [column()]
#'
#' @examples
#' ## Only run examples in interactive R sessions
@@ -130,6 +131,8 @@ fluidRow <- function(...) {
#' Shiny Application Layout Guide](http://shiny.rstudio.com/articles/layout-guide.html) for additional details on laying out fixed
#' pages.
#'
#' @family layout functions
#'
#' @seealso [column()]
#'
#' @examples
@@ -243,7 +246,6 @@ column <- function(width, ..., offset = 0) {
#' `title` tag within the head. You can also specify a page title
#' explicitly using the `title` parameter of the top-level page function.
#'
#'
#' @examples
#' ## Only run examples in interactive R sessions
#' if (interactive()) {
@@ -279,6 +281,8 @@ titlePanel <- function(title, windowTitle=title) {
#' width must be 12 or less.
#' @param ... Output elements to include in the sidebar/main panel.
#'
#' @family layout functions
#'
#' @examples
#' ## Only run examples in interactive R sessions
#' if (interactive()) {
@@ -369,7 +373,7 @@ mainPanel <- function(..., width = 8) {
#' @param fluid `TRUE` to use fluid layout; `FALSE` to use fixed
#' layout.
#'
#' @seealso [fluidPage()], [flowLayout()]
#' @family layout functions
#'
#' @examples
#' ## Only run examples in interactive R sessions
@@ -407,7 +411,7 @@ verticalLayout <- function(..., fluid = TRUE) {
#' @param cellArgs Any additional attributes that should be used for each cell
#' of the layout.
#'
#' @seealso [verticalLayout()]
#' @family layout functions
#'
#' @examples
#' ## Only run examples in interactive R sessions
@@ -463,6 +467,8 @@ inputPanel <- function(...) {
#' @param cellArgs Any additional attributes that should be used for each cell
#' of the layout.
#'
#' @family layout functions
#'
#' @examples
#' ## Only run examples in interactive R sessions
#' if (interactive()) {

View File

@@ -130,6 +130,8 @@ basicPage <- function(...) {
#' @param bootstrap If `TRUE`, load the Bootstrap CSS library.
#' @param theme URL to alternative Bootstrap stylesheet.
#'
#' @family layout functions
#'
#' @examples
#' fillPage(
#' tags$style(type = "text/css",
@@ -233,6 +235,8 @@ collapseSizes <- function(padding) {
#' [updateNavbarPage()], [insertTab()],
#' [showTab()]
#'
#' @family layout functions
#'
#' @examples
#' navbarPage("App Title",
#' tabPanel("Plot"),

View File

@@ -16,7 +16,9 @@ register_s3_method <- function(pkg, generic, class, fun = NULL) {
registerS3method(generic, class, fun, envir = asNamespace(pkg))
}
# Always register hook in case package is later unloaded & reloaded
# Always register hook in case pkg is loaded at some
# point the future (or, potentially, but less commonly,
# unloaded & reloaded)
setHook(
packageEvent(pkg, "onLoad"),
function(...) {
@@ -25,6 +27,37 @@ register_s3_method <- function(pkg, generic, class, fun = NULL) {
)
}
register_upgrade_message <- function(pkg, version) {
# Is an out-dated version of this package installed?
needs_upgrade <- function() {
if (system.file(package = pkg) == "")
return(FALSE)
if (utils::packageVersion(pkg) >= version)
return(FALSE)
TRUE
}
msg <- sprintf(
"This version of Shiny is designed to work with '%s' >= %s.
Please upgrade via install.packages('%s').",
pkg, version, pkg
)
if (pkg %in% loadedNamespaces() && needs_upgrade()) {
packageStartupMessage(msg)
}
# Always register hook in case pkg is loaded at some
# point the future (or, potentially, but less commonly,
# unloaded & reloaded)
setHook(
packageEvent(pkg, "onLoad"),
function(...) {
if (needs_upgrade()) packageStartupMessage(msg)
}
)
}
.onLoad <- function(libname, pkgname) {
# R's lazy-loading package scheme causes the private seed to be cached in the
# package itself, making our PRNG completely deterministic. This line resets
@@ -36,18 +69,10 @@ register_s3_method <- function(pkg, generic, class, fun = NULL) {
register_s3_method("knitr", "knit_print", "reactive")
register_s3_method("knitr", "knit_print", "shiny.appobj")
register_s3_method("knitr", "knit_print", "shiny.render.function")
}
.onAttach <- function(libname, pkgname) {
# Check for htmlwidgets version, if installed. As of Shiny 0.12.0 and
# htmlwidgets 0.4, both packages switched from RJSONIO to jsonlite. Because of
# this change, Shiny 0.12.0 will work only with htmlwidgets >= 0.4, and vice
# versa.
if (system.file(package = "htmlwidgets") != "" &&
utils::packageVersion("htmlwidgets") < "0.4") {
packageStartupMessage(
"This version of Shiny is designed to work with htmlwidgets >= 0.4. ",
"Please upgrade your version of htmlwidgets."
)
}
# Shiny 1.4.0 bumps jQuery 1.x to 3.x, which caused a problem
# with static-rendering of htmlwidgets, and htmlwidgets 1.5
# includes a fix for this problem
# https://github.com/rstudio/shiny/issues/2630
register_upgrade_message("htmlwidgets", 1.5)
}

View File

@@ -37,6 +37,13 @@
#' }
#'
#' @seealso [observeEvent()] and [eventReactive()]
#'
#' @section Server value:
#' An integer of class `"shinyActionButtonValue"`. This class differs from
#' ordinary integers in that a value of 0 is considered "falsy".
#' This implies two things:
#' * Event handlers (e.g., [observeEvent()], [eventReactive()]) won't execute on initial load.
#' * Input validation (e.g., [req()], [need()]) will fail on initial load.
#' @export
actionButton <- function(inputId, label, icon = NULL, width = NULL, ...) {

View File

@@ -22,6 +22,10 @@
#' }
#' shinyApp(ui, server)
#' }
#'
#' @section Server value:
#' `TRUE` if checked, `FALSE` otherwise.
#'
#' @export
checkboxInput <- function(inputId, label, value = FALSE, width = NULL) {

View File

@@ -67,6 +67,9 @@
#'
#' shinyApp(ui, server)
#' }
#' @section Server value:
#' Character vector of values corresponding to the boxes that are checked.
#'
#' @export
checkboxGroupInput <- function(inputId, label, choices = NULL, selected = NULL,
inline = FALSE, width = NULL, choiceNames = NULL, choiceValues = NULL) {

View File

@@ -86,6 +86,10 @@
#'
#' shinyApp(ui, server = function(input, output) { })
#' }
#'
#' @section Server value:
#' A [Date] vector of length 1.
#'
#' @export
dateInput <- function(inputId, label, value = NULL, min = NULL, max = NULL,
format = "yyyy-mm-dd", startview = "month", weekstart = 0,

View File

@@ -70,6 +70,10 @@
#'
#' shinyApp(ui, server = function(input, output) { })
#' }
#'
#' @section Server value:
#' A [Date] vector of length 2.
#'
#' @export
dateRangeInput <- function(inputId, label, start = NULL, end = NULL,
min = NULL, max = NULL, format = "yyyy-mm-dd", startview = "month",

View File

@@ -3,21 +3,7 @@
#' Create a file upload control that can be used to upload one or more files.
#'
#' Whenever a file upload completes, the corresponding input variable is set
#' to a dataframe. This dataframe contains one row for each selected file, and
#' the following columns:
#' \describe{
#' \item{`name`}{The filename provided by the web browser. This is
#' **not** the path to read to get at the actual data that was uploaded
#' (see
#' `datapath` column).}
#' \item{`size`}{The size of the uploaded data, in
#' bytes.}
#' \item{`type`}{The MIME type reported by the browser (for example,
#' `text/plain`), or empty string if the browser didn't know.}
#' \item{`datapath`}{The path to a temp file that contains the data that was
#' uploaded. This file may be deleted if the user performs another upload
#' operation.}
#' }
#' to a dataframe. See the `Server value` section.
#'
#' @family input elements
#'
@@ -71,6 +57,23 @@
#'
#' shinyApp(ui, server)
#' }
#'
#' @section Server value:
#' A `data.frame` that contains one row for each selected file, and following columns:
#' \describe{
#' \item{`name`}{The filename provided by the web browser. This is
#' **not** the path to read to get at the actual data that was uploaded
#' (see
#' `datapath` column).}
#' \item{`size`}{The size of the uploaded data, in
#' bytes.}
#' \item{`type`}{The MIME type reported by the browser (for example,
#' `text/plain`), or empty string if the browser didn't know.}
#' \item{`datapath`}{The path to a temp file that contains the data that was
#' uploaded. This file may be deleted if the user performs another upload
#' operation.}
#' }
#'
#' @export
fileInput <- function(inputId, label, multiple = FALSE, accept = NULL,
width = NULL, buttonLabel = "Browse...", placeholder = "No file selected") {

View File

@@ -24,6 +24,10 @@
#' }
#' shinyApp(ui, server)
#' }
#'
#' @section Server value:
#' A numeric vector of length 1.
#'
#' @export
numericInput <- function(inputId, label, value, min = NA, max = NA, step = NA,
width = NULL) {

View File

@@ -8,6 +8,10 @@
#' @family input elements
#' @seealso [updateTextInput()]
#'
#' @section Server value:
#' A character string of the password input. The default value is `""`
#' unless `value` is provided.
#'
#' @examples
#' ## Only run examples in interactive R sessions
#' if (interactive()) {

View File

@@ -80,6 +80,10 @@
#'
#' shinyApp(ui, server)
#' }
#'
#' @section Server value:
#' A character string containing the value of the selected button.
#'
#' @export
radioButtons <- function(inputId, label, choices = NULL, selected = NULL,
inline = FALSE, width = NULL, choiceNames = NULL, choiceValues = NULL) {

View File

@@ -3,33 +3,32 @@
#' Create a select list that can be used to choose a single or multiple items
#' from a list of values.
#'
#' By default, `selectInput()` and `selectizeInput()` use the
#' JavaScript library \pkg{selectize.js}
#' (<https://github.com/selectize/selectize.js>) instead of the basic
#' select input element. To use the standard HTML select input element, use
#' `selectInput()` with `selectize=FALSE`.
#' By default, `selectInput()` and `selectizeInput()` use the JavaScript library
#' \pkg{selectize.js} (<https://github.com/selectize/selectize.js>) instead of
#' the basic select input element. To use the standard HTML select input
#' element, use `selectInput()` with `selectize=FALSE`.
#'
#' In selectize mode, if the first element in `choices` has a value of
#' `""`, its name will be treated as a placeholder prompt. For example:
#' In selectize mode, if the first element in `choices` has a value of `""`, its
#' name will be treated as a placeholder prompt. For example:
#' `selectInput("letter", "Letter", c("Choose one" = "", LETTERS))`
#'
#' @inheritParams textInput
#' @param choices List of values to select from. If elements of the list are
#' named, then that name --- rather than the value --- is displayed to the
#' user. It's also possible to group related inputs by providing a named list
#' whose elements are (either named or unnamed) lists, vectors, or factors. In this
#' case, the outermost names will be used as the group labels (leveraging the
#' `<optgroup>` HTML tag) for the elements in the respective sublist. See the
#' example section for a small demo of this feature.
#' @param selected The initially selected value (or multiple values if
#' `multiple = TRUE`). If not specified then defaults to the first value
#' for single-select lists and no values for multiple select lists.
#' whose elements are (either named or unnamed) lists, vectors, or factors. In
#' this case, the outermost names will be used as the group labels (leveraging
#' the `<optgroup>` HTML tag) for the elements in the respective sublist. See
#' the example section for a small demo of this feature.
#' @param selected The initially selected value (or multiple values if `multiple
#' = TRUE`). If not specified then defaults to the first value for
#' single-select lists and no values for multiple select lists.
#' @param multiple Is selection of multiple items allowed?
#' @param selectize Whether to use \pkg{selectize.js} or not.
#' @param size Number of items to show in the selection box; a larger number
#' will result in a taller box. Not compatible with `selectize=TRUE`.
#' Normally, when `multiple=FALSE`, a select input will be a drop-down
#' list, but when `size` is set, it will be a box instead.
#' Normally, when `multiple=FALSE`, a select input will be a drop-down list,
#' but when `size` is set, it will be a box instead.
#' @return A select list control that can be added to a UI definition.
#'
#' @family input elements
@@ -72,6 +71,11 @@
#' }
#' )
#' }
#'
#' @section Server value: A vector of character strings, usually of length
#' 1, with the value of the selected items. When `multiple=TRUE` and
#' nothing is selected, this value will be `NULL`.
#'
#' @export
selectInput <- function(inputId, label, choices, selected = NULL,
multiple = FALSE, selectize = TRUE, width = NULL,
@@ -225,18 +229,6 @@ selectizeIt <- function(inputId, select, options, nonempty = FALSE) {
#' Create a select list that can be used to choose a single or multiple items
#' from the column names of a data frame.
#'
#' The resulting server `input` value will be returned as:
#' \itemize{
#' \item a symbol if `multiple = FALSE`. The `input` value should be
#' used with rlang's [rlang::!!()]. For example,
#' `ggplot2::aes(!!input$variable)`.
#' \item a list of symbols if `multiple = TRUE`. The `input` value
#' should be used with rlang's [rlang::!!!()] to expand
#' the symbol list as individual arguments. For example,
#' `dplyr::select(mtcars, !!!input$variabls)` which is
#' equivalent to `dplyr::select(mtcars, !!input$variabls[[1]], !!input$variabls[[2]], ..., !!input$variabls[[length(input$variabls)]])`.
#' }
#'
#' By default, `varSelectInput()` and `selectizeInput()` use the
#' JavaScript library \pkg{selectize.js}
#' (<https://github.com/selectize/selectize.js>) to instead of the basic
@@ -249,6 +241,19 @@ selectizeIt <- function(inputId, select, options, nonempty = FALSE) {
#'
#' @family input elements
#' @seealso [updateSelectInput()]
#'
#' @section Server value:
#' The resulting server `input` value will be returned as:
#'
#' * A symbol if `multiple = FALSE`. The `input` value should be
#' used with rlang's [rlang::!!()]. For example,
#' `ggplot2::aes(!!input$variable)`.
#' * A list of symbols if `multiple = TRUE`. The `input` value
#' should be used with rlang's [rlang::!!!()] to expand
#' the symbol list as individual arguments. For example,
#' `dplyr::select(mtcars, !!!input$variabls)` which is
#' equivalent to `dplyr::select(mtcars, !!input$variabls[[1]], !!input$variabls[[2]], ..., !!input$variabls[[length(input$variabls)]])`.
#'
#' @examples
#'
#' ## Only run examples in interactive R sessions

View File

@@ -70,6 +70,10 @@
#' # Complete app with UI and server components
#' shinyApp(ui, server)
#' }
#'
#' @section Server value:
#' A number, or in the case of slider range, a vector of two numbers.
#'
#' @export
sliderInput <- function(inputId, label, min, max, value, step = NULL,
round = FALSE, format = NULL, locale = NULL,

View File

@@ -28,6 +28,11 @@
#' }
#' shinyApp(ui, server)
#' }
#'
#' @section Server value:
#' A character string of the text input. The default value is `""`
#' unless `value` is provided.
#'
#' @export
textInput <- function(inputId, label, value = "", width = NULL,
placeholder = NULL) {

View File

@@ -35,6 +35,11 @@
#' shinyApp(ui, server)
#'
#' }
#'
#' @section Server value:
#' A character string of the text input. The default value is `""`
#' unless `value` is provided.
#'
#' @export
textAreaInput <- function(inputId, label, value = "", width = NULL, height = NULL,
cols = NULL, rows = NULL, placeholder = NULL, resize = NULL) {

View File

@@ -92,7 +92,10 @@ generateOptions <- function(inputId, selected, inline, type = 'checkbox',
# True when a choice list item represents a group of related inputs.
isGroup <- function(choice) {
length(choice) > 1 || !is.null(names(choice))
is.list(choice) ||
!is.null(names(choice)) ||
length(choice) > 1 ||
length(choice) == 0
}
# True when choices is a list and contains at least one group of related inputs.
@@ -131,6 +134,10 @@ processFlatChoices <- function(choices) {
processGroupedChoices <- function(choices) {
# We assert choices is a list, since only a list may contain a group.
stopifnot(is.list(choices))
# The list might be unnamed by this point. We add default names of "" so that
# names(choices) is not zero-length and mapply can work. Within mapply, we
# error if any group's name is ""
choices <- asNamed(choices)
choices <- mapply(function(name, choice) {
choiceIsGroup <- isGroup(choice)
if (choiceIsGroup && name == "") {

View File

@@ -3,7 +3,27 @@ NULL
reactLogHandler <- function(req) {
if (! rLog$isLogging()) {
return(NULL)
if (
identical(req$PATH_INFO, "/reactlog/mark") ||
identical(req$PATH_INFO, "/reactlog")
) {
# is not logging, but is a reactlog path...
return(
httpResponse(
# Not Implemented
# - The server either does not recognize the request method, or it lacks the ability to fulfil the request.
status = 501,
content_type = "text/plain; charset=utf-8",
content = "To enable reactlog, set the following option before running the application: \n\noptions(shiny.reactlog = TRUE)"
)
)
} else {
# continue on like normal
return(NULL)
}
}
if (identical(req$PATH_INFO, "/reactlog/mark")) {
@@ -37,6 +57,7 @@ reactLogHandler <- function(req) {
))
} else {
# continue on like normal
return(NULL)
}
}

View File

@@ -12,11 +12,13 @@
#' disappear.
#' @param closeButton If `TRUE`, display a button which will make the
#' notification disappear when clicked. If `FALSE` do not display.
#' @param id An ID string. This can be used to change the contents of an
#' existing message with `showNotification`, or to remove it with
#' `removeNotification`. If not provided, one will be generated
#' automatically. If an ID is provided and there does not currently exist a
#' notification with that ID, a new notification will be created with that ID.
#' @param id A unique identifier for the notification.
#'
#' `id` is optional for `showNotification()`: Shiny will automatically create
#' one if needed. If you do supply it, Shiny will update an existing
#' notification if it exists, otherwise it will create a new one.
#'
#' `id` is required for `removeNotification()`.
#' @param type A string which controls the color of the notification. One of
#' "default" (gray), "message" (blue), "warning" (yellow), or "error" (red).
#' @param session Session object to send notification to.
@@ -97,10 +99,8 @@ showNotification <- function(ui, action = NULL, duration = 5,
#' @rdname showNotification
#' @export
removeNotification <- function(id = NULL, session = getDefaultReactiveDomain()) {
if (is.null(id)) {
stop("id is required.")
}
removeNotification <- function(id, session = getDefaultReactiveDomain()) {
force(id)
session$sendNotification("remove", id)
id
}

View File

@@ -889,6 +889,14 @@ find_panel_info_non_api <- function(b, ggplot_format) {
})
}
# Use public API for getting the unit's type (grid::unitType(), added in R 4.0)
# https://github.com/wch/r-source/blob/f9b8a42/src/library/grid/R/unit.R#L179
getUnitType <- function(u) {
tryCatch(
get("unitType", envir = asNamespace("grid"))(u),
error = function(e) attr(u, "unit", exact = TRUE)
)
}
# Given a gtable object, return the x and y ranges (in pixel dimensions)
find_panel_ranges <- function(g, res) {
@@ -904,11 +912,11 @@ find_panel_ranges <- function(g, res) {
if (inherits(x, "unit.list")) {
# For ggplot2 <= 1.0.1
vapply(x, FUN.VALUE = logical(1), function(u) {
isTRUE(attr(u, "unit", exact = TRUE) == "null")
isTRUE(getUnitType(u) == "null")
})
} else {
# For later versions of ggplot2
attr(x, "unit", exact = TRUE) == "null"
getUnitType(x) == "null"
}
}
@@ -948,7 +956,11 @@ find_panel_ranges <- function(g, res) {
# The plotting panels all are 'null' units.
null_sizes <- rep(NA_real_, length(rel_sizes))
null_sizes[null_idx] <- as.numeric(rel_sizes[null_idx])
# Workaround for `[.unit` forbidding zero-length subsets
# https://github.com/wch/r-source/blob/f9b8a42/src/library/grid/R/unit.R#L448-L450
if (length(null_idx)) {
null_sizes[null_idx] <- as.numeric(rel_sizes[null_idx])
}
# Total size allocated for panels is the total image size minus absolute
# (non-panel) elements.

View File

@@ -724,7 +724,7 @@ isRunning <- function() {
#' }
#' @export
runApp <- function(appDir=getwd(),
port=getOption('shiny.port', findPort(host = host)),
port=getOption('shiny.port'),
launch.browser=getOption('shiny.launch.browser',
interactive()),
host=getOption('shiny.host', '127.0.0.1'),
@@ -794,12 +794,12 @@ runApp <- function(appDir=getwd(),
if (arg %in% names(appOps)) appOps[[arg]] else default
}
if (missing(host))
host <- findVal("host", host %OR% '0.0.0.0')
if (missing(port))
port <- findVal("port", port %OR% findPort(host = host))
port <- findVal("port", port)
if (missing(launch.browser))
launch.browser <- findVal("launch.browser", launch.browser)
if (missing(host))
host <- findVal("host", host)
if (missing(quiet))
quiet <- findVal("quiet", quiet)
if (missing(display.mode))
@@ -807,6 +807,8 @@ runApp <- function(appDir=getwd(),
if (missing(test.mode))
test.mode <- findVal("test.mode", test.mode)
if (is.null(host) || is.na(host)) host <- '0.0.0.0'
workerId(workerId)
if (inShinyServer()) {
@@ -881,6 +883,44 @@ runApp <- function(appDir=getwd(),
require(shiny)
# determine port if we need to
if (is.null(port)) {
# Try up to 20 random ports. If we don't succeed just plow ahead
# with the final value we tried, and let the "real" startServer
# somewhere down the line fail and throw the error to the user.
#
# If we (think we) succeed, save the value as .globals$lastPort,
# and try that first next time the user wants a random port.
for (i in 1:20) {
if (!is.null(.globals$lastPort)) {
port <- .globals$lastPort
.globals$lastPort <- NULL
}
else {
# Try up to 20 random ports
while (TRUE) {
port <- p_randomInt(3000, 8000)
# Reject ports in this range that are considered unsafe by Chrome
# http://superuser.com/questions/188058/which-ports-are-considered-unsafe-on-chrome
# https://github.com/rstudio/shiny/issues/1784
if (!port %in% c(3659, 4045, 6000, 6665:6669, 6697)) {
break
}
}
}
# Test port to see if we can use it
tmp <- try(startServer(host, port, list()), silent=TRUE)
if (!inherits(tmp, 'try-error')) {
stopServer(tmp)
.globals$lastPort <- port
break
}
}
}
# Invoke user-defined onStop callbacks, before the application's internal
# onStop callbacks.
on.exit({
@@ -1022,7 +1062,7 @@ stopApp <- function(returnValue = invisible()) {
#' }
#' @export
runExample <- function(example=NA,
port=getOption('shiny.port', findPort(host = host)),
port=NULL,
launch.browser=getOption('shiny.launch.browser',
interactive()),
host=getOption('shiny.host', '127.0.0.1'),
@@ -1086,7 +1126,7 @@ runExample <- function(example=NA,
#' runGadget(shinyApp(ui, server))
#' }
#' @export
runGadget <- function(app, server = NULL, port = getOption("shiny.port", findPort()),
runGadget <- function(app, server = NULL, port = getOption("shiny.port"),
viewer = paneViewer(), stopOnCancel = TRUE) {
if (!is.shiny.appobj(app)) {
@@ -1181,41 +1221,6 @@ browserViewer <- function(browser = getOption("browser")) {
}
}
#' Find an open TCP port
#'
#' Finds a random available TCP port for listening on.
#'
#' @param min Minimum port number.
#' @param max Maximum port number.
#' @param host see [httpuv::randomPort()].
#' @param n Number of ports to try before giving up.
#' @param cache if `TRUE`, use the last random port if it's available.
#'
#' @details This function automatically excludes some ports
#' which are considered unsafe by web browsers.
#'
#' @seealso [httpuv::randomPort()]
#' @export
#' @examples
#'
#' findPort()
#' findPort()
#' findPort(cache = FALSE)
findPort <- function(min = 3000L, max = 8000L,
host = getOption("shiny.host", "127.0.0.1"),
n = 20, cache = TRUE) {
if (cache && !is.null(.globals$lastPort)) {
tmp <- try(startServer(host, .globals$lastPort, list()), silent = TRUE)
if (!inherits(tmp, 'try-error')) {
stopServer(tmp)
return(.globals$lastPort)
}
}
.globals$lastPort <- withPrivateSeed(httpuv::randomPort(min, max, host, n))
.globals$lastPort
}
# Returns TRUE if we're running in Shiny Server or other hosting environment,
# otherwise returns FALSE.
inShinyServer <- function() {

View File

@@ -35,7 +35,7 @@ getShinyOption <- function(name, default = NULL) {
#' `shinyOptions()`.
#'
#' \describe{
#' \item{shiny.autoreload}{If `TRUE` when a Shiny app is launched, the
#' \item{shiny.autoreload (defaults to `FALSE`)}{If `TRUE` when a Shiny app is launched, the
#' app directory will be continually monitored for changes to files that
#' have the extensions: r, htm, html, js, css, png, jpg, jpeg, gif. If any
#' changes are detected, all connected Shiny sessions are reloaded. This
@@ -51,62 +51,63 @@ getShinyOption <- function(name, default = NULL) {
#' The default polling interval is 500 milliseconds. You can change this
#' by setting e.g. `options(shiny.autoreload.interval = 2000)` (every
#' two seconds).}
#' \item{shiny.deprecation.messages}{This controls whether messages for
#' \item{shiny.deprecation.messages (defaults to `TRUE`)}{This controls whether messages for
#' deprecated functions in Shiny will be printed. See
#' [shinyDeprecated()] for more information.}
#' \item{shiny.error}{This can be a function which is called when an error
#' \item{shiny.error (defaults to `NULL`)}{This can be a function which is called when an error
#' occurs. For example, `options(shiny.error=recover)` will result a
#' the debugger prompt when an error occurs.}
#' \item{shiny.fullstacktrace}{Controls whether "pretty" or full stack traces
#' are dumped to the console when errors occur during Shiny app execution.
#' The default is `FALSE` (pretty stack traces).}
#' \item{shiny.host}{The IP address that Shiny should listen on. See
#' \item{shiny.fullstacktrace (defaults to `FALSE`)}{Controls whether "pretty" (`FALSE`) or full
#' stack traces (`TRUE`) are dumped to the console when errors occur during Shiny app execution.
#' Pretty stack traces attempt to only show user-supplied code, but this pruning can't always
#' be done 100\% correctly.}
#' \item{shiny.host (defaults to `"127.0.0.1"`)}{The IP address that Shiny should listen on. See
#' [runApp()] for more information.}
#' \item{shiny.json.digits}{The number of digits to use when converting
#' \item{shiny.jquery.version (defaults to `3`)}{The major version of jQuery to use.
#' Currently only values of `3` or `1` are supported. If `1`, then jQuery 1.12.4 is used. If `3`,
#' then jQuery 3.4.1 is used.}
#' \item{shiny.json.digits (defaults to `16`)}{The number of digits to use when converting
#' numbers to JSON format to send to the client web browser.}
#' \item{shiny.launch.browser}{A boolean which controls the default behavior
#' \item{shiny.launch.browser (defaults to `interactive()`)}{A boolean which controls the default behavior
#' when an app is run. See [runApp()] for more information.}
#' \item{shiny.maxRequestSize}{This is a number which specifies the maximum
#' web request size, which serves as a size limit for file uploads. If
#' unset, the maximum request size defaults to 5MB.}
#' \item{shiny.minified}{If this is `TRUE` or unset (the default), then
#' Shiny will use minified JavaScript (`shiny.min.js`). If
#' `FALSE`, then Shiny will use the un-minified JavaScript
#' (`shiny.js`); this can be useful during development.}
#' \item{shiny.port}{A port number that Shiny will listen on. See
#' \item{shiny.maxRequestSize (defaults to 5MB)}{This is a number which specifies the maximum
#' web request size, which serves as a size limit for file uploads.}
#' \item{shiny.minified (defaults to `TRUE`)}{By default
#' Whether or not to include Shiny's JavaScript as a minified (`shiny.min.js`)
#' or un-minified (`shiny.js`) file. The un-minified version is larger,
#' but can be helpful for development and debugging.}
#' \item{shiny.port (defaults to a random open port)}{A port number that Shiny will listen on. See
#' [runApp()] for more information.}
#' \item{shiny.reactlog}{If `TRUE`, enable logging of reactive events,
#' \item{shiny.reactlog (defaults to `FALSE`)}{If `TRUE`, enable logging of reactive events,
#' which can be viewed later with the [reactlogShow()] function.
#' This incurs a substantial performance penalty and should not be used in
#' production.}
#' \item{shiny.sanitize.errors}{If `TRUE`, then normal errors (i.e.
#' \item{shiny.sanitize.errors (defaults to `FALSE`)}{If `TRUE`, then normal errors (i.e.
#' errors not wrapped in `safeError`) won't show up in the app; a simple
#' generic error message is printed instead (the error and strack trace printed
#' to the console remain unchanged). The default is `FALSE` (unsanitized
#' errors).If you want to sanitize errors in general, but you DO want a
#' to the console remain unchanged). If you want to sanitize errors in general, but you DO want a
#' particular error `e` to get displayed to the user, then set this option
#' to `TRUE` and use `stop(safeError(e))` for errors you want the
#' user to see.}
#' \item{shiny.stacktraceoffset}{If `TRUE`, then Shiny's printed stack
#' \item{shiny.stacktraceoffset (defaults to `TRUE`)}{If `TRUE`, then Shiny's printed stack
#' traces will display srcrefs one line above their usual location. This is
#' an arguably more intuitive arrangement for casual R users, as the name
#' of a function appears next to the srcref where it is defined, rather than
#' where it is currently being called from.}
#' \item{shiny.suppressMissingContextError}{Normally, invoking a reactive
#' \item{shiny.suppressMissingContextError (defaults to `FALSE`)}{Normally, invoking a reactive
#' outside of a reactive context (or [isolate()]) results in
#' an error. If this is `TRUE`, don't error in these cases. This
#' should only be used for debugging or demonstrations of reactivity at the
#' console.}
#' \item{shiny.table.class}{CSS class names to use for tables.}
#' \item{shiny.testmode}{If `TRUE`, then enable features for testing Shiny
#' applications. If `FALSE` (the default), do not enable those features.}
#' \item{shiny.trace}{Print messages sent between the R server and the web
#' \item{shiny.testmode (defaults to `FALSE`)}{If `TRUE`, then various features for testing Shiny
#' applications are enabled.}
#' \item{shiny.trace (defaults to `FALSE`)}{Print messages sent between the R server and the web
#' browser client to the R console. This is useful for debugging. Possible
#' values are `"send"` (only print messages sent to the client),
#' `"recv"` (only print messages received by the server), `TRUE`
#' (print all messages), or `FALSE` (default; don't print any of these
#' messages).}
#' \item{shiny.usecairo}{This is used to disable graphical rendering by the
#' \item{shiny.usecairo (defaults to `TRUE`)}{This is used to disable graphical rendering by the
#' Cairo package, if it is installed. See [plotPNG()] for more
#' information.}
#' }

View File

@@ -42,9 +42,28 @@ renderPage <- function(ui, connection, showcase=0, testMode=FALSE) {
)
}
jquery <- function() {
version <- getOption("shiny.jquery.version", 3)
if (version == 3) {
return(htmlDependency(
"jquery", "3.4.1",
c(href = "shared"),
script = "jquery.min.js"
))
}
if (version == 1) {
return(htmlDependency(
"jquery", "1.12.4",
c(href = "shared/legacy"),
script = "jquery.min.js"
))
}
stop("Unsupported version of jQuery: ", version)
}
shiny_deps <- list(
htmlDependency("json2", "2014.02.04", c(href="shared"), script = "json2-min.js"),
htmlDependency("jquery", "3.4.1", c(href="shared"), script = "jquery.min.js"),
jquery(),
htmlDependency("shiny", utils::packageVersion("shiny"), c(href="shared"),
script = if (getOption("shiny.minified", TRUE)) "shiny.min.js" else "shiny.js",
stylesheet = "shiny.css")

View File

@@ -61,7 +61,7 @@ The Javascript code in Shiny is minified using tools that run on Node.js. See th
## Guidelines for contributing
We welcome contributions to the **shiny** package. Please see our [CONTRIBUTING.md](CONTRIBUTING.md) file for detailed guidelines of how to contribute.
We welcome contributions to the **shiny** package. Please see our [CONTRIBUTING.md](https://github.com/rstudio/shiny/blob/master/.github/CONTRIBUTING.md) file for detailed guidelines of how to contribute.
## License

View File

@@ -16,6 +16,9 @@ cache:
# Adapt as necessary starting from here
build_script:
- travis-tool.sh install_github rstudio/htmltools@rc-v0.4.0
- travis-tool.sh install_github rstudio/promises@rc-v1.1.0
- travis-tool.sh install_github r-lib/later@rc-v1.0.0
- travis-tool.sh install_deps
test_script:

217
inst/_pkgdown.yml Normal file
View File

@@ -0,0 +1,217 @@
# NOTE: The main Shiny site, https://shiny.rstudio.com/, is not a pkgdown site.
# However, as part of the build process for that site
# (rstudio/shiny-dev-center), we do use pkgdown to generate the function
# reference index pages for each release. This file configures the look of
# those pages for releases from 1.4 onward. Prior to 1.4, staticdocs from
# https://github.com/r-lib/pkgdown/releases/tag/old was used and
# inst/staticdocs/index.r was its configuration.
template:
# NOTE: These templates live in shiny-dev-center
path: _pkgdown_templates
reference:
- title: UI Layout
desc: Functions for laying out the user interface for your application.
contents:
- absolutePanel
- bootstrapPage
- column
- conditionalPanel
- fillPage
- fillRow
- fixedPage
- fluidPage
- helpText
- icon
- navbarPage
- navlistPanel
- sidebarLayout
- tabPanel
- tabsetPanel
- titlePanel
- inputPanel
- flowLayout
- splitLayout
- verticalLayout
- wellPanel
- withMathJax
- title: UI Inputs
desc: Functions for creating user interface elements that prompt the user for input values or interaction.
contents:
- actionButton
- checkboxGroupInput
- checkboxInput
- dateInput
- dateRangeInput
- fileInput
- numericInput
- radioButtons
- selectInput
- varSelectInput
- sliderInput
- submitButton
- textInput
- textAreaInput
- passwordInput
- modalButton
- updateActionButton
- updateCheckboxGroupInput
- updateCheckboxInput
- updateDateInput
- updateDateRangeInput
- updateNumericInput
- updateRadioButtons
- updateSelectInput
- updateSliderInput
- updateTabsetPanel
- insertTab
- showTab
- updateTextInput
- updateTextAreaInput
- updateQueryString
- getQueryString
- title: UI Outputs
desc: Functions for creating user interface elements that, in conjunction with rendering functions, display different kinds of output from your application.
contents:
- htmlOutput
- plotOutput
- outputOptions
- tableOutput
- textOutput
- verbatimTextOutput
- downloadButton
- Progress
- withProgress
- modalDialog
- urlModal
- showModal
- showNotification
- title: Interface builder functions
desc: A sub-library for writing HTML using R functions. These functions form the foundation on which the higher level user interface functions are built, and can also be used in your Shiny UI to provide custom HTML, CSS, and JavaScript.
contents:
- builder
- HTML
- include
- singleton
- tag
- validateCssUnit
- withTags
- htmlTemplate
- bootstrapLib
- suppressDependencies
- insertUI
- removeUI
- title: Rendering functions
desc: Functions that you use in your application's server side code, assigning them to outputs that appear in your user interface.
contents:
- renderPlot
- renderCachedPlot
- renderText
- renderPrint
- renderDataTable
- renderImage
- renderTable
- renderUI
- downloadHandler
- createRenderFunction
- title: Reactive programming
desc: A sub-library that provides reactive programming facilities for R.
contents:
- reactive
- observe
- observeEvent
- reactiveVal
- reactiveValues
- reactiveValuesToList
- is.reactivevalues
- isolate
- invalidateLater
- debounce
- reactlog
- makeReactiveBinding
- reactiveFileReader
- reactivePoll
- reactiveTimer
- domains
- freezeReactiveValue
- title: Boilerplate
desc: Functions that are required boilerplate in ui.R and server.R.
contents:
- shinyUI
- shinyServer
- title: Running
desc: Functions that are used to run or stop Shiny applications.
contents:
- runApp
- runGadget
- runExample
- runGadget
- runUrl
- stopApp
- viewer
- isRunning
- loadSupport
- title: Bookmarking state
desc: Functions that are used for bookmarking and restoring state.
contents:
- bookmarkButton
- enableBookmarking
- setBookmarkExclude
- showBookmarkUrlModal
- onBookmark
- title: Extending Shiny
desc: Functions that are intended to be called by third-party packages that extend Shiny.
contents:
- createWebDependency
- resourcePaths
- registerInputHandler
- removeInputHandler
- markRenderFunction
- title: Utility functions
desc: Miscellaneous utilities that may be useful to advanced users or when extending Shiny.
contents:
- req
- validate
- session
- shinyOptions
- safeError
- onFlush
- restoreInput
- applyInputHandlers
- exprToFunction
- installExprFunction
- parseQueryString
- getCurrentOutputInfo
- plotPNG
- sizeGrowthRatio
- exportTestValues
- setSerializer
- snapshotExclude
- snapshotPreprocessInput
- snapshotPreprocessOutput
- markOutputAttrs
- repeatable
- shinyDeprecated
- serverInfo
- onStop
- diskCache
- memoryCache
- reexports
- title: Plot interaction
desc: Functions related to interactive plots
contents:
- brushedPoints
- brushOpts
- clickOpts
- dblclickOpts
- hoverOpts
- nearPoints
- title: Modules
desc: Functions for modularizing Shiny apps
contents:
- NS
- callModule
- title: Embedding
desc: Functions that are intended for third-party packages that embed Shiny applications.
contents:
- shinyApp
- maskReactiveContext

View File

@@ -1,235 +0,0 @@
sd_section("UI Layout",
"Functions for laying out the user interface for your application.",
c(
"absolutePanel",
"bootstrapPage",
"column",
"conditionalPanel",
"fillPage",
"fillRow",
"fixedPage",
"fluidPage",
"helpText",
"icon",
"navbarPage",
"navlistPanel",
"sidebarLayout",
"tabPanel",
"tabsetPanel",
"titlePanel",
"inputPanel",
"flowLayout",
"splitLayout",
"verticalLayout",
"wellPanel",
"withMathJax"
)
)
sd_section("UI Inputs",
"Functions for creating user interface elements that prompt the user for input values or interaction.",
c(
"actionButton",
"checkboxGroupInput",
"checkboxInput",
"dateInput",
"dateRangeInput",
"fileInput",
"numericInput",
"radioButtons",
"selectInput",
"varSelectInput",
"sliderInput",
"submitButton",
"textInput",
"textAreaInput",
"passwordInput",
"modalButton",
"updateActionButton",
"updateCheckboxGroupInput",
"updateCheckboxInput",
"updateDateInput",
"updateDateRangeInput",
"updateNumericInput",
"updateRadioButtons",
"updateSelectInput",
"updateSliderInput",
"updateTabsetPanel",
"insertTab",
"showTab",
"updateTextInput",
"updateTextAreaInput",
"updateQueryString",
"getQueryString"
)
)
sd_section("UI Outputs",
"Functions for creating user interface elements that, in conjunction with rendering functions, display different kinds of output from your application.",
c(
"htmlOutput",
"plotOutput",
"outputOptions",
"tableOutput",
"textOutput",
"verbatimTextOutput",
"downloadButton",
"Progress",
"withProgress",
"modalDialog",
"urlModal",
"showModal",
"showNotification"
)
)
sd_section("Interface builder functions",
"A sub-library for writing HTML using R functions. These functions form the foundation on which the higher level user interface functions are built, and can also be used in your Shiny UI to provide custom HTML, CSS, and JavaScript.",
c(
"builder",
"HTML",
"include",
"singleton",
"tag",
"validateCssUnit",
"withTags",
"htmlTemplate",
"bootstrapLib",
"suppressDependencies",
"insertUI",
"removeUI"
)
)
sd_section("Rendering functions",
"Functions that you use in your application's server side code, assigning them to outputs that appear in your user interface.",
c(
"renderPlot",
"renderCachedPlot",
"renderText",
"renderPrint",
"renderDataTable",
"renderImage",
"renderTable",
"renderUI",
"downloadHandler",
"createRenderFunction"
)
)
sd_section("Reactive programming",
"A sub-library that provides reactive programming facilities for R.",
c(
"reactive",
"observe",
"observeEvent",
"reactiveVal",
"reactiveValues",
"reactiveValuesToList",
"is.reactivevalues",
"isolate",
"invalidateLater",
"debounce",
"reactlog",
"makeReactiveBinding",
"reactiveFileReader",
"reactivePoll",
"reactiveTimer",
"domains",
"freezeReactiveValue"
)
)
sd_section("Boilerplate",
"Functions that are required boilerplate in ui.R and server.R.",
c(
"shinyUI",
"shinyServer"
)
)
sd_section("Running",
"Functions that are used to run or stop Shiny applications.",
c(
"runApp",
"runGadget",
"runExample",
"runGadget",
"runUrl",
"stopApp",
"viewer",
"isRunning",
"loadSupport"
)
)
sd_section("Bookmarking state",
"Functions that are used for bookmarking and restoring state.",
c(
"bookmarkButton",
"enableBookmarking",
"setBookmarkExclude",
"showBookmarkUrlModal",
"onBookmark"
)
)
sd_section("Extending Shiny",
"Functions that are intended to be called by third-party packages that extend Shiny.",
c(
"createWebDependency",
"resourcePaths",
"registerInputHandler",
"removeInputHandler",
"markRenderFunction"
)
)
sd_section("Utility functions",
"Miscellaneous utilities that may be useful to advanced users or when extending Shiny.",
c(
"req",
"validate",
"session",
"shinyOptions",
"safeError",
"onFlush",
"restoreInput",
"applyInputHandlers",
"exprToFunction",
"installExprFunction",
"parseQueryString",
"getCurrentOutputInfo",
"plotPNG",
"sizeGrowthRatio",
"exportTestValues",
"setSerializer",
"snapshotExclude",
"snapshotPreprocessInput",
"snapshotPreprocessOutput",
"markOutputAttrs",
"repeatable",
"shinyDeprecated",
"serverInfo",
"onStop",
"diskCache",
"memoryCache",
"reexports",
"findPort"
)
)
sd_section("Plot interaction",
"Functions related to interactive plots",
c(
"brushedPoints",
"brushOpts",
"clickOpts",
"dblclickOpts",
"hoverOpts",
"nearPoints"
)
)
sd_section("Modules",
"Functions for modularizing Shiny apps",
c(
"NS",
"callModule"
)
)
sd_section("Embedding",
"Functions that are intended for third-party packages that embed Shiny applications.",
c(
"shinyApp",
"maskReactiveContext"
)
)

View File

@@ -0,0 +1,266 @@
Authors ordered by first contribution.
John Resig <jeresig@gmail.com>
Gilles van den Hoven <gilles0181@gmail.com>
Michael Geary <mike@geary.com>
Stefan Petre <stefan.petre@gmail.com>
Yehuda Katz <wycats@gmail.com>
Corey Jewett <cj@syntheticplayground.com>
Klaus Hartl <klaus.hartl@googlemail.com>
Franck Marcia <franck.marcia@gmail.com>
Jörn Zaefferer <joern.zaefferer@gmail.com>
Paul Bakaus <paul.bakaus@googlemail.com>
Brandon Aaron <brandon.aaron@gmail.com>
Mike Alsup <malsup@gmail.com>
Dave Methvin <dave.methvin@gmail.com>
Ed Engelhardt <edengelhardt@gmail.com>
Sean Catchpole <littlecooldude@gmail.com>
Paul Mclanahan <pmclanahan@gmail.com>
David Serduke <davidserduke@gmail.com>
Richard D. Worth <rdworth@gmail.com>
Scott González <scott.gonzalez@gmail.com>
Ariel Flesler <aflesler@gmail.com>
Jon Evans <jon@springyweb.com>
TJ Holowaychuk <tj@vision-media.ca>
Michael Bensoussan <mickey@seesmic.com>
Robert Katić <robert.katic@gmail.com>
Louis-Rémi Babé <lrbabe@gmail.com>
Earle Castledine <mrspeaker@gmail.com>
Damian Janowski <damian.janowski@gmail.com>
Rich Dougherty <rich@rd.gen.nz>
Kim Dalsgaard <kim@kimdalsgaard.com>
Andrea Giammarchi <andrea.giammarchi@gmail.com>
Mark Gibson <jollytoad@gmail.com>
Karl Swedberg <kswedberg@gmail.com>
Justin Meyer <justinbmeyer@gmail.com>
Ben Alman <cowboy@rj3.net>
James Padolsey <cla@padolsey.net>
David Petersen <public@petersendidit.com>
Batiste Bieler <batiste.bieler@gmail.com>
Alexander Farkas <info@corrupt-system.de>
Rick Waldron <waldron.rick@gmail.com>
Filipe Fortes <filipe@fortes.com>
Neeraj Singh <neerajdotname@gmail.com>
Paul Irish <paul.irish@gmail.com>
Iraê Carvalho <irae@irae.pro.br>
Matt Curry <matt@pseudocoder.com>
Michael Monteleone <michael@michaelmonteleone.net>
Noah Sloan <noah.sloan@gmail.com>
Tom Viner <github@viner.tv>
Douglas Neiner <doug@pixelgraphics.us>
Adam J. Sontag <ajpiano@ajpiano.com>
Dave Reed <dareed@microsoft.com>
Ralph Whitbeck <ralph.whitbeck@gmail.com>
Carl Fürstenberg <azatoth@gmail.com>
Jacob Wright <jacwright@gmail.com>
J. Ryan Stinnett <jryans@gmail.com>
unknown <Igen005@.upcorp.ad.uprr.com>
temp01 <temp01irc@gmail.com>
Heungsub Lee <h@subl.ee>
Colin Snover <colin@alpha.zetafleet.com>
Ryan W Tenney <ryan@10e.us>
Pinhook <contact@pinhooklabs.com>
Ron Otten <r.j.g.otten@gmail.com>
Jephte Clain <Jephte.Clain@univ-reunion.fr>
Anton Matzneller <obhvsbypqghgc@gmail.com>
Alex Sexton <AlexSexton@gmail.com>
Dan Heberden <danheberden@gmail.com>
Henri Wiechers <hwiechers@gmail.com>
Russell Holbrook <russell.holbrook@patch.com>
Julian Aubourg <aubourg.julian@gmail.com>
Gianni Alessandro Chiappetta <gianni@runlevel6.org>
Scott Jehl <scott@scottjehl.com>
James Burke <jrburke@gmail.com>
Jonas Pfenniger <jonas@pfenniger.name>
Xavi Ramirez <xavi.rmz@gmail.com>
Jared Grippe <jared@deadlyicon.com>
Sylvester Keil <sylvester@keil.or.at>
Brandon Sterne <bsterne@mozilla.com>
Mathias Bynens <mathias@qiwi.be>
Timmy Willison <timmywillisn@gmail.com>
Corey Frang <gnarf@gnarf.net>
Digitalxero <digitalxero>
Anton Kovalyov <anton@kovalyov.net>
David Murdoch <musicisair@yahoo.com>
Josh Varner <josh.varner@gmail.com>
Charles McNulty <cmcnulty@kznf.com>
Jordan Boesch <jboesch26@gmail.com>
Jess Thrysoee <jess@thrysoee.dk>
Michael Murray <m@murz.net>
Lee Carpenter <elcarpie@gmail.com>
Alexis Abril <me@alexisabril.com>
Rob Morgan <robbym@gmail.com>
John Firebaugh <john_firebaugh@bigfix.com>
Sam Bisbee <sam@sbisbee.com>
Gilmore Davidson <gilmoreorless@gmail.com>
Brian Brennan <me@brianlovesthings.com>
Xavier Montillet <xavierm02.net@gmail.com>
Daniel Pihlstrom <sciolist.se@gmail.com>
Sahab Yazdani <sahab.yazdani+github@gmail.com>
avaly <github-com@agachi.name>
Scott Hughes <hi@scott-hughes.me>
Mike Sherov <mike.sherov@gmail.com>
Greg Hazel <ghazel@gmail.com>
Schalk Neethling <schalk@ossreleasefeed.com>
Denis Knauf <Denis.Knauf@gmail.com>
Timo Tijhof <krinklemail@gmail.com>
Steen Nielsen <swinedk@gmail.com>
Anton Ryzhov <anton@ryzhov.me>
Shi Chuan <shichuanr@gmail.com>
Berker Peksag <berker.peksag@gmail.com>
Toby Brain <tobyb@freshview.com>
Matt Mueller <mattmuelle@gmail.com>
Justin <drakefjustin@gmail.com>
Daniel Herman <daniel.c.herman@gmail.com>
Oleg Gaidarenko <markelog@gmail.com>
Richard Gibson <richard.gibson@gmail.com>
Rafaël Blais Masson <rafbmasson@gmail.com>
cmc3cn <59194618@qq.com>
Joe Presbrey <presbrey@gmail.com>
Sindre Sorhus <sindresorhus@gmail.com>
Arne de Bree <arne@bukkie.nl>
Vladislav Zarakovsky <vlad.zar@gmail.com>
Andrew E Monat <amonat@gmail.com>
Oskari <admin@o-programs.com>
Joao Henrique de Andrade Bruni <joaohbruni@yahoo.com.br>
tsinha <tsinha@Anthonys-MacBook-Pro.local>
Matt Farmer <matt@frmr.me>
Trey Hunner <treyhunner@gmail.com>
Jason Moon <jmoon@socialcast.com>
Jeffery To <jeffery.to@gmail.com>
Kris Borchers <kris.borchers@gmail.com>
Vladimir Zhuravlev <private.face@gmail.com>
Jacob Thornton <jacobthornton@gmail.com>
Chad Killingsworth <chadkillingsworth@missouristate.edu>
Nowres Rafid <nowres.rafed@gmail.com>
David Benjamin <davidben@mit.edu>
Uri Gilad <antishok@gmail.com>
Chris Faulkner <thefaulkner@gmail.com>
Elijah Manor <elijah.manor@gmail.com>
Daniel Chatfield <chatfielddaniel@gmail.com>
Nikita Govorov <nikita.govorov@gmail.com>
Wesley Walser <wwalser@atlassian.com>
Mike Pennisi <mike@mikepennisi.com>
Markus Staab <markus.staab@redaxo.de>
Dave Riddle <david@joyvuu.com>
Callum Macrae <callum@lynxphp.com>
Benjamin Truyman <bentruyman@gmail.com>
James Huston <james@jameshuston.net>
Erick Ruiz de Chávez <erickrdch@gmail.com>
David Bonner <dbonner@cogolabs.com>
Akintayo Akinwunmi <aakinwunmi@judge.com>
MORGAN <morgan@morgangraphics.com>
Ismail Khair <ismail.khair@gmail.com>
Carl Danley <carldanley@gmail.com>
Mike Petrovich <michael.c.petrovich@gmail.com>
Greg Lavallee <greglavallee@wapolabs.com>
Daniel Gálvez <dgalvez@editablething.com>
Sai Lung Wong <sai.wong@huffingtonpost.com>
Tom H Fuertes <TomFuertes@gmail.com>
Roland Eckl <eckl.roland@googlemail.com>
Jay Merrifield <fracmak@gmail.com>
Allen J Schmidt Jr <cobrasoft@gmail.com>
Jonathan Sampson <jjdsampson@gmail.com>
Marcel Greter <marcel.greter@ocbnet.ch>
Matthias Jäggli <matthias.jaeggli@gmail.com>
David Fox <dfoxinator@gmail.com>
Yiming He <yiminghe@gmail.com>
Devin Cooper <cooper.semantics@gmail.com>
Paul Ramos <paul.b.ramos@gmail.com>
Rod Vagg <rod@vagg.org>
Bennett Sorbo <bsorbo@gmail.com>
Sebastian Burkhard <sebi.burkhard@gmail.com>
nanto <nanto@moon.email.ne.jp>
Danil Somsikov <danilasomsikov@gmail.com>
Ryunosuke SATO <tricknotes.rs@gmail.com>
Jean Boussier <jean.boussier@gmail.com>
Adam Coulombe <me@adam.co>
Andrew Plummer <plummer.andrew@gmail.com>
Mark Raddatz <mraddatz@gmail.com>
Dmitry Gusev <dmitry.gusev@gmail.com>
Michał Gołębiowski <m.goleb@gmail.com>
Nguyen Phuc Lam <ruado1987@gmail.com>
Tom H Fuertes <tomfuertes@gmail.com>
Brandon Johnson <bjohn465+github@gmail.com>
Jason Bedard <jason+jquery@jbedard.ca>
Kyle Robinson Young <kyle@dontkry.com>
Renato Oliveira dos Santos <ros3@cin.ufpe.br>
Chris Talkington <chris@talkingtontech.com>
Eddie Monge <eddie@eddiemonge.com>
Terry Jones <terry@jon.es>
Jason Merino <jasonmerino@gmail.com>
Jeremy Dunck <jdunck@gmail.com>
Chris Price <price.c@gmail.com>
Amey Sakhadeo <me@ameyms.com>
Anthony Ryan <anthonyryan1@gmail.com>
Dominik D. Geyer <dominik.geyer@gmail.com>
George Kats <katsgeorgeek@gmail.com>
Lihan Li <frankieteardrop@gmail.com>
Ronny Springer <springer.ronny@gmail.com>
Marian Sollmann <marian.sollmann@cargomedia.ch>
Corey Frang <gnarf37@gmail.com>
Chris Antaki <ChrisAntaki@gmail.com>
Noah Hamann <njhamann@gmail.com>
David Hong <d.hong@me.com>
Jakob Stoeck <jakob@pokermania.de>
Christopher Jones <christopherjonesqed@gmail.com>
Forbes Lindesay <forbes@lindesay.co.uk>
John Paul <john@johnkpaul.com>
S. Andrew Sheppard <andrew@wq.io>
Leonardo Balter <leonardo.balter@gmail.com>
Roman Reiß <me@silverwind.io>
Benjy Cui <benjytrys@gmail.com>
Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>
John Hoven <hovenj@gmail.com>
Christian Kosmowski <ksmwsk@gmail.com>
Liang Peng <poppinlp@gmail.com>
TJ VanToll <tj.vantoll@gmail.com>
Senya Pugach <upisfree@outlook.com>
Aurelio De Rosa <aurelioderosa@gmail.com>
Nazar Mokrynskyi <nazar@mokrynskyi.com>
Arthur Verschaeve <contact@arthurverschaeve.be>
Dan Hart <danhart@notonthehighstreet.com>
Scott González <scott.gonzalez@gmail.com>
Zheming Sun <mescodasun@gmail.com>
Bin Xin <rhyzix@gmail.com>
David Corbacho <davidcorbacho@gmail.com>
Veaceslav Grimalschi <grimalschi@yandex.ru>
Daniel Husar <dano.husar@gmail.com>
Jason Bedard <jason+github@jbedard.ca>
Ben Toews <mastahyeti@gmail.com>
Aditya Raghavan <araghavan3@gmail.com>
Nicolas HENRY <icewil@gmail.com>
Norman Xu <homyu.shinn@gmail.com>
Anne-Gaelle Colom <coloma@westminster.ac.uk>
Victor Homyakov <vkhomyackov@gmail.com>
George Mauer <gmauer@gmail.com>
Leonardo Braga <leonardo.braga@gmail.com>
Stephen Edgar <stephen@netweb.com.au>
Thomas Tortorini <thomastortorini@gmail.com>
Winston Howes <winstonhowes@gmail.com>
Jon Hester <jon.d.hester@gmail.com>
Alexander O'Mara <me@alexomara.com>
Bastian Buchholz <buchholz.bastian@googlemail.com>
Arthur Stolyar <nekr.fabula@gmail.com>
Calvin Metcalf <calvin.metcalf@gmail.com>
Mu Haibao <mhbseal@163.com>
Richard McDaniel <rm0026@uah.edu>
Chris Rebert <github@rebertia.com>
Gilad Peleg <giladp007@gmail.com>
Martin Naumann <martin@geekonaut.de>
Bruno Pérel <brunoperel@gmail.com>
Reed Loden <reed@reedloden.com>
Daniel Nill <daniellnill@gmail.com>
Yongwoo Jeon <yongwoo.jeon@navercorp.com>
Sean Henderson <seanh.za@gmail.com>
Adrian Olek <adrianolek@gmail.com>
Richard Kraaijenhagen <stdin+git@riichard.com>
Gary Ye <garysye@gmail.com>
Christian Grete <webmaster@christiangrete.com>
Liza Ramo <liza.h.ramo@gmail.com>
Joelle Fleurantin <joasqueeniebee@gmail.com>
Julian Alexander Murillo <julian.alexander.murillo@gmail.com>
Jun Sun <klsforever@gmail.com>
Devin Wilson <dwilson6.github@gmail.com>
Todor Prikumov <tono_pr@abv.bg>
Zack Hall <zackhall@outlook.com>

11008
inst/www/shared/legacy/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

5
inst/www/shared/legacy/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
var exports = window.Shiny = window.Shiny || {};
exports.version = "1.3.2.9001"; // Version number inserted by Grunt
exports.version = "1.4.0.1"; // Version number inserted by Grunt
var origPushState = window.history.pushState;
window.history.pushState = function () {
@@ -611,7 +611,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
return;
}
this.lastSentValues[inputName] = { jsonValue: jsonValue, inputType: inputType };
this.target.setInput(name, value, opts);
this.target.setInput(nameType, value, opts);
};
this.reset = function () {
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -626,10 +626,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
for (var inputName in values) {
if (values.hasOwnProperty(inputName)) {
var _splitInputNameType2 = splitInputNameType(inputName),
_name = _splitInputNameType2.name,
name = _splitInputNameType2.name,
inputType = _splitInputNameType2.inputType;
cacheValues[_name] = {
cacheValues[name] = {
jsonValue: JSON.stringify(values[inputName]),
inputType: inputType
};
@@ -658,7 +658,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
$(opts.el).trigger(evt);
if (!evt.isDefaultPrevented()) {
name = evt.name;
var name = evt.name;
if (evt.inputType !== '') name += ':' + evt.inputType;
// Most opts aren't passed along to lower levels in the input decorator
@@ -713,13 +713,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
};
(function () {
this.setInput = function (nameType, value, opts) {
if (/^\./.test(nameType)) this.target.setInput(nameType, value, opts);else this.pendingInput[name] = { value: value, opts: opts };
if (/^\./.test(nameType)) this.target.setInput(nameType, value, opts);else this.pendingInput[nameType] = { value: value, opts: opts };
};
this.submit = function () {
for (var name in this.pendingInput) {
if (this.pendingInput.hasOwnProperty(name)) {
var input = this.pendingInput[name];
this.target.setInput(name, input.value, input.opts);
for (var nameType in this.pendingInput) {
if (this.pendingInput.hasOwnProperty(nameType)) {
var _pendingInput$nameTyp = this.pendingInput[nameType],
value = _pendingInput$nameTyp.value,
opts = _pendingInput$nameTyp.opts;
this.target.setInput(nameType, value, opts);
}
}
};
@@ -2999,9 +3002,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
var e2 = $.Event(newEventType, {
which: e.which,
pageX: e.pageX,
pageY: e.pageY,
offsetX: e.offsetX,
offsetY: e.offsetY
pageY: e.pageY
});
$el.trigger(e2);
@@ -3048,7 +3049,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// If second click is too far away, it doesn't count as a double
// click. Instead, immediately trigger a mousedown2 for the previous
// click, and set this click as a new first click.
if (pending_e && Math.abs(pending_e.offsetX - e.offsetX) > 2 || Math.abs(pending_e.offsetY - e.offsetY) > 2) {
if (pending_e && Math.abs(pending_e.pageX - e.pageX) > 2 || Math.abs(pending_e.pageY - e.pageY) > 2) {
triggerPendingMousedown2();
scheduleMousedown2(e);
@@ -6593,7 +6594,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
initialValues['.clientdata_url_hash'] = window.location.hash;
$(window).on('hashchange', function (e) {
inputs.setInput('.clientdata_url_hash', location.hash);
inputs.setInput('.clientdata_url_hash', window.location.hash);
});
// The server needs to know what singletons were rendered as part of
@@ -6659,7 +6660,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
});
$(document).on('keydown', function (e) {
if (e.which !== 115 || !e.ctrlKey && !e.metaKey || e.shiftKey || e.altKey) return;
if (
// if not one of the key combos below
!(
// cmd/ctrl + fn + f4
e.which === 115 && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey ||
// cmd/ctrl + shift + fn + f3
e.which === 114 && (e.ctrlKey || e.metaKey) && e.shiftKey && !e.altKey)) {
return;
}
var url = 'reactlog/mark?w=' + window.escape(exports.shinyapp.config.workerId) + "&s=" + window.escape(exports.shinyapp.config.sessionId);
// send notification
@@ -6672,6 +6682,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
html: html,
closeButton: true
});
}).fail(function () {
// found returned error while marking, should open webpage
window.open(url);
});
e.preventDefault();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -26,6 +26,17 @@ see \code{\link[=validateCssUnit]{validateCssUnit()}}.}
Creates an action button or link whose value is initially zero, and increments by one
each time it is pressed.
}
\section{Server value}{
An integer of class \code{"shinyActionButtonValue"}. This class differs from
ordinary integers in that a value of 0 is considered "falsy".
This implies two things:
\itemize{
\item Event handlers (e.g., \code{\link[=observeEvent]{observeEvent()}}, \code{\link[=eventReactive]{eventReactive()}}) won't execute on initial load.
\item Input validation (e.g., \code{\link[=req]{req()}}, \code{\link[=need]{need()}}) will fail on initial load.
}
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {

View File

@@ -44,6 +44,11 @@ Create a group of checkboxes that can be used to toggle multiple choices
independently. The server will receive the input as a character vector of the
selected values.
}
\section{Server value}{
Character vector of values corresponding to the boxes that are checked.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {

View File

@@ -22,6 +22,11 @@ A checkbox control that can be added to a UI definition.
\description{
Create a checkbox that can be used to specify logical values.
}
\section{Server value}{
\code{TRUE} if checked, \code{FALSE} otherwise.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -35,6 +40,7 @@ server <- function(input, output) {
}
shinyApp(ui, server)
}
}
\seealso{
\code{\link[=checkboxGroupInput]{checkboxGroupInput()}}, \code{\link[=updateCheckboxInput]{updateCheckboxInput()}}

View File

@@ -75,6 +75,11 @@ the browser. It allows the following values:
\item \code{DD} Full weekday name
}
}
\section{Server value}{
A \link{Date} vector of length 1.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -110,6 +115,7 @@ ui <- fluidPage(
shinyApp(ui, server = function(input, output) { })
}
}
\seealso{
\code{\link[=dateRangeInput]{dateRangeInput()}}, \code{\link[=updateDateInput]{updateDateInput()}}

View File

@@ -75,6 +75,11 @@ the browser. It allows the following values:
\item \code{DD} Full weekday name
}
}
\section{Server value}{
A \link{Date} vector of length 2.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -114,6 +119,7 @@ ui <- fluidPage(
shinyApp(ui, server = function(input, output) { })
}
}
\seealso{
\code{\link[=dateInput]{dateInput()}}, \code{\link[=updateDateRangeInput]{updateDateRangeInput()}}

View File

@@ -33,8 +33,11 @@ Create a file upload control that can be used to upload one or more files.
}
\details{
Whenever a file upload completes, the corresponding input variable is set
to a dataframe. This dataframe contains one row for each selected file, and
the following columns:
to a dataframe. See the \code{Server value} section.
}
\section{Server value}{
A \code{data.frame} that contains one row for each selected file, and following columns:
\describe{
\item{\code{name}}{The filename provided by the web browser. This is
\strong{not} the path to read to get at the actual data that was uploaded
@@ -49,6 +52,7 @@ uploaded. This file may be deleted if the user performs another upload
operation.}
}
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -89,6 +93,7 @@ server <- function(input, output) {
shinyApp(ui, server)
}
}
\seealso{
Other input elements: \code{\link{actionButton}},

View File

@@ -82,3 +82,10 @@ fillPage(
)
)
}
\seealso{
Other layout functions: \code{\link{fixedPage}},
\code{\link{flowLayout}}, \code{\link{fluidPage}},
\code{\link{navbarPage}}, \code{\link{sidebarLayout}},
\code{\link{splitLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -1,36 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/server.R
\name{findPort}
\alias{findPort}
\title{Find an open TCP port}
\usage{
findPort(min = 3000L, max = 8000L, host = getOption("shiny.host",
"127.0.0.1"), n = 20, cache = TRUE)
}
\arguments{
\item{min}{Minimum port number.}
\item{max}{Maximum port number.}
\item{host}{see \code{\link[httpuv:randomPort]{httpuv::randomPort()}}.}
\item{n}{Number of ports to try before giving up.}
\item{cache}{if \code{TRUE}, use the last random port if it's available.}
}
\description{
Finds a random available TCP port for listening on.
}
\details{
This function automatically excludes some ports
which are considered unsafe by web browsers.
}
\examples{
findPort()
findPort()
findPort(cache = FALSE)
}
\seealso{
\code{\link[httpuv:randomPort]{httpuv::randomPort()}}
}

View File

@@ -66,4 +66,10 @@ shinyApp(ui, server = function(input, output) { })
}
\seealso{
\code{\link[=column]{column()}}
Other layout functions: \code{\link{fillPage}},
\code{\link{flowLayout}}, \code{\link{fluidPage}},
\code{\link{navbarPage}}, \code{\link{sidebarLayout}},
\code{\link{splitLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -32,5 +32,9 @@ shinyApp(ui, server = function(input, output) { })
}
}
\seealso{
\code{\link[=verticalLayout]{verticalLayout()}}
Other layout functions: \code{\link{fillPage}},
\code{\link{fixedPage}}, \code{\link{fluidPage}},
\code{\link{navbarPage}}, \code{\link{sidebarLayout}},
\code{\link{splitLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -99,5 +99,11 @@ shinyApp(ui, server = function(input, output) { })
}
}
\seealso{
\code{\link[=column]{column()}}, \code{\link[=sidebarLayout]{sidebarLayout()}}
\code{\link[=column]{column()}}
Other layout functions: \code{\link{fillPage}},
\code{\link{fixedPage}}, \code{\link{flowLayout}},
\code{\link{navbarPage}}, \code{\link{sidebarLayout}},
\code{\link{splitLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -105,4 +105,10 @@ navbarPage("App Title",
\code{\link[=tabPanel]{tabPanel()}}, \code{\link[=tabsetPanel]{tabsetPanel()}},
\code{\link[=updateNavbarPage]{updateNavbarPage()}}, \code{\link[=insertTab]{insertTab()}},
\code{\link[=showTab]{showTab()}}
Other layout functions: \code{\link{fillPage}},
\code{\link{fixedPage}}, \code{\link{flowLayout}},
\code{\link{fluidPage}}, \code{\link{sidebarLayout}},
\code{\link{splitLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -29,6 +29,11 @@ A numeric input control that can be added to a UI definition.
\description{
Create an input control for entry of numeric values
}
\section{Server value}{
A numeric vector of length 1.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -42,6 +47,7 @@ server <- function(input, output) {
}
shinyApp(ui, server)
}
}
\seealso{
\code{\link[=updateNumericInput]{updateNumericInput()}}

View File

@@ -27,6 +27,12 @@ A text input control that can be added to a UI definition.
\description{
Create an password control for entry of passwords.
}
\section{Server value}{
A character string of the password input. The default value is \code{""}
unless \code{value} is provided.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {

View File

@@ -49,6 +49,11 @@ the radio buttons to have no options selected by using \code{selected = characte
to return to that state once they've made a selection. Instead, consider
having the first of your choices be \code{c("None selected" = "")}.
}
\section{Server value}{
A character string containing the value of the selected button.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -98,6 +103,7 @@ server <- function(input, output) {
shinyApp(ui, server)
}
}
\seealso{
\code{\link[=updateRadioButtons]{updateRadioButtons()}}

View File

@@ -4,11 +4,11 @@
\alias{runApp}
\title{Run Shiny Application}
\usage{
runApp(appDir = getwd(), port = getOption("shiny.port", findPort(host =
host)), launch.browser = getOption("shiny.launch.browser",
interactive()), host = getOption("shiny.host", "127.0.0.1"),
workerId = "", quiet = FALSE, display.mode = c("auto", "normal",
"showcase"), test.mode = getOption("shiny.testmode", FALSE))
runApp(appDir = getwd(), port = getOption("shiny.port"),
launch.browser = getOption("shiny.launch.browser", interactive()),
host = getOption("shiny.host", "127.0.0.1"), workerId = "",
quiet = FALSE, display.mode = c("auto", "normal", "showcase"),
test.mode = getOption("shiny.testmode", FALSE))
}
\arguments{
\item{appDir}{The application to run. Should be one of the following:

View File

@@ -4,10 +4,10 @@
\alias{runExample}
\title{Run Shiny Example Applications}
\usage{
runExample(example = NA, port = getOption("shiny.port", findPort(host =
host)), launch.browser = getOption("shiny.launch.browser",
interactive()), host = getOption("shiny.host", "127.0.0.1"),
display.mode = c("auto", "normal", "showcase"))
runExample(example = NA, port = NULL,
launch.browser = getOption("shiny.launch.browser", interactive()),
host = getOption("shiny.host", "127.0.0.1"), display.mode = c("auto",
"normal", "showcase"))
}
\arguments{
\item{example}{The name of the example to run, or \code{NA} (the default) to

View File

@@ -4,8 +4,8 @@
\alias{runGadget}
\title{Run a gadget}
\usage{
runGadget(app, server = NULL, port = getOption("shiny.port",
findPort()), viewer = paneViewer(), stopOnCancel = TRUE)
runGadget(app, server = NULL, port = getOption("shiny.port"),
viewer = paneViewer(), stopOnCancel = TRUE)
}
\arguments{
\item{app}{Either a Shiny app object as created by

View File

@@ -18,14 +18,13 @@ selectizeInput(inputId, ..., options = NULL, width = NULL)
\item{choices}{List of values to select from. If elements of the list are
named, then that name --- rather than the value --- is displayed to the
user. It's also possible to group related inputs by providing a named list
whose elements are (either named or unnamed) lists, vectors, or factors. In this
case, the outermost names will be used as the group labels (leveraging the
\code{<optgroup>} HTML tag) for the elements in the respective sublist. See the
example section for a small demo of this feature.}
whose elements are (either named or unnamed) lists, vectors, or factors. In
this case, the outermost names will be used as the group labels (leveraging
the \code{<optgroup>} HTML tag) for the elements in the respective sublist. See
the example section for a small demo of this feature.}
\item{selected}{The initially selected value (or multiple values if
\code{multiple = TRUE}). If not specified then defaults to the first value
for single-select lists and no values for multiple select lists.}
\item{selected}{The initially selected value (or multiple values if \code{multiple = TRUE}). If not specified then defaults to the first value for
single-select lists and no values for multiple select lists.}
\item{multiple}{Is selection of multiple items allowed?}
@@ -36,8 +35,8 @@ see \code{\link[=validateCssUnit]{validateCssUnit()}}.}
\item{size}{Number of items to show in the selection box; a larger number
will result in a taller box. Not compatible with \code{selectize=TRUE}.
Normally, when \code{multiple=FALSE}, a select input will be a drop-down
list, but when \code{size} is set, it will be a box instead.}
Normally, when \code{multiple=FALSE}, a select input will be a drop-down list,
but when \code{size} is set, it will be a box instead.}
\item{...}{Arguments passed to \code{selectInput()}.}
@@ -54,14 +53,13 @@ Create a select list that can be used to choose a single or multiple items
from a list of values.
}
\details{
By default, \code{selectInput()} and \code{selectizeInput()} use the
JavaScript library \pkg{selectize.js}
(\url{https://github.com/selectize/selectize.js}) instead of the basic
select input element. To use the standard HTML select input element, use
\code{selectInput()} with \code{selectize=FALSE}.
By default, \code{selectInput()} and \code{selectizeInput()} use the JavaScript library
\pkg{selectize.js} (\url{https://github.com/selectize/selectize.js}) instead of
the basic select input element. To use the standard HTML select input
element, use \code{selectInput()} with \code{selectize=FALSE}.
In selectize mode, if the first element in \code{choices} has a value of
\code{""}, its name will be treated as a placeholder prompt. For example:
In selectize mode, if the first element in \code{choices} has a value of \code{""}, its
name will be treated as a placeholder prompt. For example:
\code{selectInput("letter", "Letter", c("Choose one" = "", LETTERS))}
}
\note{
@@ -74,6 +72,12 @@ value when it is a single choice input and the empty string is not in the
\code{choices} argument. This is to keep compatibility with
\code{selectInput(..., selectize = FALSE)}.
}
\section{Server value}{
A vector of character strings, usually of length
1, with the value of the selected items. When \code{multiple=TRUE} and
nothing is selected, this value will be \code{NULL}.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -111,6 +115,7 @@ shinyApp(
}
)
}
}
\seealso{
\code{\link[=updateSelectInput]{updateSelectInput()}} \code{\link[=varSelectInput]{varSelectInput()}}

View File

@@ -40,7 +40,7 @@ be set globally with \code{options()} or locally (for a single app) with
\code{shinyOptions()}.
\describe{
\item{shiny.autoreload}{If \code{TRUE} when a Shiny app is launched, the
\item{shiny.autoreload (defaults to \code{FALSE})}{If \code{TRUE} when a Shiny app is launched, the
app directory will be continually monitored for changes to files that
have the extensions: r, htm, html, js, css, png, jpg, jpeg, gif. If any
changes are detected, all connected Shiny sessions are reloaded. This
@@ -56,62 +56,63 @@ by setting e.g. `options(shiny.autoreload.interval = 2000)` (every
two seconds).}
}
\item{shiny.deprecation.messages}{This controls whether messages for
\item{shiny.deprecation.messages (defaults to \code{TRUE})}{This controls whether messages for
deprecated functions in Shiny will be printed. See
\code{\link[=shinyDeprecated]{shinyDeprecated()}} for more information.}
\item{shiny.error}{This can be a function which is called when an error
\item{shiny.error (defaults to \code{NULL})}{This can be a function which is called when an error
occurs. For example, \code{options(shiny.error=recover)} will result a
the debugger prompt when an error occurs.}
\item{shiny.fullstacktrace}{Controls whether "pretty" or full stack traces
are dumped to the console when errors occur during Shiny app execution.
The default is \code{FALSE} (pretty stack traces).}
\item{shiny.host}{The IP address that Shiny should listen on. See
\item{shiny.fullstacktrace (defaults to \code{FALSE})}{Controls whether "pretty" (\code{FALSE}) or full
stack traces (\code{TRUE}) are dumped to the console when errors occur during Shiny app execution.
Pretty stack traces attempt to only show user-supplied code, but this pruning can't always
be done 100\% correctly.}
\item{shiny.host (defaults to \code{"127.0.0.1"})}{The IP address that Shiny should listen on. See
\code{\link[=runApp]{runApp()}} for more information.}
\item{shiny.json.digits}{The number of digits to use when converting
\item{shiny.jquery.version (defaults to \code{3})}{The major version of jQuery to use.
Currently only values of \code{3} or \code{1} are supported. If \code{1}, then jQuery 1.12.4 is used. If \code{3},
then jQuery 3.4.1 is used.}
\item{shiny.json.digits (defaults to \code{16})}{The number of digits to use when converting
numbers to JSON format to send to the client web browser.}
\item{shiny.launch.browser}{A boolean which controls the default behavior
\item{shiny.launch.browser (defaults to \code{interactive()})}{A boolean which controls the default behavior
when an app is run. See \code{\link[=runApp]{runApp()}} for more information.}
\item{shiny.maxRequestSize}{This is a number which specifies the maximum
web request size, which serves as a size limit for file uploads. If
unset, the maximum request size defaults to 5MB.}
\item{shiny.minified}{If this is \code{TRUE} or unset (the default), then
Shiny will use minified JavaScript (\code{shiny.min.js}). If
\code{FALSE}, then Shiny will use the un-minified JavaScript
(\code{shiny.js}); this can be useful during development.}
\item{shiny.port}{A port number that Shiny will listen on. See
\item{shiny.maxRequestSize (defaults to 5MB)}{This is a number which specifies the maximum
web request size, which serves as a size limit for file uploads.}
\item{shiny.minified (defaults to \code{TRUE})}{By default
Whether or not to include Shiny's JavaScript as a minified (\code{shiny.min.js})
or un-minified (\code{shiny.js}) file. The un-minified version is larger,
but can be helpful for development and debugging.}
\item{shiny.port (defaults to a random open port)}{A port number that Shiny will listen on. See
\code{\link[=runApp]{runApp()}} for more information.}
\item{shiny.reactlog}{If \code{TRUE}, enable logging of reactive events,
\item{shiny.reactlog (defaults to \code{FALSE})}{If \code{TRUE}, enable logging of reactive events,
which can be viewed later with the \code{\link[=reactlogShow]{reactlogShow()}} function.
This incurs a substantial performance penalty and should not be used in
production.}
\item{shiny.sanitize.errors}{If \code{TRUE}, then normal errors (i.e.
\item{shiny.sanitize.errors (defaults to \code{FALSE})}{If \code{TRUE}, then normal errors (i.e.
errors not wrapped in \code{safeError}) won't show up in the app; a simple
generic error message is printed instead (the error and strack trace printed
to the console remain unchanged). The default is \code{FALSE} (unsanitized
errors).If you want to sanitize errors in general, but you DO want a
to the console remain unchanged). If you want to sanitize errors in general, but you DO want a
particular error \code{e} to get displayed to the user, then set this option
to \code{TRUE} and use \code{stop(safeError(e))} for errors you want the
user to see.}
\item{shiny.stacktraceoffset}{If \code{TRUE}, then Shiny's printed stack
\item{shiny.stacktraceoffset (defaults to \code{TRUE})}{If \code{TRUE}, then Shiny's printed stack
traces will display srcrefs one line above their usual location. This is
an arguably more intuitive arrangement for casual R users, as the name
of a function appears next to the srcref where it is defined, rather than
where it is currently being called from.}
\item{shiny.suppressMissingContextError}{Normally, invoking a reactive
\item{shiny.suppressMissingContextError (defaults to \code{FALSE})}{Normally, invoking a reactive
outside of a reactive context (or \code{\link[=isolate]{isolate()}}) results in
an error. If this is \code{TRUE}, don't error in these cases. This
should only be used for debugging or demonstrations of reactivity at the
console.}
\item{shiny.table.class}{CSS class names to use for tables.}
\item{shiny.testmode}{If \code{TRUE}, then enable features for testing Shiny
applications. If \code{FALSE} (the default), do not enable those features.}
\item{shiny.trace}{Print messages sent between the R server and the web
\item{shiny.testmode (defaults to \code{FALSE})}{If \code{TRUE}, then various features for testing Shiny
applications are enabled.}
\item{shiny.trace (defaults to \code{FALSE})}{Print messages sent between the R server and the web
browser client to the R console. This is useful for debugging. Possible
values are \code{"send"} (only print messages sent to the client),
\code{"recv"} (only print messages received by the server), \code{TRUE}
(print all messages), or \code{FALSE} (default; don't print any of these
messages).}
\item{shiny.usecairo}{This is used to disable graphical rendering by the
\item{shiny.usecairo (defaults to \code{TRUE})}{This is used to disable graphical rendering by the
Cairo package, if it is installed. See \code{\link[=plotPNG]{plotPNG()}} for more
information.}
}

View File

@@ -9,7 +9,7 @@ showNotification(ui, action = NULL, duration = 5, closeButton = TRUE,
id = NULL, type = c("default", "message", "warning", "error"),
session = getDefaultReactiveDomain())
removeNotification(id = NULL, session = getDefaultReactiveDomain())
removeNotification(id, session = getDefaultReactiveDomain())
}
\arguments{
\item{ui}{Content of message.}
@@ -26,11 +26,13 @@ disappear.}
\item{closeButton}{If \code{TRUE}, display a button which will make the
notification disappear when clicked. If \code{FALSE} do not display.}
\item{id}{An ID string. This can be used to change the contents of an
existing message with \code{showNotification}, or to remove it with
\code{removeNotification}. If not provided, one will be generated
automatically. If an ID is provided and there does not currently exist a
notification with that ID, a new notification will be created with that ID.}
\item{id}{A unique identifier for the notification.
\code{id} is optional for \code{showNotification()}: Shiny will automatically create
one if needed. If you do supply it, Shiny will update an existing
notification if it exists, otherwise it will create a new one.
\code{id} is required for \code{removeNotification()}.}
\item{type}{A string which controls the color of the notification. One of
"default" (gray), "message" (blue), "warning" (yellow), or "error" (red).}

View File

@@ -76,3 +76,10 @@ server <- function(input, output) {
shinyApp(ui, server)
}
}
\seealso{
Other layout functions: \code{\link{fillPage}},
\code{\link{fixedPage}}, \code{\link{flowLayout}},
\code{\link{fluidPage}}, \code{\link{navbarPage}},
\code{\link{splitLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -93,6 +93,11 @@ or list of tags (using \code{\link[=tag]{tag()}} and friends), or raw HTML (usin
\description{
Constructs a slider widget to select a numeric value from a range.
}
\section{Server value}{
A number, or in the case of slider range, a vector of two numbers.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -115,6 +120,7 @@ server <- function(input, output) {
# Complete app with UI and server components
shinyApp(ui, server)
}
}
\seealso{
\code{\link[=updateSliderInput]{updateSliderInput()}}

View File

@@ -61,3 +61,10 @@ ui <- splitLayout(
shinyApp(ui, server)
}
}
\seealso{
Other layout functions: \code{\link{fillPage}},
\code{\link{fixedPage}}, \code{\link{flowLayout}},
\code{\link{fluidPage}}, \code{\link{navbarPage}},
\code{\link{sidebarLayout}}, \code{\link{verticalLayout}}
}
\concept{layout functions}

View File

@@ -45,6 +45,12 @@ A textarea input control that can be added to a UI definition.
\description{
Create a textarea input control for entry of unstructured text values.
}
\section{Server value}{
A character string of the text input. The default value is \code{""}
unless \code{value} is provided.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -59,6 +65,7 @@ server <- function(input, output) {
shinyApp(ui, server)
}
}
\seealso{
\code{\link[=updateTextAreaInput]{updateTextAreaInput()}}

View File

@@ -27,6 +27,12 @@ A text input control that can be added to a UI definition.
\description{
Create an input control for entry of unstructured text values
}
\section{Server value}{
A character string of the text input. The default value is \code{""}
unless \code{value} is provided.
}
\examples{
## Only run examples in interactive R sessions
if (interactive()) {
@@ -40,6 +46,7 @@ server <- function(input, output) {
}
shinyApp(ui, server)
}
}
\seealso{
\code{\link[=updateTextInput]{updateTextInput()}}

View File

@@ -30,14 +30,13 @@ updateVarSelectizeInput(session, inputId, label = NULL, data = NULL,
\item{choices}{List of values to select from. If elements of the list are
named, then that name --- rather than the value --- is displayed to the
user. It's also possible to group related inputs by providing a named list
whose elements are (either named or unnamed) lists, vectors, or factors. In this
case, the outermost names will be used as the group labels (leveraging the
\code{<optgroup>} HTML tag) for the elements in the respective sublist. See the
example section for a small demo of this feature.}
whose elements are (either named or unnamed) lists, vectors, or factors. In
this case, the outermost names will be used as the group labels (leveraging
the \code{<optgroup>} HTML tag) for the elements in the respective sublist. See
the example section for a small demo of this feature.}
\item{selected}{The initially selected value (or multiple values if
\code{multiple = TRUE}). If not specified then defaults to the first value
for single-select lists and no values for multiple select lists.}
\item{selected}{The initially selected value (or multiple values if \code{multiple = TRUE}). If not specified then defaults to the first value for
single-select lists and no values for multiple select lists.}
\item{options}{A list of options. See the documentation of \pkg{selectize.js}
for possible options (character option values inside \code{\link[base:I]{base::I()}} will

View File

@@ -17,9 +17,8 @@ varSelectizeInput(inputId, ..., options = NULL, width = NULL)
\item{data}{A data frame. Used to retrieve the column names as choices for a \code{\link[=selectInput]{selectInput()}}}
\item{selected}{The initially selected value (or multiple values if
\code{multiple = TRUE}). If not specified then defaults to the first value
for single-select lists and no values for multiple select lists.}
\item{selected}{The initially selected value (or multiple values if \code{multiple = TRUE}). If not specified then defaults to the first value for
single-select lists and no values for multiple select lists.}
\item{multiple}{Is selection of multiple items allowed?}
@@ -30,8 +29,8 @@ see \code{\link[=validateCssUnit]{validateCssUnit()}}.}
\item{size}{Number of items to show in the selection box; a larger number
will result in a taller box. Not compatible with \code{selectize=TRUE}.
Normally, when \code{multiple=FALSE}, a select input will be a drop-down
list, but when \code{size} is set, it will be a box instead.}
Normally, when \code{multiple=FALSE}, a select input will be a drop-down list,
but when \code{size} is set, it will be a box instead.}
\item{...}{Arguments passed to \code{varSelectInput()}.}
@@ -48,18 +47,6 @@ Create a select list that can be used to choose a single or multiple items
from the column names of a data frame.
}
\details{
The resulting server \code{input} value will be returned as:
\itemize{
\item a symbol if \code{multiple = FALSE}. The \code{input} value should be
used with rlang's \code{\link[rlang:!!]{rlang::!!()}}. For example,
\code{ggplot2::aes(!!input$variable)}.
\item a list of symbols if \code{multiple = TRUE}. The \code{input} value
should be used with rlang's \code{\link[rlang:!!!]{rlang::!!!()}} to expand
the symbol list as individual arguments. For example,
\code{dplyr::select(mtcars, !!!input$variabls)} which is
equivalent to \code{dplyr::select(mtcars, !!input$variabls[[1]], !!input$variabls[[2]], ..., !!input$variabls[[length(input$variabls)]])}.
}
By default, \code{varSelectInput()} and \code{selectizeInput()} use the
JavaScript library \pkg{selectize.js}
(\url{https://github.com/selectize/selectize.js}) to instead of the basic
@@ -76,6 +63,21 @@ value when it is a single choice input and the empty string is not in the
\code{choices} argument. This is to keep compatibility with
\code{selectInput(..., selectize = FALSE)}.
}
\section{Server value}{
The resulting server \code{input} value will be returned as:
\itemize{
\item A symbol if \code{multiple = FALSE}. The \code{input} value should be
used with rlang's \code{\link[rlang:!!]{rlang::!!()}}. For example,
\code{ggplot2::aes(!!input$variable)}.
\item A list of symbols if \code{multiple = TRUE}. The \code{input} value
should be used with rlang's \code{\link[rlang:!!!]{rlang::!!!()}} to expand
the symbol list as individual arguments. For example,
\code{dplyr::select(mtcars, !!!input$variabls)} which is
equivalent to \code{dplyr::select(mtcars, !!input$variabls[[1]], !!input$variabls[[2]], ..., !!input$variabls[[length(input$variabls)]])}.
}
}
\examples{
## Only run examples in interactive R sessions

View File

@@ -31,5 +31,9 @@ shinyApp(ui, server = function(input, output) { })
}
}
\seealso{
\code{\link[=fluidPage]{fluidPage()}}, \code{\link[=flowLayout]{flowLayout()}}
Other layout functions: \code{\link{fillPage}},
\code{\link{fixedPage}}, \code{\link{flowLayout}},
\code{\link{fluidPage}}, \code{\link{navbarPage}},
\code{\link{sidebarLayout}}, \code{\link{splitLayout}}
}
\concept{layout functions}

View File

@@ -457,7 +457,7 @@ function initShiny() {
initialValues['.clientdata_url_hash'] = window.location.hash;
$(window).on('hashchange', function(e) {
inputs.setInput('.clientdata_url_hash', location.hash);
inputs.setInput('.clientdata_url_hash', window.location.hash);
});
// The server needs to know what singletons were rendered as part of

View File

@@ -238,7 +238,7 @@ var InputNoResendDecorator = function(target, initialValues) {
return;
}
this.lastSentValues[inputName] = { jsonValue, inputType };
this.target.setInput(name, value, opts);
this.target.setInput(nameType, value, opts);
};
this.reset = function(values = {}) {
// Given an object with flat name-value format:
@@ -281,7 +281,7 @@ var InputEventDecorator = function(target) {
$(opts.el).trigger(evt);
if (!evt.isDefaultPrevented()) {
name = evt.name;
let name = evt.name;
if (evt.inputType !== '') name += ':' + evt.inputType;
// Most opts aren't passed along to lower levels in the input decorator
@@ -345,13 +345,13 @@ var InputDeferDecorator = function(target) {
if (/^\./.test(nameType))
this.target.setInput(nameType, value, opts);
else
this.pendingInput[name] = { value, opts };
this.pendingInput[nameType] = { value, opts };
};
this.submit = function() {
for (var name in this.pendingInput) {
if (this.pendingInput.hasOwnProperty(name)) {
let input = this.pendingInput[name];
this.target.setInput(name, input.value, input.opts);
for (var nameType in this.pendingInput) {
if (this.pendingInput.hasOwnProperty(nameType)) {
let { value, opts } = this.pendingInput[nameType];
this.target.setInput(nameType, value, opts);
}
}
};

View File

@@ -656,9 +656,7 @@ imageutils.createClickInfo = function($el, dblclickId, dblclickDelay) {
var e2 = $.Event(newEventType, {
which: e.which,
pageX: e.pageX,
pageY: e.pageY,
offsetX: e.offsetX,
offsetY: e.offsetY
pageY: e.pageY
});
$el.trigger(e2);
@@ -707,8 +705,8 @@ imageutils.createClickInfo = function($el, dblclickId, dblclickDelay) {
// click. Instead, immediately trigger a mousedown2 for the previous
// click, and set this click as a new first click.
if (pending_e &&
Math.abs(pending_e.offsetX - e.offsetX) > 2 ||
Math.abs(pending_e.offsetY - e.offsetY) > 2) {
Math.abs(pending_e.pageX - e.pageX) > 2 ||
Math.abs(pending_e.pageY - e.pageY) > 2) {
triggerPendingMousedown2();
scheduleMousedown2(e);

View File

@@ -9,8 +9,18 @@ $(document).on('keydown', function(e) {
$(document).on('keydown', function(e) {
if (e.which !== 115 || (!e.ctrlKey && !e.metaKey) || (e.shiftKey || e.altKey))
if (
// if not one of the key combos below
!(
// cmd/ctrl + fn + f4
(e.which === 115 && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey) ||
// cmd/ctrl + shift + fn + f3
(e.which === 114 && (e.ctrlKey || e.metaKey) && e.shiftKey && !e.altKey)
)
) {
return;
}
var url = 'reactlog/mark?w=' + window.escape(exports.shinyapp.config.workerId) +
"&s=" + window.escape(exports.shinyapp.config.sessionId);
@@ -24,6 +34,9 @@ $(document).on('keydown', function(e) {
html: html,
closeButton: true,
});
}).fail(function() {
// found returned error while marking, should open webpage
window.open(url);
});
e.preventDefault();

View File

@@ -69,7 +69,7 @@ test_that("Repeated names for selectInput and radioButtons choices", {
test_that("Choices are correctly assigned names", {
# Empty non-list comes back with names
# Empty non-list comes back as a list with names
expect_identical(
choicesWithNames(numeric(0)),
stats::setNames(list(), character(0))
@@ -79,6 +79,16 @@ test_that("Choices are correctly assigned names", {
choicesWithNames(list()),
stats::setNames(list(), character(0))
)
# NULL comes back as an empty list with names
expect_identical(
choicesWithNames(NULL),
stats::setNames(list(), character(0))
)
# NA is processed as a leaf, not a group
expect_identical(
choicesWithNames(NA),
as.list(stats::setNames(as.character(NA), NA))
)
# Empty character vector
# An empty character vector isn't a sensical input, but we preserved this test
# in the off chance that somebody relies on the existing behavior.
@@ -151,8 +161,19 @@ test_that("Choices are correctly assigned names", {
choicesWithNames(list(A="a", "b", C=list("d", E="e"))),
list(A="a", b="b", C=list(d="d", E="e"))
)
# List, with a single-item unnamed group list
expect_identical(
choicesWithNames(list(C=list(123))),
list(C=list("123"="123"))
)
# Error when sublist is unnamed
expect_error(choicesWithNames(list(A="a", "b", list(1,2))))
# Error when list is unnamed and contains a group
# NULL, list(1,2), and anything of length() == 0 is considered a group.
# NA is NOT a group.
expect_error(choicesWithNames(list(NULL)), regexp = "must be named")
expect_error(choicesWithNames(list(list(1,2))), regexp = "must be named")
expect_error(choicesWithNames(list(character(0))), regexp = "must be named")
# Unnamed factor
expect_identical(
choicesWithNames(factor(c("a","b","3"))),
@@ -173,6 +194,16 @@ test_that("Choices are correctly assigned names", {
choicesWithNames(list(A="a", B="b", C=structure(factor(c("d", "e")), names = c("d", "e")))),
list(A="a", B="b", C=list(d="d", e="e"))
)
# List, named, with an empty group as an unnamed empty list
expect_identical(
choicesWithNames(list(C=list())),
list(C=stats::setNames(list(), character()))
)
# List, named, with an empty group as an unnamed empty vector
expect_identical(
choicesWithNames(list(C=c())),
list(C=stats::setNames(list(), character()))
)
})

View File

@@ -0,0 +1,40 @@
context("pkgdown")
get_exported <- function() {
if (all(file.exists(c('../../inst/_pkgdown.yml', '../../man')))) {
# We're running tests on a source tree, likely by devtools::test()
sub("\\.Rd", "", list.files("../../man", pattern = "*.Rd"))
} else {
# We're testing an installed package, possibly for R CMD check
unique(unname(readRDS("../../shiny/help/aliases.rds")))
}
}
get_indexed <- function(f = system.file('_pkgdown.yml', package = 'shiny')) {
unlist(lapply(yaml::yaml.load_file(f)$reference, function(x) x$contents))
}
test_that("All man pages have an entry in _pkgdown.yml", {
skip_on_cran()
indexed_topics <- get_indexed()
all_topics <- get_exported()
## Known not to be indexed
known_unindexed <- c("shiny-package", "stacktrace", "knitr_methods",
"pageWithSidebar", "headerPanel", "shiny.appobj",
"deprecatedReactives")
## This test ensures that every documented topic is included in
## staticdocs/index.r, unless explicitly waived by specifying it
## in the known_unindexed variable above.
missing <- setdiff(all_topics, c(known_unindexed, indexed_topics))
unknown <- setdiff(c(known_unindexed, indexed_topics), all_topics)
expect_equal(length(missing), 0,
info = paste("Functions missing from _pkgdown.yml:\n",
paste(" ", missing, sep = "", collapse = "\n"),
sep = ""))
expect_equal(length(unknown), 0,
info = paste("Unrecognized functions in _pkgdown.yml:\n",
paste(" ", unknown, sep = "", collapse = "\n"),
sep = ""))
})

View File

@@ -48,50 +48,59 @@ dumpTests <- function(df) {
}
test_that("integration tests", {
# The expected call stack can be changed by other packages (namely, promises).
# If promises changes its internals, it can break this test on CRAN. Because
# CRAN package releases are generally not synchronized (that is, promises and
# shiny can't be updated at the same time, unless there is manual intervention
# from CRAN maintaineres), these specific test expectations make it impossible
# to release a version of promises that will not break this test and cause
# problems on CRAN.
skip_on_cran()
df <- causeError(full = FALSE)
# dumpTests(df)
expect_equal(df$num, c(56L, 55L, 54L, 38L, 37L, 36L, 35L,
expect_equal(df$num, c(56L, 55L, 54L, 38L, 37L, 36L, 35L,
34L, 33L, 32L, 31L, 30L))
expect_equal(df$call, c("A", "B", "<reactive:C>", "C", "renderTable",
"func", "force", "withVisible", "withCallingHandlers", "globals$domain$wrapSync",
expect_equal(df$call, c("A", "B", "<reactive:C>", "C", "renderTable",
"func", "force", "withVisible", "withCallingHandlers", "domain$wrapSync",
"promises::with_promise_domain", "captureStackTraces"))
expect_equal(nzchar(df$loc), c(TRUE, TRUE, TRUE, FALSE, TRUE,
expect_equal(nzchar(df$loc), c(TRUE, TRUE, TRUE, FALSE, TRUE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE))
df <- causeError(full = TRUE)
# dumpTests(df)
expect_equal(df$num, c(59L, 58L, 57L, 56L, 55L, 54L, 53L,
52L, 51L, 50L, 49L, 48L, 47L, 46L, 45L, 44L, 43L, 42L, 41L,
40L, 39L, 38L, 37L, 36L, 35L, 34L, 33L, 32L, 31L, 30L, 29L,
28L, 27L, 26L, 25L, 24L, 23L, 22L, 21L, 20L, 19L, 18L, 17L,
16L, 15L, 14L, 13L, 12L, 11L, 10L, 9L, 8L, 7L, 6L, 5L, 4L,
expect_equal(df$num, c(59L, 58L, 57L, 56L, 55L, 54L, 53L,
52L, 51L, 50L, 49L, 48L, 47L, 46L, 45L, 44L, 43L, 42L, 41L,
40L, 39L, 38L, 37L, 36L, 35L, 34L, 33L, 32L, 31L, 30L, 29L,
28L, 27L, 26L, 25L, 24L, 23L, 22L, 21L, 20L, 19L, 18L, 17L,
16L, 15L, 14L, 13L, 12L, 11L, 10L, 9L, 8L, 7L, 6L, 5L, 4L,
3L, 2L, 1L))
expect_equal(df$call, c("h", ".handleSimpleError", "stop",
"A", "B", "<reactive:C>", "..stacktraceon..", ".func", "withVisible",
"withCallingHandlers", "contextFunc", "env$runWith", "force",
"globals$domain$wrapSync", "promises::with_promise_domain",
"withReactiveDomain", "globals$domain$wrapSync", "promises::with_promise_domain",
"ctx$run", "self$.updateValue", "..stacktraceoff..", "C",
"renderTable", "func", "force", "withVisible", "withCallingHandlers",
"globals$domain$wrapSync", "promises::with_promise_domain",
"captureStackTraces", "doTryCatch", "tryCatchOne", "tryCatchList",
"tryCatch", "do", "hybrid_chain", "origRenderFunc", "renderTable({ C() }, server = FALSE)",
"..stacktraceon..", "contextFunc", "env$runWith", "force",
"globals$domain$wrapSync", "promises::with_promise_domain",
"withReactiveDomain", "globals$domain$wrapSync", "promises::with_promise_domain",
"ctx$run", "..stacktraceoff..", "isolate", "withCallingHandlers",
"globals$domain$wrapSync", "promises::with_promise_domain",
"captureStackTraces", "doTryCatch", "tryCatchOne", "tryCatchList",
expect_equal(df$call, c("h", ".handleSimpleError", "stop",
"A", "B", "<reactive:C>", "..stacktraceon..", ".func", "withVisible",
"withCallingHandlers", "contextFunc", "env$runWith", "force",
"domain$wrapSync", "promises::with_promise_domain",
"withReactiveDomain", "domain$wrapSync", "promises::with_promise_domain",
"ctx$run", "self$.updateValue", "..stacktraceoff..", "C",
"renderTable", "func", "force", "withVisible", "withCallingHandlers",
"domain$wrapSync", "promises::with_promise_domain",
"captureStackTraces", "doTryCatch", "tryCatchOne", "tryCatchList",
"tryCatch", "do", "hybrid_chain", "origRenderFunc", "renderTable({ C() }, server = FALSE)",
"..stacktraceon..", "contextFunc", "env$runWith", "force",
"domain$wrapSync", "promises::with_promise_domain",
"withReactiveDomain", "domain$wrapSync", "promises::with_promise_domain",
"ctx$run", "..stacktraceoff..", "isolate", "withCallingHandlers",
"domain$wrapSync", "promises::with_promise_domain",
"captureStackTraces", "doTryCatch", "tryCatchOne", "tryCatchList",
"tryCatch", "try"))
expect_equal(nzchar(df$loc), c(FALSE, FALSE, FALSE, TRUE,
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE,
expect_equal(nzchar(df$loc), c(FALSE, FALSE, FALSE, TRUE,
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE,
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE,
FALSE))
})

View File

@@ -1,52 +0,0 @@
context("staticdocs")
test_that("All man pages have an entry in staticdocs/index.r", {
if (all(file.exists(c('../../inst/staticdocs', '../../man')))) {
# We're running tests on a source tree
mode <- "source"
} else if (all(file.exists(c('../../shiny/staticdocs', '../../shiny/html')))) {
# We're testing an installed package, possibly for R CMD check
mode <- "bundle"
} else {
cat("Unknown testing environment for test-staticdocs.R.\n", file = stderr())
return()
}
# Known not to be indexed
known_unindexed <- c("shiny-package", "stacktrace", "knitr_methods",
"pageWithSidebar", "headerPanel", "shiny.appobj",
"deprecatedReactives")
# Read in topics from a staticdocs/index.r file
get_indexed_topics <- function(index_path) {
result <- character(0)
sd_section <- function(dummy1, dummy2, section_topics) {
result <<- c(result, section_topics)
}
source(index_path, local = TRUE)
result
}
if (mode == "source") {
indexed_topics <- get_indexed_topics("../../inst/staticdocs/index.r")
all_topics <- sub("\\.Rd", "", list.files("../../man", pattern = "*.Rd"))
} else if (mode == "bundle") {
indexed_topics <- get_indexed_topics("../../shiny/staticdocs/index.r")
all_topics <- unique(unname(readRDS("../../shiny/help/aliases.rds")))
}
# This test ensures that every documented topic is included in
# staticdocs/index.r, unless explicitly waived by specifying it
# in the known_unindexed variable above.
missing <- setdiff(sort(all_topics), sort(c(known_unindexed, indexed_topics)))
unknown <- setdiff(sort(c(known_unindexed, indexed_topics)), sort(all_topics))
expect_equal(length(missing), 0,
info = paste("Functions missing from index:\n",
paste(" ", missing, sep = "", collapse = "\n"),
sep = ""))
expect_equal(length(unknown), 0,
info = paste("Unrecognized functions in index.r:\n",
paste(" ", unknown, sep = "", collapse = "\n"),
sep = ""))
})

View File

@@ -110,6 +110,9 @@ module.exports = function(grunt) {
"dot-location": [1, "property"],
"eqeqeq": 1,
// "no-shadow": 1,
"no-implicit-globals": 1,
"no-restricted-globals": ["error", "name", "length", "top", "location", "parent", "status"],
"no-global-assign": 1,
"no-undef": 1,
"no-unused-vars": [1, {"args": "none"}],
"guard-for-in": 1,