Skip to content

Commit 2c68b7d

Browse files
committed
Added an option to specify the theme of the interactive explainer.
1 parent 49df0a1 commit 2c68b7d

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

R/shiny.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#' @param window_title,title,place_holder,minimum_lentgh_error text to be displayed on the page
1010
#' @param minimum_lentgh don't update display if text is shorter than this parameter
1111
#' @param max_feature_to_select up limit to the number of words that can be selected
12-
#'
12+
#' @param shinytheme default is 'superhero'.
1313
#' @rdname interactive_text_explanations
1414
#' @importFrom shiny fluidPage textAreaInput shinyApp sliderInput mainPanel titlePanel hr need validate h1 h2 h3 h4 h5 h6 numericInput selectInput sidebarPanel renderPlot plotOutput
1515
#' @importFrom stringi stri_count_words stri_replace_all_fixed
@@ -49,7 +49,8 @@ interactive_text_explanations <- function(explainer, window_title = "Text model
4949
place_holder = "Put here the text to explain",
5050
minimum_lentgh = 3,
5151
minimum_lentgh_error = "Text provided is too short to be explained (>= 3).",
52-
max_feature_to_select = 20) {
52+
max_feature_to_select = 20,
53+
shinytheme = 'superhero') {
5354
assert_that(is.list(explainer))
5455
assert_that(is.string(window_title))
5556
assert_that(is.string(title))
@@ -67,7 +68,7 @@ interactive_text_explanations <- function(explainer, window_title = "Text model
6768
})
6869

6970
ui <- fluidPage(title = window_title,
70-
theme = shinytheme("superhero"),
71+
theme = shinytheme(shinytheme),
7172
titlePanel(title = title),
7273
hr(),
7374
sidebarPanel(

man/interactive_text_explanations.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)