-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: shinywb | ||
Title: 'WinBox' Window for 'shiny' Applications | ||
Version: 0.0.0.9140 | ||
Version: 0.0.0.9200 | ||
Authors@R: c( | ||
person("Victor", "Perrier", , "[email protected]", role = c("aut", "cre")), | ||
person("Fanny", "Meyer", role = "aut"), | ||
|
@@ -14,7 +14,7 @@ Description: Interface to 'WinBox' 'JavaScript' library to use in 'shiny' applic | |
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.1.2 | ||
RoxygenNote: 7.3.1 | ||
Imports: | ||
htmltools, | ||
shiny |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
library(shiny) | ||
library(shinywb) | ||
library(htmltools) | ||
library(phosphoricons) | ||
|
||
|
||
ui <- fluidPage( | ||
html_dependency_winbox(), | ||
actionButton(inputId = "show", label = "Show one or more WinBox"), | ||
radioButtons( | ||
inputId = "background", | ||
label = "Background color:", | ||
choices = c("forestgreen", "firebrick", "steelblue", "goldenrod") | ||
), | ||
checkboxInput( | ||
inputId = "modal", | ||
label = "Shows the window as modal", | ||
value = FALSE | ||
), | ||
checkboxInput( | ||
inputId = "autosize", | ||
label = "Automatically size the window to fit the window contents.", | ||
value = FALSE | ||
), | ||
checkboxInput( | ||
inputId = "max", | ||
label = "Automatically toggles the window into maximized state when created.", | ||
value = FALSE | ||
), | ||
checkboxInput( | ||
inputId = "min", | ||
label = "Automatically toggles the window into minimized state when created.", | ||
value = FALSE | ||
) | ||
) | ||
|
||
server <- function(input, output, session) { | ||
|
||
observeEvent(input$show, { | ||
WinBox( | ||
title = "This is a WinBox", | ||
ui = tagList( | ||
tags$h3("Hello from WinBox!") | ||
), | ||
options = wbOptions( | ||
background = input$background, | ||
modal = input$modal, | ||
autosize = input$autosize, | ||
max = input$max, | ||
min = input$min | ||
) | ||
) | ||
}) | ||
|
||
} | ||
|
||
if (interactive()) | ||
shinyApp(ui, server) |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters