Compare commits

...

6 Commits

Author SHA1 Message Date
cpsievert
3f3399568f Sync package version (GitHub Actions) 2022-10-20 19:09:43 +00:00
Carson
f50076f2f9 bump version 2022-10-20 14:01:02 -05:00
Carson
c4e314ae04 Merge branch 'main' into vfill 2022-10-20 13:56:25 -05:00
Carson
b4a8236df5 Don't require latest bslib 2022-10-20 13:49:05 -05:00
Carson
a3743e2c90 Require dev version of bslib 2022-10-06 13:58:32 -05:00
Carson
0e401d268d plotOutput(), imageOutput(), and uiOutput() are now more capable of vertically stretching to a suitable container like fillPage() 2022-09-26 10:14:06 -05:00
15 changed files with 84 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
Package: shiny
Type: Package
Title: Web Application Framework for R
Version: 1.7.2.9000
Version: 1.7.2.9001
Authors@R: c(
person("Winston", "Chang", role = c("aut", "cre"), email = "winston@rstudio.com", comment = c(ORCID = "0000-0002-1576-2126")),
person("Joe", "Cheng", role = "aut", email = "joe@rstudio.com"),

View File

@@ -57,17 +57,18 @@ bootstrapPage <- function(..., title = NULL, theme = NULL, lang = NULL) {
ui <- attachDependencies(ui, bootstrapLib())
}
setLang(ui, lang)
setHtmlAttr(ui, "lang", lang)
}
setLang <- function(ui, lang) {
# Add lang attribute to be passed to renderPage function
attr(ui, "lang") <- lang
setHtmlAttr <- function(ui, attr_name, attr_value) {
attrs <- getHtmlAttrs(ui)
attrs[[attr_name]] <- attr_value
attr(ui, "html_attrs") <- attrs
ui
}
getLang <- function(ui) {
getHtmlAttrs <- function(ui) {
# Check if ui has lang attribute; otherwise, NULL
attr(ui, "lang", exact = TRUE)
attr(ui, "html_attrs", exact = TRUE)
}
#' Bootstrap libraries
@@ -331,10 +332,22 @@ fillPage <- function(..., padding = 0, title = NULL, bootstrap = TRUE,
...
)
ui <- setLang(ui, lang)
ui <- setHtmlAttr(ui, "lang", lang)
}
return(ui)
# vfill-container rules live in bslib which means something like
# fillPage(plotOutput("x")) won't work unless a bslib theme is used
setBodyAttr(ui, "class", "vfill-container")
}
setBodyAttr <- function(ui, attr_name, attr_value) {
attrs <- getBodyAttrs(ui)
attrs[[attr_name]] <- attr_value
attr(ui, "body_attrs") <- attrs
ui
}
getBodyAttrs <- function(ui) {
attr(ui, "body_attrs", exact = TRUE)
}
collapseSizes <- function(padding) {
@@ -792,7 +805,7 @@ verbatimTextOutput <- function(outputId, placeholder = FALSE) {
#' @name plotOutput
#' @rdname plotOutput
#' @export
imageOutput <- function(outputId, width = "100%", height="400px",
imageOutput <- function(outputId, width = NULL, height = NULL,
click = NULL, dblclick = NULL, hover = NULL, brush = NULL,
inline = FALSE) {
@@ -807,6 +820,7 @@ imageOutput <- function(outputId, width = "100%", height="400px",
args <- list(
id = outputId,
class = "shiny-image-output",
class = if (is.null(height)) "vfill-item",
style = style
)
@@ -1086,7 +1100,7 @@ imageOutput <- function(outputId, width = "100%", height="400px",
#'
#' }
#' @export
plotOutput <- function(outputId, width = "100%", height="400px",
plotOutput <- function(outputId, width = NULL, height = NULL,
click = NULL, dblclick = NULL, hover = NULL, brush = NULL,
inline = FALSE) {
@@ -1135,16 +1149,18 @@ dataTableOutput <- function(outputId) {
#' Create an HTML output element
#'
#' Render a reactive output variable as HTML within an application page. The
#' text will be included within an HTML `div` tag, and is presumed to
#' contain HTML content which should not be escaped.
#' text will be included within an HTML `div` tag, and is presumed to contain
#' HTML content which should not be escaped.
#'
#' `uiOutput` is intended to be used with `renderUI` on the server
#' side. It is currently just an alias for `htmlOutput`.
#' `uiOutput` is intended to be used with `renderUI` on the server side. It is
#' currently just an alias for `htmlOutput`.
#'
#' @param outputId output variable to read the value from
#' @param outputId output variable to read the value from.
#' @param ... Other arguments to pass to the container tag function. This is
#' useful for providing additional classes for the tag.
#' @inheritParams textOutput
#' @param fill Whether the output should be allowed to grow/shrink to the size
#' of the `container`. Ignored when `inline = TRUE`.
#' @return An HTML output element that can be included in a panel
#' @examples
#' htmlOutput("summary")
@@ -1155,12 +1171,18 @@ dataTableOutput <- function(outputId) {
#' )
#' @export
htmlOutput <- function(outputId, inline = FALSE,
container = if (inline) span else div, ...)
container = if (inline) span else div, fill = FALSE, ...)
{
if (any_unnamed(list(...))) {
warning("Unnamed elements in ... will be replaced with dynamic UI.")
}
container(id = outputId, class="shiny-html-output", ...)
container(
id = outputId,
class = "shiny-html-output",
class = if (fill && !inline) "vfill-container vfill-item",
...
)
}
#' @rdname htmlOutput

View File

@@ -29,7 +29,6 @@ withMathJax <- function(...) {
}
renderPage <- function(ui, showcase=0, testMode=FALSE) {
lang <- getLang(ui)
# If the ui is a NOT complete document (created by htmlTemplate()), then do some
# preprocessing and make sure it's a complete document.
@@ -38,13 +37,17 @@ renderPage <- function(ui, showcase=0, testMode=FALSE) {
ui <- showcaseUI(ui)
# Wrap ui in body tag if it doesn't already have a single top-level body tag.
if (!(inherits(ui, "shiny.tag") && ui$name == "body"))
ui <- tags$body(ui)
ui <- if (inherits(ui, "shiny.tag") && ui$name == "body") {
tagAppendAttributes(ui, !!!getBodyAttrs(ui))
} else {
tags$body(ui, !!!getBodyAttrs(ui))
}
# Put the body into the default template
ui <- htmlTemplate(
system_file("template", "default.html", package = "shiny"),
lang = lang,
html_open = HTML(sub("</html>$", "", tags$html(!!!getHtmlAttrs(ui)))),
body = ui,
# this template is a complete HTML document
document_ = TRUE

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html{{ if (isTRUE(nzchar(lang))) paste0(" lang=\"", lang, "\"") }}>
{{html_open}}
<head>
{{ headContent() }}
</head>

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
/*! shiny 1.7.2.9000 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.7.2.9001 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
#showcase-well{border-radius:0}.shiny-code{background-color:#fff;margin-bottom:0}.shiny-code code{font-family:Menlo,Consolas,Courier New,monospace}.shiny-code-container{margin-top:20px;clear:both}.shiny-code-container h3{display:inline;margin-right:15px}.showcase-header{font-size:16px;font-weight:400}.showcase-code-link{text-align:right;padding:15px}#showcase-app-container{vertical-align:top}#showcase-code-tabs{margin-right:15px}#showcase-code-tabs pre{border:none;line-height:1em}#showcase-code-tabs .nav,#showcase-code-tabs ul{margin-bottom:0}#showcase-code-tabs .tab-content{border-style:solid;border-color:#e5e5e5;border-width:0px 1px 1px 1px;overflow:auto;border-bottom-right-radius:4px;border-bottom-left-radius:4px}#showcase-app-code{width:100%}#showcase-code-position-toggle{float:right}#showcase-sxs-code{padding-top:20px;vertical-align:top}.showcase-code-license{display:block;text-align:right}#showcase-code-content pre{background-color:#fff}

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
/*! shiny 1.7.2.9000 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.7.2.9001 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
"use strict";(function(){var a=eval;window.addEventListener("message",function(i){var e=i.data;e.code&&a(e.code)});})();
//# sourceMappingURL=shiny-testmode.js.map

View File

@@ -1,4 +1,4 @@
/*! shiny 1.7.2.9000 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
/*! shiny 1.7.2.9001 | (c) 2012-2022 RStudio, PBC. | License: GPL-3 | file LICENSE */
"use strict";
(function() {
var __create = Object.create;
@@ -13066,7 +13066,7 @@
var windowShiny2;
function setShiny(windowShiny_) {
windowShiny2 = windowShiny_;
windowShiny2.version = "1.7.2.9000";
windowShiny2.version = "1.7.2.9001";
var _initInputBindings = initInputBindings(), inputBindings = _initInputBindings.inputBindings, fileInputBinding2 = _initInputBindings.fileInputBinding;
var _initOutputBindings = initOutputBindings(), outputBindings = _initOutputBindings.outputBindings;
setFileInputBinding(fileInputBinding2);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -86,6 +86,11 @@ pre.shiny-text-output {
}
}
.shiny-image-output, .shiny-plot-output {
width: 100%;
height: 400px;
}
#shiny-disconnected-overlay {
position: fixed;
top: 0;

View File

@@ -9,19 +9,29 @@ htmlOutput(
outputId,
inline = FALSE,
container = if (inline) span else div,
fill = FALSE,
...
)
uiOutput(outputId, inline = FALSE, container = if (inline) span else div, ...)
uiOutput(
outputId,
inline = FALSE,
container = if (inline) span else div,
fill = FALSE,
...
)
}
\arguments{
\item{outputId}{output variable to read the value from}
\item{outputId}{output variable to read the value from.}
\item{inline}{use an inline (\code{span()}) or block container (\code{div()})
for the output}
\item{container}{a function to generate an HTML element to contain the text}
\item{fill}{Whether the output should be allowed to grow/shrink to the size
of the \code{container}. Ignored when \code{inline = TRUE}.}
\item{...}{Other arguments to pass to the container tag function. This is
useful for providing additional classes for the tag.}
}
@@ -30,12 +40,12 @@ An HTML output element that can be included in a panel
}
\description{
Render a reactive output variable as HTML within an application page. The
text will be included within an HTML \code{div} tag, and is presumed to
contain HTML content which should not be escaped.
text will be included within an HTML \code{div} tag, and is presumed to contain
HTML content which should not be escaped.
}
\details{
\code{uiOutput} is intended to be used with \code{renderUI} on the server
side. It is currently just an alias for \code{htmlOutput}.
\code{uiOutput} is intended to be used with \code{renderUI} on the server side. It is
currently just an alias for \code{htmlOutput}.
}
\examples{
htmlOutput("summary")

View File

@@ -7,8 +7,8 @@
\usage{
imageOutput(
outputId,
width = "100\%",
height = "400px",
width = NULL,
height = NULL,
click = NULL,
dblclick = NULL,
hover = NULL,
@@ -18,8 +18,8 @@ imageOutput(
plotOutput(
outputId,
width = "100\%",
height = "400px",
width = NULL,
height = NULL,
click = NULL,
dblclick = NULL,
hover = NULL,

View File

@@ -3,7 +3,7 @@
"homepage": "https://shiny.rstudio.com",
"repository": "github:rstudio/shiny",
"name": "@types/rstudio-shiny",
"version": "1.7.2-alpha.9000",
"version": "1.7.2-alpha.9001",
"license": "GPL-3.0-only",
"main": "",
"browser": "",