ropensci/iheatmapr

Remove reliance on plotly htmlwidget

AliciaSchep opened this issue · 2 comments

So as to avoid issues like #6, I think it would be best to remove plotly r package dependence -- iheatmapr creates the list of inputs needed for plotlyjs, could create an iheatmapr htmlwidget instead of using plotly one. Advantages would be:

  • more control over what happens when plotly js is updated
  • remove crosstalk dependency (not being used with iheatmapr at moment; probably would want a different implementation if it were to be added in future)
  • enabling specialized iheamapr shiny event functions (to take into account information stored witihin Iheatmap object)

Dear Alicia,

I recently updated plotly & iheatmapr, so I'll have to adjust my code.

So far I used something like the following my Shiny app:

# ui.R

library(plotly)

fluidPage(
   titlePanel(title = "dummy heatmap app"),
   sidebarLayout(
      sidebarPanel(
          textInput(inputID = "data.rds",
                    label = "Input data",
                    value = "input.data.Rds",
                    placeholder = "Rds file path")
      ),
      mainPanel(
         plotlyOutput(outputID = "heat")
      )
   )
)
# server.R

library(iheatmapr)

function(input, output){
  output$heat <- renderPlotly(as_plotly(main_heatmap(readRDS(input$data.rds))))
}

I guess I know have to change this to

# ui.R

library(iheatmapr)

fluidPage(
   titlePanel(title = "dummy heatmap app"),
   sidebarLayout(
      sidebarPanel(
          textInput(inputID = "data.rds",
                    label = "Input data",
                    value = "input.data.Rds",
                    placeholder = "Rds file path")
      ),
      mainPanel(
         iheatmaprOutput(outputID = "heat")
      )
   )
)
# server.R

library(iheatmapr)

function(input, output){
  output$heat <- renderIheatmap(main_heatmap(readRDS(input$data.rds)))
}

but the vignette still mentions the as_plotly function even after the removal of plotly.R in 3e09ad6.


Could you please update the documentation to reflect the changes in the context of shiny?

Best,
Marcel

Sorry, there was an error with configuration of website, I had updated the vignette but the website link was pointing to the old version of vignette. Should be fixed now. Vignette includes section on shiny.