Shiny

Reactively updating sidebar in modular Shiny app

左心房为你撑大大i 提交于 2021-01-01 18:01:04
问题 I have a modularized Golem app using bs4Dash. I want to update the active sidebar tab from an actionBttn that is dynamically generated from renderUI . While updatebs4ControlbarMenu works as expected as shown here, it does not work in the modularized version of the application. What am I doing wrong? I suspect it is related to input[[btnID]] management across modules but I struggle to find the solution. Working example without modules as shown here: library(shiny) library(shinyWidgets) library

Reactively updating sidebar in modular Shiny app

ぃ、小莉子 提交于 2021-01-01 17:52:05
问题 I have a modularized Golem app using bs4Dash. I want to update the active sidebar tab from an actionBttn that is dynamically generated from renderUI . While updatebs4ControlbarMenu works as expected as shown here, it does not work in the modularized version of the application. What am I doing wrong? I suspect it is related to input[[btnID]] management across modules but I struggle to find the solution. Working example without modules as shown here: library(shiny) library(shinyWidgets) library

Reactively updating sidebar in modular Shiny app

瘦欲@ 提交于 2021-01-01 17:51:15
问题 I have a modularized Golem app using bs4Dash. I want to update the active sidebar tab from an actionBttn that is dynamically generated from renderUI . While updatebs4ControlbarMenu works as expected as shown here, it does not work in the modularized version of the application. What am I doing wrong? I suspect it is related to input[[btnID]] management across modules but I struggle to find the solution. Working example without modules as shown here: library(shiny) library(shinyWidgets) library

How to add a “back to top of page” button in R Shiny?

狂风中的少年 提交于 2021-01-01 02:10:25
问题 This is a very common feature among other webapps, but in R Shiny, how do you add a button that brings the user back to the top of the page when clicked? In addition to that, is it possible to set how far up or down the user's view moves to? Many thanks, I searched for a while but can't find any posts about this. 回答1: Using the shinyjs package, you can define a simple jump to top function along the lines of jscode <- "shinyjs.toTop = function() {document.body.scrollTop = 0;}" And you can then

Display images from web in shiny R

廉价感情. 提交于 2020-12-31 14:55:46
问题 I am trying to make a Shiny App that retrieves an image from Nasa API and displays it to the user. Although I manage to download the image from the API and store it in a temp file I can't display it in the shiny app but only locally. Here is my code so far: library(shiny) library(httr) library(jpeg) library(RCurl) library(jsonlite) library(shinythemes) #library(imager) key<-"eH45R9w40U4mHE79ErvPWMtaANJlDwNaEtGx3vLF" url<-"https://api.nasa.gov/planetary/apod?date=" ui <- fluidPage(theme =

Display images from web in shiny R

江枫思渺然 提交于 2020-12-31 14:54:02
问题 I am trying to make a Shiny App that retrieves an image from Nasa API and displays it to the user. Although I manage to download the image from the API and store it in a temp file I can't display it in the shiny app but only locally. Here is my code so far: library(shiny) library(httr) library(jpeg) library(RCurl) library(jsonlite) library(shinythemes) #library(imager) key<-"eH45R9w40U4mHE79ErvPWMtaANJlDwNaEtGx3vLF" url<-"https://api.nasa.gov/planetary/apod?date=" ui <- fluidPage(theme =

Collapse rowGroup Shiny

狂风中的少年 提交于 2020-12-30 03:43:54
问题 I have rather simple application (below) where I try to output grouped table using DataTable with the ability to collapse the groups. I found solution in that is implemented in jQuery here but I have no idea how such complex implementation could be moved into R. Currently, I am able to collapse within a group but not the whole group itself. Any hints how this could be implemented in Shiny? My application: library(shiny) library(DT) library(shinyjs) ui <- fluidPage( # Application title

R shiny: Freehand drawing ggplot. How to improve and/or format for plotly?

馋奶兔 提交于 2020-12-30 02:35:27
问题 I have a client that wants to be able to "freehand" draw on a plotly (ggplot) graph in Rshiny. I said to use the lasso select button on plotly graphs, but they were not happy that if you click somewhere else on the graph it removes the first lasso. Using this post, I was able to workup a ggplot that I could draw on. I cannot however get it to work with plotly as I do not know the equivalent of the hover options in the ui below. I would love some input on how to do this with plotly, how to

R shiny: Freehand drawing ggplot. How to improve and/or format for plotly?

北战南征 提交于 2020-12-30 02:33:06
问题 I have a client that wants to be able to "freehand" draw on a plotly (ggplot) graph in Rshiny. I said to use the lasso select button on plotly graphs, but they were not happy that if you click somewhere else on the graph it removes the first lasso. Using this post, I was able to workup a ggplot that I could draw on. I cannot however get it to work with plotly as I do not know the equivalent of the hover options in the ui below. I would love some input on how to do this with plotly, how to

Change cell background of rHandsontable with afterChange event on client side

戏子无情 提交于 2020-12-30 01:45:15
问题 I'd like to change the background color of a handsontable cell after it's been edited by the user on the client side. The handsontable is defined through a Shiny application; so this is really a question about how to define event hooks in rHandsontable in the Shiny application. The general use case that I'm trying to accomplish is: users edit cell data; the background color change to indicate that it's been changed and is pending saving to a database; the change is passed back to Shiny's