How to add tooltips to html widgets in shiny dashboard

I am struggling to add tooltips to html widgets in Rshiny. bs_embed_tooltip from library(flexdashboard) does the job for some shiny widgets but returns the following error when it is applied to an html widget:

Error in .tag_validate(.) : 
  tag is not a shiny.tag - tag must be generated using htmltools or shiny

Here is my minimal working example (modifying example code from shinydashboard):

## app.R ##
library(shinydashboard)
library(flexdashboard)
library(bsplus) # For shiny tooltips

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
    # Boxes need to be put in a row (or column)
    fluidRow(
      box(plotOutput("plot1", height = 250) %>%
            bs_embed_tooltip("This is the output chart.", placement = 'bottom')
      ),

      box(title = "Controls",
          sliderInput("slider", "Number of observations:", 1, 100, 50) %>%
            bs_embed_tooltip("Use this slider to select the number of observations.", placement = 'bottom')
      ),
      box(title = "Guage",
          gaugeOutput("guage_value") # %>% bs_embed_tooltip("This gauge shows the input value from the slider.", placement = 'bottom')
      )
    )
  )
)

server <- function(input, output) {
  set.seed(122)
  histdata <- rnorm(500)

  output$plot1 <- renderPlot({
    data <- histdata[seq_len(input$slider)]
    hist(data)
  })

  output$guage_value <- renderGauge({

    gauge(input$slider, min = 0, max = 100, symbol = '', gaugeSectors(
      danger = c(0, 30), warning = c(31, 70), success = c(71, 100) ))

  })
}

shinyApp(ui, server)

Your help to get around the code in the comment would be much appreciated.

  • installed shiny and shinydashboard with sudo and now, some of applications does not load

    I am on a server with ubuntu 16.04, R version 3.2.3. I have several shiny applications hosted. I updated shiny package and shiny dashboard package in R with sudo. Now, some of the applications work properly (as before) but some of them load with an error and this is the log:

    Listening on http://127.0.0.1:43323 Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘promises’ Warning: Error in : package or namespace load failed for ‘shinydashboard’ Stack trace (innermost first): 41: library 1: runApp Error: An error has occurred. Check your logs or contact the app author for clarification.

    Execution halted

    I have updated the "promises" package with sudo, but nothing has changed. here is the sessionInfo():

    sessionInfo() R version 3.2.3 (2015-12-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.4 LTS

    locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
    LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

    attached base packages: [1] stats graphics grDevices utils
    datasets methods base

    Even if I select one the working apps and copy the whole directory into a new one, the new copied application does not come up! there is no problem with applications, but I do not know what is the problem! please help

  • Shinydashboard: How to paste filtration in navbar instead of title?

    I want to paste filtration instead of title in navbar. How is it possible to do?

    In question here the filtration is placed right from the title. But in that case a button which collapses sidebar disappears. In this code I placed filtration instead of title but I still don't see the full list of items in widget.

    CustomHeader <- dashboardHeader()
    CustomHeader$children[[2]]$children <- list(
      div(style="padding: 7px; height: 30px;",
          selectInput("select1", NULL, c("a","b","c"))))
    
    ui <- dashboardPage(
      CustomHeader,
      dashboardSidebar(),
      dashboardBody(textOutput("text1"))
    )
    
    server <- function(input, output, session) {
      output$text1 <- renderText({input$select1})
    
    }
    
    shinyApp(ui, server)
    

    enter image description here