From 26c04f50a00f8537e8c2c42d7a2eb3e35f7155aa Mon Sep 17 00:00:00 2001 From: Schultheis Date: Thu, 21 Dec 2017 13:26:42 +0100 Subject: [PATCH] scatterPlot: use external css file --- R/scatterPlot.R | 5 ++++- inst/www/styles.css | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 inst/www/styles.css diff --git a/R/scatterPlot.R b/R/scatterPlot.R index b577b39..9acbd5a 100644 --- a/R/scatterPlot.R +++ b/R/scatterPlot.R @@ -9,6 +9,7 @@ scatterPlotUI <- function(id) { ns <- shiny::NS(id) shiny::tagList(shiny::fluidPage( + shiny::singleton(shiny::tags$head(shiny::tags$link(rel = "stylesheet", type = "text/css", href = "wilson_www/styles.css"))), shiny::fluidRow(shinydashboard::box( width = 12, shiny::div(style = "overflow-y: scroll; overflow-x: scroll; height: 800px; text-align: center", @@ -271,10 +272,12 @@ scatterPlot <- function(input, output, session, data, types, features = NULL, ma result$highlight.labels <- markerReac()$label } else { shiny::showNotification( + id = session$ns("label-limit"), paste("Warning! Label restricted to 100 or less labels. Currently selected:", length(markerReac()$label)), - duration = 10, + duration = NULL, type = "warning" ) + shinyjs::addClass(selector = paste0("#shiny-notification-", session$ns("label-limit")), class = "notification-position-center") } } diff --git a/inst/www/styles.css b/inst/www/styles.css new file mode 100644 index 0000000..dbbbaa8 --- /dev/null +++ b/inst/www/styles.css @@ -0,0 +1,13 @@ +/* notifications */ + +.notification-position-center { + position: fixed; + top: 50%; + left: 40%; + right: 40%; + opacity: 1; +} + +/* slider */ + +/* text input */