Skip to content

Instantly share code, notes, and snippets.

@shaun-jacks
Last active February 18, 2019 06:12
Show Gist options
  • Save shaun-jacks/59e0136bef76c3d35c87891bc58762f2 to your computer and use it in GitHub Desktop.
Save shaun-jacks/59e0136bef76c3d35c87891bc58762f2 to your computer and use it in GitHub Desktop.
UI for R Shiny Project
# This ui function holds the ui for our Shiny Vision Project.
# It is implemented with the shinydashboard library.
ui <- function(request){
# begin our shinydashboard
shinydashboard::dashboardPage(
#### Header ####
header = shinydashboard::dashboardHeader(
title = shiny::HTML(paste0(strong('Vision Analyze'))),
titleWidth=200 . # make this width match up with sidebar width
),
##### Sidebar #####
sidebar = shinydashboard::dashboardSidebar(
width = 200,
shinydashboard::sidebarMenu(
id = 'id_sidebar',
shinydashboard::menuItem(
text = 'Analyze Image',
tabName = 'analyze_image', # connected to tabItem id
icon = shiny::icon('binoculars')
)
)
),
##### Body #####
body = shinydashboard::dashboardBody(
# the tag function will connect our style sheet
# with the shiny dashboard / allowing for customization
tags$head(
tags$link(
rel = "stylesheet",
type = "text/css",
href = "custom.css" . # stored within www/ subfolder
)
),
shinydashboard::tabItems(
### Body: Image Analysis ###
shinydashboard::tabItem(
"analyze_image", # referenced with menuItem id
uiOutput("image_analyze") # to display conditional ui's in server
)
)
)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment