Giter Club home page Giter Club logo

shinysense's Introduction

shinysense

A series of shiny modules to help shiny sense the world around it.

It's called shinysense because shinyinputs seemed kinda lame.

How do I use it?

shinysense is not currently on CRAN. To install it use the devtools github function.

devtools::install_github("nstrayer/shinysense")

Once the app is installed just included it in your shiny app the way you usually would:

#my super cool shiny app
library(shiny)
library(shinysense)

There currently is no website for the documentation to reside in, but all the functions are documented. To figure out how to use these see the demo code posted below or just in R do the standard documentation search.

#I have no idea how these ridiculous functions work!
?shinydrawr
?shinydrawrUI
#oh, I still have no idea.

Senses present:

shinyswipr

Embeds a card that can be swiped in different directions, the swipe direction is returned to shiny. Demo. Code

# ui.R
shinyswiprUI( 
  "quote_swiper",
  div( 
    # Content can be any ui elements you want. 
    textOutput("quote")
  )
)

# server.R
# Reactive function containing swipe direction as character 
# card_swipe() == 'Up' etc. 
card_swipe <- callModule(shinyswipr, "quote_swiper")

shinydrawr

Draws a line chart that obscures the end of the results, the user then draws what they think the rest of the chart is and then the rest of the chart is revealed. Demo. Code.

# ui.R
shinydrawrUI("outbreak_stats")

# server.R
drawChart <- callModule(
    shinydrawr,
    "outbreak_stats",
    data = data,
    draw_start = cutoff,
    x_key = "time",
    y_key = "metric"
  )

shinyearr

Records audio on a button press and returns the fast-fourier transformed signal to the server.

Demo. Code.

# ui.R
shinyearrUI("my_recorder")

# server.R
recorder <- callModule(shinyearr, "my_recorder")

shinyviewr

Record images from a webcam.

Demo. Code.

#ui.R
shinyviewrUI("myCamera", height = '200px'))

#server.R
myCamera <- callModule(shinyviewr,"myCamera", outputWidth = 500, outputHeight = 500)

shinymovr

Capture and return accelerometer data from your phone or tablet.

Demo. Code.

# ui.R
shinymovrUI("movr_button")

# server.R
  movement <- callModule(
    shinymovr, "movr_button",
    time_limit = 2,
    recording_message = "RECORDING!"
  )

Helpers

  • shinypopup : A lot of times when you're developing an app using the above senses you need to let your user's know you're collecting their data. This module creates a popup that obscures a given section of your app that forces the user to accept your terms before they can go any further.
    • Used in papr to force people to accept our data use agreement.
    • Demo. Code.

Nothing works, what do I do?

The probability of there being bugs in these functions is unfortunately high. If you've found one I would be delighted if you could file a new issue here. I'll try my best to at least respond.

shinysense's People

Contributors

nstrayer avatar muschellij2 avatar 1wheel avatar carlescg avatar

Watchers

James Cloos avatar Mahesh Kulkarni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.