rintrojs
rintrojs
R topics documented:
introBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
introjs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
introjsUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
readCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Index 7
1
2 introBox
Description
Wrap introBox around elements you want to include in introduction. Use data.step to order the
boxes and data.intro to specify the comment in the introduction
Usage
introBox(
...,
data.step,
data.intro,
data.hint,
data.position = c("bottom", "auto", "top", "left", "right", "bottom",
"bottom-left_aligned", "bottom-middle-aligned", "bottom-right-aligned", "auto")
)
Arguments
... Elements in introduction element
data.step a number indicating its spot in the order in the intro
data.intro text for introduction
data.hint text for clickable hints
data.position position of intro
See Also
introjsUI() introjs()
Examples
## Not run:
library(rintrojs)
library(shiny)
ui <- shinyUI(fluidPage(
introjsUI(), # must include in UI
mainPanel(
introBox(
tableOutput("mtcars"),
data.step = 1,
data.intro = "This is the table"
),
introBox(
actionButton("btn","Intro"),
data.step = 2,
introjs 3
## End(Not run)
Description
Usage
Arguments
session the Shiny session object (from the server function of the Shiny app)
options List of options to be passed to intro.js
events List of text that are the body of a Javascript function. Must wrap in I()
Note
See Also
introjsUI() introBox()
4 introjsUI
Examples
## Not run:
library(rintrojs)
library(shiny)
ui <- shinyUI(fluidPage(
introjsUI(), # must include in UI
mainPanel(
introBox(
tableOutput("mtcars"),
data.step = 1,
data.intro = "This is the table"
),
introBox(
actionButton("btn","Intro"),
data.step = 2,
data.intro = "This is the button",
data.hint = "Here is clue"
)
)))
server <- shinyServer(function(input, output, session) {
## End(Not run)
Description
This function must be called from a Shiny app’s UI in order to use the package.
Usage
introjsUI(includeOnly = FALSE, cdn = FALSE, version = "3.2.1")
Arguments
includeOnly Only include intro.js files. For users who will write their own javascript
readCallback 5
Examples
## Not run:
library(rintrojs)
library(shiny)
shinyApp(
ui = fluidPage(
introjsUI(), # must include in UI
actionButton("btn", "Click me")
),
server = function(input, output, session) {
observeEvent(input$btn, {
intro <- data.frame(element="#btn",
intro="In Codd we trust")
introjs(session, options = list(steps= intro))
})
}
)
## End(Not run)
Description
Reads a JS callback function into rintrojs
Usage
readCallback(funname = c("switchTabs"))
Arguments
funname The name of the function you want to use. Options include:
switchTabs This function is intended to be passed to IntroJs’s onbeforechange
method. It will switch the currently active tab in your Shiny app to be the
one containing the next element in your tour (this function is called by In-
troJs right before it moves to the next element). Try running shiny::runApp(system.file("exampl
package = "rintrojs")) to see an example.
Value
A string containing the body of a callback function
6 readCallback
Examples
## Not run:
introjs(session, events = list(onbeforechange = readCallback("switchTabs")))
## End(Not run)
Index
hintjs (introjs), 3
I(), 3
introBox, 2
introBox(), 3
introjs, 3
introjs(), 2
introjsUI, 4
introjsUI(), 2, 3
readCallback, 5