diff --git a/.gitignore b/.gitignore index 07bc03b..418f15b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ docs .DS_Store inst/examples/**/rsconnect + +/.quarto/ diff --git a/DESCRIPTION b/DESCRIPTION index 01aa5e1..f551493 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: shiny386 Title: Old School 'Bootstrap 4' Template for Shiny -Version: 0.0.0.9000 +Version: 0.0.1.9000 Authors@R: person(given = "David", family = "Granjon", @@ -14,13 +14,12 @@ License: MIT + file LICENSE Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1.9000 -URL: https://github.com/RinteRface/shiny386 +RoxygenNote: 7.3.2 +URL: https://github.com/RinteRface/shiny386, https://rinterface.github.io/shiny386 BugReports: https://github.com/RinteRface/shiny386/issues Imports: htmltools, shiny, - magrittr, httpuv Depends: R (>= 2.10) diff --git a/NAMESPACE b/NAMESPACE index dd76473..cbba489 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,5 @@ # Generated by roxygen2: do not edit by hand -export("%>%") export(badge_386) export(button_386) export(card_386) @@ -47,4 +46,3 @@ export(validate_progress_value) export(validate_status) import(htmltools) import(shiny) -importFrom(magrittr,"%>%") diff --git a/NEWS.md b/NEWS.md index 99551cd..13ea999 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,13 @@ +# shiny386 0.0.1.9000 + +## Features + +* Added shinylive demo to pkgdown website. + +## Bug fixes + +* Fix default value for `checkbox_input_386()`. + # shiny386 0.0.0.9000 * Added a `NEWS.md` file to track changes to the package. diff --git a/R/inputs.R b/R/inputs.R index c66b839..22ffc07 100644 --- a/R/inputs.R +++ b/R/inputs.R @@ -352,7 +352,7 @@ update_toggle_input_386 <- function (session, inputId, label = NULL, value = NUL #' shinyApp(ui, server) #' } checkbox_input_386 <- function(inputId, label, value = FALSE, width = NULL) { - create_checkbox_tag(inputId, label, value = FALSE, width = NULL, type = "checkbox") + create_checkbox_tag(inputId, label, value = value, width = NULL, type = "checkbox") } diff --git a/R/shiny386-package.R b/R/shiny386-package.R index c32b04b..1b3600c 100644 --- a/R/shiny386-package.R +++ b/R/shiny386-package.R @@ -6,4 +6,4 @@ #' @import htmltools #' @import shiny #' @docType package -NULL +"_PACKAGE" diff --git a/R/sysdata.rda b/R/sysdata.rda index d7c4acf..dfe8a11 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/R/utils-pipe.R b/R/utils-pipe.R deleted file mode 100644 index e79f3d8..0000000 --- a/R/utils-pipe.R +++ /dev/null @@ -1,11 +0,0 @@ -#' Pipe operator -#' -#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. -#' -#' @name %>% -#' @rdname pipe -#' @keywords internal -#' @export -#' @importFrom magrittr %>% -#' @usage lhs \%>\% rhs -NULL diff --git a/R/utils-shiny.R b/R/utils-shiny.R index e57187e..5aaa373 100644 --- a/R/utils-shiny.R +++ b/R/utils-shiny.R @@ -469,15 +469,45 @@ buildTabItem <- function (index, tabsetId, foundSelected, tabs = NULL, divTag = return(list(liTag = liTag, divTag = divTag)) } -create_link_iframe <- function(link) { - shiny::tags$iframe( +#' Create shinylive iframe +#' +#' Useful for pkgdown website +#' +#' @param url app url. A shinylive link. +#' @param mode How to display the shinylive app. Default to app mode. +#' @param header Whether to display the shinylive header. Default to TRUE. +#' @keywords internal +create_app_link <- function(url, mode = c("app", "editor"), header = TRUE) { + mode <- match.arg(mode) + + if (mode != "editor") url <- gsub("editor", mode, url) + + if (!header) { + url <- paste0(url, "&h=0") + } + + tags$iframe( + # To allow the content to fill the full screen card class = "html-fill-item", - src = link, - height = "800", - width = "100%", - style = "border: 1px solid rgba(0,0,0,0.175); border-radius: .375rem;", - allowfullscreen = "", - allow = "autoplay", + src = url, + height = "700", + width = "100%", + style = "border: 1px solid rgba(0,0,0,0.175); border-radius: .375rem;", + allowfullscreen = "", + allow = "autoplay", `data-external` = "1" ) +} + +code_chunk <- function(output, language = "r") { + cat(paste0("```", language)) + cat(output) + cat("\n```\n") +} + +print_r_code <- function(name) { + path <- system.file(sprintf("examples/shinylive/%s/app.R", name), package = "shiny386") + lines <- readLines(path) + to_remove <- grep("webr::", lines) + code_chunk(cat(paste(lines[-to_remove], collapse = "\n"))) } \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index 3e5709b..d3c05aa 100644 --- a/README.Rmd +++ b/README.Rmd @@ -24,21 +24,22 @@ pak::paks("RinteRface/shiny386") ## Example -This is a basic example which shows you how to solve a common problem: - -``` r -library(shiny) -library(shiny386) -ui <- page_386( - card_386( - title = "My card", - "This is my card", - br(), - card_link_386(href = "https://www.google.com", "More"), - footer = "Card footer" - ) -) - -server <- function(input, output, session) {} -shinyApp(ui, server) +shiny366 demo image + +

+ +Toggle code + +

+ +
+```{r, results="asis", echo=FALSE, warning=FALSE, comment = ""} +shiny386:::print_r_code("penguins") ``` +
\ No newline at end of file diff --git a/README.md b/README.md index 91cfe03..ae347f1 100644 --- a/README.md +++ b/README.md @@ -28,21 +28,105 @@ pak::paks("RinteRface/shiny386") ## Example -This is a basic example which shows you how to solve a common problem: +shiny366 demo image + +

+ Toggle code +

+ +
``` r library(shiny) library(shiny386) +library(bslib) +library(dplyr) +library(ggplot2) +library(ggExtra) +library(thematic) + +thematic_shiny(font = "auto") + +penguins_csv <- "https://raw.githubusercontent.com/jcheng5/simplepenguins.R/main/penguins.csv" + +df <- readr::read_csv(penguins_csv) +# Find subset of columns that are suitable for scatter plot +df_num <- df |> select(where(is.numeric), -Year) + ui <- page_386( - card_386( - title = "My card", - "This is my card", + h1("Penguins App"), br(), - card_link_386(href = "https://www.google.com", "More"), - footer = "Card footer" - ) + + h3("This app is just amazing..."), + + fluidRow( + column( + width = 4, + card_386( + title = "Aesthetics", + status = "warning", + select_input_386("xvar", "X variable", colnames(df_num), selected = "Bill Length (mm)"), + select_input_386("yvar", "Y variable", colnames(df_num), selected = "Bill Depth (mm)"), + checkbox_group_input_386( + "species", "Filter by species", + choices = unique(df$Species), + selected = unique(df$Species) + ) + ), + card_386( + title = "Other options", + status = "warning", + checkbox_input_386("by_species", "Show species", TRUE), + checkbox_input_386("show_margins", "Show marginal plots", TRUE), + checkbox_input_386("smooth", "Add smoother") + ), + button_386("run", "Do plot!", class = "btn-lg btn-block") + ), + column( + width = 8, + jumbotron_386(plotOutput("scatter")) + ) + ) ) -server <- function(input, output, session) {} +server <- function(input, output, session) { + + subsetted <- eventReactive(input$run, { + req(input$species) + df |> filter(Species %in% input$species) + }) + + output$scatter <- renderPlot( + { + p <- ggplot(subsetted(), aes(.data[[input$xvar]], .data[[input$yvar]])) + + list( + theme(legend.position = "bottom"), + if (input$by_species) aes(color = Species), + geom_point(), + if (input$smooth) geom_smooth() + ) + + if (input$show_margins) { + margin_type <- if (input$by_species) "density" else "histogram" + p <- ggExtra::ggMarginal(p, + type = margin_type, margins = "both", + size = 8, groupColour = input$by_species, groupFill = input$by_species + ) + } + + p + }, + res = 100 + ) +} + shinyApp(ui, server) ``` + +
diff --git a/_pkgdown.yml b/_pkgdown.yml index 604e5ea..4b72808 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,3 +1,3 @@ template: bootstrap: 5 -url: https://shiny386.rinterface.com/ +url: https://rinterface.github.io/shiny386/ diff --git a/cran-comments.md b/cran-comments.md index 1d1f628..cb48130 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,5 @@ ## Test environments -* local R installation, R 3.6.1 -* ubuntu 16.04 (on travis-ci), R 3.6.1 +* local R installation, R 4.2.2 * win-builder (devel) ## R CMD check results diff --git a/index.Rmd b/index.Rmd index a93b577..eec9eb0 100644 --- a/index.Rmd +++ b/index.Rmd @@ -28,15 +28,27 @@ pak::pak("RinteRface/shiny386") ## Demo -```{r showcase-code, eval=TRUE, echo=FALSE} +```{r penguins-code, eval=TRUE, echo=FALSE} card( - shiny386:::create_link_iframe(shiny386:::shinylive_links["inst/examples/shinylive/basic"]), + shiny386:::create_app_link(shiny386:::shinylive_links["inst/examples/shinylive/penguins"], header = FALSE), full_screen = TRUE, style = "margin: 0 auto; float: none;" ) ``` -The original app may be found [here](https://shiny.rstudio.com/gallery/bus-dashboard.html) +The code may be found [here](https://github.com/RinteRface/shiny386/blob/78c01d766912f9d1168e28fdd77e94bf4c93ebe1/inst/examples/shinylive/penguins/app.R). + +
+ +You can play with the demo app below and modify the code. + +```{r basic-code, eval=TRUE, echo=FALSE} +card( + shiny386:::create_app_link(shiny386:::shinylive_links["inst/examples/shinylive/basic"], mode = "editor"), + full_screen = TRUE, + style = "margin: 0 auto; float: none;" +) +``` ## Example diff --git a/index.html b/index.html deleted file mode 100644 index f6f6839..0000000 --- a/index.html +++ /dev/null @@ -1,649 +0,0 @@ - - - - - - - - - - - - - - - - - - - -

shiny386

- - -

CRAN status Lifecycle: experimental R build status

- - -

The goal of shiny386 is to provide an old school Bootstrap 4 template -for Shiny. It is built on top of the Bootstrap -386 HTML template.

-

Installation

-

You can install the released version of shiny386 from Github -with:

-
pak::pak("RinteRface/shiny386")
-

Demo

-
-
- -
- - - - - -
- -

The original app may be found here

-

Example

-

This is a basic example which shows you how to solve a common -problem:

-
library(shiny)
-library(shiny386)
-ui <- page_386(
- card_386(
-  title = "My card",
-  "This is my card",
-  br(),
-  card_link_386(href = "https://www.google.com", "More"),
-  footer = "Card footer"
- )
-)
-
-server <- function(input, output, session) {}
-shinyApp(ui, server)
- - - diff --git a/index.md b/index.md index 77163a7..fc6170a 100644 --- a/index.md +++ b/index.md @@ -26,9 +26,9 @@ pak::pak("RinteRface/shiny386") ## Demo -
+
- +
@@ -37,8 +37,23 @@ pak::pak("RinteRface/shiny386")
-The original app may be found -[here](https://shiny.rstudio.com/gallery/bus-dashboard.html) +The code may be found +[here](https://github.com/RinteRface/shiny386/blob/78c01d766912f9d1168e28fdd77e94bf4c93ebe1/inst/examples/shinylive/penguins/app.R). + +
+ +You can play with the demo app below and modify the code. + +
+
+ +
+ + + + + +
## Example diff --git a/inst/examples/shinylive/penguins/app.R b/inst/examples/shinylive/penguins/app.R new file mode 100644 index 0000000..bd80836 --- /dev/null +++ b/inst/examples/shinylive/penguins/app.R @@ -0,0 +1,86 @@ +webr::install("shiny386", repos = c("https://rinterface.github.io/rinterface-wasm-cran/", "https://repo.r-wasm.org")) + +library(shiny) +library(shiny386) +library(bslib) +library(dplyr) +library(ggplot2) +library(ggExtra) +library(thematic) + +thematic_shiny(font = "auto") + +penguins_csv <- "https://raw.githubusercontent.com/jcheng5/simplepenguins.R/main/penguins.csv" + +df <- readr::read_csv(penguins_csv) +# Find subset of columns that are suitable for scatter plot +df_num <- df |> select(where(is.numeric), -Year) + +ui <- page_386( + h1("Penguins App"), + br(), + + h3("This app is just amazing..."), + + fluidRow( + column( + width = 4, + card_386( + title = "Aesthetics", + status = "warning", + select_input_386("xvar", "X variable", colnames(df_num), selected = "Bill Length (mm)"), + select_input_386("yvar", "Y variable", colnames(df_num), selected = "Bill Depth (mm)"), + checkbox_group_input_386( + "species", "Filter by species", + choices = unique(df$Species), + selected = unique(df$Species) + ) + ), + card_386( + title = "Other options", + status = "warning", + checkbox_input_386("by_species", "Show species", TRUE), + checkbox_input_386("show_margins", "Show marginal plots", TRUE), + checkbox_input_386("smooth", "Add smoother") + ), + button_386("run", "Do plot!", class = "btn-lg btn-block") + ), + column( + width = 8, + jumbotron_386(plotOutput("scatter")) + ) + ) +) + +server <- function(input, output, session) { + + subsetted <- eventReactive(input$run, { + req(input$species) + df |> filter(Species %in% input$species) + }) + + output$scatter <- renderPlot( + { + p <- ggplot(subsetted(), aes(.data[[input$xvar]], .data[[input$yvar]])) + + list( + theme(legend.position = "bottom"), + if (input$by_species) aes(color = Species), + geom_point(), + if (input$smooth) geom_smooth() + ) + + if (input$show_margins) { + margin_type <- if (input$by_species) "density" else "histogram" + p <- ggExtra::ggMarginal(p, + type = margin_type, margins = "both", + size = 8, groupColour = input$by_species, groupFill = input$by_species + ) + } + + p + }, + res = 100 + ) +} + +shinyApp(ui, server) diff --git a/man/checkbox_group_input_386.Rd b/man/checkbox_group_input_386.Rd index ae942a7..3b58254 100644 --- a/man/checkbox_group_input_386.Rd +++ b/man/checkbox_group_input_386.Rd @@ -30,17 +30,7 @@ types (such as logicals and numbers) will be coerced to strings.} \item{width}{The width of the input, e.g. \code{'400px'}, or \code{'100\%'}; see \code{\link[shiny:validateCssUnit]{validateCssUnit()}}.} -\item{choiceNames}{List of names and values, respectively, -that are displayed to the user in the app and correspond to the each -choice (for this reason, \code{choiceNames} and \code{choiceValues} -must have the same length). If either of these arguments is -provided, then the other \emph{must} be provided and \code{choices} -\emph{must not} be provided. The advantage of using both of these over -a named list for \code{choices} is that \code{choiceNames} allows any -type of UI object to be passed through (tag objects, icons, HTML code, -...), instead of just simple text. See Examples.} - -\item{choiceValues}{List of names and values, respectively, +\item{choiceNames, choiceValues}{List of names and values, respectively, that are displayed to the user in the app and correspond to the each choice (for this reason, \code{choiceNames} and \code{choiceValues} must have the same length). If either of these arguments is diff --git a/man/create_app_link.Rd b/man/create_app_link.Rd new file mode 100644 index 0000000..fb8ea32 --- /dev/null +++ b/man/create_app_link.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/utils-shiny.R +\name{create_app_link} +\alias{create_app_link} +\title{Create shinylive iframe} +\usage{ +create_app_link(url, mode = c("app", "editor"), header = TRUE) +} +\arguments{ +\item{url}{app url. A shinylive link.} + +\item{mode}{How to display the shinylive app. Default to app mode.} + +\item{header}{Whether to display the shinylive header. Default to TRUE.} +} +\description{ +Useful for pkgdown website +} +\keyword{internal} diff --git a/man/figures/penguins-demo.png b/man/figures/penguins-demo.png new file mode 100644 index 0000000..ea3abe8 Binary files /dev/null and b/man/figures/penguins-demo.png differ diff --git a/man/modal.Rd b/man/modal.Rd index 546427c..20f349c 100644 --- a/man/modal.Rd +++ b/man/modal.Rd @@ -10,7 +10,7 @@ modal_386( ..., title = NULL, footer = modalButton("Dismiss"), - size = c("m", "s", "l"), + size = c("m", "s", "l", "xl"), easyClose = FALSE, fade = TRUE ) @@ -27,13 +27,16 @@ remove_modal_386(session = getDefaultReactiveDomain()) \item{footer}{UI for footer. Use \code{NULL} for no footer.} \item{size}{One of \code{"s"} for small, \code{"m"} (the default) for medium, -or \code{"l"} for large.} +\code{"l"} for large, or \code{"xl"} for extra large. Note that \code{"xl"} only +works with Bootstrap 4 and above (to opt-in to Bootstrap 4+, +pass \code{\link[bslib:bs_theme]{bslib::bs_theme()}} to the \code{theme} argument of a page container +like \code{\link[shiny:fluidPage]{fluidPage()}}).} \item{easyClose}{If \code{TRUE}, the modal dialog can be dismissed by clicking outside the dialog box, or be pressing the Escape key. If \code{FALSE} (the default), the modal dialog can't be dismissed in those -ways; instead it must be dismissed by clicking on the dismiss button, or -from a call to \code{\link[shiny:showModal]{removeModal()}} on the server.} +ways; instead it must be dismissed by clicking on a \code{modalButton()}, or +from a call to \code{\link[shiny:removeModal]{removeModal()}} on the server.} \item{fade}{If \code{FALSE}, the modal dialog will have no fade-in animation (it will simply appear rather than fade in to view).} diff --git a/man/navbar.Rd b/man/navbar.Rd index 4737c0e..d4d7f5e 100644 --- a/man/navbar.Rd +++ b/man/navbar.Rd @@ -20,7 +20,11 @@ navbar_page_386( navbar_menu_386(title, ..., menuName = title, icon = NULL) -update_navbar_page_386(session, inputId, selected = NULL) +update_navbar_page_386( + session = getDefaultReactiveDomain(), + inputId, + selected = NULL +) } \arguments{ \item{title}{The title to display in the navbar} @@ -30,7 +34,7 @@ update_navbar_page_386(session, inputId, selected = NULL) section headers. If the string is a set of dashes like \code{"----"} a horizontal separator will be displayed in the menu.} -\item{id}{If provided, you can use \code{input$}\emph{\code{id}} in your +\item{id}{If provided, you can use \verb{input$}\emph{\code{id}} in your server logic to determine which of the current tabs is active. The value will correspond to the \code{value} argument that is passed to \code{\link[shiny:tabPanel]{tabPanel()}}.} @@ -56,8 +60,10 @@ tabPanels} \item{inverse}{\code{TRUE} to use a dark background and light text for the navigation bar} -\item{windowTitle}{The title that should be displayed by the browser window. -Useful if \code{title} is not a string.} +\item{windowTitle}{the browser window title (as a character string). The +default value, \code{NA}, means to use any character strings that appear in +\code{title} (if none are found, the host URL of the page is displayed by +default).} \item{menuName}{A name that identifies this \code{navbarMenu}. This is needed if you want to insert/remove or show/hide an entire @@ -66,7 +72,7 @@ is needed if you want to insert/remove or show/hide an entire \item{icon}{Optional icon to appear on a \code{navbarMenu} tab.} \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the \code{tabsetPanel}, \code{navlistPanel}, or \code{navbarPage} object.} diff --git a/man/pipe.Rd b/man/pipe.Rd deleted file mode 100644 index 0eec752..0000000 --- a/man/pipe.Rd +++ /dev/null @@ -1,12 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/utils-pipe.R -\name{\%>\%} -\alias{\%>\%} -\title{Pipe operator} -\usage{ -lhs \%>\% rhs -} -\description{ -See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. -} -\keyword{internal} diff --git a/man/radio_input_386.Rd b/man/radio_input_386.Rd index 111cef9..77c323b 100644 --- a/man/radio_input_386.Rd +++ b/man/radio_input_386.Rd @@ -21,35 +21,25 @@ radio_input_386( \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). If -this argument is provided, then \code{choiceNames} and \code{choiceValues} -must not be provided, and vice-versa. The values should be strings; other -types (such as logicals and numbers) will be coerced to strings.} +this argument is provided, then \code{choiceNames} and \code{choiceValues} must not +be provided, and vice-versa. The values should be strings; other types +(such as logicals and numbers) will be coerced to strings.} -\item{selected}{The initially selected value (if not specified then defaults -to the first value)} +\item{selected}{The initially selected value. If not specified, then it +defaults to the first item in \code{choices}. To start with no items selected, +use \code{character(0)}.} \item{width}{The width of the input, e.g. \code{'400px'}, or \code{'100\%'}; see \code{\link[shiny:validateCssUnit]{validateCssUnit()}}.} -\item{choiceNames}{List of names and values, respectively, that +\item{choiceNames, choiceValues}{List of names and values, respectively, that are displayed to the user in the app and correspond to the each choice (for -this reason, \code{choiceNames} and \code{choiceValues} must have the same -length). If either of these arguments is provided, then the other -\emph{must} be provided and \code{choices} \emph{must not} be provided. The -advantage of using both of these over a named list for \code{choices} is -that \code{choiceNames} allows any type of UI object to be passed through -(tag objects, icons, HTML code, ...), instead of just simple text. See -Examples.} - -\item{choiceValues}{List of names and values, respectively, that -are displayed to the user in the app and correspond to the each choice (for -this reason, \code{choiceNames} and \code{choiceValues} must have the same -length). If either of these arguments is provided, then the other -\emph{must} be provided and \code{choices} \emph{must not} be provided. The -advantage of using both of these over a named list for \code{choices} is -that \code{choiceNames} allows any type of UI object to be passed through -(tag objects, icons, HTML code, ...), instead of just simple text. See -Examples.} +this reason, \code{choiceNames} and \code{choiceValues} must have the same length). +If either of these arguments is provided, then the other \emph{must} be provided +and \code{choices} \emph{must not} be provided. The advantage of using both of these +over a named list for \code{choices} is that \code{choiceNames} allows any type of UI +object to be passed through (tag objects, icons, HTML code, ...), instead +of just simple text. See Examples.} } \description{ Create a Bootstrap 386 radio buttons diff --git a/man/select_input_386.Rd b/man/select_input_386.Rd index 777e1be..a49aef0 100644 --- a/man/select_input_386.Rd +++ b/man/select_input_386.Rd @@ -25,7 +25,7 @@ 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{} HTML tag) for the elements in the respective sublist. See +the \verb{} 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 diff --git a/man/shiny386.Rd b/man/shiny386.Rd index c0dd2c7..968a7b5 100644 --- a/man/shiny386.Rd +++ b/man/shiny386.Rd @@ -2,8 +2,21 @@ % Please edit documentation in R/shiny386-package.R \docType{package} \name{shiny386} +\alias{shiny386-package} \alias{shiny386} \title{shiny386} \description{ Old school Bootstrap 4 template for Shiny } +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/RinteRface/shiny386} + \item Report bugs at \url{https://github.com/RinteRface/shiny386/issues} +} + +} +\author{ +\strong{Maintainer}: David Granjon \email{dgranjon@ymail.com} + +} diff --git a/man/tab_panel_386.Rd b/man/tab_panel_386.Rd index ea69ba1..26703f9 100644 --- a/man/tab_panel_386.Rd +++ b/man/tab_panel_386.Rd @@ -13,7 +13,7 @@ tab_panel_386(title, ..., value = title, icon = NULL) \item{value}{The value that should be sent when \code{tabsetPanel} reports that this tab is selected. If omitted and \code{tabsetPanel} has an -\code{id}, then the title will be used..} +\code{id}, then the title will be used.} \item{icon}{Optional icon to appear on the tab. This attribute is only valid when using a \code{tabPanel} within a \code{\link[shiny:navbarPage]{navbarPage()}}.} diff --git a/man/tabset_panel_386.Rd b/man/tabset_panel_386.Rd index f74c993..3ed05e7 100644 --- a/man/tabset_panel_386.Rd +++ b/man/tabset_panel_386.Rd @@ -15,7 +15,7 @@ tabset_panel_386( \arguments{ \item{...}{\code{\link[shiny:tabPanel]{tabPanel()}} elements to include in the tabset} -\item{id}{If provided, you can use \code{input$}\emph{\code{id}} in your +\item{id}{If provided, you can use \verb{input$}\emph{\code{id}} in your server logic to determine which of the current tabs is active. The value will correspond to the \code{value} argument that is passed to \code{\link[shiny:tabPanel]{tabPanel()}}.} @@ -24,11 +24,13 @@ will correspond to the \code{value} argument that is passed to of the tab that should be selected by default. If \code{NULL}, the first tab will be selected.} -\item{type}{Use "tabs" for the standard look; Use "pills" for a more plain -look where tabs are selected using a background fill color.} - -\item{position}{This argument is deprecated; it has been discontinued in -Bootstrap 3.} +\item{type}{\describe{ +\item{\code{"tabs"}}{Standard tab look} +\item{\code{"pills"}}{Selected tabs use the background fill color} +\item{\code{"hidden"}}{Hides the selectable tabs. Use \code{type = "hidden"} in +conjunction with \code{\link[shiny:tabPanelBody]{tabPanelBody()}} and \code{\link[shiny:updateTabsetPanel]{updateTabsetPanel()}} to control the +active tab via other input controls. (See example below)} +}} } \description{ Create a Bootstrap 386 tabset panel diff --git a/man/update_checkbox_group_input_386.Rd b/man/update_checkbox_group_input_386.Rd index df2126b..1fce343 100644 --- a/man/update_checkbox_group_input_386.Rd +++ b/man/update_checkbox_group_input_386.Rd @@ -29,17 +29,7 @@ types (such as logicals and numbers) will be coerced to strings.} \item{selected}{The values that should be initially selected, if any.} -\item{choiceNames}{List of names and values, respectively, -that are displayed to the user in the app and correspond to the each -choice (for this reason, \code{choiceNames} and \code{choiceValues} -must have the same length). If either of these arguments is -provided, then the other \emph{must} be provided and \code{choices} -\emph{must not} be provided. The advantage of using both of these over -a named list for \code{choices} is that \code{choiceNames} allows any -type of UI object to be passed through (tag objects, icons, HTML code, -...), instead of just simple text. See Examples.} - -\item{choiceValues}{List of names and values, respectively, +\item{choiceNames, choiceValues}{List of names and values, respectively, that are displayed to the user in the app and correspond to the each choice (for this reason, \code{choiceNames} and \code{choiceValues} must have the same length). If either of these arguments is diff --git a/man/update_checkbox_input_386.Rd b/man/update_checkbox_input_386.Rd index f7cb1f1..2c91ca1 100644 --- a/man/update_checkbox_input_386.Rd +++ b/man/update_checkbox_input_386.Rd @@ -8,13 +8,13 @@ update_checkbox_input_386(session, inputId, label = NULL, value = NULL) } \arguments{ \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the input object.} \item{label}{The label to set for the input object.} -\item{value}{The value to set for the input object.} +\item{value}{Initial value (\code{TRUE} or \code{FALSE}).} } \description{ Update \link{checkbox_input_386} on the client diff --git a/man/update_radio_input_386.Rd b/man/update_radio_input_386.Rd index 9e3694a..6d32371 100644 --- a/man/update_radio_input_386.Rd +++ b/man/update_radio_input_386.Rd @@ -23,32 +23,22 @@ update_radio_input_386( \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). If -this argument is provided, then \code{choiceNames} and \code{choiceValues} -must not be provided, and vice-versa. The values should be strings; other -types (such as logicals and numbers) will be coerced to strings.} +this argument is provided, then \code{choiceNames} and \code{choiceValues} must not +be provided, and vice-versa. The values should be strings; other types +(such as logicals and numbers) will be coerced to strings.} -\item{selected}{The initially selected value (if not specified then defaults -to the first value)} +\item{selected}{The initially selected value. If not specified, then it +defaults to the first item in \code{choices}. To start with no items selected, +use \code{character(0)}.} -\item{choiceNames}{List of names and values, respectively, that +\item{choiceNames, choiceValues}{List of names and values, respectively, that are displayed to the user in the app and correspond to the each choice (for -this reason, \code{choiceNames} and \code{choiceValues} must have the same -length). If either of these arguments is provided, then the other -\emph{must} be provided and \code{choices} \emph{must not} be provided. The -advantage of using both of these over a named list for \code{choices} is -that \code{choiceNames} allows any type of UI object to be passed through -(tag objects, icons, HTML code, ...), instead of just simple text. See -Examples.} - -\item{choiceValues}{List of names and values, respectively, that -are displayed to the user in the app and correspond to the each choice (for -this reason, \code{choiceNames} and \code{choiceValues} must have the same -length). If either of these arguments is provided, then the other -\emph{must} be provided and \code{choices} \emph{must not} be provided. The -advantage of using both of these over a named list for \code{choices} is -that \code{choiceNames} allows any type of UI object to be passed through -(tag objects, icons, HTML code, ...), instead of just simple text. See -Examples.} +this reason, \code{choiceNames} and \code{choiceValues} must have the same length). +If either of these arguments is provided, then the other \emph{must} be provided +and \code{choices} \emph{must not} be provided. The advantage of using both of these +over a named list for \code{choices} is that \code{choiceNames} allows any type of UI +object to be passed through (tag objects, icons, HTML code, ...), instead +of just simple text. See Examples.} } \description{ Change the value of a radio input on the client diff --git a/man/update_select_input_386.Rd b/man/update_select_input_386.Rd index 1ca866c..fad0785 100644 --- a/man/update_select_input_386.Rd +++ b/man/update_select_input_386.Rd @@ -5,7 +5,7 @@ \title{Update a Bootstrap 386 select input on the client} \usage{ update_select_input_386( - session, + session = getDefaultReactiveDomain(), inputId, label = NULL, choices = NULL, @@ -14,7 +14,7 @@ update_select_input_386( } \arguments{ \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the input object.} @@ -25,7 +25,7 @@ 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{} HTML tag) for the elements in the respective sublist. See +the \verb{} 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 diff --git a/man/update_tabset_panel_386.Rd b/man/update_tabset_panel_386.Rd index e7377a4..7afd47e 100644 --- a/man/update_tabset_panel_386.Rd +++ b/man/update_tabset_panel_386.Rd @@ -4,16 +4,22 @@ \alias{update_tabset_panel_386} \title{Update a Bootstrap 386 tabset panel on the client} \usage{ -update_tabset_panel_386(session, inputId, selected = NULL) +update_tabset_panel_386( + session = getDefaultReactiveDomain(), + inputId, + selected = NULL +) } \arguments{ \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the \code{tabsetPanel}, \code{navlistPanel}, or \code{navbarPage} object.} -\item{selected}{The name of the tab to make active.} +\item{selected}{The \code{value} (or, if none was supplied, the \code{title}) +of the tab that should be selected by default. If \code{NULL}, the first +tab will be selected.} } \description{ Update a Bootstrap 386 tabset panel on the client diff --git a/man/update_text_area_input_386.Rd b/man/update_text_area_input_386.Rd index 9be907c..7620698 100644 --- a/man/update_text_area_input_386.Rd +++ b/man/update_text_area_input_386.Rd @@ -5,7 +5,7 @@ \title{Update a Bootstrap 386 text area input on the client} \usage{ update_text_area_input_386( - session, + session = getDefaultReactiveDomain(), inputId, label = NULL, value = NULL, @@ -14,15 +14,17 @@ update_text_area_input_386( } \arguments{ \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the input object.} \item{label}{The label to set for the input object.} -\item{value}{The value to set for the input object.} +\item{value}{Initial value.} -\item{placeholder}{The placeholder to set for the input object.} +\item{placeholder}{A character string giving the user a hint as to what can +be entered into the control. Internet Explorer 8 and 9 do not support this +option.} } \description{ Update a Bootstrap 386 text area input on the client diff --git a/man/update_text_input_386.Rd b/man/update_text_input_386.Rd index 7a9efff..a0c32dc 100644 --- a/man/update_text_input_386.Rd +++ b/man/update_text_input_386.Rd @@ -5,7 +5,7 @@ \title{Update a Bootstrap 386 text input on the client} \usage{ update_text_input_386( - session, + session = getDefaultReactiveDomain(), inputId, label = NULL, value = NULL, @@ -14,15 +14,17 @@ update_text_input_386( } \arguments{ \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the input object.} \item{label}{The label to set for the input object.} -\item{value}{The value to set for the input object.} +\item{value}{Initial value.} -\item{placeholder}{The placeholder to set for the input object.} +\item{placeholder}{A character string giving the user a hint as to what can +be entered into the control. Internet Explorer 8 and 9 do not support this +option.} } \description{ Update a Bootstrap 386 text input on the client diff --git a/man/update_toggle_input_386.Rd b/man/update_toggle_input_386.Rd index 6fcc096..75b3edc 100644 --- a/man/update_toggle_input_386.Rd +++ b/man/update_toggle_input_386.Rd @@ -8,13 +8,13 @@ update_toggle_input_386(session, inputId, label = NULL, value = NULL) } \arguments{ \item{session}{The \code{session} object passed to function given to -\code{shinyServer}.} +\code{shinyServer}. Default is \code{getDefaultReactiveDomain()}.} \item{inputId}{The id of the input object.} \item{label}{The label to set for the input object.} -\item{value}{The value to set for the input object.} +\item{value}{Initial value (\code{TRUE} or \code{FALSE}).} } \description{ Update \link{toggle_input_386} on the client