How can I force reactive graphs to plot/evaluate when not in focus in flexdashboard tabs?

I have a shiny application that uses flexdashboard, and I have a couple of tabs that are written into the app in the form

Tab 1

# input controls (affect both tabs)

# plots using ggplot2

Tab 2
# additional input controls (only affect plots in tab 2)

# plots using ggplot2

However, whenever I create an app like this, the plots don't begin updating with their respective reactive environments until I navigate to their respective panels.

I would like to force them to all update simultaneously, or in sequence at least, without having to navigate to each different tab. Is this possible?

Yes! Check out Shiny - Set options for an output object. — outputOptions

You'll want to add an R chunk with content similar to:

outputOptions(output, "myplot", suspendWhenHidden = FALSE)

As you said... by default, Shiny does not compute outputs unless they are visible. This option will disable that logic and always compute the output.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.