MyNixOS website logo
Description

Glide Component for Shiny Applications.

Insert Glide JavaScript component into Shiny applications for carousel or assistant-like user interfaces.

shinyglide

Lifecycle: stable CRAN status CRAN downloads R build status

shinyglide is an R package which provides carousel-like or assistant-like components to shiny applications, thanks to the Glide JavaScript library.

It allows to create this sort of app (live example) :

presentation

Or can be integrated into an existing app to create an "assistant-like" interface (live example):

modal

Features

  • Responsive, navigation by mouse, keyboard, swiping
  • Controls are completely customizable (live example)
  • Next and Back controls can be disabled until an input condition is met (same syntax as shiny::conditionalPanel)
  • "Screens" can be generated or hidden depending on user inputs. Loading time are taken into accounts (disabled Next button and customizable animation)
  • Integration with Shiny modal dialogs (live example)
  • Multiple glides per app (live example)

Installation

You can install the stable version with :

install.packages("shinyglide")

And the development version with :

remotes::install_github("juba/shinyglide")

Usage

A shinyglide component is created with the glide() function. This component is then divided intro screens with the screen() function.

Here is the code of a very basic app (live example):

library(shiny)
library(shinyglide)

ui <- fixedPage(style = "max-width: 500px;",
  titlePanel("Simple shinyglide app"),

  glide(
    height = "350px",
    screen(
      p("This is a very simple shinyglide application."),
      p("Please click on Next to go to the next screen.")
    ),
    screen(
      p("Please choose a value."),
      numericInput("n", "n", value = 10, min = 10)
    ),
    screen(
      p("And here is the result."),
      plotOutput("plot")
    )
  )
)


server <- function(input, output, session) {

  output$plot <- renderPlot({
    hist(
      rnorm(input$n),
      main = paste("n =", input$n),
      xlab = ""
    )
  })

}

shinyApp(ui, server)

For more information, see the three available vignettes :

Development notes

This package uses packer to manage JavaScript source code and dependencies. If you want to modify it, you'll need a working installation of Node.js.

After cloning this repository, run the following in a terminal at the project root :

npm install

Then, if you modify the JavaScript code in srcjs, you'll have to run the following command to bundle and update the widget JavaScript code :

packer::bundle_dev()

If you want to ship a minimized production version, use :

packer::bundle_prod()

Credits

Metadata

Version

0.1.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows