library(shiny)
shinyUI(pageWithSidebar(
# Application title
headerPanel("Spatially Balanced Sampling Tool"),
sidebarPanel(
tags$head(
tags$style(type="text/css", "select { max-width: 250px; }"),
tags$style(type="text/css", "textarea { max-width: 250px; }"),
tags$style(type="text/css", ".jslider { max-width: 250px; }"),
tags$style(type='text/css', ".well { max-width: 250px; }"),
tags$style(type='text/css', ".span4 { max-width: 250px; }")
),
helpText("PLEASE RUN STEPS IN ORDER"),
helpText(""),
fileInput('file1', '1) Choose .ZIP Shapefile:', multiple=TRUE,
accept=c('binary')),
selectInput("strataname","2) Select a stratum field:", choices=c("strata")),
helpText("Display now ready in 'Plot' tab..."),
numericInput("pts", "3) enter # of sampling points per stratum:", 0),
helpText("And - (optional)"),
numericInput("oversamppts", "enter # to OVER sample", 0),
submitButton("Fetch Points!"),
helpText("Points now ready to view in 'View Points' tab"),
downloadLink('downloadData', '4) click to Download Points as shapefile')
),
mainPanel(
tabsetPanel(
tabPanel("Instructions",
includeHTML("instructions.html"),
div(id="linkToMap", tags$a("Click here to see a map of your input data and create points")),
div(id="linkToPoints", tags$a("Click here to see table of created points")),
value=1,
HTML('
')
),
tabPanel("Plot",
#
# conditionalPanel(condition="$('div#plot').hasClass('recalculating'))", h4("Calculating... ")),
# conditionalPanel(condition="!($('div#grtsPointData').hasClass('recalculating'))", br()),
# conditionalPanel(condition="$('html').hasClass('shiny-busy')", img(src="dogfetcher2.gif")),
# conditionalPanel(condition="$('html').hasClass('shiny-busy')", h5("Calculating... ")),
# conditionalPanel(condition="!($('html').hasClass('shiny-busy'))", br()),
helpText("Map of input polygons by strata"),
plotOutput(outputId = "plot"),
value=2
),
tabPanel("View Points", helpText("suggested sampling points"),
helpText(" "),
tableOutput(outputId = "pointdata"),
HTML("
"),
HTML("
"),
value=3),
id = "conditionedPanels")
))
)