From e7233672c0778ff303574d742a24733485772ecc Mon Sep 17 00:00:00 2001 From: DivadNojnarg Date: Wed, 10 Apr 2024 00:50:23 +0200 Subject: [PATCH] cleanup dead links --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/useful-items.R | 5 ++- man/accordion.Rd | 5 ++- vignettes/improved-boxes.Rmd | 67 +++++++++++++++++------------------- 5 files changed, 42 insertions(+), 39 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c0d2c43..2c1e153 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,7 +31,7 @@ Suggests: knitr, rmarkdown, jsonlite -URL: https://github.com/RinteRface/shinydashboardPlus, https://rinterface.com/shiny/shinydashboardPlus/ +URL: https://github.com/RinteRface/shinydashboardPlus, https://shinydashboardPlus.rinterface.com/ BugReports: https://github.com/RinteRface/shinydashboardPlus/issues Encoding: UTF-8 RoxygenNote: 7.3.1 diff --git a/NEWS.md b/NEWS.md index 659b55b..ccac569 100644 --- a/NEWS.md +++ b/NEWS.md @@ -249,7 +249,7 @@ or redirect at the top of the page ## Breaking changes - change argument name in `dropdownItem()` (`boxPlus()`): "target" is replaced by "url". - Widely simplify the `rightSidebar()` function: remove `rightSidebarTabList()`, `rightSidebarTabItem()` and -`rightSidebarPanel()` from the user interface. See [here](https://rinterface.github.io/shinydashboardPlus/articles/rightSidebar.html) to discover how to set up +`rightSidebarPanel()` from the user interface. See [here](https://shinydashboardplus.rinterface.com/articles/controlbar#controlbar) to discover how to set up a new `rightSidebar()` ## Major changes - add a "width" argument to the `rightSidebar()` (set to 230 pixels by default) to diff --git a/R/useful-items.R b/R/useful-items.R index 1b8051c..1014baa 100644 --- a/R/useful-items.R +++ b/R/useful-items.R @@ -185,7 +185,10 @@ accordionItem <- function(..., title, status = NULL, collapsed = TRUE, #' }) #' observe(print(input$accordion1)) #' observeEvent(input$accordion1, { -#' showNotification(sprintf("You selected accordion N° %s", input$accordion1), type = "message") +#' showNotification( +#' sprintf("You selected accordion N° %s", input$accordion1), +#' type = "message" +#' ) #' }) #' } #' ) diff --git a/man/accordion.Rd b/man/accordion.Rd index 87584c5..6548c45 100644 --- a/man/accordion.Rd +++ b/man/accordion.Rd @@ -140,7 +140,10 @@ if (interactive()) { }) observe(print(input$accordion1)) observeEvent(input$accordion1, { - showNotification(sprintf("You selected accordion N° \%s", input$accordion1), type = "message") + showNotification( + sprintf("You selected accordion N° \%s", input$accordion1), + type = "message" + ) }) } ) diff --git a/vignettes/improved-boxes.Rmd b/vignettes/improved-boxes.Rmd index 5de26b0..0126ad1 100644 --- a/vignettes/improved-boxes.Rmd +++ b/vignettes/improved-boxes.Rmd @@ -56,37 +56,37 @@ server <- function(input, output, session) { req(!input$mybox$collapsed) plot(rnorm(200)) }) - + output$box_state <- renderText({ state <- if (input$mybox$collapsed) "collapsed" else "uncollapsed" paste("My box is", state) }) - + observeEvent(input$toggle_box, { updateBox("mybox", action = "toggle") }) - + observeEvent(input$remove_box, { updateBox("mybox", action = "remove") }) - + observeEvent(input$restore_box, { updateBox("mybox", action = "restore") }) - + observeEvent(input$update_box, { updateBox( - "mybox", - action = "update", + "mybox", + action = "update", options = list( title = h2("New title", dashboardLabel(1, status = "primary")), - status = "danger", + status = "danger", solidHeader = TRUE, width = 4 ) ) }) - + observeEvent(input$mybox$visible, { collapsed <- if (input$mybox$collapsed) "collapsed" else "uncollapsed" visible <- if (input$mybox$visible) "visible" else "hidden" @@ -107,7 +107,7 @@ We call the `updateBox()` function, specifying the action to accomplish: Knowing the state of a box significantly opens new possibilities within the application, thereby increasing interactivity. Additionally, the toggle animation has been speed up (from 0.5s to 0.1s) so as to reduce the latency. -If you want to know more about the underlying mechanisms, have a look at the box widget [documentation](https://adminlte.io/docs/2.4/js-box-widget). +If you want to know more about the underlying mechanisms, have a look at the box widget [documentation](https://github.com/ColorlibHQ/AdminLTE/tree/86990d5b48f5b9d747ee14d67df7bb200ffc6f85/documentation).
@@ -140,21 +140,21 @@ shinyApp( header = dashboardHeader(), body = dashboardBody( box( - title = "Update box sidebar", - closable = TRUE, + title = "Update box sidebar", + closable = TRUE, width = 12, height = "500px", - solidHeader = FALSE, + solidHeader = FALSE, collapsible = TRUE, actionButton("update", "Toggle card sidebar"), sidebar = boxSidebar( id = "mycardsidebar", width = 25, sliderInput( - "obs", + "obs", "Number of observations:", - min = 0, - max = 1000, + min = 0, + max = 1000, value = 500 ) ), @@ -165,15 +165,14 @@ shinyApp( ), server = function(input, output, session) { observe(print(input$mycardsidebar)) - + output$distPlot <- renderPlot({ hist(rnorm(input$obs)) }) - + observeEvent(input$update, { updateBoxSidebar("mycardsidebar") }) - } ) ``` @@ -201,11 +200,11 @@ shinyApp( dashboardSidebar(), dashboardBody( box( - title = "Closable Box with dropdown", - closable = TRUE, + title = "Closable Box with dropdown", + closable = TRUE, width = 12, - status = "warning", - solidHeader = FALSE, + status = "warning", + solidHeader = FALSE, collapsible = TRUE, dropdownMenu = boxDropdown( boxDropdownItem("Click me", id = "dropdownItem", icon = icon("heart")), @@ -284,14 +283,14 @@ shinyApp( navPills( id = "pillItem", navPillsItem( - left = "Item 1", + left = "Item 1", color = "green", right = 10 ), navPillsItem( - left = "Item 2", + left = "Item 2", color = "red", - icon = icon("angle-down"), + icon = icon("angle-down"), right = "10%" ) ), @@ -301,7 +300,6 @@ shinyApp( title = "userBox" ), server = function(input, output) { - observeEvent(input$pillItem, { if (input$pillItem == 2) { showModal( @@ -309,10 +307,10 @@ shinyApp( ) } }) - + observeEvent(input$pillItem, { showNotification( - sprintf("You clicked on pill N° %s", input$pillItem), + sprintf("You clicked on pill N° %s", input$pillItem), type = "warning", duration = 1 ) @@ -497,10 +495,10 @@ shinyApp( fluidRow( column( width = 6, - uiOutput("active_side"), + uiOutput("active_side"), actionButton("toggle", "Toggle flip box"), flipBox( - id = "myflipbox", + id = "myflipbox", trigger = "hover", width = 12, front = div( @@ -548,18 +546,17 @@ shinyApp( ) ) ), - server = function(input, output, session) { output$active_side <- renderUI({ side <- if (input$myflipbox) "front" else "back" dashboardBadge(side, color = "blue") }) - - output$active_side_2<- renderUI({ + + output$active_side_2 <- renderUI({ side <- if (input$myflipbox2) "front" else "back" dashboardBadge(side, color = "blue") }) - + observeEvent(input$toggle, { updateFlipBox("myflipbox") })