Skip to content
Give a tour of your Shiny app
R JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R has next Nov 24, 2019
docs
inst
man has next Nov 24, 2019
.DS_Store initialise and highlight added Nov 22, 2019
.Rbuildignore website init Nov 22, 2019
.gitignore
.travis.yml
DESCRIPTION
LICENSE
LICENSE.md init Nov 21, 2019
NAMESPACE remove initilize to avoid clash with {methods} Nov 22, 2019
README.md website init Nov 22, 2019
appveyor.yml website init Nov 22, 2019

README.md

cicerone

Travis build status

A convenient API to create guided tours of Shiny applications using driver.js.

Installation

You can install {cicerone} from Github with:

# install.packages("remotes")
remotes::install_github("JohnCoene/cicerone")

Usage

Let's create a very basic Shiny app to demonstrate: it takes a text input and on hitting a button simply prints it.

library(shiny)

ui <- fluidPage(
  textInput("text_inputId", "Enter some text"),
  actionButton("submit_inputId", "Submit text"),
  verbatimTextOutput("print")
)

server <- function(input, output){
  txt <- eventReactive(input$submit_inputId, {
    input$text_inputId
  })

  output$print <- renderPrint(txt())
}

shinyApp(ui, server)

Now we can create a guide to walk the user through the application: simply initialise a new guide from the Cicerone object then add steps.

library(cicerone)

guide <- Cicerone$
  new()$ 
  step(
    el = "text_inputId",
    title = "Text Input",
    description = "This is where you enter the text you want to print."
  )$
  step(
    "submit_inputId",
    "Send the Text",
    "Send the text to the server for printing"
  )

This is our guide created, we can now include it the Shiny app we created earlier and start the guide. Note to that you need to include use_cicerone in your UI.

library(shiny)

ui <- fluidPage(
  use_cicerone(), # include dependencies
  textInput("text_inputId", "Enter some text"),
  actionButton("submit_inputId", "Submit text"),
  verbatimTextOutput("print")
)

server <- function(input, output){

  # initialise then start the guide
  guide$init()$start()

  txt <- eventReactive(input$submit_inputId, {
    input$text_inputId
  })

  output$print <- renderPrint(txt())
}

shinyApp(ui, server)

All options are detailed in the documentation of the object: ?Cicerone. See the post for more information and some rambling on the logo and package name.

You can’t perform that action at this time.