Skip to content
Commits on Source (2)
library(iSEE)
library(jsonlite)
# library(jsonlite)
library(shinyjs)
# JSON approach ----
......@@ -33,6 +34,10 @@ merge_table <- merge(datasets_table, files_table, by.x = "name", by.y = "dataset
dataset_rds_files <- subset(merge_table, grepl("\\.rds$", path, ignore.case = TRUE), c("name", "title", "added", "size", "path"))
configuration_scripts <- subset(merge_table, grepl("\\.R$", path, ignore.case = TRUE), c("name", "added", "size", "path"))
# Release info ----
release_date <- scan("release/RELEASE_DATE", "character")
# Initialise the landing page ----
seLoad <- function(x) {
......@@ -52,15 +57,16 @@ renku_landing_page <- function(FUN, input, output, session) {
.initializeInitial_row_selected <- paste0(.initializeInitial, "_rows_selected")
output$allPanels <- renderUI({
useShinyjs()
tagList(
h1("Select a data set"),
DT::dataTableOutput(.initializeSE),
h1("Select a configuration"),
HTML("<blockquote>Unselect the default option (if any) to use the <code>iSEE</code> default settings.</blockquote>"),
DT::dataTableOutput(.initializeInitial),
actionButton(.initializeLaunch, label = "Launch", style = iSEE:::.actionbutton_biocstyle)
)
})
target <- .initializeLaunch
output[[.initializeSE]] <- DT::renderDataTable({
DT::datatable(
......@@ -85,7 +91,17 @@ renku_landing_page <- function(FUN, input, output, session) {
)
})
observeEvent(input[[target]], {
observeEvent(input[[.initializeSE_row_selected]], {
if (is.null(input[[.initializeSE_row_selected]])) {
disable(.initializeLaunch)
updateActionButton(inputId = .initializeLaunch, label = "Select a dataset")
} else {
enable(.initializeLaunch)
updateActionButton(inputId = .initializeLaunch, label = "Launch")
}
}, ignoreNULL=FALSE, ignoreInit=TRUE)
observeEvent(input[[.initializeLaunch]], {
print(input[[.initializeSE_row_selected]])
se2 <- try(seLoad(input[[.initializeSE_row_selected]]))
if (is(se2, "try-error")) {
......@@ -93,8 +109,8 @@ renku_landing_page <- function(FUN, input, output, session) {
type = "error")
}
else {
print(input[[.initializeInitial]])
init <- try(initLoad(input[[.initializeInitial]]))
print(input[[.initializeInitial_row_selected]])
init <- try(initLoad(input[[.initializeInitial_row_selected]]))
if (is(init, "try-error")) {
showNotification("invalid initial state supplied",
type = "warning")
......@@ -107,7 +123,9 @@ renku_landing_page <- function(FUN, input, output, session) {
invisible(NULL)
}
app <- iSEE(landingPage = renku_landing_page)
app <- iSEE(
landingPage = renku_landing_page,
appTitle = sprintf("iSEE dashboard @ Renku (updated %s)", release_date))
if (interactive()) {
shiny::runApp(app, port=1234)
}
......