shinyhttr v1.0.0

0

Monthly downloads

0th

Percentile

Progress Bars for Downloads in 'shiny' Apps

Modifies the progress() function from 'httr' package to let it send output to progressBar() function from 'shinyWidgets' package. It is just a tweak at the original functions from 'httr' package to make it smooth for 'shiny' developers.

Readme

shinyhttr

Travis build
status AppVeyor build
status CRAN
status

The goal of shinyhttr is to integrate httr::progress with shinyWidgets::progressBar.

In practice, the difference will be

# from this
httr::GET("http://download.com/large_file.txt", 
          progress())


# to this
httr::GET("http://download.com/large_file.txt", 
          progress(session, id = "my_progress_bar1"))

gif\_progress\_example.gif

Installation

From CRAN:

install.packages("shinyhttr")

From github:

devtools::install_github("curso-r/shinyhttr")

Example

library(shiny)
library(shinyWidgets)
library(httr)
library(shinyhttr)

ui <- fluidPage(

  sidebarLayout(

    NULL,

    mainPanel(
      actionButton('download', 'Download 100MB file...'),
      tags$p("see R console to compare both progress bars."),
      progressBar(
        id = "pb",
        value = 0,
        title = "",
        display_pct = TRUE
      )
    )
  )
)

server <- function(input, output, session) {
  observeEvent(input$download, {
    GET(
      url = "https://speed.hetzner.de/100MB.bin",
      shinyhttr::progress(session, id = "pb") # <- the magic happens here. progress() now has session and id args
    )
  })
}

shinyApp(ui, server)

Functions in shinyhttr

Name Description
progress Add a progress bar compatible with `shinyWidgets::updateProgressBar()`.
progress_bar progress_bar
runExample runExample
No Results!

Last month downloads

Details

Type Package
License MIT + file LICENSE
BugReports https://github.com/curso-r/shinyhttr/issues
URL https://github.com/curso-r/shinyhttr
Encoding UTF-8
LazyData true
RoxygenNote 6.1.1
NeedsCompilation no
Packaged 2019-03-19 03:44:52 UTC; ap_da
Repository CRAN
Date/Publication 2019-03-22 17:10:42 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/shinyhttr)](http://www.rdocumentation.org/packages/shinyhttr)