I am wondering if there is a way to detect a page change using an observer in flexdashboard with a shiny runtime environment? I would like to observe a page change then force evaluation of another observer, or, if easier, force evaluation a reactive data object inside a shiny module. The present design has a couple of graphs and stuff on the first page, all generated from the reactive dat()
object, and then a leaflet map on the second page of the flexdashboard, that uses the same dat()
object. The issue is that my present observer does not fire the first time a user clicks on the page, despite being setup to run via observeEvent(dat(), {plotting code here})
. After they make a new data selection, however, the dat()
observer fires off, thereby producing the desired results and expected leaflet plots.
I would like to solve the issue of the map being blank the first time the user clicks on the second page. I have tried looking on RStudio's docs, but maybe I have missed something. I'm hoping someone could help me with this. Thank you in advance, Nate.
1 Answers
Answers 1
It is difficult to say what is amiss w/o a reprex
, but I would guess that the plot output is not rendered because it is on a hidden page. Maybe
outputOptions(output, "myplot", suspendWhenHidden = FALSE)
would help with myplot
equal to the id
of your leaflet map output object?
0 comments:
Post a Comment