Skip to content

Commit

Permalink
version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Joedean31 authored and cran-robot committed Nov 3, 2022
1 parent 32831de commit 023b605
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 50 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
@@ -1,7 +1,7 @@
Package: shinyStorePlus
Type: Package
Title: Secure in-Browser Storage for 'Shiny' Inputs and Variables
Version: 0.6
Version: 0.7
Authors@R: c(
person("Obinna", "Obianom", email = "idonshayo@gmail.com", role = c("aut", "cre")))
Maintainer: Obinna Obianom <idonshayo@gmail.com>
Expand All @@ -16,9 +16,9 @@ Encoding: UTF-8
VignetteBuilder: knitr
Language: en-US
LazyData: false
RoxygenNote: 7.1.1
RoxygenNote: 7.2.1
NeedsCompilation: no
Packaged: 2022-08-10 12:24:01 UTC; in198
Packaged: 2022-11-03 06:40:27 UTC; in198
Author: Obinna Obianom [aut, cre]
Repository: CRAN
Date/Publication: 2022-08-14 07:20:02 UTC
Date/Publication: 2022-11-03 07:02:22 UTC
28 changes: 14 additions & 14 deletions MD5
@@ -1,27 +1,27 @@
2481d2409973c27ceb65fd4b5b7bae67 *DESCRIPTION
eeeeb071d6ffb1d31e7e91ad7d469b6d *DESCRIPTION
8ab64ed62f653af571a1146937596c7b *LICENSE
913d2b2d04b1a803ef08e32379590342 *NAMESPACE
4862fe40c6dabcdbf91b4a15ba94c9eb *NEWS.md
e07c6482b87174d042a4a29bd33cdb89 *R/clearStore.R
0e7e23011962a7414284e339e28f7bfb *NEWS.md
c54735e0f89a76de59a673f067f54975 *R/clearStore.R
6491bcb5e842a1e9ef27d089c8db78f4 *R/includes.R
b2d88a73fce68d7081e809cfad6201ac *R/seeex.R
ec0afb29be0a19c986ba17305c9a133e *R/setup.R
e7ef715812096ac548e68679330972a0 *R/setup.R
3cc7900c579f0864ee1ebb0e3a2e88be *R/zzz.R
94ae94750cf7bcb86e691e57c1570664 *README.md
3ec354e925106948c0596be396d18f50 *README.md
eef067cf7c16eca9d4f059e8ae26fcba *build/vignette.rds
b0979064b15697f4ad2de09c8629d903 *inst/doc/introduction_to_shinystoreplus.R
4e69ea1b1f26f7405eac36c48a61824e *inst/doc/introduction_to_shinystoreplus.Rmd
275e5d1af5bb2a4aff31131d90fe0968 *inst/doc/introduction_to_shinystoreplus.html
c1b9bcfa41e67b6af742912ea6fd727a *inst/doc/introduction_to_shinystoreplus.html
37fac86ba6186694ee58246ce9ec4b30 *inst/doc/using_shinystoreplus.R
d4be2b92c7b7ab35940b9f85267e3878 *inst/doc/using_shinystoreplus.Rmd
bc50dd5f5b290de2a3d4541c081d3520 *inst/doc/using_shinystoreplus.html
290494a6bc4cf815c70cc627bf308dad *inst/example/server.R
67cf15370ef675c358e6516af3f2ad56 *inst/example/ui.R
7c558fca03fffda9cc6795f85a15a464 *inst/doc/using_shinystoreplus.Rmd
b4be2edf612988722a05c884d20c6691 *inst/doc/using_shinystoreplus.html
18c5ced14b1183559255f42e12f7f154 *inst/example/server.R
8caee1f58c11a5f85d0382ad5abdf042 *inst/example/ui.R
a259c8d46c354b2a3be505905e603142 *inst/scripts/dexie.js
741202a777c6c9ddd34a5cfd3d11d480 *inst/scripts/shinystoreplus.js
3a8c0cc41a612a7dd6b63d40f427bf9b *man/clearStore.Rd
1392b9013f7cdf8a5ea38bb383f58000 *inst/scripts/shinystoreplus.js
e0816ea380cc8cc584a7fc27ab0f67ff *man/clearStore.Rd
a444e5f35413dd6c929c34b89ffc3548 *man/initStore.Rd
87a6ef70c257db08f52d5135c3850d12 *man/seeexample.Rd
8c0f0f08e9c0ae6f27c15ae369c2ddcb *man/setupStorage.Rd
6b4902e6bcb862812ea4b05c86bb27c8 *man/setupStorage.Rd
4e69ea1b1f26f7405eac36c48a61824e *vignettes/introduction_to_shinystoreplus.Rmd
d4be2b92c7b7ab35940b9f85267e3878 *vignettes/using_shinystoreplus.Rmd
7c558fca03fffda9cc6795f85a15a464 *vignettes/using_shinystoreplus.Rmd
19 changes: 17 additions & 2 deletions NEWS.md
@@ -1,8 +1,23 @@
# shinyStorePlus 0.6
# shinyStorePlus 0.8
--------------------------------------------------------------------------
## Planned Features

- [x] Store all outputs automatically
- [ ] Store specific variables
- [ ] Retrieve all stored specific variables & outputs
- [ ] An updated example of the package in action

# shinyStorePlus 0.7
--------------------------------------------------------------------------
## Planned Features

- [x] Bug fix on clearStore

# shinyStorePlus 0.6
----------------------------------------------------------------------------
## Features

- [x] Store all or some inputs automatically
- [x] Store inputs automatically
- [x] Retrieve all stored inputs
- [x] Clear Storage of all inputs
- [x] An example of the package in action
9 changes: 3 additions & 6 deletions R/clearStore.R
Expand Up @@ -3,6 +3,7 @@
#' Remove all stored inputs of an application
#'
#' @param appId the application identification
#' @param session session object
#'
#' @note Ensure not to use this function when the inputs are intended to be tracked.
#' @return No return value, called for side effects
Expand Down Expand Up @@ -30,10 +31,6 @@
#' @export
#'

clearStore <- function(appId) {
envir <- parent.frame()
envir$session$sendCustomMessage(
"clearStorage",
appId
)
clearStore <- function(appId, session = getDefaultReactiveDomain()) {
session$sendCustomMessage("clearStorage", appId)
}
2 changes: 1 addition & 1 deletion R/setup.R
Expand Up @@ -29,7 +29,7 @@
#' textInput(
#' "caption",
#' "simple caption:",
#' "summary, try editing"
#' "try editing - r2resize pkg"
#' ),
#' numericInput("obs",
#' "sample observations:",
Expand Down
21 changes: 17 additions & 4 deletions README.md
@@ -1,18 +1,31 @@
# shinyStorePlus R package

__Official docs link:__ [shinystoreplus.obi.obianom.com](https://shinystoreplus.obi.obianom.com/articles/using_shinystoreplus.html)
__Official docs link:__ [shinystoreplus.obi.obianom.com](https://shinystoreplus.obi.obianom.com/articles/using_shinystoreplus.html) | [View Demo Shiny App](https://r2apps.shinyapps.io/shinystoreplus)

In-browser storage for Shiny persistent, synchronized data from the inputs using IndexedDB
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/shinyStorePlus)](https://cran.r-project.org/package=shinyStorePlus) [![](https://cranlogs.r-pkg.org/badges/grand-total/shinyStorePlus)](https://cran.r-project.org/package=shinyStorePlus) [![](https://rpkg.net/pub-age/shinyStorePlus)](https://rpkg.net/package/shinyStorePlus)

In-browser storage for Shiny persistent, synchronized data from the inputs using IndexedDB

There has been tremendous contribution from the R community on the topic of storing Shiny data and re-using them within an application. The current solutions include Dropbox, Amazon s3, Googlesheets, SQLite, MongoDB and so on. However, a problem with these methods is that it takes a number of steps in order to correctly program your Shiny application for them. More so, the owner of the accounts may need to consistently monitor the storage accounts to ensure that it is not expire or that the data storage is not exhausted.

__So let's face it. When you build a shiny app that allows a user to change inputs and see the results immediately, guess what the user is itching to have?? The ability to change the inputs and when they refresh or reopen the shiny app at a later time, still see the inputs they previously entered. Well, <code>shinyStorePlus R package</code> gives that!__
__So let's face it. When you develop a shiny app that allows a user to change inputs and see the results immediately, guess what the user is itching to have?? The ability to change the inputs and when they refresh or reopen the shiny app at a later time, still see the inputs they previously entered. Well, <code>shinyStorePlus R package</code> gives that!__

![](https://shinystoreplus.obi.obianom.com/shinystoreplus-2.png)

## Installation and Usage

### Install

`install.packages(shinyStorePlus)`
```{r shinyStorePlus}
# From CRAN
install.packages(shinyStorePlus)
# OR from Github
library(devtools)
install_github("oobianom/shinyStorePlus")
```

### Usage

Expand Down
4 changes: 2 additions & 2 deletions inst/doc/introduction_to_shinystoreplus.html
Expand Up @@ -12,7 +12,7 @@

<meta name="author" content="Obinna N. Obianom" />

<meta name="date" content="2022-08-10" />
<meta name="date" content="2022-11-03" />

<title>shinyStorePlus: An in-browser secure storage for persistent and synchronized data from the Shiny inputs using IndexedDB</title>

Expand Down Expand Up @@ -336,7 +336,7 @@ <h1 class="title toc-ignore">shinyStorePlus: An in-browser secure
storage for persistent and synchronized data from the Shiny inputs using
IndexedDB</h1>
<h4 class="author">Obinna N. Obianom</h4>
<h4 class="date">2022-08-10</h4>
<h4 class="date">2022-11-03</h4>



Expand Down
8 changes: 5 additions & 3 deletions inst/doc/using_shinystoreplus.Rmd
Expand Up @@ -17,6 +17,8 @@ knitr::opts_chunk$set(

## Introduction

__Create a shiny app such that when a user refreshed the app, they can still see the input they entered.__

Integrating the shinyStorePlus package into your already developed application is very simple and can be accomplished in just few lines of code. Neat, right?

Well, get started ...
Expand Down Expand Up @@ -153,7 +155,7 @@ shinyApp(ui = ui, server = server)
```


## Step 2: Initialize by including the scripts required for processing the stores
## Step 3: Initialize by including the scripts required for processing the stores

You must initialize for the package to work. Its as simple as inserting the function below within the <code>fluidPage()</code>

Expand Down Expand Up @@ -226,7 +228,7 @@ if (interactive()) {



## Step 3: Setup storage in the server function
## Step 4: Setup storage in the server function

Setup the stores by declaring a unique app id and including this in the setup function as shown below

Expand Down Expand Up @@ -303,7 +305,7 @@ if (interactive()) {
```

## Step 4: Run the final code
## Step 5: Run the final code

Paste the final R code into your console and run. Change several inputs when the application loads, see the effect. Now, refresh the page. You should see that your previous inputs are preserved.

Expand Down
18 changes: 10 additions & 8 deletions inst/doc/using_shinystoreplus.html
Expand Up @@ -12,7 +12,7 @@

<meta name="author" content="Obinna N. Obianom" />

<meta name="date" content="2022-08-10" />
<meta name="date" content="2022-11-03" />

<title>Integrating the shinyStorePlus R package into Shiny applications</title>

Expand Down Expand Up @@ -335,12 +335,14 @@
<h1 class="title toc-ignore">Integrating the shinyStorePlus R package
into Shiny applications</h1>
<h4 class="author">Obinna N. Obianom</h4>
<h4 class="date">2022-08-10</h4>
<h4 class="date">2022-11-03</h4>



<div id="introduction" class="section level2">
<h2>Introduction</h2>
<p><strong>Create a shiny app such that when a user refreshed the app,
they can still see the input they entered.</strong></p>
<p>Integrating the shinyStorePlus package into your already developed
application is very simple and can be accomplished in just few lines of
code. Neat, right?</p>
Expand Down Expand Up @@ -465,8 +467,8 @@ <h2>Step 2: Install and attach the <code>shinyStorePlus</code> R
<span id="cb2-51"><a href="#cb2-51" aria-hidden="true" tabindex="-1"></a><span class="fu">shinyApp</span>(<span class="at">ui =</span> ui, <span class="at">server =</span> server)</span>
<span id="cb2-52"><a href="#cb2-52" aria-hidden="true" tabindex="-1"></a>}</span></code></pre></div>
</div>
<div id="step-2-initialize-by-including-the-scripts-required-for-processing-the-stores" class="section level2">
<h2>Step 2: Initialize by including the scripts required for processing
<div id="step-3-initialize-by-including-the-scripts-required-for-processing-the-stores" class="section level2">
<h2>Step 3: Initialize by including the scripts required for processing
the stores</h2>
<p>You must initialize for the package to work. Its as simple as
inserting the function below within the <code>fluidPage()</code></p>
Expand Down Expand Up @@ -531,8 +533,8 @@ <h2>Step 2: Initialize by including the scripts required for processing
<span id="cb3-57"><a href="#cb3-57" aria-hidden="true" tabindex="-1"></a> <span class="fu">shinyApp</span>(<span class="at">ui =</span> ui, <span class="at">server =</span> server)</span>
<span id="cb3-58"><a href="#cb3-58" aria-hidden="true" tabindex="-1"></a>}</span></code></pre></div>
</div>
<div id="step-3-setup-storage-in-the-server-function" class="section level2">
<h2>Step 3: Setup storage in the server function</h2>
<div id="step-4-setup-storage-in-the-server-function" class="section level2">
<h2>Step 4: Setup storage in the server function</h2>
<p>Setup the stores by declaring a unique app id and including this in
the setup function as shown below</p>
<p><code>appid = &quot;applicatio32n501&quot;</code>
Expand Down Expand Up @@ -601,8 +603,8 @@ <h2>Step 3: Setup storage in the server function</h2>
<span id="cb4-61"><a href="#cb4-61" aria-hidden="true" tabindex="-1"></a> <span class="fu">shinyApp</span>(<span class="at">ui =</span> ui, <span class="at">server =</span> server)</span>
<span id="cb4-62"><a href="#cb4-62" aria-hidden="true" tabindex="-1"></a>}</span></code></pre></div>
</div>
<div id="step-4-run-the-final-code" class="section level2">
<h2>Step 4: Run the final code</h2>
<div id="step-5-run-the-final-code" class="section level2">
<h2>Step 5: Run the final code</h2>
<p>Paste the final R code into your console and run. Change several
inputs when the application loads, see the effect. Now, refresh the
page. You should see that your previous inputs are preserved.</p>
Expand Down
3 changes: 3 additions & 0 deletions inst/example/server.R
Expand Up @@ -18,6 +18,9 @@ server <- function(input, output, session) {
appid = "application501"
setupStorage(appId = appid,inputs = TRUE)

observeEvent(input$clear1,{
clearStore(appId = appid)
})

}

1 change: 1 addition & 0 deletions inst/example/ui.R
Expand Up @@ -32,6 +32,7 @@ ui <- fluidPage(
label = "Number of observations to view:",
value = 10
),
actionButton("clear1","Clear saved inputs"),
textAreaInput("sure", "label textara", "nothing"),
radioButtons("radi45o", "radioed", c("Obianom", "Obinna")),
radioButtons("retired", "radioed", c("juice", "rock", "angelo")),
Expand Down

0 comments on commit 023b605

Please sign in to comment.