shinyjs

DataTables DT: reset value of clicked cell

我怕爱的太早我们不能终老 提交于 2020-01-07 02:57:13
问题 I wanted to add the functionality of something happening after a table cell was clicked (e.g. open a modal). Because (suppose my dt is has the ID "dt") input$dt_cell_clicked stays the same until I click a new cell, I cannot execute the same event on re-clicking that cell. I tried working around it resetting input$dt_cell_clicked with javascript manually. This works, but there seems to be an internal updatemarker in DT that noticed I clicked the cell before and does not set the value of input

Modify shiny action button once it is clicked

陌路散爱 提交于 2020-01-06 02:49:25
问题 I have the following in server.R shinyServer(function(input, output) { # builds a reactive expression that only invalidates # when the value of input$goButton becomes out of date # (i.e., when the button is pressed) ntext <- eventReactive(input$goButton, { input$n }) output$nText <- renderText({ ntext() }) }) and the following in ui.R shinyUI(pageWithSidebar( headerPanel("actionButton test"), sidebarPanel( numericInput("n", "N:", min = 0, max = 100, value = 50), br(), actionButton("goButton",

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

Resetting fileInput in Shiny App

你说的曾经没有我的故事 提交于 2020-01-04 11:10:41
问题 I have been trying for a long time to reset fileInput in a Shiny app and read solutions to similar problems, but my problem still persists. Most solutions ultimately lead to using Dean Attali's brilliant shinyjs package and the reset() function therein. Here's what my code looks like after following these instructions: library(shiny) library(shinyjs) library(xlsx) library(tidyverse) ui <- fluidPage( useShinyjs(), fileInput('inFile', 'Choose file'), actionButton('reset', 'Reset'), radioButtons

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

R shinyjs shinydashboard box uncollapse on action button input

你说的曾经没有我的故事 提交于 2020-01-02 21:53:49
问题 In my shiny app, I have few boxes that are collapsed when application starts. Upon clicking on action button, calculations are run and then box should uncollapse and show results. Here is an example code that I am using, but it does not uncollapse the box. I got the code for "jscode" from here How to manually collapse a box in shiny dashboard. I believe this code was for collapsing the box upon clicking the button; I am not sure how to make it to uncollapse the box upon clicking the button.

shiny using selectizeInput to build dynamic data output

假如想象 提交于 2019-12-25 08:18:15
问题 The inputs are displayed in "iris$Petal.Width - iris$Species" format.Upon selected inputs, data to be split and iris$Petal.Width alone to be used to filter entire data. Example: selected values are as in the image. Try to get data like dplyr::filter(iris,iris$Petal.Width %in% c('0.2','0.3','0.1','0.6','1.4')) How to form the c('0.2','0.3','0.1','0.6','1.4') dynamically. Taken this example for easy understanding, actually the inputs are in A001 - Description1, A002 - Description2 format. Need

Shiny expanding submenu items manually

荒凉一梦 提交于 2019-12-25 08:08:33
问题 I'm trying to manually expand a submenu in a sidebar in shiny dashboard. The updateTabItems function allows me to go to the tab, but it does not expand the menu with it. I am looking for a reproducible answer to the question here:how to manually expand a submenu in a shiny dashboard side bar which includes a nice working example and answers which are however not implemented. 回答1: Here is a working code based on the referred answer. Please note that in this case the JavaScript uses the tabName

tab specific sidebar in shinydashboard

倾然丶 夕夏残阳落幕 提交于 2019-12-24 16:18:19
问题 I am using the shinyjs package in R to allow for onclick type events to navigate between tabs in a tabset. Each tab has a specific sidebar, and there are multiple (two) ways of getting between each tab (i.e. via clicking on the tab itself or by clicking on the valueBoxes). I would like to ensure that no matter what way you get to a specific tab the correct sidebar loads. # load libraries require(shiny) require(shinydashboard) require(shinyjs) # create a simple app ui <- dashboardPage( title=

R shiny: Check if some download is available

两盒软妹~` 提交于 2019-12-24 08:56:16
问题 Suppose I have a shiny application that has a download button, and I want to check if that download button has received a file, how can I do it? Basically if the download button has a tag download1 , I want to check if output$download1 is null. This is basically an example of what I'm trying to do. It's a simplified version of my current application, and I know that checking if output$download1 is null is not necessary in my case, but I need it for something else that I am doing. Is that