Closed ChrisBeeley closed 3 years ago
There's something weird going on. The sentiment control in the sentiment module isn't working anymore.
EDIT: It's the renderCachedPlot()
in this line that freezes it. Using renderPlot()
instead works just fine. I wonder why on earth renderCachedPlot()
ignores the sentiment control. This is very annoying. Without caching, a user that alternates between sentiments will wait forever for the plots to be calculated.
I think I found it. It took a look at some examples with renderCachedPlot()
and noticed that, when the dataset is reactive, it's included in cacheKeyExpr
.
So I replaced this
cacheKeyExpr =
{
list(
input$label,
input$ngramsType
)
}
with this
cacheKeyExpr =
{
list(
plot_data(),
input$label,
input$ngramsType
)
}
here and it seems to be working fine.
Can you please take a look too?
The debounce is fine, but the renderCachePlot does not work properly.
In my commit message I wondered if the req() in the reactive() might be the cause, but now I'm doubtful. It's all pretty new, I think maybe just wait till 1.6 settles down a bit and there are more SO qs and as to look at?