Commit 7f88d0f3 authored by Virgile Baudrot's avatar Virgile Baudrot
Browse files

add Mathjax and footer function and header navigation

parent d6a4590f
......@@ -36,7 +36,6 @@ app_server <- function(input, output,session) {
"landscape" = "start")
shinydashboard::updateTabItems(session, "tabs", newtab)
})
## OBSERVE
observe({
r$landscapeSOURCE <- sf::st_zm(sf::st_read(req(input$landscapeSOURCE)$datapath))
})
......
......@@ -18,6 +18,7 @@ mod_tabItemDamage_ui <- function(id){
tabItem(tabName = "damage",
title = "Damage",
# App title ----
briskaRshinyApp::headerNavigationPage("backExposureTab", "switchInteractiveMapTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -30,23 +31,7 @@ mod_tabItemDamage_ui <- function(id){
p("Information about damage ..."),
hr(),
h4("Check list of previous items:"),
verbatimTextOutput(ns("CheckDamage")),
#
hr(),
column(width = 6,
p("You can come back to the previous page, but before running new simulations, clear the current page." ),
actionButton('backExposureTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("If the dispersal seems ok, you can consider to safely click to go to the next step... " ),
actionButton('switchInteractiveMapTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
verbatimTextOutput(ns("CheckDamage"))
)
),
fluidRow( # width of fluidrow is 12
......@@ -135,7 +120,8 @@ mod_tabItemDamage_ui <- function(id){
plotOutput(ns("mapDAMAGE"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......
......@@ -18,6 +18,7 @@ mod_tabItemDevelopment_ui <- function(id){
tabItem(tabName = "development",
title = "Development",
# App title ----
briskaRshinyApp::headerNavigationPage("backHostTab", "switchExposureTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -30,23 +31,7 @@ mod_tabItemDevelopment_ui <- function(id){
p("Information about development ..."),
hr(),
h4("Check list of previous items:"),
verbatimTextOutput(ns("CheckDevelopment")),
#
hr(),
column(width = 6,
p("You can come back to the previous page, but before running new simulations, clear the current page." ),
actionButton('backHostTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("If the dispersal seems ok, you can consider to safely click to go to the next step... " ),
actionButton('switchExposureTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
verbatimTextOutput(ns("CheckDevelopment"))
)
),
fluidRow( # width of fluidrow is 12
......@@ -104,7 +89,8 @@ mod_tabItemDevelopment_ui <- function(id){
plotOutput(ns("mapINDIVIDUAL"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......
This diff is collapsed.
......@@ -21,6 +21,7 @@ mod_tabItemEmission_ui <- function(id){
# List the first level UI elements here
tabItem(tabName = "emission",
# App title ----
briskaRshinyApp::headerNavigationPage("backDispersalTab", "switchHostTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -34,23 +35,7 @@ mod_tabItemEmission_ui <- function(id){
# img(src = 'www/modelScheme_item_3.jpg', title = "item1", width = "800px"),
hr(),
h4("Check list of previous items:"),
verbatimTextOutput(ns("CheckEmission")),
#
hr(),
column(width = 6,
p("You can come back to the previous page, but before running new simulations, clear the current page." ),
actionButton('backDispersalTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("If the dispersal seems ok, you can consider to safely click to go to the next step... " ),
actionButton('switchHostTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
verbatimTextOutput(ns("CheckEmission"))
)
),
fluidRow( # width of fluidrow is 12
......@@ -173,7 +158,8 @@ mod_tabItemEmission_ui <- function(id){
plotOutput(ns("plotSPREAD"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......
......@@ -18,6 +18,7 @@ mod_tabItemExposure_ui <- function(id){
tabItem(tabName = "exposure",
title = "Exposure",
# App title ----
briskaRshinyApp::headerNavigationPage("backDevelopmentTab", "switchDamageTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -30,23 +31,7 @@ mod_tabItemExposure_ui <- function(id){
p("Information about exposure ..."),
hr(),
h4("Check list of previous items:"),
verbatimTextOutput(ns("CheckExposure")),
#
hr(),
column(width = 6,
p("You can come back to the previous page, but before running new simulations, clear the current page." ),
actionButton('backDevelopmentTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("If the dispersal seems ok, you can consider to safely click to go to the next step... " ),
actionButton('switchDamageTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
verbatimTextOutput(ns("CheckExposure"))
)
),
fluidRow( # width of fluidrow is 12
......@@ -84,7 +69,8 @@ mod_tabItemExposure_ui <- function(id){
plotOutput(ns("mapEXPOSURE"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......
......@@ -18,6 +18,7 @@ mod_tabItemHost_ui <- function(id){
tabItem(tabName = "host",
title = "Laying site",
# App title ----
briskaRshinyApp::headerNavigationPage("backEmissionTab", "switchDevelopmentTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -30,23 +31,7 @@ mod_tabItemHost_ui <- function(id){
p("Location of host plants."),
hr(),
h4("Check list of previous items:"),
verbatimTextOutput(ns("CheckHost")),
#
hr(),
column(width = 6,
p("You can come back to the previous page, but before running new simulations, clear the current page." ),
actionButton('backEmissionTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("If the dispersal seems ok, you can consider to safely click to go to the next step... " ),
actionButton('switchDevelopmentTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
verbatimTextOutput(ns("CheckHost"))
)
),
fluidRow( # width of fluidrow is 12
......@@ -105,7 +90,8 @@ mod_tabItemHost_ui <- function(id){
plotOutput(ns("mapSITE"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......
......@@ -19,6 +19,7 @@ mod_tabItemInteractiveMap_ui <- function(id){
tabItem(tabName = "interactiveMap",
title = "Interactive Map",
# App title ----
briskaRshinyApp::headerNavigationPage("backDamageTab", "switchDataExplorerTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -28,23 +29,7 @@ mod_tabItemInteractiveMap_ui <- function(id){
collapsible = TRUE,
closable = FALSE,
footer_padding = FALSE,
p("Information on Interactive Map ..."),
#
hr(),
column(width = 6,
p("You can come back to the previous page, but before running new simulations, clear the current page." ),
actionButton('backDamageTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("If the dispersal seems ok, you can consider to safely click to go to the next step... " ),
actionButton('switchDataExplorerTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
p("Information on Interactive Map ...")
)
),
fluidRow(
......@@ -75,7 +60,8 @@ mod_tabItemInteractiveMap_ui <- function(id){
leafletOutput(ns("mapDAMAGE"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......
......@@ -22,32 +22,7 @@ mod_tabItemLandscape_ui <- function(id){
# List the first level UI elements here
tabItem(tabName = "landscape",
title = "Landscape",
# App title ----
fluidRow(
shinydashboardPlus::gradientBox(
title = "Navigation",
width = 12,
gradientColor = "purple",
boxToolSize = "xs",
collapsible = FALSE,
closable = FALSE,
footer_padding = FALSE,
column(width = 6,
p("Come back to the previous page," ),
actionButton('backStartTab',
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
p("Go to the next step..." ),
actionButton('switchDispersalTab',
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
)
),
briskaRshinyApp::headerNavigationPage("backStartTab", "switchDispersalTab"),
fluidRow(
shinydashboardPlus::gradientBox(
title = iconed(" - Information", "info"),
......@@ -57,10 +32,11 @@ mod_tabItemLandscape_ui <- function(id){
collapsible = TRUE,
closable = FALSE,
footer_padding = FALSE,
p("In this part, you have to download the source file, the host file and to compute
h4("In this part, you have to download the source file, the host file and to compute
or load a square frame including host and sources in the same spatial square."),
column(width = 6,
p("Tutorial on building KML landscape files."),
align="center",
h4("Tutorial on building KML landscape files."),
tags$video(id = ns("videoLandscape"),
type = "video/mp4",
src = "www/maizeFieldMap_VIDEO_medium2.mp4",
......@@ -68,7 +44,8 @@ mod_tabItemLandscape_ui <- function(id){
height = "300px")
),
column(width = 6,
p("Tutorial on Uploading landscape elements."),
align="center",
h4("Tutorial on Uploading landscape elements."),
tags$video(id = ns("videoLandscape"),
type = "video/mp4",
src = "www/load_landscape_medium3.mp4",
......@@ -168,13 +145,6 @@ mod_tabItemLandscape_ui <- function(id){
downloadButton(ns("download_LandscapeHOST"),
"Download Host",
style="color: #fff; background-color: #33595f; border-color: #052327")
# hr(),
# actionButton(ns("Xple_LandscapeHOST"), "CLICK HERE FOR EXAMPLE DATA", icon("paper-plane"),
# style="color: #fff; background-color: #33595f; border-color: #052327"),
# hr(),
# p("1. Upload landscape shapefiles for hosts. It must be a KML shapefile,"),
# p("2. Select the column used to identified each field (re-use after for emission),"),
# p("3. Then select if necessary an EPSG projection (host and host projections must match)."),)
),
column( width = 6,
selectizeInput(ns("ctrlIDhost"),
......@@ -189,9 +159,7 @@ mod_tabItemLandscape_ui <- function(id){
selectizeInput(ns("ctrlEPSGhost"),
label = "Choose EPSG",
choices = NULL)
# p("First lines of table:"),
# tableOutput(ns("tableHOST"))
)#,
)
)
)
)
......@@ -201,10 +169,6 @@ mod_tabItemLandscape_ui <- function(id){
box(title = iconed("Frame", "database"),
solidHeader = TRUE,
width = 4, status = "warning",
# hr(),
# actionButton(ns("Xple_LandscapeSQUAREFRAME"), "CLICK HERE FOR EXAMPLE DATA", icon("paper-plane"),
# style="color: #fff; background-color: #33595f; border-color: #052327"),
# hr(),
tabsetPanel(id = ns("tabsetSQUAREFRAME"),
selected = "bufferSQUAREFRAME",
tabPanel(title = "Buffer",
......@@ -249,7 +213,8 @@ mod_tabItemLandscape_ui <- function(id){
leafletOutput(ns("mapLANDSCAPE"))
)
)
)
),
briskaRshinyApp::footerPage()
)
}
......@@ -313,17 +278,14 @@ mod_tabItemLandscape_server <- function(input, output, session, r){
r$landscapeSOURCE = land %>% dplyr::filter(sources == 1)
r$landscapeHOST = land %>% dplyr::filter(sources == 0) #situation everywhere except on source
})
# SOURCE
# ## OBSERVE
observe({
ctrlIDsource <- names(r$landscapeSOURCE)
updateSelectizeInput( session, "ctrlIDsource", selected = NULL, choices = ctrlIDsource)
})
observe({
ctrlEPSGsource <- names(r$landscapeSOURCE)
updateSelectizeInput( session, "ctrlEPSGsource", selected = "initial", choices = c("initial",rgdal::make_EPSG()$code))
updateSelectizeInput( session, "ctrlEPSGsource", selected = "initial", choices = c("initial",sort(rgdal::make_EPSG()$code)))
})
## CREATE
observe({
......@@ -361,7 +323,7 @@ mod_tabItemLandscape_server <- function(input, output, session, r){
})
observe({
ctrlEPSGhost <- names(r$landscapeHOST)
updateSelectizeInput( session, "ctrlEPSGhost", selected = "initial", choices = c("initial",rgdal::make_EPSG()$code))
updateSelectizeInput( session, "ctrlEPSGhost", selected = "initial", choices = c("initial",sort(rgdal::make_EPSG()$code)))
})
## CREATE
observe({
......@@ -391,19 +353,6 @@ mod_tabItemLandscape_server <- function(input, output, session, r){
output$textEPSGhost = renderText({
paste("EPSG initial:", sf::st_crs(r$landscapeHOST)$epsg)
})
# output$plotHOST <- renderPlot({
# pltHOST = ggplot(data = r$landscapeHOST) +
# theme_minimal() +
# geom_sf()
# if(!is.null(r$landscapeHOST)){
# if(!is.null(r$IDhost) || !(r$IDhost == "")){
# pltHOST = pltHOST +
# geom_sf_text(data = r$landscapeHOST,
# aes_string(label = r$IDhost))
# }
# }
# return(pltHOST)
# })
############################################ SQUARE FRAME
observe({
ctrlEPSGsqFrame <- names(r$landscapeSQUAREFRAME)
......@@ -425,8 +374,6 @@ mod_tabItemLandscape_server <- function(input, output, session, r){
}
})
observe({
# if(!is.null(r$landscapeSQUAREFRAME)){
# if(!is.null(r$landscapeSQUAREFRAME)){
if (r$tabsetSQUAREFRAME == "loadSQUAREFRAME") {
if(!is.null(r$landscapeSQUAREFRAME)){
if(r$ctrlEPSGsqFrame != "initial"){
......
......@@ -52,7 +52,8 @@ mod_tabItemReport_ui <- function(id){
icon = icon("home"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
)
)
),
briskaRshinyApp::footerPage()
)
}
......
......@@ -54,7 +54,15 @@ of the", strong("dynamics of toxin ingestion on lethal and sublethal effects at
)
),
fluidRow(
# box(width =12,
shinydashboardPlus::gradientBox(
title = "Navigation",
width = 12,
gradientColor = "purple",
boxToolSize = "xs",
collapsible = FALSE,
closable = FALSE,
footer_padding = FALSE,
solidHeader = TRUE,
align="center",
# solidHeader = TRUE,
# title = iconed("Start", "rocket"),
......@@ -68,56 +76,49 @@ of the", strong("dynamics of toxin ingestion on lethal and sublethal effects at
# label = h5("Wait, you may need some", strong("information"), "about how the", strong("application"), "work... what is just the object of the next", strong("blue box.")),
# icon = icon("pause"),
# style="color: #fff; background-color: #00c0ef; border-color: #00c0ef")
# )
)
),
fluidRow(
hr(),
box(
shinydashboardPlus::gradientBox(
title = iconed(" - How to Run and Explore a Simulation", "info"),
width = 12,
gradientColor = "purple",
boxToolSize = "xs",
collapsible = TRUE,
closable = FALSE,
footer_padding = FALSE,
solidHeader = TRUE,
width = 12, status = "info",
title = "How to Run and Explore a Simulation",
column(width = 6,
p(strong("Getting Started"), ": current home page,"),
p(strong("1. Landscape"), ": define a landscape with sources and host plant location,"),
p(strong("2. Dispersal"), ": apply a dispersal kernel on sources,"),
p(strong("3. Emission"), ": apply emission function on sources,"),
p(strong("4. Host"), ": define location and phenology,"),
p(strong("5. Development"), ": define development model of organisms,")
column(
width = 6,
# align="center",
p(strong("Getting Started"), "in the current home page, and follow the", strong("7 steps:"),
strong("1. Landscape"), "you define a landscape with sources and host plant location,",
strong("2. Dispersal"), ": apply a dispersal kernel on sources,",
strong("3. Emission"), ": apply emission function on sources,",
strong("4. Host"), ": define location and phenology,",
strong("5. Development"), ": define development model of organisms,",
strong("6. Exposure"), ": compute exposure of organisms,",
strong("7. Damage"), ": compute lethal and eventually sublethal damages,",
strong("Interactive Map"), ": explore results on maps,",
strong("Report"), ": compose a report of simulation."),
tags$img(src = 'www/modelScheme.jpg',
title = "EFSA Home",
height = "350px")
),
column(width = 6,
p(strong("6. Exposure"), ": compute exposure of organisms,"),
p(strong("7. Damage"), ": compute lethal and eventually sublethal damages,"),
p(strong("Interactive Map"), ": explore results on maps,"),
p(strong("Data Explorer"), ": explore results with statistics,"),
p(strong("Report"), ": compose a report of simulation.")
),
#
hr(),
column(
width = 12,
align="center",
img(src = 'www/modelScheme.jpg',
title = "EFSA Home", width = "800px")
align="center",
h4("Video taking a quick look at all simulation steps:"),
br(),
tags$video(id = ns("videoStart_all"),
type = "video/mp4",
src = "www/video_allStart2.mp4",
controls = "controls",
height = "350px")
)
)
),
#
fluidRow(
hr(),
column(width =12,
align="center",
actionButton('project',
"Project Gitlab Page",
onclick ="window.open('https://gitlab.paca.inra.fr/vbaudrot/r-shiny-app-ci-cd', '_blank')",
icon = icon("gitlab"),
style="color: #fff; background-color: #33595f; border-color: #052327"),
actionButton('issue',
"Report Issue Here",
onclick ="window.open('https://gitlab.paca.inra.fr/vbaudrot/r-shiny-app-ci-cd/issues', '_blank')",
icon = icon("exclamation-triangle"),
style="color: #fff; background-color: #f14b3d; border-color: #8a0a00")
)
)
briskaRshinyApp::footerPage()
)
}
......
......@@ -4,3 +4,55 @@
iconed <- function(x, icon) {
span(tagList(icon(icon), x))
}
#' Bottom of a page with link to Gitlab page and Report Issue
#'
footerPage = function(){
fluidRow(
hr(),
column(width =12,
align="center",
actionButton('project',
"Project Gitlab Page",
onclick ="window.open('https://gitlab.paca.inra.fr/vbaudrot/r-shiny-app-ci-cd', '_blank')",
icon = icon("gitlab"),
style="color: #fff; background-color: #33595f; border-color: #052327"),
actionButton('issue',
"Report Issue Here",
onclick ="window.open('https://gitlab.paca.inra.fr/vbaudrot/r-shiny-app-ci-cd/issues', '_blank')",
icon = icon("exclamation-triangle"),
style="color: #fff; background-color: #f14b3d; border-color: #8a0a00")
)
)
}
#' Header of navigation
#'
headerNavigationPage = function(backNavKey, nextNavKey){
fluidRow(
shinydashboardPlus::gradientBox(
title = "Navigation",
width = 12,
gradientColor = "purple",
boxToolSize = "xs",
collapsible = FALSE,
closable = FALSE,
footer_padding = FALSE,
column(width = 6,
h4("Come back to the previous page," ),
actionButton(backNavKey,
"Back",
icon = icon("backward"),
style="color: #fff; background-color: #3c8dbc; border-color: #3c8dbc")
),
column(width = 6,
h4("Go to the next step..." ),
actionButton(nextNavKey,
"Next",
icon = icon("forward"),
style="color: #fff; background-color: #00a65a; border-color: #00a65a")
)
)
)
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment