fdTour: Create an interactive tour of a page.

Description Usage Arguments Examples

Description

This widget makes it easy to create an interactive tour of the various panels on a page of the dashboard. It relies on the http://introjs.com/.

Usage

1
fdTour(steps, options, button = NULL, width = 30, height = 10)

Arguments

steps

list of steps for the tour

options

options for the tour

button

boolean indicating if a tour button should be displayed

width

width of the tour button

height

height of the tour button

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
library(flightdeck)
library(htmltools)

#' Example 1
fit <- rpart::rpart(Species ~ ., data = iris)
actual <- iris$Species
predicted <- predict(fit, type = 'class')

## Clicking on the Alteryx title will trigger an interactive tour of the page.
tour = fdTour(list(
  list(intro = 'Decision Tree'),
  list(
    intro = "This panel displays class-wise performance metrics.",
    element = htmlwidgets::JS("document.querySelector('.box')"),
    numberPosition = "top-right",
    tooltipPosition = "right"
  )
), list(), '.logo-lg', width = 90, height = 30)


fdPanelClassificationMetrics(actual, predicted) %>%
  fdPreviewBoard(title = 'Classification Performance', tour, wrap = 'rowbox')

tourButton <- tags$li(
  tags$a(id = 'tour', href = "#", fdIcon('play'), 'Tour')
)

tour = fdTour(list(
  list(intro = 'Decision Tree'),
  list(
    intro = "This panel displays class-wise performance metrics.",
    element = htmlwidgets::JS("document.querySelector('.box')"),
    numberPosition = "top-right",
    tooltipPosition = "right"
  )
), list(), '#tour', width = 90, height = 30)

fdBoard(
  fdHeader(title = 'Decision Tree', tourButton), 
  fdSidebar(), 
  fdBody(
    fdRowBox(width = 12, fdPanelClassificationMetrics(actual, predicted)), 
    tour
  )
)

alteryx/flightdeck documentation built on May 12, 2019, 1:39 a.m.