From 3bd2657c97ef354cc7e1c9020dc34a6cc58e0e5c Mon Sep 17 00:00:00 2001 From: sebastien-plutniak Date: Tue, 23 Apr 2024 02:51:02 +0200 Subject: [PATCH] fix AMADO table generation --- R/app_server.R | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/R/app_server.R b/R/app_server.R index e7698eb..6b79577 100755 --- a/R/app_server.R +++ b/R/app_server.R @@ -1613,23 +1613,28 @@ app_server <- function(input, output, session) { # 2) amado url amado.url <- reactive({ req(export.table()) - + data <- export.table() + data <- data[order(rownames(data)), ] + + # retrieve the name of the instance: + title <- shiny::getShinyOption("title") + if(is.null(title)){ title <- "archeoViz" } data <- eval(parse(text = paste0( - "cbind('", shiny::getShinyOption("title"), "'= rownames(data), data)" + "cbind('", title, "'= rownames(data), data)" ))) - - data <- cbind("archeoViz" = rownames(data), data) data <- rbind(colnames(data), data) + # recast the table as a single string: data <- apply(data, 2, paste0, collapse="%09") # separate cells by tabs data <- gsub(" ", "%20", data) # add spaces data <- paste0(data, collapse = "%0A") # encode lines + # generate an URL: amado.lang <- "en" - if(getShinyOption("lang") %in% c('es', 'fr', 'it', 'ru', 'tr', 'uk', 'vi', 'zh')){ - amado.lang <- getShinyOption("lang") + if(shiny::getShinyOption("lang") %in% c('es', 'fr', 'it', 'ru', 'tr', 'uk', 'vi', 'zh')){ + amado.lang <- shiny::getShinyOption("lang") } paste0("https://app.ptm.huma-num.fr/amado/main.html?lang=", @@ -1639,7 +1644,7 @@ app_server <- function(input, output, session) { output$run.amado <- renderUI({ req(amado.url()) - + tagList( "> ", .term_switcher("export.to"), actionLink("run.amado",