#' paramsTree UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny NS tagList
mod_paramsTree_ui <- function(id){
ns <- NS(id)
tagList(
checkboxInput(ns("alignTips"), "Align tip labels", FALSE),
checkboxInput(ns("midPoint"), "Midpoint Root Tree", TRUE),
numericInput(ns("tipLim"), 'Add spacing to plot - ', value = 0.02, max = 1 ),
#numericInput(ns("numScale"), "Size of the scale bar - ", value = 0.001),
#numericInput(ns("nodeDisplay"), "Minimum value of bootstrap -", value = 50, max = 100),
radioButtons(ns("treeFormat"), "What tree layout?",
choices = list(
"rectangular" = "rectangular", "slanted" = "slanted",
"circular" = "circular", "fan" = "fan"), selected = "rectangular"),
radioButtons(ns("fontFormat"), "What font format for tip labels?",
choices = list(
"bold" = "bold", "italic" = "italic",
"bold+italic" = "bold.italic"), selected = "bold")
)
}
#' paramsTree Server Function
#'
#' @noRd
mod_paramsTree_server <- function(input, output, session){
ns <- session$ns
return(
list(
align = reactive(input$alignTips),
treeformat = reactive(input$treeFormat),
font = reactive(input$fontFormat),
numscale = reactive(input$numScale),
node = reactive(input$nodeDisplay),
lim = reactive(input$tipLim),
midP = reactive(input$midPoint))
)
}
## To be copied in the UI
# mod_paramsTree_ui("paramsTree_ui_1")
## To be copied in the server
# callModule(mod_paramsTree_server, "paramsTree_ui_1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.