Questions tagged [shinyjs]

0

votes
0

answer
8

Views

r2d3 not loading my graph on Shiny implementation, but it's working fine on my regular html

I have a shiny app, and I'm trying to include d3 graphs using r2d3. When I test my app on a regular html/js environment, the app works properly. But when I use r2d3 on Rstudio, and load the js that has my d3 code, no graph shows up. ¿Has anyone experienced this before?
0

votes
1

answer
18

Views

R Shiny - Removing UI using jQuery and onclick event handler

The app below contains an actionButton Add box that creates a box when clicked. Each box has a AdminLTE data-widget = "remove" attribute, so each box has a remove button that is placed in the box-tools div in the box-header. At the moment, clicking the remove button for a box only hides the box rat...
user51462
1

votes
1

answer
136

Views

Access Javascript Variable in R Shiny Application

I want to know if it is possible to use variables created in runjs() in my R code. For example will I be able to access the variable today_var outside the runjs() function for further analysis. if (interactive()) { library(shiny) shinyApp( ui = fluidPage( useShinyjs(), actionButton("btn", "Click m...
kay_arr
1

votes
1

answer
901

Views

R Shiny - extendShinyjs Error parsing the JavaScript code provided

I am testing extendShinyJs with the simple test on GitHub: link. I have installed the V8 package, but I get this error, even with the sample script: Error : shinyjs: Error parsing the JavaScript code provided. I also tried moving the JavaScript code into a separate file under www folder. Additional...
aloplop85
1

votes
1

answer
387

Views

Use JavaScript to validate a field in Shiny App

I would like to validate a the a form on using JavaScript. I know I can add an onclick method to an actionButton by providing an onclick argument like so: textInput('timeField', "Time",'12:00') actionButton('okButton', 'OK', onclick="function(){ if(!(/^([01][0-9]|2[0-3]):([0-6][0-9])$/ .test($('#...
Jthorpe
1

votes
2

answer
335

Views

How can I get the date from the draggable vertical bar in timevis?

I found the timevis package to be very useful for displaying time periods, and it is working as expected to display my data. I have used the addCustomTime() function to add a draggable vertical line, which also works great, however, I find that I can't get the current value of that line. The underly...
James
2

votes
1

answer
115

Views

Save variable output from shinyalert

I would like to save the output result (TRUE/FALSE) of a shinyalert warning (https://github.com/daattali/shinyalert). This post is helpful for printing the value to console (How to capture shinyalert input field as variable), but I am unable to save the value itself as a variable. library(shiny) lib...
ben
6

votes
1

answer
1.5k

Views

Shiny: use shinyjs to fetch cookie data

I want to fetch cookie data from my Shiny app using shinyjs. I have created a cookie, "samplecookie=testval"; and I want to be able to retrieve the value of samplecookie. I use the below javascript function (where I pass the cookieName and it returns the corresponding value). function fetchCookie(na...
rookieJoe
21

votes
2

answer
4.6k

Views

Possible to show console messages (written with `message`) in a shiny ui?

(Cross post from the shiny-discuss Google group since I got 0 answers). I don't understand R's message vs cat vs print vs etc. too deeply, but I'm wondering if it's possible to capture messages and who them in a shiny app? Example: the following app can capture cat statements (and print statements a...
Dean Attali
2

votes
1

answer
425

Views

R Shiny display app is busy in a widget

I am developing a R Shiny application involving Twitter data fetching. As the process could last some time I would like to indicate that the application is busy doing something, so the user doesn't thing the page is frozen. In my case, I store some reactive values this way: rv
aloplop85
3

votes
2

answer
2.1k

Views

How to hide a conditional panel in Shiny?

How to hide a conditional panel in Shiny? Please, see the following example: library(shiny) ui
Joe
11

votes
3

answer
8.7k

Views

Shiny Dashboard - display a dedicated “loading..” page until initial loading of the data is done

I have initial loading of data from the DB in the server.R which takes a few seconds. Until this is done, the page displayed is distorted (wrong data in selection box, and weird placing of the boxes, see below). I want to display a different page (or at least different content in my first-displayed...
KeshetE
2

votes
1

answer
2.6k

Views

show(), hide() usage from shinyjs, Shiny

I have a simplified version of a shiny application I developed. What I want is to be able to show dataframe1 when Frame1 actionbutton is pressed and hide dataframe2 and again show dataframe2 when Frame2 actionbutton is pressed and hide dataframe1. I need to print the tables at the same location obvi...
Alperen Taciroglu
4

votes
1

answer
1k

Views

Shinydashboard grayed out downloadButton?

How can I fix the download button on this simple example? library(shiny) library(shinydashboard) library(shinyjs) header
Ignacio
1

votes
2

answer
155

Views

Use shinyjs and ggplot2::autoplot in the same shiny app

I use the function ggplot2::autoplot with a lm object on my shiny app. This is possible thanks to the package ggfortify. On my shiny app I also use shinyjs. On the reproductible example below, as soon as I uncomment library(shinyjs) & useShinyjs() I get the error : Error in unclass(x) : cannot uncla...
qfazille
1

votes
1

answer
1.5k

Views

r Using action buttons to hide/show checkboxes

Say I had the following code... ui.r library(shiny) ui
Ulgur
4

votes
1

answer
2.9k

Views

How to manually collapse a box in shiny dashboard

I'm trying to collapse a box manually when something happens. It seems that I only need to add the class "collapsed-box" to the box, I tried to use the shinyjs function addClass, but I don't know how to do that becuase a box doesn't have an id. Here as simple basic code that can be used to test poss...
Geovany
3

votes
2

answer
379

Views

Shiny App not updating hidden sliders

I currently have a basic R Shiny app that consists of a couple of sliders whose values are outputted in a table. The table is rendered using as follows: output$profile
Fra Contin
3

votes
1

answer
2.1k

Views

Shiny: Dynamic colour (fill) input for ggplot

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
Mal_a
1

votes
1

answer
1.3k

Views

tab specific sidebar in shinydashboard

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 tha...
h.l.m
1

votes
1

answer
1k

Views

Increase length of the shiny dashboard sidebar

Since, my original dataset is very huge I recreated my problem using the iris dataset. I added a column 'new_var' which has descriptions of flowers. The trouble I have is when I select multiple inputs(> 3) from the drop down menu, the length of the sidebar doesn't get adjusted to show remaining valu...
user1946217
4

votes
2

answer
177

Views

R/shinyjs: Plot appears beyond the box width after using function show/hide sidebar

since couple of days I am trying to find solution to plot appearing wrongly (beyond box width) in shiny app while using function show/hide sidebar. Here is example code: library(shiny) library(shinydashboard) library(ggplot2) library(shinyjs) ui
Mal_a
5

votes
1

answer
2.1k

Views

R Shiny: Use Onclick Option of Actionbutton on the Server Side

I want to make a Shiny App in which the user can press an actionbutton which would then trigger some code on the server side creating a file in the www folder and then opens/downloads the file. Suppose the file is test.txt (in my case it would be a variety of R, Excel, and exe files which will be c...
Jeppe S.
2

votes
1

answer
383

Views

Drop down menu with sub category using R and Shiny

I want to create a dropdown menu with sub-categories using R - how is a sub-category supposed to be introduced? `if (interactive()) { ui
Harryy
2

votes
1

answer
577

Views

Clickable hyperlink Shiny R

I've tried this code to create a clickable hyperlink in Shiny Dashboard, but the image doesn't show up for some reason (I get a question mark kind of an icon, but it's hyperlinked) `dashboardBody( tabItems( tabItem("icratio", fluidRow( a(img(src="image.png"), href="https://google.com") ) ) ) )` What...
thecoder
1

votes
2

answer
6.7k

Views

Hide an element (box/tabs) in shiny dashbaord

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...
mongofresher
3

votes
1

answer
603

Views

Loading screen and navbarPage

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 o...
Michal Majka
1

votes
2

answer
322

Views

shinyBS observe toggling of bsCollapsePanel

my question relates to observing the event of toggling and untoggling of the header in bsCollapsePanel in shinyBS. Lets consider following following app as an example: library(shiny) library(shinyBS) server = function(input, output, session) { observeEvent(input$p1Button, ({ updateCollapse(session,...
user974514
3

votes
1

answer
1.9k

Views

Restart shiny app from within app (reloading data)

I want to restart a shiny app from within the app, so that e.g. code in global.R will be executed again (to reload a csv file with data). Here is a minimal example showing what I want to do: This shiny app loads some coordinates data and plots markers on a map. When a new marker is added to the map,...
needRhelp
3

votes
0

answer
126

Views

R shiny: send data to Firebase

I would like to send some data to Firebase using shiny, this is a simplified version of my app.R: library(shiny) library(shinyjs) callFB
mat
3

votes
1

answer
121

Views

Shinyjs: [add|remove]Class does not work in a module

Background In my shiny module I run a lenghty calculation. I want to provide some visual feedback to the user by changing the cursor to the spinning circle. For this I created a css class .wait and was hoping to use shinyjs::addClass on the body to show the new cursor. However, within a module this...
thothal
5

votes
2

answer
2.1k

Views

How to collapse sidebarPanel in shiny app?

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 show...
needRhelp
5

votes
2

answer
964

Views

Disable button in shiny while plot is loading

Is it possible to disable a button in shiny while a plot / a reactive element is loading? I know shinyjs can disable and enable input elements, but I don't know how to set up the connection to a loading plot / reactive element. The example is based on the Single-file shiny apps page. I just added a...
2

votes
0

answer
318

Views

can you put a shiny progress bar in global.r

I have a data source that needs to be loaded once and so read the data source into the global environment. I put it in the global environment because the ui.r file needs to access it to take the unique values of some columns to create dropdowns on the ui. so my global.r has this: ############## glo...
user3022875
7

votes
2

answer
3.7k

Views

shiny app : disable downloadbutton

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...
Elaheh kamaliha
1

votes
1

answer
412

Views

Enable disable input RShiny

I have RShiny code, with which i want to disable/enable number input with checkbox. However, it works only for disable. library(shiny) runApp(shinyApp( ui = fluidPage( shinyjs::useShinyjs(), numericInput("test", "Test", 5), checkboxInput("submit", label="Choose") ), server = function(input, output,...
Lesley.H
2

votes
1

answer
109

Views

Shiny application data by default not visible for special input widget

I have a shiny application where I want to be able to edit data which is in a database. In my application I select a ID and retrieve the corresponding data. (in the example "record") This data is filled in into different shiny widgets to be able to edit them. (in the example below "textID" and "rem...
Berecht
7

votes
1

answer
1.1k

Views

capturing cat output periodically for R shiny output (renderPrint)

Hope someone can help me with this. Let's say there is a function "example" which is something like ##function from a package example
dlow
2

votes
0

answer
336

Views

Conditional shinydashboard box status / style

I want to change the status / style of a shinydashboard box conditional on some inputs, basically to signal warnings to the user (see example below). Actually, I already managed to solve my problem by using shinyjs and its extendShinyjs functionality. But I would like to understand why my initial at...
Matt Flor
4

votes
2

answer
813

Views

shiny: start the app with hidden tabs, with NO delay

I would like to build an application and some of the tabs will be hidden to the user until he types the right password. I know how to do this with shinyjs::hideTab: library(shiny);library(shinyjs) ui
agenis

View additional questions