shinyjs

How to add/remove input fields dynamically by a button in shiny

偶尔善良 提交于 2019-12-02 02:49:33
问题 I've been trying to find a solution how to add and remove input fields with a button in shiny. I don't have a source code since I haven't made that much progress, but this jQuery example (http://www.mkyong.com/jquery/how-to-add-remove-textbox-dynamically-with-jquery/) gives a good idea on what I'm trying to accomplish. Is this possible in shiny or should I use shinyjs to do this? Thank you in advance! 回答1: EDIT: I read the jQuery example a bit more, and added a code snippet doing what I think

How to add/remove input fields dynamically by a button in shiny

岁酱吖の 提交于 2019-12-02 01:51:54
I've been trying to find a solution how to add and remove input fields with a button in shiny. I don't have a source code since I haven't made that much progress, but this jQuery example ( http://www.mkyong.com/jquery/how-to-add-remove-textbox-dynamically-with-jquery/ ) gives a good idea on what I'm trying to accomplish. Is this possible in shiny or should I use shinyjs to do this? Thank you in advance! EDIT: I read the jQuery example a bit more, and added a code snippet doing what I think you were looking for. I don't know jQuery, so I couldn't make much out of the example link. I took a

How to create On load Event or default event in shiny?

拟墨画扇 提交于 2019-12-01 08:27:41
I am new to shiny as well as stackoverflow and looking for some help with a problem that I am currently stuck at. I am trying to build a shiny app which collects some inputs from the user and creates visualization based on inputs on click of a button. Currently, that works fine, but one of the major ask is that, when the app loads for the first time, it shall have visualization prepared based on the default inputs. I am pasting a sample code, which can explain the issue I am facing: UI.R #loading shiny library(shiny) ui<-shinyUI(fluidPage( titlePanel("Iris Dataset"), sidebarLayout(

How to create On load Event or default event in shiny?

送分小仙女□ 提交于 2019-12-01 05:35:26
问题 I am new to shiny as well as stackoverflow and looking for some help with a problem that I am currently stuck at. I am trying to build a shiny app which collects some inputs from the user and creates visualization based on inputs on click of a button. Currently, that works fine, but one of the major ask is that, when the app loads for the first time, it shall have visualization prepared based on the default inputs. I am pasting a sample code, which can explain the issue I am facing: UI.R

Hide an element (box/tabs) in shiny dashboard

点点圈 提交于 2019-12-01 00:29:47
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 landing on the page but doesn't disappear on entering text. Appreciate any help. Thanks Oskar's answer is

shiny app : disable downloadbutton

核能气质少年 提交于 2019-11-30 09:35:09
My shiny app produces some files that user can download. I have put downloadbutton in the ui for this purpose. However, when the page launches and before any calculation is done, there is nothing to download. I want to prevent user from downloading empty pages. For this, I'm thinking to disable the downloadButton before the output is ready. But I don't know how to do that. I have found ways to disable ActionButton (such as ShinyBS package and other JS codes), but nothing for downloadButton. Right now, I use validate() to throw errors if the output is not ready. However, when the downloadButton

How to collapse sidebarPanel in shiny app?

我的梦境 提交于 2019-11-29 07:28:01
I have a shiny app with a mainPanel and a sidebarPanel inside a tabPanel in a navbarPage. I need an option to hide the sidebarPanel similar to this: Hide sidebar in default in shinydashboard and https://github.com/daattali/shinyjs/issues/43 . An actionButton should control if the sidebarPanel is shown or collapsed. This is the code: library(shiny) library(shinyjs) ui <- fluidPage( navbarPage("", tabPanel("tab", sidebarPanel( useShinyjs() ), mainPanel(actionButton("showSidebar", "Show sidebar"), actionButton("hideSidebar", "Hide sidebar") ) ) ) ) server <-function(input, output, session) {

Shiny leaflet easyPrint plugin

谁说胖子不能爱 提交于 2019-11-29 07:19:08
I'm trying to incorporate the easyPrint plugin into my shiny leaflet app. What I want is something that looks like the demo , but in shiny. I have tried to mimic the examples , but have been unsuccessful. Here's my code for my R code so far: library(shiny) library(shinydashboard) library(shinyjs) library(htmlwidgets) library(htmltools) library(leaflet) library(leaflet.extras) library(sp) shinyApp( ui = fluidPage( leafletOutput("map", height = 750) ), server = function(input, output) { registerPlugin <- function(map, plugin) { map$dependencies <- c(map$dependencies, list(plugin)) map }

Draggable line chart in R/Shiny

白昼怎懂夜的黑 提交于 2019-11-28 18:57:21
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? You could do it with R/Shiny + d3.js: A preview, reproducible example, code and a walkthrough can be found below. Edit: 12/2018 - See the comment of MrGrumble: "With d3 v5, I had to rename the events from dragstart and dragend to start

Page refresh Button in R shiny

廉价感情. 提交于 2019-11-28 11:39:41
I tried to implement a page refresh button following the link here . However when I tried deploying to shinyapp.io , it failed and asked for installing package V8 which I had already done. The app was working fine on the machine. The code I used is: jsResetCode <- "shinyjs.reset = function() {history.go(0)}", useShinyjs(), # Include shinyjs in the UI extendShinyjs(text = jsResetCode), # Add the js code to the page p(actionButton("reset_button", "Reset Tool")) In server.R : observeEvent(input$reset_button, {js$reset()}) Is there any way to do this without shinyjs ? Just to be complete, the code