From c4e193203d66596f74923728159c8e33f984679b Mon Sep 17 00:00:00 2001 From: Schultheis Date: Thu, 24 May 2018 08:21:15 +0200 Subject: [PATCH] featureSelector: download button for subset in .tsv format --- R/featureSelector.R | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/R/featureSelector.R b/R/featureSelector.R index 13fea96..2458375 100644 --- a/R/featureSelector.R +++ b/R/featureSelector.R @@ -28,6 +28,7 @@ featureSelectorUI <- function(id){ shiny::actionButton(ns("select"), "Select", style = "color: #fff; background-color: #3c8dbc"), shiny::actionButton(ns("reset"), "Reset", style = "color: #fff; background-color: #3c8dbc"), shiny::actionButton(ns("guide"), "Launch guide", style = "color: #fff; background-color: #3c8dbc", icon = shiny::icon("question-circle")), + shiny::downloadButton(ns("download")), shiny::br("The SELECT button only evaluates the filter(s) below. Sorting or sub-selections based on the table above will reset!") ) @@ -316,6 +317,16 @@ featureSelector <- function(input, output, session, data, features = NULL, featu data_change(1) }) + # download ##### + output$download <- shiny::downloadHandler( + filename = "subset.tsv", + content = function(file) { + log_message("FeatureSelector: download", "INFO", token = session$token) + + data.table::fwrite(x = result()$data, file = file, sep = "\t") + } + ) + return(result) } @@ -338,7 +349,8 @@ featureSelectorGuide <- function(session, grouping = FALSE) { So in order to apply a filter and create a specific subset adjust the selectors as needed.
The sum of those adjustments will be the filter used in the next step.", "guide_buttons" = "

Apply filter

- After the filter is set as intended, click on 'select' to filter the dataset, or click on 'reset' to delete the current filter.", + After the filter is set as intended, click on 'select' to filter the dataset, or click on 'reset' to delete the current filter.
+ Download the current subset via the respecting 'Download' Button (includes reorder, text search & row selection).", "guide_table" = "

Further limit dataset

Once the filter is successfully applied the remaining data is shown in this table.