ricv icon indicating copy to clipboard operation
ricv copied to clipboard

ricv changing images almost randomly when inputs change

Open jebyrnes opened this issue 2 years ago • 2 comments

I'm having the oddest issue with shiny and ricv. See https://shiny.umb.edu/shiny/users/jarrett.byrnes/borror_algae_maps_shiny/ in the tab Compare Years. Initially, looks good. But, as soon as you change either a start or end year, the behavior becomes inconsistent. The wrong years are sometimes selected. Or start and end are switched. It seems almost random.

For example, change them to be the same year. Should be the same image you scroll back and forth across. Except it is not.

So, here is my output

  output$compare_years <- renderRicv({
    ricv(
      img1 = glue("figures/{input$start_year}.jpg"),
      img2 = glue("figures/{input$end_year}.jpg"),
      options = list(addCircle = T, hoverStart = T, fluidMode=T)
    )
  })

Seems standard. This draws from two radio buttons

sidebarPanel(width=2,
                          radioButtons(inputId = "start_year",
                                       "Start Year",
                                       choices = sort(unique(shapes_cleaned$year)),
                                       selected = 1982),
                          
                          radioButtons(inputId = "end_year",
                                       "End Year",
                                       choices = sort(unique(shapes_cleaned$year)),
                                       selected = 2014)
             )

So, why the totally odd behavior?

jebyrnes avatar Apr 22 '22 14:04 jebyrnes