Add buttons to copy results

This commit is contained in:
Elias Projahn 2021-10-07 12:59:04 +02:00
parent 686af3f44b
commit ae0643741a
2 changed files with 34 additions and 0 deletions

View file

@ -2,6 +2,7 @@ library(data.table)
library(DT)
library(gprofiler2)
library(plotly)
library(rclipboard)
library(shiny)
source("init.R")
@ -100,6 +101,33 @@ server <- function(input, output) {
)
})
output$copy <- renderUI({
results <- results()
gene_ids <- results[, gene]
names <- results[name != "", name]
genes_text <- paste(gene_ids, collapse = "\n")
names_text <- paste(names, collapse = "\n")
splitLayout(
rclipButton(
"copy_ids_button",
"Copy gene IDs",
genes_text,
icon = icon("clipboard"),
width = "100%"
),
rclipButton(
"copy_names_button",
"Copy gene names",
names_text,
icon = icon("clipboard"),
width = "100%"
)
)
})
output$scatter <- renderPlot({
results <- results()