shinydashboard

Shinydashboard - Change background based on selected tab

那年仲夏 提交于 2020-01-14 01:47:47
问题 I am creating a dashboard using Shinydashboard package, where I need to change the background color based on the selected Tab. I have tried the following code, but it is not working as intended. library(shiny) library(shinydashboard) library(dplyr) ui <- dashboardPage(dashboardHeader(dropdownMenuOutput("notificationMenu")), dashboardSidebar(sidebarMenu(menuItem("Page 1", tabName = "page1"), menuItem("Page 2", tabName = "page2"))), dashboardBody(tags$style(".content {background-color: #f7f7f7;

R shinydashboard - change height of valueBox

北城以北 提交于 2020-01-13 14:59:11
问题 Given a shinydashboard ui.R library(shinydashboard) library(shiny) dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( valueBoxOutput(outputId = "vb") ) ) server.R library(shinydashboard) library(shiny) function(input, output, session) { output$vb <- renderValueBox({ valueBox(subtitle = "Hello", value = "hi", width = 6, color="blue" ) }) } Question Is it possible to change the height of the valueBox ? I've tried using tags but can't get them to work so I'm obviously missing

ShinyApp - Dropbox authentication with rdrop2

三世轮回 提交于 2020-01-13 06:02:10
问题 I stored files on my dropbox and I am accessing them through rdrop2 on a shinyapp hosted at shinyapps.io. The following code works great on my laptop but aborts when I deploy my app on shinyapp.io and freezes an opaque screen. Any clues on why and how to troubleshoot? Thanks a bunch! - stephane Here is the code I am using (from https://github.com/karthik/rdrop2): token<-drop_auth() saveRDS(token, "droptoken.rds") token <- readRDS("droptoken.rds") ZIPFile<-drop_read_csv(as.character(ZIPCode)

React to menuItem() tab selection

↘锁芯ラ 提交于 2020-01-12 07:30:09
问题 In shinydashboard , one can create menuItem() s, which are tabs in the sidebar. I want to be able to poll which tab is active, by using the standard input$foo syntax. However, I was not able to do so. I tried by referencing the menuItem() 's tabName or id but that did nothing. Is there a way to do it? 回答1: sidebarMenu have optional id parametr you can use it sidebarMenu(id="menu1", menuItem("PointA_",tabName = "PointA") ) On server side use input$menu1 Full working example, print PointA or

Dynamically create sortable menuSubItems in shinydashboard

为君一笑 提交于 2020-01-12 05:49:07
问题 I have a Shiny app using the shinydashboard package in which I'm dynamically creating menuSubItem s in the sidebarMenu of a dashboardSidebar . The creation of the subItems is triggered by an actionButton. I can create the menuSubItem s on the server side just fine, but I would like to also make them sortable using the sortable package and sortable_js function. I just can't seem to figure out where to place the sortable_js function to make this actually work, though. Here's my MRE: library

Wrap equations in box in Shiny Dashboard

纵然是瞬间 提交于 2020-01-05 04:40:05
问题 I'm having an issue in shinydashboard where equations that I'm writing are not wrapping when placed in a box . The equations are extending beyond the limits of the box . MWE: library(shinydashboard) library(shiny) # UI ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( fluidRow( column(width = 6, box("Long Equation", width = 12, h3(withMathJax("$$ \\alpha + \\beta + \\gamma + \\delta + \\alpha + \\beta + \\gamma + \\delta + \\alpha + \\beta + \\gamma + \\delta + $$")))

R/Shiny : Color of boxes depend on select

旧城冷巷雨未停 提交于 2020-01-05 04:28:27
问题 I try to create dynamic boxes in shiny. We can change the status (color) of the box with (status = "warning" or "info" etc.) I would like to change the color of this box (dynamically) depend on the choice of select input like that : https://image.noelshack.com/fichiers/2018/32/2/1533638864-v1.png https://image.noelshack.com/fichiers/2018/32/2/1533638864-v2.png The code looks like this : SelectInput("s010102i", label = NULL, choices = list("Value 1" = 1, "Value 2" = 2, "Value 3" = 3), selected

Editing multiple cells in a datatable in shiny

旧巷老猫 提交于 2020-01-05 04:15:06
问题 I asked this question earlier - Write editable shiny Datatable to .csv file Trying to edit cells in a shiny datatable and replace the original data with the edited data. I was able to figure out how to edit a single cell in the datatable, however if multiple cells are edited only the last edit is saved. Code: library(shiny) library(shinydashboard) library(tidyverse) library(DT) users <- reactiveFileReader( intervalMillis = 1000, NULL, filePath = 'appData/userTest.csv', readFunc = read.csv,

Draw bullets/circles on an Image given image coordinates

耗尽温柔 提交于 2020-01-05 03:46:07
问题 Hi I have a R shiny app displaying an image. I would like to draw a bullets/circles on an image based on image coordinates. The image coordinates are being read from a data frame where I would like to iterate over every row, plot and then remove the coordinates drawn for every iteration. I have something like this now #UI UI <- function(id) { fluidPage( useShinyjs(), fluidRow( column(width=12, box(title='Select', width = NULL, closable = TRUE, actionButton("draw", "draw")) )), fluidRow(width

To enable and disable sidebar toggle button using a action button

荒凉一梦 提交于 2020-01-03 17:42:09
问题 I am looking for a code snippet using which, I can enable/disable sidebar toggle button in shinydashboard header. library(shiny) library(shinydashboard) library(shinyjs) ui <- shinyUI(dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( useShinyjs() ) )) server <- shinyServer(function(input, output, session) { addClass(selector = "body", class = "sidebar-collapse") # Hide Side Bar }) shinyApp(ui = ui, server = server) Let me know if anybody can help??? 回答1: I have found a