magnusdv / forrel

Forensic pedigree analysis and relatedness inference
GNU General Public License v2.0
10 stars 0 forks source link

Saving and restoring configuration / workspace #19

Closed knifecake closed 1 year ago

knifecake commented 5 years ago

Say the user wants to save the configuration of the application so that the next time they want to run the calculations they don't need to import everything again. This would be beneficial for two reasons:

  1. It eliminates repetition and thus errors.
  2. It allows us to add more advanced and extensive options to the program without fear of overwhelming users with settings.

Right now, shiny v0.14 supports bookmarking. Bookmarking makes it very easy for us to save user input (it's really just calling two functions). However, the mechanism that shiny implements for saving is not conventional for desktop applications. Basically, bookmarking works like this:

  1. The user does some work and configures the program to their liking.
  2. The user hits the Bookmark button and the shiny server saves the application state to disk. Then it provides the user with a link.
  3. The user must save the link somewhere to regain access to the configuration they left behin.

Right now, bookmarking has a few shortcomings:

Other forms of saving application state are not straightforward either. Some of the prior problems still apply, namely those that require interaction with the filesystem. Also, because of the reactive programming paradigm of shiny apps, saving/restoring state is not trivial for some input objects.

Note at the end: one way to solve these two problems at once can be to not show the user the URL after saving (can be done by overriding onBookmarked). Instead, when users want to restore a workspace, they would be presented with a modal containing a list of all saved workspaces. This list can be obtained by listing the contents of the directory in which datastores are saved (inst/exclusionPowerUI/shiny_store). Furthermore, we could allow for only one workspace to be saved at a time, thereby also eliminating the problem with too many saved workspaces filling up space.

References

[1] http://shiny.rstudio.com/articles/advanced-bookmarking.html