15.5 R does too much
15.5.1 Rendering the UI from the server side
Change things on the UI based on what happens in the server:
A. Implement UI events in JavaScript
Adding JavaScript elements would speed up the process, as well as substituting uiOutput()
and renderUI()
with more direct functions, for example if requested is a text use: textOutput("...")
instead of the whole uiOutput().
And in the server renderText(...)
instead of renderUI()
.
(compare cac_6 to cac_7)
B. update* inputs
Same as using selectInput(...)
and updateSelectInput(...)
C. insertUI and removeUI
Dynamically change what is in the UI is with insertUI()
and removeUI()
To make the code simpler for the developer and to make an app which is easier to use from a user perspective, there are some strategies that suggest to avoid some common functions, such as: uiOutput()
and renderUI()
.
In general what is happening is that we change things on the UI based on what happens in the server, and for making R not regenerate the whole UI component but only changing what is needed, we can: