You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been writing Shiny apps in recent 2 years and learned a lot from scattered places. It will be great to have one book to include all the key ideas.
In my learning experience, I think some good examples can really help readers to understand the concept and apply to their own problems. I also would like to share some of tricks I think are very useful.
My first suggestion of example is based on my two answers in Stackoverflow - Add weblink to actionButton, basically I used actionButton css class for a link, so a link will look like a button. Further more we can make a material button for a link. The key take away in this example is to print the tag function output, explore and set attributes properly.
In customizing css part, it's also worth mentioning the development tools within rstudio or chrome which can work on shiny app directly(you probably have this in mind already).
In reactivity part:
turning on options(shiny.trace = TRUE) is often very helpful(I found the reactive log is often overwhelming and less useful).
data.table modify variable by reference, so if user was using a data.table for reactive value, they need to set it to NULL then update value again to trigger reactive changes.
req is very useful to prevent unwanted error messages or behaviors. However req cannot be used inside data.table bracket like dt[req(var), .N], probably because when req returned Error it was not handled properly inside data.table. req has to be used outside of data.table call.
if the execution order of multiple reactive parts is not working as expected,freezeReactiveValue can be helpful (I found different priority settings never worked for me), but often there is a better design by choosing different reactive variables.
I also have to go through lots of trial and errors in using DT row selection to trigger app behavior, because the row selection event was the slowest in shiny app, which often create problem of updates order in reactive context. I can help to provide some example on this but not sure if there is a need for this kind of usage.
The text was updated successfully, but these errors were encountered:
Thanks for the comments. I think shiny.trace is probably not quite right for this audience, and I think the interaction of shiny and data.table probably deserves its own independent treatment. I'm tracking freezing inputs in #293.
I've been writing Shiny apps in recent 2 years and learned a lot from scattered places. It will be great to have one book to include all the key ideas.
In my learning experience, I think some good examples can really help readers to understand the concept and apply to their own problems. I also would like to share some of tricks I think are very useful.
My first suggestion of example is based on my two answers in Stackoverflow -
Add weblink to actionButton, basically I used actionButton css class for a link, so a link will look like a button. Further more we can make a material button for a link. The key take away in this example is to print the tag function output, explore and set attributes properly.
In customizing css part, it's also worth mentioning the development tools within rstudio or chrome which can work on shiny app directly(you probably have this in mind already).
In reactivity part:
options(shiny.trace = TRUE)
is often very helpful(I found the reactive log is often overwhelming and less useful).freezeReactiveValue
can be helpful (I found different priority settings never worked for me), but often there is a better design by choosing different reactive variables.I also have to go through lots of trial and errors in using DT row selection to trigger app behavior, because the row selection event was the slowest in shiny app, which often create problem of updates order in reactive context. I can help to provide some example on this but not sure if there is a need for this kind of usage.
The text was updated successfully, but these errors were encountered: