From 9b4c7c470a41cf58e41909460c30199dd254444b Mon Sep 17 00:00:00 2001 From: Gordon Shotwell Date: Mon, 22 Jan 2024 10:37:03 -0400 Subject: [PATCH 1/2] Delete shiny/api-examples/Calc directory --- shiny/api-examples/Calc/app.py | 36 ---------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 shiny/api-examples/Calc/app.py diff --git a/shiny/api-examples/Calc/app.py b/shiny/api-examples/Calc/app.py deleted file mode 100644 index 603313593..000000000 --- a/shiny/api-examples/Calc/app.py +++ /dev/null @@ -1,36 +0,0 @@ -import random -import time - -from shiny import App, Inputs, Outputs, Session, reactive, render, ui - -app_ui = ui.page_fluid( - ui.input_action_button("first", "Invalidate first (slow) computation"), - " ", - ui.input_action_button("second", "Invalidate second (fast) computation"), - ui.br(), - ui.output_ui("result"), -) - - -def server(input: Inputs, output: Outputs, session: Session): - @reactive.Calc - def first(): - input.first() - p = ui.Progress() - for i in range(30): - p.set(i / 30, message="Computing, please wait...") - time.sleep(0.1) - p.close() - return random.randint(1, 1000) - - @reactive.Calc - def second(): - input.second() - return random.randint(1, 1000) - - @render.ui - def result(): - return first() + second() - - -app = App(app_ui, server) From 737dd0dd8b2778bf79051afd14a320d7719aa5a0 Mon Sep 17 00:00:00 2001 From: Gordon Shotwell Date: Mon, 22 Jan 2024 10:38:11 -0400 Subject: [PATCH 2/2] Delete shiny/api-examples/Effect directory Delete `shiny/api-examples/Effect` --- shiny/api-examples/Effect/app.py | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 shiny/api-examples/Effect/app.py diff --git a/shiny/api-examples/Effect/app.py b/shiny/api-examples/Effect/app.py deleted file mode 100644 index 8b9c2c599..000000000 --- a/shiny/api-examples/Effect/app.py +++ /dev/null @@ -1,17 +0,0 @@ -from shiny import App, Inputs, Outputs, Session, reactive, ui - -app_ui = ui.page_fluid(ui.input_action_button("btn", "Press me!")) - - -def server(input: Inputs, output: Outputs, session: Session): - @reactive.Effect - @reactive.event(input.btn) - def _(): - ui.insert_ui( - ui.p("Number of clicks: ", input.btn()), - selector="#btn", - where="afterEnd", - ) - - -app = App(app_ui, server)