Commit 50b4099e authored by Midoux Cedric's avatar Midoux Cedric

fonctions dans internals.R

parent 30aa79da
......@@ -59,3 +59,72 @@
## Unhappy paths: everything else
return()
}
###
checkNull <- function(x) {
if (!exists(as.character(substitute(x)))) {
return(NULL)
} else if (is.null(x)) {
return(NULL)
} else if (length(x) > 1) {
return(x)
}
else if (x %in% c(0, "", NA, "NULL")) {
return(NULL)
} else {
return(x)
}
}
beautifulTable <- function(data) {
DT::datatable(
data = data,
rownames = FALSE,
filter = "top",
extensions = c("Buttons", "ColReorder", "FixedColumns"),
options = list(
dom = "lBtip",
pageLength = 10,
lengthMenu = list(c(10, 25, 50, 100,-1), list('10', '25', '50', '100', 'All')),
buttons = list(
'colvis',
list(
extend = 'collection',
buttons = c('copy', 'csv', 'excel', 'pdf'),
text = 'Download'
)
),
colReorder = TRUE,
scrollX = TRUE,
fixedColumns = list(leftColumns = 1, rightColumns = 0)
),
width = "auto",
height = "auto"
)
}
collapsedBox <- function(data, title = title) {
box(
title = title,
width = NULL,
status = "primary",
collapsible = TRUE,
collapsed = TRUE,
data
)
}
scriptHead <- c(
"# Loading packages",
"library(phyloseq.extended)",
"",
"# Loading data",
glue(
"load(\"Easy16S-data.{Sys.Date()}.RData\") # if necessary, adapt the file path"
),
"",
"# View data",
"data",
""
)
......@@ -10,7 +10,9 @@ library(factoextra)
shinyServer
(function(input, output, session)
{
{
source("internals.R")
source("panels/dataInput.R", local = TRUE)
source("panels/Sidebar-server.R", local = TRUE)
source("panels/Summary-server.R", local = TRUE)
source("panels/barplot-server.R", local = TRUE)
......@@ -23,61 +25,6 @@ shinyServer
source("panels/tree-server.R", local = TRUE)
source("panels/cluster-server.R", local = TRUE)
checkNull <- function(x) {
if (!exists(as.character(substitute(x)))) {
return(NULL)
} else if (is.null(x)) {
return(NULL)
} else if (length(x) > 1) {
return(x)
}
else if (x %in% c(0, "", NA, "NULL")) {
return(NULL)
} else {
return(x)
}
}
beautifulTable <- function(data) {
DT::datatable(
data = data,
rownames = FALSE,
filter = "top",
extensions = c("Buttons", "ColReorder", "FixedColumns"),
options = list(
dom = "lBtip",
pageLength = 10,
lengthMenu = list(c(10, 25, 50, 100,-1), list('10', '25', '50', '100', 'All')),
buttons = list(
'colvis',
list(
extend = 'collection',
buttons = c('copy', 'csv', 'excel', 'pdf'),
text = 'Download'
)
),
colReorder = TRUE,
scrollX = TRUE,
fixedColumns = list(leftColumns = 1, rightColumns = 0)
),
width = "auto",
height = "auto"
)
}
collapsedBox <- function(data, title = title) {
box(
title = title,
width = NULL,
status = "primary",
collapsible = TRUE,
collapsed = TRUE,
data
)
}
source("internals.R")
data16S <- reactive({
## BIOM input
if (input$dataset == "input")
......@@ -138,18 +85,4 @@ shinyServer
isolate(data <<- data16S())
})
}
scriptHead <- c(
"# Loading packages",
"library(phyloseq.extended)",
"",
"# Loading data",
glue(
"load(\"Easy16S-data.{Sys.Date()}.RData\") # if necessary, adapt the file path"
),
"",
"# View data",
"data",
""
)
})
......@@ -14,8 +14,9 @@ source("panels/cluster-ui.R", local = TRUE)
source("panels/Help-ui.R", local = TRUE)
shinyUI(dashboardPage(
dashboardHeader(title = "Easy16S"),
dashboardHeader(title = "Easy16S"),
dashboardSidebar(
actionButton("dataButton", "Select your data"),
sidebarMenu(
menuItem("Data", tabName = "Data", icon = icon("dashboard")),
menuItem("Summary", tabName = "Summary", icon = icon("dashboard")),
......
Markdown is supported
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