thanks for your rapidly reply, I have try your method, but have no effect, the second time to load the cached image(very tiny size,just less than 500 bytes),there have a blank plot at the position.
I have try to move the shinyjs code trunk out of the renderCachedPlot, just before the output$plot3,have solved this blank plot problem, but the cached plot is still render( though very tiny size), so I still want solved this problem by the renderCachedPlot function self, not by the shinyjs. just not caching it other than hiding it, could you have any suggestion?
My solved code like following, but this is not satisfy me.
z <- reactive({
...
return(list(a=a,...))
})
observe({
a <- z()$a
if (a>1) {
shinyjs::show("plot3")
} else {
shinyjs::hide("plot3")
}
})
output$plot3 <- renderCachedPlot({
a <- z()$a
if(a>1){
plot(...)
}else{
return(NULL)
}
},cacheKeyExpr={list(z()$a)})