Shiny

R shiny - DT::renderDataTable column width

二次信任 提交于 2020-01-11 09:06:11
问题 I'm making an app in shiny, and have run into a small but irritating problem. Part of the output that I produce is outputted using DT::renderDataTable . There are only two columns, and the width of the first column will depend on the input dataset, so I don't want to absolutely fix the width to anything. I've seen this thread, and the code in one of the answers works to some extent. However, if I push the actionButton a second time, the table resizes itself to fill the entire width of the

How to listen for multiple events which contain an isolate() in a shiny eventReactive handler

半世苍凉 提交于 2020-01-11 07:56:09
问题 Like in a previous question: How to listen for more than one event expression within a Shiny eventReactive handler I'm wanting to listen for two events in my eventReactive expression, however in this case one event is more complicated than a single input and I cant get both the simple first event and the second more complicated event to both work together. The first event is input$start an actionButton that self deletes once clicked using removeUI() and the second requires two inputs to

event when clicking a name in the legend of a plotly's graph in R Shiny

孤街醉人 提交于 2020-01-11 06:52:07
问题 I want to display some information when the user click on the legend of a plotly graph. For example in the code below, if the user clicks on the "drat" name in the legend to unshow these data, I would like to print a text saying "drat and qsec are selected". I have seen this stackoverflow's post: R shiny and plotly getting legend click events but it works with labels. In my case, labels is not an available parameter. I have tested the different plotly events but none return any information

R Leaflet (CRAN) - how to register clicking off a marker

我们两清 提交于 2020-01-11 06:07:08
问题 Using the RStudio Leaflet package in a shiny app I've been able to achieve all the functionality I've looked for except deselecting a marker object once it has been clicked on. More specifically, the input$map_click_id value is set to NULL before any markers are clicked. Upon clicking a marker it is updated with the data (ID, lat, lng, nonce) for that marker. I would like to set the map up so that when a user clicks on any area of the map which is not a marker, input$map_click_id is reset to

Creating Leaflet heatmaps in r and shiny using rCharts

橙三吉。 提交于 2020-01-10 15:39:59
问题 I am using the great demo by Ramnath Vaidyanathan at http://rmaps.github.io/blog/posts/leaflet-heat-maps/index.html and I would like to reproduce his heat map for my shiny application. When I try to use Ramnath's code in shiny though I only manage to get the map out, but not the heat map. Possibly part of the reason of my problems is that the original code from Ramnath uses rMaps while I'm using rCharts (also developed by Ramnath) as it is more developed / better integrated with shiny and of

Creating Leaflet heatmaps in r and shiny using rCharts

夙愿已清 提交于 2020-01-10 15:39:07
问题 I am using the great demo by Ramnath Vaidyanathan at http://rmaps.github.io/blog/posts/leaflet-heat-maps/index.html and I would like to reproduce his heat map for my shiny application. When I try to use Ramnath's code in shiny though I only manage to get the map out, but not the heat map. Possibly part of the reason of my problems is that the original code from Ramnath uses rMaps while I'm using rCharts (also developed by Ramnath) as it is more developed / better integrated with shiny and of

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

风流意气都作罢 提交于 2020-01-10 14:54:33
问题 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 <- fluidPage(useShinyjs(), navbarPage("hello", id="hello", tabPanel("home", br(), h3("this is home"),passwordInput("pass", "enter 'password' to see the tabs: "),actionButton("enter", "enter")), tabPanel("tab2", br(), h4("this is tab2")), tabPanel("tab3 with a lot of stuff in it", br(), h4("this

styleColorBar Center and shift Left/Right dependent on Sign

丶灬走出姿态 提交于 2020-01-10 07:42:20
问题 I am looking to create bars that when using DT's datatable appear in the middle of the cells of a column and reach out left or right depending on whether the value in the cell is positive or negative. I have tried using the function styleColorBar and changing the argument backgroundPosition to 'left' or 'center' however with each try the bars still appear to the right of the cell and always go to the left. I can't find an example from R code, but have attached an example of what can be done

Total of a column in DT dataTables in shiny

不问归期 提交于 2020-01-10 04:10:39
问题 I am trying to calculate the total of a column in my shiny app using DT::datatable. By total I mean the sum of all elements in a table not just what is showing in the current pagination. Following this example the following code should work (but it doesn't): jsCode <- "function(row, data, start, end, display) { var api = this.api(), data; total = api.column(1, {page: 'all'}).data().reduce( function(a, b) { return a + b}, 0); $( api.column(1).footer() ).html('Total: ' + total); }" All I am

Total of a column in DT dataTables in shiny

做~自己de王妃 提交于 2020-01-10 04:10:05
问题 I am trying to calculate the total of a column in my shiny app using DT::datatable. By total I mean the sum of all elements in a table not just what is showing in the current pagination. Following this example the following code should work (but it doesn't): jsCode <- "function(row, data, start, end, display) { var api = this.api(), data; total = api.column(1, {page: 'all'}).data().reduce( function(a, b) { return a + b}, 0); $( api.column(1).footer() ).html('Total: ' + total); }" All I am