You are currently browsing the tag archive for the ‘shiny’ tag.

Shiny v0.10.2 has been released to CRAN. To install it:

install.packages('shiny')

This version of Shiny requires R 3.0.0 or higher (note the current version of R is 3.1.1). R 2.15.x is no longer supported.

Here are the most prominent changes:

  • File uploading via fileInput() now works for Internet Explorer 8 and 9. Note, however, that IE 8/9 do not support multiple files from a single file input. If you need to upload multiple files, you must use one file input for each file. Unlike in modern web browsers, no progress bar will display when uploading files in IE 8/9.
  • Shiny now supports single-file applications: instead of needing two separate files, server.R and ui.R, you can now create an application with single file named app.R. This also makes it easier to distribute example Shiny code, because you can run an entire app by simply copying and pasting the code for a single-file app into the R console. Here’s a simple example of a single-file app:
    ## app.R
    server <- function(input, output) {
      output$distPlot <- renderPlot({
        hist(rnorm(input$obs), col = 'darkgray', border = 'white')
      })
    }
    
    ui <- shinyUI(fluidPage(
      sidebarLayout(
        sidebarPanel(
          sliderInput("obs", "Number of observations:",
                      min = 10, max = 500, value = 100)
        ),
        mainPanel(plotOutput("distPlot"))
      )
    ))
    
    shinyApp(ui = ui, server = server)
    

    See the single-file app article for more.

  • We’ve added progress bars, which allow you to indicate to users that something is happening when there’s a long-running computation. The progress bar will show at the top of the browser window, as shown here:progress
    Read the progress bar article for more.
  • We’ve upgraded the DataTables Javascript library from 1.9.4 to 1.10.2. We’ve tried to support backward compatibility as much as possible, but this might be a breaking change if you’ve customized the DataTables options in your apps. This is because some option names have changed; for example, aLengthMenu has been renamed to lengthMenu. Please read the article on DataTables on the Shiny website for more information about updating Shiny apps that use DataTables 1.9.4.

In addition to the changes listed above, there are some smaller updates:

  • Searching in DataTables is case-insensitive and the search strings are not treated as regular expressions by default now. If you want case-sensitive searching or regular expressions, you can use the configuration options search$caseInsensitive and search$regex, e.g. renderDataTable(..., options = list(search = list(caseInsensitve = FALSE, regex = TRUE))).
  • Shiny has switched from reference classes to R6.
  • Reactive log performance has been greatly improved.
  • Exported createWebDependency. It takes an htmltools::htmlDependency object and makes it available over Shiny’s built-in web server.
  • Custom output bindings can now render htmltools::htmlDependency objects at runtime using Shiny.renderDependencies().

Please read the NEWS file for a complete list of changes, and let us know if you have any comments or questions.

Are you headed to Strata? It’s just around the corner!

We particularly hope to see you at R Day on October 15, where we will cover a raft of current topics that analysts and R users need to pay attention to. The R Day tutorials come from Hadley Wickham, Winston Chang, Garrett Grolemund, J.J. Allaire, and Yihui Xie who are all working on fascinating new ways to keep the R ecosystem apace of the challenges facing those who work with data.

If you plan to stay for the full Strata Conference+Hadoop World be sure to look us up in the Innovator Pavilion booth P14 during the Expo Hall hours. We’ll have the latest books from RStudio authors and “shiny” t-shirts to win. Share with us what you’re doing with RStudio and get your product and company questions answered by RStudio employees.

See you in New York City!

ShinyApps.io dashboard

Some of the most innovative Shiny apps share data across user sessions. Some apps share the results of one session to use in future sessions, others track user characteristics over time and make them available as part of the app.

This level of sophistication creates tricky design choices when you host your app on a server. A nimble server will open new instances of your app to speed up performance, or relaunch your app on a bigger server when it becomes popular. How should you ensure that your app can find and use its data trail along the way?

Shiny Server developer Jeff Allen explains the best ways to share data between sessions in Share data across sessions with ShinyApps.io, a new article at the Shiny Dev Center.

Shiny v0.10.1 has been released to CRAN. You can either install it from a CRAN mirror, or update it if you have installed a previous version.

install.packages('shiny', repos = 'http://cran.rstudio.com')
# or update your installed packages
# update.packages(ask = FALSE, repos = 'http://cran.rstudio.com')

The most prominent change in this patch release is that we added full Unicode support on Windows. Shiny apps running on Windows must use the UTF-8 encoding for ui.R and server.R (also the optional global.R, README.md, and DESCRIPTION) if they contain non-ASCII characters. See this article for details and examples: http://shiny.rstudio.com/articles/unicode.html

Chinese characters in a shiny app

Chinese characters in a shiny app

Please note although we require UTF-8 for the app components, UTF-8 is not a general requirement for any other files. If you read/write text files in an app, you are free to use any encoding you want, e.g. you can readLines('foo.txt', encoding = 'Windows-1252'). The article above has explained it in detail.

Other changes include:

  • runGitHub() also allows the 'username/repo' syntax now, which is equivalent to runGitHub('repo', 'username'). (#427)
  • navbarPage() now accepts a windowTitle parameter to set the web browser page title to something other than the title displayed in the navbar.
  • Added an inline argument to textOutput(), imageOutput(), plotOutput(), and htmlOutput(). When inline = TRUE, these outputs will be put in span() instead of the default div(). This occurs automatically when these outputs are created via the inline expressions (e.g. `r renderText(expr)`) in R Markdown documents. See an R Markdown example at http://shiny.rstudio.com/gallery/inline-output.html (#512)
  • Added support for option groups in the select/selectize inputs. When the choices argument for selectInput()/selectizeInput() is a list of sub-lists and any sub-list is of length greater than 1, the HTML tag <optgroup> will be used. See an example at here (#542)

Please let us know if you have any comments or questions.

Shiny apps use an HTML interface, which means that you can change the visual appearance of your apps quickly and simply with CSS files. Would you like to know how? I posted a new article that will step you through the options at the Shiny Dev Center. Check it out here.

Image

We are happy to announce the availability of v1.1 of RStudio Shiny Server Pro, our commercial server for deploying Shiny applications.  In this release we took your feedback and made it easier for you to integrate Shiny Server Pro into your production environments.  With Shiny Server Pro v1.1 you now can:

  • Control access to your applications with Google Authentication (OAuth2).
  • Create sessions and authenticate with PAM (auth_pam and pam_sessions_profile).
  • Set the version of R that is used per application and/or per user
  • Customize page templates for directory listings and error pages.
  • Monitor service health and get additional metrics with a new health check endpoint.
  • Provide custom environment variables to a Shiny process using Bash profiles
  • Configure apps to run using the authenticated user’s account with custom environment variables from Bash or PAM
  • Launch Shiny apps with a prefix command such as ‘nice’ allowing you to prioritize compute resources per application or  per user

If you haven’t tried Shiny Server Pro yet, download a copy here.

 

Follow

Get every new post delivered to your Inbox.

Join 700 other followers