Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nstrayer/shinyswipr
An R Shiny module to put swiping interfaces in your app!
https://github.com/nstrayer/shinyswipr
Last synced: 2 days ago
JSON representation
An R Shiny module to put swiping interfaces in your app!
- Host: GitHub
- URL: https://github.com/nstrayer/shinyswipr
- Owner: nstrayer
- Created: 2017-03-12T22:50:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T18:38:30.000Z (over 7 years ago)
- Last Synced: 2024-10-11T11:02:25.594Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://livefreeordichotomize.com/2017/03/12/introducing-shinyswipr-swipe-your-way-to-a-great-shiny-ui/
- Size: 35.2 KB
- Stars: 13
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - nstrayer/shinyswipr - An R Shiny module to put swiping interfaces in your app! (JavaScript)
README
## Note:
This particular repo is no longer maintained and has been merged into the larger R package for data-collection with shiny, [shinysense](https://github.com/nstrayer/shinysense). Nothing has changed other than the library called in the begining of your app.
---
# shinyswipr
A simple Shiny module for putting swipe based interfaces into shiny apps. Ever felt like Shiny wasn't "tinder-y" enough? Well here you go.
---
### Installation
This package is currently not on CRAN so the only way to install it is using github.
```r
devtools::install_github("nstrayer/shinyswipr")
```---
### Usage
Two functions are exported by this package: `shinySwiprUI` and `shinySwipr`. These two must be used in conjunction with each other in both the `ui` and `server` of your shiny app respectively.
`shinySwiprUI` allows you to pass any other UI elements to it, it will then wrap those UI elements in a card interface that can be swiped.
A simple app that displays a card and prints to the R console your swipe result would go as follows.
```r
library(shinyswipr)
ui <- fixedPage(
shinySwiprUI( "my_swiper",
h4("Swipe Me!"),
hr(),
p("This is some content that would warrent a good swipe")
)
)server <- function(input, output, session) {
card_swipe <- callModule(shinySwipr, "my_swiper")observeEvent( card_swipe(),{
print(card_swipe) #show last swipe result.
})
}
```