shinyjs

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

早过忘川 提交于 2019-12-11 02:47:37
问题 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 this Shiny app to highlight the polygon corresponding to the mouse cursor location but without having to click on it. library(shiny) library(shinyjs) library(leaflet) library(sf) download.file(url = "http://thematicmapping.org/downloads/TM_WORLD_BORDERS

Highcharter - Click event to filter data from graph

守給你的承諾、 提交于 2019-12-11 01:35:58
问题 I am using highcharter and I want to be able to add a click event to my graph that when I click on a bar (whether its top level or drilldown), it filters the data table below it to contain the same information. I've checked this SO question which shows how to implement the the Java to R to contain a click function but not how to use that information to filter data / choose the correct data set. Hyperlink bar chart in Highcharter Any help would be greatly appreciated! An example code is below:

Can I set html class dynamically? Or how does Shiny set 'html'.hasClass('Shiny-busy')?

泪湿孤枕 提交于 2019-12-10 11:05:24
问题 So this is more of a conceptual question in response to getting a 'busy' notification working on my shiny app using the: conditionalPanel( condition="$('html').hasClass('shiny-busy')", img(src="images/busy.gif")) I've gotten a animation gif to show during an initial query to a database, but it becomes unpredictable after that. I added in a second conditionalPanel with to hide the output graph if a new database call is made: conditionalPanel( condition="!($('html').hasClass('shiny-busy'))",

R shinyjs shinydashboard box uncollapse on action button input

巧了我就是萌 提交于 2019-12-09 08:34:27
In my shiny app, I have few boxes that are collapsed when application starts. Upon clicking on action button, calculations are run and then box should uncollapse and show results. Here is an example code that I am using, but it does not uncollapse the box. I got the code for "jscode" from here How to manually collapse a box in shiny dashboard . I believe this code was for collapsing the box upon clicking the button; I am not sure how to make it to uncollapse the box upon clicking the button. many thanks, Krina ui.R library(shiny) library(shinyBS) library(dplyr) library(shinydashboard) #

conditionally output different colored text in Shiny

空扰寡人 提交于 2019-12-09 05:26:00
问题 I would like Shiny to print out some different color text depending on the size of a vector. I was thinking something like: output$some_text <- renderText({ if(length(some_vec) < 20){ paste("This is red text") <somehow make it red> }else{ paste("This is blue text") <somehow make it blue> ...but then I realized, I'm doing this in the server, not the UI. And, as far as I know, I can't move this conditional logic into the UI. For example, something like this won't work in the UI: if(length(some

Shinyjs: On click option in shiny dashboard

人走茶凉 提交于 2019-12-08 12:04:03
问题 I have a shiny dashboard app with 3 tabs and a notification menu. I am trying to track user activity on the dashboard and wish to log each of their clicks on the dashboard. The code in server.R for the tabset panel is as below: output$tabs1=renderUI( tabsetPanel(type="tab", tabPanel(id="OverallTab","Overall Activity"), tabPanel(id="Tab1","Tab 1 details"), tabPanel(id="Tab2","Tab 2 details")) Part of my notification code is as below: output$notiMenu <- renderMenu({ all_nots <- apply(u_notd, 1,

Hide main header toggle in R Shiny App

吃可爱长大的小学妹 提交于 2019-12-08 06:36:15
问题 I am looking for a way to hide main header toggle icon as we do for side bar in R Shiny App using ShinyJS Package. Attaching the Image for the reference. Code library(shiny) library(shinydashboard) library(shinyjs) ui <- shinyUI(dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( useShinyjs() ) )) server <- shinyServer(function(input, output, session) { addClass(selector = "body", class = "sidebar-collapse") # Hide Side Bar }) shinyApp(ui = ui, server = server) 回答1: One way

Show/hide menuItem in shinydashboard

拟墨画扇 提交于 2019-12-08 05:06:16
问题 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 found R shinydashboard - show/hide multiple menuItems based on user input and came up with this library(shiny) library(shinydashboard) library(shinyjs) header <- dashboardHeader(title = "APP", titleWidth = 330) sidebar <- dashboardSidebar(

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

谁都会走 提交于 2019-12-08 05:00:59
问题 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 using the shinyjs package, as illustrated in the code below library(shiny) library(shinydashboard) library(shinyjs) jscode <- " shinyjs.collapse = function(boxid) { $('#' + boxid).closest('.box').find('[data-widget=collapse]').click(); } " ui <-

How to capture shinyalert input field as variable

可紊 提交于 2019-12-07 05:04:25
问题 I'm trying to use the relatively new shinyAlert package to see if it offers better results than the sweetalert package but I'm unable to figure out how to get this: Myvar <- shinyalert input text from this minimal example. library(shiny) library(shinyjs) library(shinyalert) ui <- fluidPage( shinyjs::useShinyjs(), useShinyalert(), actionButton("run", "Run", class = "btn-success") ) server <- function(input, output, session) { shinyEnv <- environment() observeEvent(input$run, { shinyalert(