lineupjs / lineup_htmlwidget

HTMLWidget wrapper of LineUp for Visual Analysis of Multi-Attribute Rankings
https://lineup.js.org
Other
54 stars 9 forks source link

Conflicts with shinyWidgets #15

Closed JonP-16 closed 4 years ago

JonP-16 commented 4 years ago

Hi!

I'm trying to use your package in my shiny application and found that it doesn't seem to display data when any command from shinyWidgets is invoked. I've tried updating to the latest versions of both packages but that doesn't seem to work.

As an example:

library(shiny)
library(lineupjs)

ui <- fluidPage(
  sidebarLayout(

    sidebarPanel(
      shinyWidgets::awesomeRadio(
        inputId = "data_file_type",
        label = 'Select data type.',
        choices = c('Example Data' = "example_data",
                    'Upload Data'  = "upload_data"),
        inline = FALSE, status = "primary")
    ),

    mainPanel(
      lineupOutput("lineup1")
    )

  )

)

server <- function(input, output) {

  output$lineup1 <- renderLineup({
    if (input$data_file_type == 'example_data'){
      lineup(iris, options=list(rowHeight=20))

    } else {
      return(NULL)

    }
  })

}

shinyApp(ui = ui, server = server)
sgratzl commented 4 years ago

as far as I can see it is a bad polyfill in shinyWidgets:

https://github.com/dreamRs/shinyWidgets/blob/3d1785125cc67654fb672b2bf35b1120b699b7f5/inst/assets/sweetalert2/sweetalert-bindings.js#L80-L82

I posted an issue in https://github.com/dreamRs/shinyWidgets/issues/243

JonP-16 commented 4 years ago

Ah - my mistake for thinking it was your package.

I just tried an older version of shinyWidgets (0.4.8 as opposed to 0.5.0) and it seems to work so I may end up doing that as a short-term solution until shinyWidgets gets fixed.

Thank you for the prompt investigation.

sgratzl commented 4 years ago

the merged a PR that fixes this issue, closing this one