shinyjs

R shiny, shinyjs, remove plot and draw it again if button is clicked

点点圈 提交于 2019-12-23 17:07:15
问题 I have an app that plots the Old Faithul data with k-means clusters once the user clicks on a specific button ("run k-means"). Now, I want to add a button that removes the plot again ("remove plot"). Following Hide/show outputs Shiny R I tried this: library(shiny) ui <- fluidPage( actionButton(inputId = "run_kmeans", label = "run k-means"), actionButton(inputId = "remove_plot", label = "remove plot"), conditionalPanel("output.show", plotOutput("plot")) ) server <- function(input, output) { v

Problem when reloading an animated GIF in Chrome

半腔热情 提交于 2019-12-23 16:51:55
问题 I have an app that reloads an animated gif. It works all the time in Safari and intermittently in Chrome. I believe the problem is similar to one mentioned here. My knowledge of Javascript is negligible. However, reading this, I came up with this example, which still doesn't work. Using Chrome, if you click again enough times you will see that sometimes the image reload fails. library(shiny) library(shinyjs) jsCode <- ' shinyjs.reset_anim = function() { var div_elem = document.getElementById(

How to get coordinates from a R plotly figure

谁都会走 提交于 2019-12-23 12:34:04
问题 I have been struggling like mad to solve an apparently basic question. Imagine you have a scatter plot, with say ... 10 markers. I suppose this plot has been generated using plotly within a Shiny environment. One can easily get the coordinates of these markers using the event_data("plotly_click") code. Now imagine you do not need the coordinates of these markers, but the coordinates generated by a mouse click but precisely where no marker exists (for example because you would like to set a

shiny: different tasks with actionButton for each menuSubItems

99封情书 提交于 2019-12-23 05:38:05
问题 I have create an app using shinydashboard with a group of menuItems and menuSubItems as well as the coresponding tabItems, and there is a conditionalPanel with different input parameters for each menuSubItems, and an actionButton for different analysing and ploting task, now it works before the actionButton is clicked, that is, the conditionalPanel changed when switching between menuSubItems, and it also works well for the first time actionButton is clicked, that is it show a plot html as

Shiny: Using enter key with action button on login screen

两盒软妹~` 提交于 2019-12-22 10:38:46
问题 I created a login screen for my Shiny app and would like users to be able to use the Enter key instead of having to use the mouse to click the OK button. I found an example that looks like it solves it for an input form but unfortunately, it does not work for my example. I am imagining it has something to do with the modal dialog. (have seen a lot of duplicate questions for this topic, this is a new parameter and none of those solutions have solved it) SO Reference: Using enter key with

Loading screen and navbarPage

*爱你&永不变心* 提交于 2019-12-22 10:34:33
问题 I try to make a loading screen as in this nice example http://daattali.com:3838/loading-screen/. Unfortunately I cannot figure out how to do exactly the same effect with 'navbarPage'. In this slightly modified app below there are two tab panels called "start" and "end". When the app starts none of the tab panels are active. One have to quickly click on the first tab to see the loading screen but this is not what I would like. Is there a way to make it so quick and easy as in the mentioned

capturing cat output periodically for R shiny output (renderPrint)

醉酒当歌 提交于 2019-12-22 04:14:10
问题 Hope someone can help me with this. Let's say there is a function "example" which is something like ##function from a package example<-function(f){ #does something cat("step 1 done....") # etc etc cat("step 2 done....") return(some_data_frame) } ##server ui code example2<-reactive({ if(input$some_action_button==0) return() result<-isolate(example(input$f1)) return(result) }) output$f2<-renderPrint({ example2() }) Is there some way to capture the "cat" outputs from the function into

Hide an element (box/tabs) in shiny dashboard

走远了吗. 提交于 2019-12-19 04:22:18
问题 I have a shiny dashboard which has a just a single text box on the landing page. The user enters an emailid which displays relevant data. This works fine. However I need a box/ tab Panel that greets the user on reaching the page and disappears when the user begins to enter text(emailid) in the text input. Is this possible? output$introbox=renderUI(box(h3("Welcome to the page. Please enter your email id to proceed")), conditionalPanel(condition=input.emailid=="") The box is displayed on

Shiny: Dynamic colour (fill) input for ggplot

落爺英雄遲暮 提交于 2019-12-18 17:55:47
问题 i do need some help as the post: Dynamic color input in shiny server does not give full answer to my problem. I would like to have dynamic colour (fill) selection in my shiny app. I have prepared a sample code: library(shiny) library(shinyjs) library(reshape2) library(ggplot2) dat <- data.frame(matrix(rnorm(60, 2, 3), ncol=3)) dat <- melt(dat) runApp(shinyApp( ui = fluidPage( selectizeInput("select","Select:", choices=as.list(levels(dat$variable)), selected="X1",multiple =TRUE), uiOutput(

Draggable line chart in R/Shiny

£可爱£侵袭症+ 提交于 2019-12-17 22:24:31
问题 I have built an R/Shiny app which uses linear regression to predict some metrics. In order to make this app more interactive, I need to add a line chart , where I can drag the points of the line chart, capture the new points and predict the values based on the new points. Basically, I'm looking for something like this in RShiny. Any help on how to achieve this? 回答1: You could do it with R/Shiny + d3.js: A preview, reproducible example, code and a walkthrough can be found below. Edit: 12/2018