From 0562b623ddbc3c4556aa4800efc386c3068cb233 Mon Sep 17 00:00:00 2001 From: Thorn Thaler Date: Thu, 14 May 2020 10:38:31 +0200 Subject: [PATCH] Add possibility to select arbitrary elements Up to now, an element has to have an 'id' attribute to be able to get an popover/tooltip. This was hardcoded in the underlying Javascript. A new parameter was added to add[Tooltip|Popover] to override the default behaviour to look for the element by id. With this flag set, the user can provide an arbitrary jQuery selector as 'id'. The argument name 'id' is maybe misleading in this case, but this approach seemed to be minimal evasive and should not be breaking old code. Closes: #124 --- DESCRIPTION | 3 +- NAMESPACE | 2 +- R/Tooltips_and_Popovers.R | 4 +- R/addPopover.R | 9 ++-- R/addTooltip.R | 8 ++- inst/examples/TooltipsandPopovers/server.R | 9 ++++ inst/examples/TooltipsandPopovers/ui.R | 3 ++ inst/www/shinyBS.js | 23 +++++---- man/Alerts.Rd | 40 ++++++++------- man/Buttons.Rd | 42 +++++++-------- man/Collapses.Rd | 35 +++++++------ man/Modals.Rd | 42 +++++++-------- man/Tooltips_and_Popovers.Rd | 59 ++++++++++++---------- man/addPopover.Rd | 36 +++++++++---- man/addTooltip.Rd | 35 +++++++++---- man/bsAlert.Rd | 12 +++-- man/bsButton.Rd | 31 ++++++++---- man/bsCollapse.Rd | 19 +++---- man/bsCollapsePanel.Rd | 14 ++--- man/bsExample.Rd | 7 ++- man/bsModal.Rd | 28 +++++++--- man/bsPopover.Rd | 30 +++++++---- man/bsTooltip.Rd | 23 +++++---- man/bsTypeahead.Rd | 3 +- man/closeAlert.Rd | 12 +++-- man/createAlert.Rd | 22 +++++--- man/popify.Rd | 30 +++++++---- man/removePopover.Rd | 18 ++++--- man/removeTooltip.Rd | 18 ++++--- man/tipify.Rd | 20 +++++--- man/toggleModal.Rd | 8 +-- man/updateButton.Rd | 32 ++++++++---- man/updateCollapse.Rd | 16 +++--- man/updateTypeahead.Rd | 6 +-- 34 files changed, 430 insertions(+), 269 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5d8df8a..390c099 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,4 +11,5 @@ Imports: htmltools URL: https://ebailey78.github.io/shinyBS BugReports: https://github.com/ebailey78/shinyBS/issues -License: GPL-3 \ No newline at end of file +License: GPL-3 +RoxygenNote: 7.1.0 diff --git a/NAMESPACE b/NAMESPACE index f3c7843..95061c5 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2 (4.1.0): do not edit by hand +# Generated by roxygen2: do not edit by hand export(addPopover) export(addTooltip) diff --git a/R/Tooltips_and_Popovers.R b/R/Tooltips_and_Popovers.R index bce5ccf..1a9d4a0 100644 --- a/R/Tooltips_and_Popovers.R +++ b/R/Tooltips_and_Popovers.R @@ -117,9 +117,9 @@ NULL ## These Functions are common to multiple tooltip and popover functions # Shared functions with really long names... -createTooltipOrPopoverOnServer <- function(session, id, type, options) { +createTooltipOrPopoverOnServer <- function(session, id, type, options, treatAsJQSel) { - data <- list(action = "add", type = type, id = id, options = options) + data <- list(action = "add", type = type, id = id, options = options, treatAsJQSel = treatAsJQSel) session$sendCustomMessage(type = "updateTooltipOrPopover", data) } diff --git a/R/addPopover.R b/R/addPopover.R index aadf0b1..31b308f 100644 --- a/R/addPopover.R +++ b/R/addPopover.R @@ -12,15 +12,18 @@ #'@param trigger What action should cause the popover to appear? (\code{hover}, #'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{hover}. #'@param options A named list of additional options to be set on the popover. -#' +#'@param treatAsJQSel if \code{TRUE}, \code{id} is treated as a general jQuery selector +#'rather than the id attribute of the element. This allows adding the popover to HTML +#'elements even if they do not have an id attribute attached to it. #'@templateVar item_name addPopover #'@templateVar family_name Tooltips_and_Popovers #'@template item_details #'@template footer #'@export -addPopover <- function(session, id, title, content, placement = "bottom", trigger = "hover", options = NULL) { +addPopover <- function(session, id, title, content, placement = "bottom", trigger = "hover", + options = NULL, treatAsJQSel = FALSE) { options <- buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content) - createTooltipOrPopoverOnServer(session, id, "popover", options) + createTooltipOrPopoverOnServer(session, id, "popover", options, treatAsJQSel) } \ No newline at end of file diff --git a/R/addTooltip.R b/R/addTooltip.R index f12af41..41e4ac9 100644 --- a/R/addTooltip.R +++ b/R/addTooltip.R @@ -11,15 +11,19 @@ #'@param trigger What action should cause the tooltip to appear? (\code{hover}, #'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}. #'@param options A named list of additional options to be set on the tooltip. +#'@param treatAsJQSel if \code{TRUE}, \code{id} is treated as a general jQuery selector +#'rather than the id attribute of the element. This allows adding the popover to HTML +#'elements even if they do not have an id attribute attached to it. #' #'@templateVar item_name addTooltip #'@templateVar family_name Tooltips_and_Popovers #'@template item_details #'@template footer #'@export -addTooltip <- function(session, id, title, placement = "bottom", trigger = "hover", options = NULL) { +addTooltip <- function(session, id, title, placement = "bottom", trigger = "hover", + options = NULL, treatAsJQSel = FALSE) { options <- buildTooltipOrPopoverOptionsList(title, placement, trigger, options) - createTooltipOrPopoverOnServer(session, id, "tooltip", options) + createTooltipOrPopoverOnServer(session, id, "tooltip", options, treatAsJQSel) } \ No newline at end of file diff --git a/inst/examples/TooltipsandPopovers/server.R b/inst/examples/TooltipsandPopovers/server.R index d7de9e2..64e4948 100644 --- a/inst/examples/TooltipsandPopovers/server.R +++ b/inst/examples/TooltipsandPopovers/server.R @@ -24,6 +24,15 @@ shinyServer( "This button is pointless too!") ) }) + addPopover(session, "#rdb .radio > label:first", + "Add [Popover|Tooltip] to sub elements", + content = paste0("You can use arbitrary jQuery selectors to add ", + "popovers/tooltips to elements even if they do not ", + "have an 'id' attribute. Use the ", code("treatAsJQSel"), + " flag to select an element by a jQuery selector rather than an ", + "id. Here we used ", code("#rdb .radio > label:first"), + " to select the first label of the radio buttons group."), + treatAsJQSel = TRUE) addPopover(session, "distPlot", "Data", content = paste0("

Waiting time between ", "eruptions and the duration of the eruption for the Old Faithful geyser ", "in Yellowstone National Park, Wyoming, USA.

Azzalini, A. and ", diff --git a/inst/examples/TooltipsandPopovers/ui.R b/inst/examples/TooltipsandPopovers/ui.R index 99c2cbc..fb89984 100644 --- a/inst/examples/TooltipsandPopovers/ui.R +++ b/inst/examples/TooltipsandPopovers/ui.R @@ -8,6 +8,9 @@ library(shinyBS) min = 1, max = 50, value = 30), + radioButtons("rdb", "Popover at a sub element", + choices = c("Popover should appear here", + "But not here")), selectInput("pointlessSelect", "Pointless Select", choices = c("A", "B", "C"), selectize = FALSE), bsTooltip("pointlessSelect", "This is another pointless input element, its just here to look pretty."), bsTooltip("bins", "The wait times will be broken into this many equally spaced bins", diff --git a/inst/www/shinyBS.js b/inst/www/shinyBS.js index cd65e90..c0e96f2 100644 --- a/inst/www/shinyBS.js +++ b/inst/www/shinyBS.js @@ -195,8 +195,8 @@ Shiny.addCustomMessageHandler("bsAlertClose", function(alertId) { // tooltips and popovers because there structure is so similar. type="popover" // will create a popover. -shinyBS.addTooltip = function(id, type, opts) { - var $id = shinyBS.getTooltipTarget(id); +shinyBS.addTooltip = function(id, type, opts, treatAsJQSel) { + var $id = shinyBS.getTooltipTarget(id, treatAsJQSel); var dopts = {html: true}; opts = $.extend(opts, dopts); @@ -210,8 +210,9 @@ shinyBS.addTooltip = function(id, type, opts) { } -shinyBS.removeTooltip = function(id, type) { - var $id = shinyBS.getTooltipTarget(id); +shinyBS.removeTooltip = function(id, type, treatAsJQSel) { + var $id = shinyBS.getTooltipTarget(id, treatAsJQSel); + console.log($id); if(type == "tooltip") { $id.tooltip("destroy"); } else if(type == "popover") { @@ -221,9 +222,13 @@ shinyBS.removeTooltip = function(id, type) { // Makes adjustments to the tooltip and popover targets for specialized // shiny inputs/outputs -shinyBS.getTooltipTarget = function(id) { - - var $id = $("#" + id).closest(".shiny-input-container, .shiny-bound-output, .btn, .shiny-download-link"); +shinyBS.getTooltipTarget = function(id, treatAsJQSel) { + var $id; + if(!treatAsJQSel) { + $id = $("#" + id).closest(".shiny-input-container, .shiny-bound-output, .btn, .shiny-download-link"); + } else { + $id = $(id); + } /* if($id.hasClass("js-range-slider")) { @@ -239,9 +244,9 @@ shinyBS.getTooltipTarget = function(id) { Shiny.addCustomMessageHandler("updateTooltipOrPopover", function(data) { if(data.action == "add") { - shinyBS.addTooltip(data.id, data.type, data.options); + shinyBS.addTooltip(data.id, data.type, data.options, data.treatAsJQSel); } else if(data.action == "remove") { - shinyBS.removeTooltip(data.id, data.type) + shinyBS.removeTooltip(data.id, data.type, data.treatAsJQSel) } }) diff --git a/man/Alerts.Rd b/man/Alerts.Rd index 9c6c1be..a3a6a8e 100644 --- a/man/Alerts.Rd +++ b/man/Alerts.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Alerts.R \name{Alerts} \alias{Alerts} @@ -11,13 +11,13 @@ contained in the Alert. \details{ To create alerts in your Shiny app you must place \code{bsAlert} in your ui. This serves as an anchor that tells shinyBS where to place the alerts created -with \code{createAlert}. +with \code{createAlert}. -Use \code{createAlert} in your server script to add alerts to the anchor +Use \code{createAlert} in your server script to add alerts to the anchor you created with \code{bsAlert} in your ui. You can place \code{createAlert} in observers, reactives, or outputs. A common usage may be to have logic that validates a user's inputs. If they are valid produce the requested output, if -not use \code{createAlert} to give the user info about what they need to +not use \code{createAlert} to give the user info about what they need to change. } \note{ @@ -26,12 +26,12 @@ of \code{Alerts} functionality. } \section{Components}{ -There are three functions in the Alerts family: +There are three functions in the Alerts family: \describe{ \item{\code{\link{bsAlert}}}{Used in the UI to create an anchor where your Alerts will be displayed.} \item{\code{\link{createAlert}}}{Used in the Server logic to create - alerts. This would be used within a reactive context to display error + alerts. This would be used within a reactive context to display error or success messages to the user based on the status of that context.} \item{\code{\link{closeAlert}}}{Used in the Server logic to close an alert that is already open. By default, Alerts are dismissable by the user, @@ -47,39 +47,41 @@ There are three functions in the Alerts family: \code{content} was called \code{message} in previous versions of shinyBS. } + \examples{ + library(shiny) library(shinyBS) app = shinyApp( - ui = + ui = fluidPage( sidebarLayout( - sidebarPanel(textInput("num1", NULL, value = 100), - "divided by", textInput("num2", NULL, value = 20), + sidebarPanel(textInput("num1", NULL, value = 100), + "divided by", textInput("num2", NULL, value = 20), "equals", textOutput("exampleOutput")), mainPanel( bsAlert("alert") ) ) ), - server = + server = function(input, output, session) { output$exampleOutput <- renderText({ num1 <- as.numeric(input$num1) num2 <- as.numeric(input$num2) - + if(is.na(num1) | is.na(num2)) { - createAlert(session, "alert", "exampleAlert", title = "Oops", + createAlert(session, "alert", "exampleAlert", title = "Oops", content = "Both inputs should be numeric.", append = FALSE) } else if(num2 == 0) { - createAlert(session, "alert", "exampleAlert", title = "Oops", + createAlert(session, "alert", "exampleAlert", title = "Oops", content = "You cannot divide by 0.", append = FALSE) } else { closeAlert(session, "exampleAlert") return(num1/num2) } - - }) + + }) } ) @@ -90,7 +92,9 @@ app = shinyApp( \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Alerts: \code{\link{bsAlert}}; - \code{\link{closeAlert}}; \code{\link{createAlert}} +Other Alerts: +\code{\link{bsAlert}()}, +\code{\link{closeAlert}()}, +\code{\link{createAlert}()} } - +\concept{Alerts} diff --git a/man/Buttons.Rd b/man/Buttons.Rd index d1c773a..7de5be2 100644 --- a/man/Buttons.Rd +++ b/man/Buttons.Rd @@ -1,10 +1,10 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Buttons.R \name{Buttons} \alias{Buttons} \title{Buttons} \description{ -Twitter Bootstrap gives many options for styling buttons that aren't made +Twitter Bootstrap gives many options for styling buttons that aren't made available by standard Shiny. Use shinyBS to create buttons of different sizes, shapes, and colors. } @@ -15,7 +15,7 @@ If \code{type = "toggle"} the button will behave like a \code{\link{checkboxInpu with an on and off state. It will return \code{TRUE} or \code{FALSE} to the Server depending on its state. -You can update the style and state of a \code{\link{bsButton}} from the Server +You can update the style and state of a \code{\link{bsButton}} from the Server logic with \code{\link{updateButton}}. For example, a button could be set to \code{disabled = TRUE} until the user has made some other selections, then once those selections have been made, an observer on the Server could use \code{\link{updateButton}} @@ -29,9 +29,9 @@ of \code{Buttons} functionality. } \section{Components}{ -There are two functions in the Buttons family: +There are two functions in the Buttons family: \describe{ - \item{\code{\link{bsButton}}}{Used in the UI to create a button. Buttons + \item{\code{\link{bsButton}}}{Used in the UI to create a button. Buttons can be of the type \code{action} or \code{toggle}.} \item{\code{\link{updateButton}}}{Used in the Server logic to modify the state of a button created with \code{\link{bsButton}}} @@ -40,16 +40,17 @@ There are two functions in the Buttons family: \section{Changes}{ -\code{bsActionButton} and \code{bsToggleButton} were replaced with just +\code{bsActionButton} and \code{bsToggleButton} were replaced with just \code{\link{bsButton}} with a \code{type} argument. \code{icon} was added to allow placing an icon in the button. } + \examples{ library(shiny) library(shinyBS) app = shinyApp( - ui = + ui = fluidPage( sidebarLayout( sidebarPanel( @@ -60,35 +61,35 @@ app = shinyApp( value = 1), bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")), tags$p("Clicking the first button below changes the disabled state of the second button."), - bsButton("togOne", label = "Toggle button disabled status", + bsButton("togOne", label = "Toggle button disabled status", block = TRUE, type = "toggle", value = TRUE), bsButton("actOne", label = "Block Action Button", block = TRUE) - + ), mainPanel( textOutput("exampleText") ) - ) + ) ), - server = + server = function(input, output, session) { observeEvent(input$togOne, ({ updateButton(session, "actOne", disabled = !input$togOne) })) observeEvent(input$bins, ({ - + b <- input$bins disabled = NULL style = "default" icon = "" - + if(b < 5) { disabled = TRUE icon <- icon("ban") } else { disabled = FALSE } - + if(b < 15 | b > 35) { style = "danger" } else if(b < 20 | b > 30) { @@ -97,11 +98,11 @@ app = shinyApp( style = "default" icon = icon("check") } - + updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon) - + })) - + output$exampleText <- renderText({ input$actTwo b <- isolate(input$bins) @@ -124,7 +125,8 @@ app = shinyApp( \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Buttons: \code{\link{bsButton}}; - \code{\link{updateButton}} +Other Buttons: +\code{\link{bsButton}()}, +\code{\link{updateButton}()} } - +\concept{Buttons} diff --git a/man/Collapses.Rd b/man/Collapses.Rd index c348f66..b4a7fa2 100644 --- a/man/Collapses.Rd +++ b/man/Collapses.Rd @@ -1,23 +1,23 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Collapses.R \name{Collapses} \alias{Collapses} \title{Collapses} \description{ -Collapse panels allow you to reduce clutter in your Shiny app by making +Collapse panels allow you to reduce clutter in your Shiny app by making panels of information that open and close with a user's click. Any type of content can go in a collapse panel. Standard Bootstrap styling options are available. } \details{ -Collapses are designed to mimic \code{\link{tabsetPanel}} in their implementation. +Collapses are designed to mimic \code{\link{tabsetPanel}} in their implementation. Start with \code{bsCollapse} to create a panel group, then fill it with panels -using \code{bsCollapsePanel}. +using \code{bsCollapsePanel}. -\code{bsCollapse} acts as an input, so you can retrieve which panels are open -from the input object passed to the function in \code{\link{shinyServer}}. +\code{bsCollapse} acts as an input, so you can retrieve which panels are open +from the input object passed to the function in \code{\link{shinyServer}}. -\code{updateCollapse} can be used within your server logic to open/close +\code{updateCollapse} can be used within your server logic to open/close collapse panels or to change their style. } \note{ @@ -35,20 +35,21 @@ of \code{Collapses} functionality. \section{Changes}{ -\code{style} is a new option that wasn't available in previous versions of +\code{style} is a new option that wasn't available in previous versions of shinyBS. } + \examples{ library(shiny) library(shinyBS) app = shinyApp( - ui = + ui = fluidPage( sidebarLayout( - sidebarPanel(HTML("This button will open Panel 1 using updateCollapse."), + sidebarPanel(HTML("This button will open Panel 1 using updateCollapse."), actionButton("p1Button", "Push Me!"), - selectInput("styleSelect", "Select style for Panel 1", + selectInput("styleSelect", "Select style for Panel 1", c("default", "primary", "danger", "warning", "info", "success")) ), mainPanel( @@ -62,9 +63,9 @@ app = shinyApp( ) ) ), - server = + server = function(input, output, session) { - output$genericPlot <- renderPlot(plot(rnorm(100))) + output$genericPlot <- renderPlot(plot(rnorm(100))) observeEvent(input$p1Button, ({ updateCollapse(session, "collapseExample", open = "Panel 1") })) @@ -80,7 +81,9 @@ app = shinyApp( \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Collapses: \code{\link{bsCollapsePanel}}; - \code{\link{bsCollapse}}; \code{\link{updateCollapse}} +Other Collapses: +\code{\link{bsCollapsePanel}()}, +\code{\link{bsCollapse}()}, +\code{\link{updateCollapse}()} } - +\concept{Collapses} diff --git a/man/Modals.Rd b/man/Modals.Rd index bcdda74..674cf6f 100644 --- a/man/Modals.Rd +++ b/man/Modals.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Modals.R \name{Modals} \alias{Modals} @@ -11,7 +11,7 @@ cluttering up the main app display or help pages to explain your apps operation. } \details{ -Use \code{\link{bsModal}} in your UI to create a modal window. It works +Use \code{\link{bsModal}} in your UI to create a modal window. It works like \code{\link{Collapses}} or \code{\link{tabPanel}}, any non-named arguments will be passed as content for the modal. @@ -24,7 +24,7 @@ of \code{Modals} functionality. } \section{Components}{ -There are only two functions in the Modals family: +There are only two functions in the Modals family: \describe{ \item{\code{\link{bsModal}}}{Used in the UI to create a modal window.} \item{\code{\link{toggleModal}}}{Used in the Server logic to open or @@ -37,15 +37,16 @@ There are only two functions in the Modals family: There is now a \code{toggle} argument in \code{\link{toggleModal}} that allows you to specify whether you want the modal to open or close. -The \code{size} argument in \code{\link{bsModal}} allows you to specify the +The \code{size} argument in \code{\link{bsModal}} allows you to specify the size of the modal window. Either \code{small} or \code{large}. } + \examples{ library(shiny) library(shinyBS) app = shinyApp( - ui = + ui = fluidPage( sidebarLayout( sidebarPanel( @@ -56,32 +57,32 @@ app = shinyApp( value = 30), actionButton("tabBut", "View Table") ), - + mainPanel( plotOutput("distPlot"), - bsModal("modalExample", "Data Table", "tabBut", size = "large", + bsModal("modalExample", "Data Table", "tabBut", size = "large", dataTableOutput("distTable")) ) ) ), - server = + server = function(input, output, session) { - + output$distPlot <- renderPlot({ - + x <- faithful[, 2] bins <- seq(min(x), max(x), length.out = input$bins + 1) - + # draw the histogram with the specified number of bins hist(x, breaks = bins, col = 'darkgray', border = 'white') - + }) - + output$distTable <- renderDataTable({ - + x <- faithful[, 2] bins <- seq(min(x), max(x), length.out = input$bins + 1) - + # draw the histogram with the specified number of bins tab <- hist(x, breaks = bins, plot = FALSE) tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) { @@ -90,9 +91,9 @@ app = shinyApp( tab <- as.data.frame(do.call(cbind, tab)) colnames(tab) <- c("Bins", "Counts", "Density") return(tab[, 1:3]) - + }, options = list(pageLength=10)) - + } ) \dontrun{ @@ -102,7 +103,8 @@ app = shinyApp( \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Modals: \code{\link{bsModal}}; - \code{\link{toggleModal}} +Other Modals: +\code{\link{bsModal}()}, +\code{\link{toggleModal}()} } - +\concept{Modals} diff --git a/man/Tooltips_and_Popovers.Rd b/man/Tooltips_and_Popovers.Rd index 1520004..7da1f72 100644 --- a/man/Tooltips_and_Popovers.Rd +++ b/man/Tooltips_and_Popovers.Rd @@ -1,11 +1,11 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/Tooltips_and_Popovers.R \name{Tooltips_and_Popovers} \alias{Tooltips_and_Popovers} \title{Tooltips and Popovers} \description{ Tooltips and Popovers allow you to add additional information about controls -or outputs without cluttering up your user interface. You can add a tooltip to +or outputs without cluttering up your user interface. You can add a tooltip to a button that displays on hover and better explains what the button will do, or you could add a popover to an output providing further analysis of that output. } @@ -13,7 +13,7 @@ you could add a popover to an output providing further analysis of that output. You can create tooltips and popovers from either the UI script or within the Server logic. \code{\link{bsTooltip}} and \code{\link{bsPopover}} are used in the UI, and \code{\link{addTooltip}} and \code{\link{addPopover}} are used in -the Server logic. \code{\link{tipify}} and \code{\link{popify}} can be used +the Server logic. \code{\link{tipify}} and \code{\link{popify}} can be used within the UI or from within a \code{\link{renderUI}} in the Server logic. They also have the added advantage of not requiring that the UI element have an ID attribute. @@ -26,7 +26,7 @@ app in order for the necessary dependencies to be loaded. Because of this, \code{\link{addTooltip}} and \code{\link{addPopover}} will not work if they are the only shinyBS components in your app. -Tooltips and popovers may not work on some of the more complex shiny inputs +Tooltips and popovers may not work on some of the more complex shiny inputs or outputs. If you encounter a problem with tooltips or popovers not appearing please file a issue on the github page so I can fix it. @@ -35,25 +35,25 @@ of \code{Tooltips_and_Popovers} functionality. } \section{Components}{ -There are eight functions in the Tooltips and Popovers family: +There are eight functions in the Tooltips and Popovers family: \describe{ \item{\code{\link{bsTooltip}}}{Used in the UI to add a tooltip to an element in your UI.} \item{\code{\link{bsPopover}}}{Used in the UI to add a popover to an element in your UI.} \item{\code{\link{tipify}}}{Wrap any UI element in \code{tipify} to add a - tooltip to the wrapped element. Preferred for elemented created with + tooltip to the wrapped element. Preferred for elemented created with \code{\link{renderUI}}.} \item{\code{\link{popify}}}{Wrap any UI element in \code{popify} to add a - popover to the wrapped element. Preferred for elements created with + popover to the wrapped element. Preferred for elements created with \code{\link{renderUI}}.} - \item{\code{\link{addTooltip}}}{Used in the Server logic to add a tooltip + \item{\code{\link{addTooltip}}}{Used in the Server logic to add a tooltip to an element in your UI.} - \item{\code{\link{addPopover}}}{Used in the Server logic to add a popover + \item{\code{\link{addPopover}}}{Used in the Server logic to add a popover to an element in your UI.} - \item{\code{\link{removeTooltip}}}{Used in the Server logic to remove a + \item{\code{\link{removeTooltip}}}{Used in the Server logic to remove a tooltip from an element in your UI.} - \item{\code{\link{removePopover}}}{Used in the Server logic to remove a + \item{\code{\link{removePopover}}}{Used in the Server logic to remove a popover from an element in your UI.} } } @@ -65,12 +65,13 @@ advanced users more control over how the tooltips and popovers appear. See the \href{http://getbootstrap.com}{Twitter Bootstrap 3 documentation} for more details. } + \examples{ library(shiny) library(shinyBS) app = shinyApp( - ui = + ui = fluidPage( sidebarLayout( sidebarPanel( @@ -79,31 +80,31 @@ app = shinyApp( min = 1, max = 50, value = 30), - bsTooltip("bins", "The wait times will be broken into this many equally spaced bins", + bsTooltip("bins", "The wait times will be broken into this many equally spaced bins", "right", options = list(container = "body")) ), mainPanel( plotOutput("distPlot"), - uiOutput("uiExample") + uiOutput("uiExample") ) - ) + ) ), - server = + server = function(input, output, session) { output$distPlot <- renderPlot({ - + # generate bins based on input$bins from ui.R x <- faithful[, 2] bins <- seq(min(x), max(x), length.out = input$bins + 1) - + # draw the histogram with the specified number of bins hist(x, breaks = bins, col = 'darkgray', border = 'white') - + }) output$uiExample <- renderUI({ tags$span( - popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"), - "A Pointless Button", + popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"), + "A Pointless Button", "This button is pointless. It does not do anything!"), tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"), "This button is pointless too!") @@ -123,10 +124,14 @@ app = shinyApp( \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{addPopover}}; - \code{\link{addTooltip}}; \code{\link{bsPopover}}; - \code{\link{bsTooltip}}; \code{\link{popify}}; - \code{\link{removePopover}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/addPopover.Rd b/man/addPopover.Rd index 36b3c6d..ff23115 100644 --- a/man/addPopover.Rd +++ b/man/addPopover.Rd @@ -1,11 +1,19 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/addPopover.R \name{addPopover} \alias{addPopover} \title{addPopover} \usage{ -addPopover(session, id, title, content, placement = "bottom", - trigger = "hover", options = NULL) +addPopover( + session, + id, + title, + content, + placement = "bottom", + trigger = "hover", + options = NULL, + treatAsJQSel = FALSE +) } \arguments{ \item{session}{The session object passed to function given to shinyServer.} @@ -16,13 +24,17 @@ addPopover(session, id, title, content, placement = "bottom", \item{content}{The main content of the popover.} -\item{placement}{Where the popover should appear relative to its target +\item{placement}{Where the popover should appear relative to its target (\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{bottom}.} \item{trigger}{What action should cause the popover to appear? (\code{hover}, \code{focus}, \code{click}, or \code{manual}). Defaults to \code{hover}.} \item{options}{A named list of additional options to be set on the popover.} + +\item{treatAsJQSel}{if \code{TRUE}, \code{id} is treated as a general jQuery selector +rather than the id attribute of the element. This allows adding the popover to HTML +elements even if they do not have an id attribute attached to it.} } \description{ \code{addPopover} is used within the Server logic of an app to add a popover to a Shiny @@ -39,10 +51,14 @@ of \code{addPopover} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addTooltip}}; \code{\link{bsPopover}}; - \code{\link{bsTooltip}}; \code{\link{popify}}; - \code{\link{removePopover}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/addTooltip.Rd b/man/addTooltip.Rd index 7049d87..9f6ca86 100644 --- a/man/addTooltip.Rd +++ b/man/addTooltip.Rd @@ -1,11 +1,18 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/addTooltip.R \name{addTooltip} \alias{addTooltip} \title{addTooltip} \usage{ -addTooltip(session, id, title, placement = "bottom", trigger = "hover", - options = NULL) +addTooltip( + session, + id, + title, + placement = "bottom", + trigger = "hover", + options = NULL, + treatAsJQSel = FALSE +) } \arguments{ \item{session}{The session object passed to function given to shinyServer.} @@ -14,13 +21,17 @@ addTooltip(session, id, title, placement = "bottom", trigger = "hover", \item{title}{The content of the tooltip.} -\item{placement}{Where the tooltip should appear relative to its target +\item{placement}{Where the tooltip should appear relative to its target (\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.} \item{trigger}{What action should cause the tooltip to appear? (\code{hover}, \code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.} \item{options}{A named list of additional options to be set on the tooltip.} + +\item{treatAsJQSel}{if \code{TRUE}, \code{id} is treated as a general jQuery selector +rather than the id attribute of the element. This allows adding the popover to HTML +elements even if they do not have an id attribute attached to it.} } \description{ \code{addTooltip} is used within the Server logic of an app to add a tooltip to a Shiny @@ -37,10 +48,14 @@ of \code{addTooltip} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{bsPopover}}; - \code{\link{bsTooltip}}; \code{\link{popify}}; - \code{\link{removePopover}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/bsAlert.Rd b/man/bsAlert.Rd index 351fe5e..1f6fa5f 100644 --- a/man/bsAlert.Rd +++ b/man/bsAlert.Rd @@ -1,10 +1,10 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsAlert.R \name{bsAlert} \alias{bsAlert} \title{bsAlert} \usage{ -bsAlert(anchorId) +bsAlert(anchorId, inline = TRUE) } \arguments{ \item{anchorId}{A unique id the identifies the anchor.} @@ -24,7 +24,9 @@ of \code{bsAlert} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Alerts: \code{\link{Alerts}}; - \code{\link{closeAlert}}; \code{\link{createAlert}} +Other Alerts: +\code{\link{Alerts}}, +\code{\link{closeAlert}()}, +\code{\link{createAlert}()} } - +\concept{Alerts} diff --git a/man/bsButton.Rd b/man/bsButton.Rd index 517fcf9..b9147c2 100644 --- a/man/bsButton.Rd +++ b/man/bsButton.Rd @@ -1,28 +1,36 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsButton.R \name{bsButton} \alias{bsButton} \title{bsButton} \usage{ -bsButton(inputId, label, icon = NULL, ..., style = "default", - size = "default", type = "action", block = FALSE, disabled = FALSE, - value = FALSE) +bsButton( + inputId, + label, + icon = NULL, + ..., + style = "default", + size = "default", + type = "action", + block = FALSE, + disabled = FALSE, + value = FALSE +) } \arguments{ -\item{inputId}{Specifies the input slot that will be used to access the -value.} +\item{inputId}{The \code{input} slot that will be used to access the value.} \item{label}{The contents of the button or link--usually a text label, but you could also use any other HTML, like an image.} -\item{icon}{An optional \code{\link{icon}} to appear on the button.} +\item{icon}{An optional \code{\link[shiny:icon]{icon()}} to appear on the button.} \item{...}{Named attributes to be applied to the button or link.} \item{style}{A Bootstrap style to apply to the button. (\code{default}, \code{primary}, \code{success}, \code{info}, \code{warning}, or \code{danger})} -\item{size}{The size of the button (\code{extra-small}, \code{small}, +\item{size}{The size of the button (\code{extra-small}, \code{small}, \code{default}, or \code{large})} \item{type}{The type of button to create. (\code{action} or \code{toggle})} @@ -48,7 +56,8 @@ of \code{bsButton} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Buttons: \code{\link{Buttons}}; - \code{\link{updateButton}} +Other Buttons: +\code{\link{Buttons}}, +\code{\link{updateButton}()} } - +\concept{Buttons} diff --git a/man/bsCollapse.Rd b/man/bsCollapse.Rd index 8d887df..6d3b3f3 100644 --- a/man/bsCollapse.Rd +++ b/man/bsCollapse.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsCollapse.R \name{bsCollapse} \alias{bsCollapse} @@ -7,16 +7,16 @@ bsCollapse(..., id = NULL, multiple = FALSE, open = NULL) } \arguments{ -\item{id}{\bold{Optional} You can use \code{input$id} in your Server logic to +\item{\dots}{\code{\link{bsCollapsePanel}} elements to include in the Collapse.} + +\item{id}{\bold{Optional} You can use \code{input$id} in your Server logic to determine which panels are open, and \code{\link{updateCollapse}} to open/close panels.} \item{multiple}{Can more than one panel be open at a time? Defaults to \code{FALSE}.} -\item{open}{The \code{value}, (or if none was supplied, the \code{title}) of +\item{open}{The \code{value}, (or if none was supplied, the \code{title}) of the panel(s) you want open on load.} - -\item{\dots}{\code{\link{bsCollapsePanel}} elements to include in the Collapse.} } \description{ \code{bsCollapse} is used in your UI to create a collapse panel group. Use @@ -33,8 +33,9 @@ of \code{bsCollapse} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Collapses: \code{\link{Collapses}}; - \code{\link{bsCollapsePanel}}; - \code{\link{updateCollapse}} +Other Collapses: +\code{\link{Collapses}}, +\code{\link{bsCollapsePanel}()}, +\code{\link{updateCollapse}()} } - +\concept{Collapses} diff --git a/man/bsCollapsePanel.Rd b/man/bsCollapsePanel.Rd index 2f1d410..ad65802 100644 --- a/man/bsCollapsePanel.Rd +++ b/man/bsCollapsePanel.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsCollapsePanel.R \name{bsCollapsePanel} \alias{bsCollapsePanel} @@ -9,11 +9,11 @@ bsCollapsePanel(title, ..., value = title, style = NULL) \arguments{ \item{title}{The title to display at the top of the panel.} +\item{\dots}{UI elements to include within the panel.} + \item{value}{\bold{Optional} The value to return when this panel is open. Defaults to \code{title}.} \item{style}{\bold{Optional} A Bootstrap style to apply to the panel. (\code{primary}, \code{danger}, \code{warning}, \code{info}, or \code{success})} - -\item{\dots}{UI elements to include within the panel.} } \description{ \code{bsCollapsePanel} creates individual panels within a \code{\link{bsCollapse}} object. @@ -29,7 +29,9 @@ of \code{bsCollapsePanel} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Collapses: \code{\link{Collapses}}; - \code{\link{bsCollapse}}; \code{\link{updateCollapse}} +Other Collapses: +\code{\link{Collapses}}, +\code{\link{bsCollapse}()}, +\code{\link{updateCollapse}()} } - +\concept{Collapses} diff --git a/man/bsExample.Rd b/man/bsExample.Rd index 624b627..4069c05 100644 --- a/man/bsExample.Rd +++ b/man/bsExample.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsExample.R \name{bsExample} \alias{bsExample} @@ -16,17 +16,16 @@ bsExample(family, display.mode = "showcase", ...) } \description{ A function to view examples of shinyBS functionality. Will run the examples -found in the examples sections of shinyBS documentation. Use this instead of +found in the examples sections of shinyBS documentation. Use this instead of \code{example}. } \details{ This function is just a wrapper for \code{\link{runApp}} that runs copies of the examples found in the family documention pages of \code{shinyBS}. By default, -\code{display.mode} is set to \code{showcase} so you can see the code while +\code{display.mode} is set to \code{showcase} so you can see the code while the app is running. } \examples{ \dontrun{ bsExample("Alerts")} } - diff --git a/man/bsModal.Rd b/man/bsModal.Rd index 0ae2e2f..38c99e8 100644 --- a/man/bsModal.Rd +++ b/man/bsModal.Rd @@ -1,10 +1,19 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsModal.R \name{bsModal} \alias{bsModal} \title{bsModal} \usage{ -bsModal(id, title, trigger, ..., size) +bsModal( + id, + title, + trigger, + ..., + size, + footer = NULL, + close.button = TRUE, + width = NULL +) } \arguments{ \item{id}{A unique identifier for the modal window} @@ -13,9 +22,15 @@ bsModal(id, title, trigger, ..., size) \item{trigger}{The id of a button or link that will open the modal.} +\item{\dots}{UI elements to include within the modal} + \item{size}{\bold{Optional} What size should the modal be? (\code{small} or \code{large})} -\item{\dots}{UI elements to include within the modal} +\item{footer}{A \code{list} of shiny UI elements to be added to the footer of the modal.} + +\item{close.button}{Should a close button be added to the footer of the modal?} + +\item{width}{An optional width argument for the modal. Must include units. Only applied if \code{size} is missing.} } \description{ \code{bsModal} is used within the UI to create a modal window. @@ -31,7 +46,8 @@ of \code{bsModal} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Modals: \code{\link{Modals}}; - \code{\link{toggleModal}} +Other Modals: +\code{\link{Modals}}, +\code{\link{toggleModal}()} } - +\concept{Modals} diff --git a/man/bsPopover.Rd b/man/bsPopover.Rd index 3cdc3af..ccc6a0f 100644 --- a/man/bsPopover.Rd +++ b/man/bsPopover.Rd @@ -1,11 +1,17 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsPopover.R \name{bsPopover} \alias{bsPopover} \title{bsPopover} \usage{ -bsPopover(id, title, content, placement = "bottom", trigger = "hover", - options = NULL) +bsPopover( + id, + title, + content, + placement = "bottom", + trigger = "hover", + options = NULL +) } \arguments{ \item{id}{The id of the element to attach the popover to.} @@ -14,7 +20,7 @@ bsPopover(id, title, content, placement = "bottom", trigger = "hover", \item{content}{The main content of the popover.} -\item{placement}{Where the popover should appear relative to its target +\item{placement}{Where the popover should appear relative to its target (\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.} \item{trigger}{What action should cause the popover to appear? (\code{hover}, @@ -37,10 +43,14 @@ of \code{bsPopover} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{addTooltip}}; - \code{\link{bsTooltip}}; \code{\link{popify}}; - \code{\link{removePopover}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/bsTooltip.Rd b/man/bsTooltip.Rd index 1494de7..6a72e5a 100644 --- a/man/bsTooltip.Rd +++ b/man/bsTooltip.Rd @@ -1,18 +1,17 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsTooltip.R \name{bsTooltip} \alias{bsTooltip} \title{bsTooltip} \usage{ -bsTooltip(id, title, placement = "bottom", trigger = "hover", - options = NULL) +bsTooltip(id, title, placement = "bottom", trigger = "hover", options = NULL) } \arguments{ \item{id}{The id of the element to attach the tooltip to.} \item{title}{The content of the tooltip.} -\item{placement}{Where the tooltip should appear relative to its target +\item{placement}{Where the tooltip should appear relative to its target (\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.} \item{trigger}{What action should cause the tooltip to appear? (\code{hover}, @@ -35,10 +34,14 @@ of \code{bsTooltip} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{addTooltip}}; - \code{\link{bsPopover}}; \code{\link{popify}}; - \code{\link{removePopover}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/bsTypeahead.Rd b/man/bsTypeahead.Rd index baf5243..8577428 100644 --- a/man/bsTypeahead.Rd +++ b/man/bsTypeahead.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/bsTypeahead.R \name{bsTypeahead} \alias{bsTypeahead} @@ -29,4 +29,3 @@ when there is no text when lookup function is called.} \seealso{ \code{\link{updateTypeaheadInput}} } - diff --git a/man/closeAlert.Rd b/man/closeAlert.Rd index 707330f..2ffbdca 100644 --- a/man/closeAlert.Rd +++ b/man/closeAlert.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/closeAlert.R \name{closeAlert} \alias{closeAlert} @@ -12,7 +12,7 @@ closeAlert(session, alertId) \item{alertId}{The id of the alert to be dismissed.} } \description{ -\code{closeAlert} is used within your Server logic to close an alert that you +\code{closeAlert} is used within your Server logic to close an alert that you created with \code{\link{createAlert}}. } \details{ @@ -26,7 +26,9 @@ of \code{closeAlert} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Alerts: \code{\link{Alerts}}; \code{\link{bsAlert}}; - \code{\link{createAlert}} +Other Alerts: +\code{\link{Alerts}}, +\code{\link{bsAlert}()}, +\code{\link{createAlert}()} } - +\concept{Alerts} diff --git a/man/createAlert.Rd b/man/createAlert.Rd index 5b6217e..01f7ad2 100644 --- a/man/createAlert.Rd +++ b/man/createAlert.Rd @@ -1,11 +1,19 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/createAlert.R \name{createAlert} \alias{createAlert} \title{createAlert} \usage{ -createAlert(session, anchorId, alertId = NULL, title = NULL, - content = NULL, style = NULL, dismiss = TRUE, append = TRUE) +createAlert( + session, + anchorId, + alertId = NULL, + title = NULL, + content = NULL, + style = NULL, + dismiss = TRUE, + append = TRUE +) } \arguments{ \item{session}{The session object passed to function given to shinyServer.} @@ -40,7 +48,9 @@ of \code{createAlert} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Alerts: \code{\link{Alerts}}; \code{\link{bsAlert}}; - \code{\link{closeAlert}} +Other Alerts: +\code{\link{Alerts}}, +\code{\link{bsAlert}()}, +\code{\link{closeAlert}()} } - +\concept{Alerts} diff --git a/man/popify.Rd b/man/popify.Rd index 180135d..3c4d43b 100644 --- a/man/popify.Rd +++ b/man/popify.Rd @@ -1,11 +1,17 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/popify.R \name{popify} \alias{popify} \title{popify} \usage{ -popify(el, title, content, placement = "bottom", trigger = "hover", - options = NULL) +popify( + el, + title, + content, + placement = "bottom", + trigger = "hover", + options = NULL +) } \arguments{ \item{el}{A shiny UI element.} @@ -14,7 +20,7 @@ popify(el, title, content, placement = "bottom", trigger = "hover", \item{content}{The main content of the popover.} -\item{placement}{Where the popover should appear relative to its target +\item{placement}{Where the popover should appear relative to its target (\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.} \item{trigger}{What action should cause the popover to appear? (\code{hover}, @@ -38,10 +44,14 @@ of \code{popify} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{addTooltip}}; - \code{\link{bsPopover}}; \code{\link{bsTooltip}}; - \code{\link{removePopover}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/removePopover.Rd b/man/removePopover.Rd index 6cb805f..d61ad3c 100644 --- a/man/removePopover.Rd +++ b/man/removePopover.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/removePopover.R \name{removePopover} \alias{removePopover} @@ -26,10 +26,14 @@ of \code{removePopover} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{addTooltip}}; - \code{\link{bsPopover}}; \code{\link{bsTooltip}}; - \code{\link{popify}}; \code{\link{removeTooltip}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removeTooltip}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/removeTooltip.Rd b/man/removeTooltip.Rd index 6f85807..5e6b4f9 100644 --- a/man/removeTooltip.Rd +++ b/man/removeTooltip.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/removeTooltip.R \name{removeTooltip} \alias{removeTooltip} @@ -26,10 +26,14 @@ of \code{removeTooltip} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{addTooltip}}; - \code{\link{bsPopover}}; \code{\link{bsTooltip}}; - \code{\link{popify}}; \code{\link{removePopover}}; - \code{\link{tipify}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{tipify}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/tipify.Rd b/man/tipify.Rd index e4f3dc2..408f660 100644 --- a/man/tipify.Rd +++ b/man/tipify.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tipify.R \name{tipify} \alias{tipify} @@ -11,7 +11,7 @@ tipify(el, title, placement = "bottom", trigger = "hover", options = NULL) \item{title}{The content of the tooltip.} -\item{placement}{Where the tooltip should appear relative to its target +\item{placement}{Where the tooltip should appear relative to its target (\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.} \item{trigger}{What action should cause the tooltip to appear? (\code{hover}, @@ -35,10 +35,14 @@ of \code{tipify} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}}; - \code{\link{addPopover}}; \code{\link{addTooltip}}; - \code{\link{bsPopover}}; \code{\link{bsTooltip}}; - \code{\link{popify}}; \code{\link{removePopover}}; - \code{\link{removeTooltip}} +Other Tooltips_and_Popovers: +\code{\link{Tooltips_and_Popovers}}, +\code{\link{addPopover}()}, +\code{\link{addTooltip}()}, +\code{\link{bsPopover}()}, +\code{\link{bsTooltip}()}, +\code{\link{popify}()}, +\code{\link{removePopover}()}, +\code{\link{removeTooltip}()} } - +\concept{Tooltips_and_Popovers} diff --git a/man/toggleModal.Rd b/man/toggleModal.Rd index 1af7454..e86e027 100644 --- a/man/toggleModal.Rd +++ b/man/toggleModal.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/toggleModal.R \name{toggleModal} \alias{toggleModal} @@ -28,6 +28,8 @@ of \code{toggleModal} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Modals: \code{\link{Modals}}; \code{\link{bsModal}} +Other Modals: +\code{\link{Modals}}, +\code{\link{bsModal}()} } - +\concept{Modals} diff --git a/man/updateButton.Rd b/man/updateButton.Rd index 219637b..26c7b18 100644 --- a/man/updateButton.Rd +++ b/man/updateButton.Rd @@ -1,29 +1,37 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/updateButton.R \name{updateButton} \alias{updateButton} \title{updateButton} \usage{ -updateButton(session, inputId, label = NULL, icon = NULL, value = NULL, - style = NULL, size = NULL, block = NULL, disabled = NULL) +updateButton( + session, + inputId, + label = NULL, + icon = NULL, + value = NULL, + style = NULL, + size = NULL, + block = NULL, + disabled = NULL +) } \arguments{ \item{session}{The session object passed to function given to shinyServer.} -\item{inputId}{Specifies the input slot that will be used to access the -value.} +\item{inputId}{The \code{input} slot that will be used to access the value.} \item{label}{The contents of the button or link--usually a text label, but you could also use any other HTML, like an image.} -\item{icon}{An optional \code{\link{icon}} to appear on the button.} +\item{icon}{An optional \code{\link[shiny:icon]{icon()}} to appear on the button.} \item{value}{\bold{logical} If \code{type = "toggle"}, the initial value of the button.} \item{style}{A Bootstrap style to apply to the button. (\code{default}, \code{primary}, \code{success}, \code{info}, \code{warning}, or \code{danger})} -\item{size}{The size of the button (\code{extra-small}, \code{small}, +\item{size}{The size of the button (\code{extra-small}, \code{small}, \code{default}, or \code{large})} \item{block}{\bold{logical} Should the button take the full width of the parent element?} @@ -39,6 +47,9 @@ Because of the way it is coded, \code{updateButton} may work on buttons not created by \code{\link{bsButton}} such as \code{\link{submitButton}}. See \code{\link{Buttons}} for more information about how to use \code{updateButton} with the rest of the Buttons family. + +See \link{Buttons} for more information about how to use \code{updateButton} with the +rest of the Buttons family. } \note{ Run \code{bsExample("Buttons")} for an example @@ -47,7 +58,8 @@ of \code{updateButton} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Buttons: \code{\link{Buttons}}; - \code{\link{bsButton}} +Other Buttons: +\code{\link{Buttons}}, +\code{\link{bsButton}()} } - +\concept{Buttons} diff --git a/man/updateCollapse.Rd b/man/updateCollapse.Rd index 42b717a..1f24e35 100644 --- a/man/updateCollapse.Rd +++ b/man/updateCollapse.Rd @@ -1,4 +1,4 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/updateCollapse.R \name{updateCollapse} \alias{updateCollapse} @@ -11,15 +11,15 @@ updateCollapse(session, id, open = NULL, close = NULL, style = NULL) \item{id}{The id of the Collapse object you want to change.} -\item{open}{A vector of \code{value} (or \code{title} if no \code{value} was +\item{open}{A vector of \code{value} (or \code{title} if no \code{value} was provided) values identifying the panels you want to open.} -\item{close}{A vector of \code{value} (or \code{title} if no \code{value} was +\item{close}{A vector of \code{value} (or \code{title} if no \code{value} was provided) values identifying the panels you want to close.} \item{style}{A named list of Bootstrap styles (\code{primary}, \code{danger}, \code{info}, \code{warning}, \code{success}, or \code{default}). The names should correspond -to the \code{value} (or \code{title} if no \code{value} was provided) of the +to the \code{value} (or \code{title} if no \code{value} was provided) of the \code{\link{bsCollapsePanel}} you want to change.} } \description{ @@ -37,7 +37,9 @@ of \code{updateCollapse} functionality. \seealso{ \href{http://getbootstrap.com}{Twitter Bootstrap 3} -Other Collapses: \code{\link{Collapses}}; - \code{\link{bsCollapsePanel}}; \code{\link{bsCollapse}} +Other Collapses: +\code{\link{Collapses}}, +\code{\link{bsCollapsePanel}()}, +\code{\link{bsCollapse}()} } - +\concept{Collapses} diff --git a/man/updateTypeahead.Rd b/man/updateTypeahead.Rd index 3084f05..8d44033 100644 --- a/man/updateTypeahead.Rd +++ b/man/updateTypeahead.Rd @@ -1,11 +1,10 @@ -% Generated by roxygen2 (4.1.0): do not edit by hand +% Generated by roxygen2: do not edit by hand % Please edit documentation in R/updateTypeahead.R \name{updateTypeahead} \alias{updateTypeahead} \title{updateTypeahead} \usage{ -updateTypeahead(session, inputId, label = NULL, value = NULL, - choices = NULL) +updateTypeahead(session, inputId, label = NULL, value = NULL, choices = NULL) } \arguments{ \item{session}{The session object passed to function given to shinyServer.} @@ -25,4 +24,3 @@ function. Use htmlwidgets::JS() to indicate JavaScript.} \seealso{ \code{\link{typeaheadInput}} } -