iobis / edna-dashboard

0 stars 0 forks source link

Move server code to R files and source #4

Open silasprincipe opened 3 weeks ago

silasprincipe commented 3 weeks ago

I suggest to move all server code to separate R files, so it is easier to edit/maintain.

As soon as you structure each section, copy all the server code for that particular section to a separate R file and save into R with the same name as the section "_server" (e.g. diversity_server.R) or if in multiple pieces something intuitive (diversity_server_plots.R; diversity_server_table.R). I will do that now for the home.

Once you have transferred the code to a separate R file, just put this in place:

source("R/home_server.R", local = TRUE)

silasprincipe commented 3 weeks ago

Code that affects multiple pages could be named server_'action'.R. For example, I created a server_updategeography.R that updates all the inputs across pages.