Created
March 25, 2014 16:42
-
-
Save trestletech/9765992 to your computer and use it in GitHub Desktop.
ConditionalPanel + Plot Shiny Resizing Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyServer(function(input, output) { | |
output$distPlot <- renderPlot({ | |
print("Plotting"); | |
Sys.sleep(1) | |
# generate and plot an rnorm distribution with the requested | |
# number of observations | |
dist <- rnorm(input$obs) | |
hist(dist) | |
}) | |
output$content <- renderTable({ | |
data.frame(a=1:3, b=2:4) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(pageWithSidebar( | |
# Application title | |
headerPanel("New Application"), | |
# Sidebar with a slider input for number of observations | |
sidebarPanel( | |
conditionalPanel("1 == 1", | |
sliderInput("obs", | |
"Number of observations:", | |
min = 1, | |
max = 1000, | |
value = 500)) | |
), | |
# Show a plot of the generated distribution | |
mainPanel( | |
tabsetPanel( | |
tabPanel("Tab1", | |
plotOutput("distPlot") | |
) | |
) | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment