From 8f8219e5d6fe29f4a231df0504e62ba7eefbd4e9 Mon Sep 17 00:00:00 2001 From: gadenbuie Date: Fri, 6 Dec 2024 19:26:28 +0000 Subject: [PATCH] Built site for shiny@1.9.1.9000: d37beee --- news/index.html | 1 + pkgdown.yml | 2 +- reference/ExtendedTask.html | 60 ++++++++++++++++++++++++++++++++++--- reference/icon.html | 16 +++++----- reference/navbarPage.html | 34 ++++++++++----------- reference/navlistPanel.html | 16 +++++----- reference/reactive.html | 2 +- reference/reactivePoll.html | 2 +- reference/reactiveVal.html | 10 +++---- reference/tabPanel.html | 16 +++++----- reference/tabsetPanel.html | 16 +++++----- 11 files changed, 114 insertions(+), 61 deletions(-) diff --git a/news/index.html b/news/index.html index 2a9a399bb..a0fe3ff56 100644 --- a/news/index.html +++ b/news/index.html @@ -54,6 +54,7 @@

Bug fixes

diff --git a/pkgdown.yml b/pkgdown.yml index 68be97d6b..ebc493f91 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,4 +2,4 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2024-12-06T18:18Z +last_built: 2024-12-06T19:25Z diff --git a/reference/ExtendedTask.html b/reference/ExtendedTask.html index 572084ee1..92445cebd 100644 --- a/reference/ExtendedTask.html +++ b/reference/ExtendedTask.html @@ -175,9 +175,9 @@ status changes.

Returns one of the following values:

Usage

ExtendedTask$status()

@@ -185,7 +185,7 @@ re-thrown if you call the result() method


-

Method result()

+

Method result()

Attempts to read the results of the most recent invocation. This is a reactive read that invalidates as the task's status changes.

The actual behavior differs greatly depending on the current status of @@ -203,7 +203,7 @@ aware that if the result isn't ready for whatever reason, processing will stop in much the same way as req(FALSE) does, but when the result is ready you'll get invalidated, and when you run again the result should be there.

-

Note that the result() method is generally not meant to be used with +

Note that the result() method is generally not meant to be used with observeEvent(), eventReactive(), bindEvent(), or isolate() as the invalidation will be ignored.

Usage

@@ -215,6 +215,58 @@ invalidation will be ignored.

+
+

Examples

+
if (FALSE) { # rlang::is_interactive() && rlang::is_installed("future")
+
+library(shiny)
+library(bslib)
+library(future)
+plan(multisession)
+
+ui <- page_fluid(
+  titlePanel("Extended Task Demo"),
+  p(
+    'Click the button below to perform a "calculation"',
+    "that takes a while to perform."
+  ),
+  input_task_button("recalculate", "Recalculate"),
+  p(textOutput("result"))
+)
+
+server <- function(input, output) {
+  rand_task <- ExtendedTask$new(function() {
+    future(
+      {
+        # Slow operation goes here
+        Sys.sleep(2)
+        sample(1:100, 1)
+      },
+      seed = TRUE
+    )
+  })
+
+  # Make button state reflect task.
+  # If using R >=4.1, you can do this instead:
+  # rand_task <- ExtendedTask$new(...) |> bind_task_button("recalculate")
+  bind_task_button(rand_task, "recalculate")
+
+  observeEvent(input$recalculate, {
+    # Invoke the extended in an observer
+    rand_task$invoke()
+  })
+
+  output$result <- renderText({
+    # React to updated results when the task completes
+    number <- rand_task$result()
+    paste0("Your number is ", number, ".")
+  })
+}
+
+shinyApp(ui, server)
+}
+
+
diff --git a/reference/reactiveVal.html b/reference/reactiveVal.html index 0d8616554..1a0c433f7 100644 --- a/reference/reactiveVal.html +++ b/reference/reactiveVal.html @@ -125,17 +125,17 @@ use reactiveVal. See the Examples section for an illustration.

value <- reactiveVal(0) # rv <- reactiveValues(value = 0) observeEvent(input$minus, { - newValue <- value() - 1 # newValue <- rv$value - 1 - value(newValue) # rv$value <- newValue + newValue <- value() - 1 # newValue <- rv$value - 1 + value(newValue) # rv$value <- newValue }) observeEvent(input$plus, { - newValue <- value() + 1 # newValue <- rv$value + 1 - value(newValue) # rv$value <- newValue + newValue <- value() + 1 # newValue <- rv$value + 1 + value(newValue) # rv$value <- newValue }) output$value <- renderText({ - value() # rv$value + value() # rv$value }) } diff --git a/reference/tabPanel.html b/reference/tabPanel.html index df12bf69b..b5b2f2cac 100644 --- a/reference/tabPanel.html +++ b/reference/tabPanel.html @@ -110,25 +110,25 @@ This function should be used within tabsetPanel(type = "hidden"). S ) #> <div class="col-sm-8" role="main"> #> <div class="tabbable"> -#> <ul class="nav nav-tabs" data-tabsetid="1018"> +#> <ul class="nav nav-tabs" data-tabsetid="7604"> #> <li class="active"> -#> <a href="#tab-1018-1" data-toggle="tab" data-bs-toggle="tab" data-value="Plot">Plot</a> +#> <a href="#tab-7604-1" data-toggle="tab" data-bs-toggle="tab" data-value="Plot">Plot</a> #> </li> #> <li> -#> <a href="#tab-1018-2" data-toggle="tab" data-bs-toggle="tab" data-value="Summary">Summary</a> +#> <a href="#tab-7604-2" data-toggle="tab" data-bs-toggle="tab" data-value="Summary">Summary</a> #> </li> #> <li> -#> <a href="#tab-1018-3" data-toggle="tab" data-bs-toggle="tab" data-value="Table">Table</a> +#> <a href="#tab-7604-3" data-toggle="tab" data-bs-toggle="tab" data-value="Table">Table</a> #> </li> #> </ul> -#> <div class="tab-content" data-tabsetid="1018"> -#> <div class="tab-pane active" data-value="Plot" id="tab-1018-1"> +#> <div class="tab-content" data-tabsetid="7604"> +#> <div class="tab-pane active" data-value="Plot" id="tab-7604-1"> #> <div class="shiny-plot-output html-fill-item" id="plot" style="width:100%;height:400px;"></div> #> </div> -#> <div class="tab-pane" data-value="Summary" id="tab-1018-2"> +#> <div class="tab-pane" data-value="Summary" id="tab-7604-2"> #> <pre class="shiny-text-output noplaceholder" id="summary"></pre> #> </div> -#> <div class="tab-pane" data-value="Table" id="tab-1018-3"> +#> <div class="tab-pane" data-value="Table" id="tab-7604-3"> #> <div id="table" class="shiny-html-output"></div> #> </div> #> </div> diff --git a/reference/tabsetPanel.html b/reference/tabsetPanel.html index f41a8abec..6f350fd81 100644 --- a/reference/tabsetPanel.html +++ b/reference/tabsetPanel.html @@ -135,25 +135,25 @@ tabPanels

) #> <div class="col-sm-8" role="main"> #> <div class="tabbable"> -#> <ul class="nav nav-tabs" data-tabsetid="6423"> +#> <ul class="nav nav-tabs" data-tabsetid="5090"> #> <li class="active"> -#> <a href="#tab-6423-1" data-toggle="tab" data-bs-toggle="tab" data-value="Plot">Plot</a> +#> <a href="#tab-5090-1" data-toggle="tab" data-bs-toggle="tab" data-value="Plot">Plot</a> #> </li> #> <li> -#> <a href="#tab-6423-2" data-toggle="tab" data-bs-toggle="tab" data-value="Summary">Summary</a> +#> <a href="#tab-5090-2" data-toggle="tab" data-bs-toggle="tab" data-value="Summary">Summary</a> #> </li> #> <li> -#> <a href="#tab-6423-3" data-toggle="tab" data-bs-toggle="tab" data-value="Table">Table</a> +#> <a href="#tab-5090-3" data-toggle="tab" data-bs-toggle="tab" data-value="Table">Table</a> #> </li> #> </ul> -#> <div class="tab-content" data-tabsetid="6423"> -#> <div class="tab-pane active" data-value="Plot" id="tab-6423-1"> +#> <div class="tab-content" data-tabsetid="5090"> +#> <div class="tab-pane active" data-value="Plot" id="tab-5090-1"> #> <div class="shiny-plot-output html-fill-item" id="plot" style="width:100%;height:400px;"></div> #> </div> -#> <div class="tab-pane" data-value="Summary" id="tab-6423-2"> +#> <div class="tab-pane" data-value="Summary" id="tab-5090-2"> #> <pre class="shiny-text-output noplaceholder" id="summary"></pre> #> </div> -#> <div class="tab-pane" data-value="Table" id="tab-6423-3"> +#> <div class="tab-pane" data-value="Table" id="tab-5090-3"> #> <div id="table" class="shiny-html-output"></div> #> </div> #> </div>