Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Ergonomic middleware for Shiny applications
Basic Info
- Host: GitHub
- Owner: ixpantia
- License: other
- Language: R
- Default Branch: main
- Homepage: https://ixpantia.github.io/tower/
- Size: 4.51 MB
Statistics
- Stars: 35
- Watchers: 2
- Forks: 3
- Open Issues: 3
- Releases: 1
Metadata Files
README.md
tower
Dead simple middleware for R Shiny.
Summary
tower is a simple library for adding middleware to Shiny applications.
It is inspired by the tower crate for Rust.
It is designed to enable package authors and Shiny developers to extend
Shiny a little bit more than what is usually possible.
You can use tower to add middlewares that forward, modify, or intercept
requests in Shiny applications. This can be useful for adding logging, authentication,
caching, or routing to your Shiny applications.
Installation
You can install the development version of tower from GitHub with:
``` r
install.packages("remotes")
remotes::install_github("ixpantia/tower") ```
Example
We may want to add a new route to our Shiny application that adds a count
to a counter every time a user visits the route. We can do this with tower
by adding a middleware that intercepts the request and increments the counter.
``` r library(shiny) library(tower)
Counter environment
globalcounter <- new.env() globalcounter$count <- 0
Middleware to increment the counter
incrementcounter <- function(req) { globalcounter$count <- globalcounter$count + 1 responsebuilder() |> addbody(paste("Counter is now", globalcounter$count)) |> build_response() }
A very empty Shiny app (not necesarry for the demo)
ui <- fluidPage() server <- function(input, output, session) {}
shinyApp(ui, server) |> createtower() |> addgetroute("/counter", incrementcounter) |> build_tower() ```
If you run the code above and visit the route /counter in your browser,
you will see the counter increment every time you visit the route.
How it works
Basically, tower adds layers to a Shiny application. A layer is a function
that takes a request and returns either a response or NULL. If a layer returns
a response, the response is sent to the client and the request is not forwarded
to the next layer. If a layer returns NULL, the request is forwarded to the next
layer.
Owner
- Name: ixpantia
- Login: ixpantia
- Kind: organization
- Location: Costa Rica
- Website: https://www.ixpantia.com
- Repositories: 10
- Profile: https://github.com/ixpantia
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 1
- Watch event: 19
- Issue comment event: 1
- Push event: 8
- Pull request event: 5
- Fork event: 2
Last Year
- Create event: 1
- Release event: 1
- Issues event: 1
- Watch event: 19
- Issue comment event: 1
- Push event: 8
- Pull request event: 5
- Fork event: 2
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 7
- Total pull requests: 7
- Average time to close issues: about 5 hours
- Average time to close pull requests: about 4 hours
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 0.14
- Average comments per pull request: 0.0
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 3
- Average time to close issues: N/A
- Average time to close pull requests: 1 minute
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- andyquinterom (6)
- jimbrig (1)
Pull Request Authors
- andyquinterom (10)
- maurolepore (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 115 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: tower
Easy Middle Ware Library for 'shiny'
- Homepage: https://github.com/ixpantia/tower
- Documentation: http://cran.r-project.org/web/packages/tower/tower.pdf
- License: MIT + file LICENSE
-
Latest release: 0.2.0
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/checkout v3 composite
- actions/upload-artifact v3 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- compiler * imports
- shiny * suggests
- stringr * suggests
- testthat >= 3.0.0 suggests