zeehio / condformat

R package to apply conditional formatting rules to a data.frame
Other
25 stars 6 forks source link

condformat in shiny? #3

Closed DataStrategist closed 7 years ago

DataStrategist commented 7 years ago

Hi, I was wondering whether you had thought about providing a function to allow this to be used in Shiny Apps. So we would need some kinda renderCondformat for the server.R and then a condformatOutput for the ui...

Have you thought about this?

zeehio commented 7 years ago

Hi,

Shiny support added in the last commit. To try it use:

devtools::install_github("zeehio/condformat")

Note that as long as htmlTable does not support pagination, long tables will be very long.

See https://github.com/gforge/htmlTable/issues/20 in case you want to implement pagination. Unfortunately neither @gforge (htmlTable maintainer) nor me have the time to work on it.

Thanks for the suggestion, I hope this Christmas commit is useful to you :smile:

DataStrategist commented 7 years ago

Trying to test. But I hate you because you have all your packages nicely updated, which forces me to update all my packages, which of course causes the typical rJava problems which cost me hours. ITS ALL YOUR FAULT! :)

Will confirm functionality asap.

zeehio commented 7 years ago

The rJava dependency is a nuisance related to exporting to excel. Sorry.

I have tried to make it optional but I have been unable to do so in a way that R CMD check does not complain. Patches are welcome.

DataStrategist commented 7 years ago

rJava is just a general tax on the R community. omeday it'll get fixed. Anyway, tried your code and it works! So thanks very much!

BTW... are you Latino and if so, would you like to join an R community for latinoamerica?

zeehio commented 7 years ago

I was able to successfully remove rJava from the condformat dependencies (now it is only suggested).

I am from Barcelona, so I am a bit far from latinoamerica. But who knows... maybe I move to America in the future :+1:

DataStrategist commented 7 years ago

It seems the latest version of either shiny or one of their dependencies, or this package or one if it's dependencies has broken condformat in shiny. image

Try this example after installing latest version of shiny:

library(shiny)
library(condformat)

server <- function(input, output) {
  output$distPlot <- renderCondformat({
    condformat(iris)
  })
}

ui <- fluidPage(
  condformatOutput("distPlot")
)

shinyApp(ui = ui, server = server)

Do you know why?