R/app_ui.R

Defines functions golem_add_external_resources app_ui

#' The application User-Interface
#'
#' @param request Internal parameter for `{shiny}`.
#'     DO NOT REMOVE.
#' @importFrom shiny navbarPage tagList fluidPage titlePanel navlistPanel tabPanel
#' @importFrom bslib bs_theme font_google
#' @noRd
app_ui <- function(request) {
  tagList(
    golem_add_external_resources(),

    shiny::fluidRow(
      shiny::column(
        width = 2,
        shiny::div(
          class = "row h-100 justify-content-center align-items-center message-box",
          shiny::uiOutput("active_tool")
        )
      ),
      shiny::column(
        width = 4,
        shiny::div(
          class = "row h-100 justify-content-center align-items-center message-box",
          shiny::div(style = "margin-right: 20px;", shiny::uiOutput("active_project")),
          shiny::div(shiny::uiOutput("change_project_button"))
        )
      ),
      shiny::column(
        width = 4,
        shiny::div(
          class = "row h-100 justify-content-center align-items-center message-box",
          "Please consult with a CompBio team member to finalize your analysis result!"
        )
      ),
      shiny::column(
        width = 2,
        shiny::div(
          class = "row h-100 justify-content-left align-items-center",
          shiny::bookmarkButton(
            label = "Save session",
            icon = shiny::icon("save"),
            title = "Clicking here will store this session and let you load it later."
          )
        )
      )
    ),
    navbarPage(id = "main_navbar",
      theme = bslib::bs_theme(
        version = 4,
        base_font = bslib::font_google("Lato"),
        heading_font = bslib::font_google("Lato"),
        font_scale = 0.9,
        primary = "#706699",
        bootswatch = "journal"
      ),
      title = "Comp Bio data hub",
      bslib::nav_spacer(),
      bslib::nav(value = "Gene editing",
        title = "Gene editing",
        navlistPanel(id = "navlist",
          widths = c(2, 10),
          "Project",
          tabPanel(value = "n1", title = "Project selection", mod_project_selection_ui("project_select")),
          "Read QC",
          tabPanel(value = "n2", title = "Reads QC and mapping summary", mod_read_qc_ui("read_qc")),
          "Editing",
          tabPanel(value = "n3", title = "Editing rate summary", mod_read_qc_barplot_ui("read_qc_boxplot")),
          tabPanel(value = "n4", title = "Editing assessment", mod_edit_assesment_plot1_ui("edit_assesment_1")),
          "Indels",
          tabPanel(value = "n6", title = "Indel distribution", mod_indel_distribution_ui("indel_distribution")),
          "Alignment",
          tabPanel(value = "n7", title = "Sequence alignment", mod_seq_alignment_ui("seq_alignment")),
          tabPanel(value = "n8", title = "Allele frequency", mod_allele_frequency_ui("allele_freq"))
        )
      ),
      bslib::nav(title = "App 2", value = "App 2"),
      bslib::nav(title = "App 3", value = "App 3"),
      bslib::nav(title = ". . .", value = "App . . .")
    )
  )
}
#' Add external Resources to the Application
#'
#' This function is internally used to add external
#' resources inside the Shiny application.
#'
#' @import shiny
#' @importFrom golem add_resource_path activate_js favicon bundle_resources
#' @noRd
golem_add_external_resources <- function() {
  add_resource_path('www', app_sys('app/www'))

  tags$head(favicon(),
            bundle_resources(path = app_sys('app/www'),app_title = 'gene.editing.dash'),
            )
}
teofiln/gene.editing.dash documentation built on Feb. 21, 2022, 12:59 a.m.