dt

Hide the filters in Shiny DT datatable

不羁的心 提交于 2019-12-24 16:25:06
问题 In my shiny app I'm creating a datatable using the DT package. I have column filters enabled, however, I want to hide the row of filter boxes. I have separate shiny widgets outside of the datatable which will act as the filters and pass them to the datatable through the searchCols option. Disabling column filters would hide the row of filter boxes but then the searchCols option doesn't work. When I run the app and inspect the elements, I see that the row I want to delete is called < tr role=

R Shiny Dashboard DataTable Column Width [duplicate]

有些话、适合烂在心里 提交于 2019-12-24 15:04:23
问题 This question already has answers here : R Shiny set DataTable column width (2 answers) Closed 9 months ago . I am building a Shiny dashboard and one panel on the dashboard is a DataTable. Below is my code: output$table = DT::renderDataTable(b1, selection = 'single') The width of columns in the data table is now adjusted with the width of column name. However, some cell values are text, and those text are squeezed to display in multiple lines as they are longer than the column names. I am

Passing input$ value to JS() statement in shiny data table

别等时光非礼了梦想. 提交于 2019-12-24 12:27:17
问题 Using this code to format the rows in my datatable rowCallback = DT::JS( 'function(row, data) { // Bold cells for those >= 5 in the first column if (parseFloat(data[0]) >= 5.0) $("td", row).css("background", "red"); }' ) I would like to alter this code so that rather than the static "5.0" value, highlighting is based on an an input$ value. So that users could click on a point on the chart, and rows with that value would be highlighted in the data table. But substituting input$click for 5

Programmatically Color Format Numeric Columns by Each Column Range in Datatable

旧时模样 提交于 2019-12-24 11:27:23
问题 I opened a thread about how to add range bars in a datatable here:Programmatically color format numeric columns in a datatable. However instead of fitting the ranges based on the whole data frame, I would like to format based on the range of each individual column. I figured out some code that works, however, it is most definitely daunting and not programmatic. library(magrittr) library(DT) # Specify numeric columns foo <- sapply(iris, is.numeric) datatable(iris, filter = 'top', options =

How to display in shiny app a matrix A with cell color depending of the cells of another matrix B?

六月ゝ 毕业季﹏ 提交于 2019-12-24 09:57:51
问题 I have a matrix M with positive values and negative values. I have another matrix X (dim(X) = dim(M)). I am trying to display X as a table in shiny app, using the DT package. I would like to display the matrix X with different colors conditioned by the values of M . It means: color1 in cells of X where M > 0 (X[M>0]) , color2 in cells of X where M<0 (X[M<0]) and color3 in cells of X where M == 0 (X[M == 0]) . The next code shows where I got stuck: X <- matrix(c(1:9), 3) M <- matrix(c(-3:2), 3

R Shiny: How to add pagination in DT::renderDataTable

我是研究僧i 提交于 2019-12-24 07:23:28
问题 I am trying to add pagination, search box and selector in my R Shiny app, but it doesn't work for now (I tried paging = TRUE and searching = TRUE, in options as you can see bellow but it doesn't work). Do you have any idea of what I should add? output$mytable1 <- DT::renderDataTable( DT::datatable( { plots.dfs()[[1]] }, caption = htmltools::tags$caption( style = 'caption-side: bottom; text-align: center;', 'Table 2: ', htmltools::em('This is a simple caption for the table.') ), extensions =

DT Shiny different custom column header by column

限于喜欢 提交于 2019-12-24 01:57:11
问题 my css skills are extremely limited but assuming the following example: sketch = htmltools::withTags(table( class = 'display', thead( tr( th(rowspan = 2, 'Species'), th(colspan = 2, 'Sepal'), th(colspan = 2, 'Petal') ), tr( lapply(rep(c('Length', 'Width'), 2), th) ) ) )) datatable(head(iris, 10), container = sketch, options = list( initComplete = JS( "function(settings, json) {", "$(this.api().table().header()).css({'background-color': '#000', 'color': '#fff'});", "}") )) How would I change

Column headers of Shiny data table gets shifted

孤者浪人 提交于 2019-12-24 00:33:32
问题 When I run my Shiny app, the headers of my data tables get shifted to the left. See below.Say this table is on Tab A. The headers get aligned correctly when I click on a different tab (Tab B),then click on Tab A again. See below for the corrected headers. Any idea what's causing it? Below is a simplified version of my code. Thanks in advance! ui.R library("shinythemes") fluidPage(title = "Segmentation App", theme = shinytheme("spacelab"), navbarPage("Segmentation", id = "allResults", tabPanel

R Shiny - multi-page editable DataTable jumps to row #1 after an edit

烂漫一生 提交于 2019-12-23 12:46:54
问题 I am developing a Shiny app using R 3.3.1, Shiny v. 1.2.0 and v. DT 0.5. One of the elements is an editable data table that spans multiple pages. After I make an edit the row in focus jumps to row #1 which kind of ruins the user experience. Here are the specific steps to reproduce this using the snippet below: Load the app Switch to page 2 of the data table Edit row 3, column 2: change Duh to Blue and press Tab Watch the current row jump to page 1 row 1. This would be easier to see if the

scroll to row based on user event, R/DT/Shiny, without using paging

社会主义新天地 提交于 2019-12-23 05:46:09
问题 I am trying to get a datatable (DT) to scroll to the proper row/line when hovering over a point on a map. I can do things like have the row be selected, but I cannot figure out how to make the datatable Y-scroll to the proper entry. I'm trying to do this without Paging, as my datatable uses subsets and is not overall that large. I'm doing this in R/Shiny/DT my javascript experience is 0. This post seems to have been trying to do the same thing, except that the example is one the initial table