Created
November 5, 2013 04:24
-
-
Save annoporci/7313856 to your computer and use it in GitHub Desktop.
from SO question http://stackoverflow.com/questions/19777515/r-shiny-mainpanel-display-style-and-font
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
# server.R | |
library("shiny") | |
shinyServer( | |
function(input, output) { | |
myFunction <- function(myinput) | |
{ | |
# compute output | |
myoutput <- myinput*myinput | |
myoutput | |
} | |
# Show computed values | |
output$myResults <- renderTable( | |
{ | |
r <- c("My Output:",myFunction(input$myinput)) | |
myTable <- do.call(rbind, list(r)) | |
myTable | |
} | |
, align = c("clc") | |
, include.rownames = FALSE | |
, include.colnames = FALSE | |
, sanitize.text.function = function(x) x | |
)#end renderTable | |
}#end function(input,output) | |
)#end shinyServer |
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
# ui.R | |
library("shiny") | |
# Define UI for slider demo application | |
shinyUI( | |
pageWithSidebar( | |
# Title | |
headerPanel("Input-Output Shiny App") | |
, | |
# User Input in sidebar panel | |
sidebarPanel( | |
# customize display settings | |
tags$head( | |
tags$style(type='text/css', "input { width: 100px; }")# control numericInput box | |
, | |
tags$style(type='text/css', "select,textarea,.jslider,.well { font-size:50%; } ")# control font / ineffective | |
) | |
, | |
# user input | |
numericInput("myinput", "My Input:", 0) | |
)# end sidebarPanel | |
, | |
# Output in main panel | |
# See output$myResults in server.R | |
mainPanel( | |
tableOutput("myResults") | |
)# end mainPanel | |
)#end pageWithSidebar | |
)#end shinyUI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment