Skip to content

Instantly share code, notes, and snippets.

@RCura
Last active November 11, 2015 13:09
Show Gist options
  • Save RCura/2e4e2fe6b02a0c80adad to your computer and use it in GitHub Desktop.
Save RCura/2e4e2fe6b02a0c80adad to your computer and use it in GitHub Desktop.
tooltip examples
# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(shiny)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$standardincome + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
})
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#
library(shiny)
library(shinyBS)
shinyUI(fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
numericInput("standardincome",
label = h4("What is your monthly household income?", icon("info-circle")),
value = "0", min=0),
numericInput("standardincome2",
label = h4("What is your monthly household income?", tipify(icon("info-circle"), title = "my tooltip content")),
value = 0, min=0),
numericInput("standardincome3", label = h4("What is your monthly household income?"), value = 0, min=0),
bsTooltip(id = "standardincome3", title = "tooltip content", placement = "right")
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment