Questions tagged [shinyjs]

shinyjs is an R package that lets you perform common useful JavaScript operations in Shiny applications without having to know any JavaScript. This is turn allows you to easily improve the user interaction and user experience in your Shiny apps. It can also be used to easily run your own custom JavaScript functions from R.

shinyjs lets you perform common useful JavaScript operations in Shiny apps that will greatly improve your apps without having to know any JavaScript.

Examples include: hiding an element, disabling an input, resetting an input back to its original value, delaying code execution by a few seconds, and many more useful functions for both the end user and the developer. shinyjs can also be used to easily call your own custom JavaScript functions from R.

Useful resources:

637 questions
4
votes
1 answer

Reset event_data using shinyjs doesn't seem to work anymore, after the recent update

I am maintaining my code for a big and bulky shiny dashboard, and I noticed that the click-event functionality doesn't reset anymore. After stripping it down to a minimal working example, and comparing to solutions from…
tmarusca
  • 45
  • 4
4
votes
0 answers

Is it possible to initialize Shiny input values without including them in the ui?

I'm building a Shiny app where elements of the output can be clicked to set input variables. I'm doing so by including some Javascript that calls the Shiny.setInputValue method. I'd like to initialize these values but don't want the user to be aware…
Walker Harrison
  • 527
  • 3
  • 12
4
votes
1 answer

Show/hide menuItem in shinydashboard

I need a menuItem hidden, when the app is entered into. When a user chooses a certain value, the menuItem has to appear. I have tried shinyjs functions hidden, and it hides a menuItem, but when using show or toggle, a menuItem doesn't appear. I've…
Vesnič
  • 365
  • 5
  • 17
4
votes
1 answer

using renderUI to update a data set instead of conditional panel

I am writing a shiny app to realize the following effects: Whenever I choose variable included by categoryname, the web will generate the slider which provides a divider. It divides the selected variable into 2 groups and form a new column…
Dianafreedom
  • 391
  • 1
  • 13
4
votes
1 answer

Highlight R leaflet polygon pointed by select Item (without cliking on it)

On R shiny app, is it possible to have a leaflet map that highlights polygons pointed by select Item (it should work just moving the mouss above the list and without having clicking on it) ? In the following reproductible example, I would like…
JeanBertin
  • 633
  • 1
  • 7
  • 23
4
votes
1 answer

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…
thothal
  • 16,690
  • 3
  • 36
  • 71
4
votes
1 answer

R Shiny: Prevent cssloader from showing until action button is clicked

I want to show a cssloader spinner while some processing is done. The cssloader must be shown only after an actionButton is clicked, which triggers the processing of data (this step requires some time, simulated by the sys.Sleep() function in the…
Hallucigeniak
  • 155
  • 1
  • 7
4
votes
2 answers

Change cell background of rHandsontable with afterChange event on client side

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…
Soren
  • 1,792
  • 1
  • 13
  • 16
4
votes
1 answer

How to add floating button in shinydashboard

I am working on something where I need a floating button in shinydashboard. Below is a code to get a floating button using shinyMaterial package. library(shiny) library(shinymaterial) # Wrap shinymaterial apps in material_page ui <-…
kawsleo
  • 560
  • 4
  • 23
4
votes
2 answers

Using Plotly in Shiny App based on a HTML template fails

I am building a Shiny app based on an HTML template and I would like to use plotly for charts. I am struggling with insertion the chart into the template. The following code works fine: library(shiny) library(plotly) shinyApp( ui <-…
mattino
  • 95
  • 7
4
votes
1 answer

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",…
neringab
  • 613
  • 1
  • 7
  • 16
4
votes
0 answers

Make Shiny Leaflet recognise a map created from an externally hosted JS file

I would like to use Shiny Leaflet to render an already existing leaflet map, but problems arise since the initial map is created from an externally hosted (rather complicated) JS file, which I do not have any control over. I can't seem to get the…
KarlJensen
  • 59
  • 5
4
votes
1 answer

How to see if a shiny dashboard box is collapsed from the server side

I'm trying to find a way to check whether a Shiny Dashboard Box is collapsed or expanded. By reading the great reply by @daattali in How to manually collapse a box in shiny dashboard I know it is possible to collapse the box from the server side by…
JesperHansen
  • 437
  • 1
  • 4
  • 16
4
votes
1 answer

Shiny with reactive inputs and "Go" button

I have a shiny App, I wanted to be reactive for the inputs choice and show the datatable when I press the "Go" button. For inputs I want to have the choice between "All value" of my variable and each value. I have some problem to fix my app. First…
Mostafa90
  • 1,674
  • 1
  • 21
  • 39
4
votes
2 answers

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
  • 3,670
  • 1
  • 27
  • 60