From ee1ff68fef30f82721a7571017830831cd3e9bea Mon Sep 17 00:00:00 2001 From: Sherwin Varghese <141290943+Sherwin-14@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:26:46 +0000 Subject: [PATCH] Removed the output decorator from the comparison page (#196) * Removed @output decorator * Remove trailing whitespace --------- Co-authored-by: Winston Chang --- docs/comp-r-shiny.qmd | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/comp-r-shiny.qmd b/docs/comp-r-shiny.qmd index 212fb7c5..46f01853 100644 --- a/docs/comp-r-shiny.qmd +++ b/docs/comp-r-shiny.qmd @@ -79,7 +79,6 @@ While R doesn't have an exact analog to decorators they are similar to [function ::: callout-tip ### Takeaways -- Decorate output function with `@output` - Use rendering decorators like `@render.plot`, `@render.text`, or `@render.ui` instead of `renderPlot()`, `renderText`, or `renderUI` - Reactive calculations (equivalent to reactive expressions in R) are decorated `@reactive.calc`, and reactive effects (equivalent to observers in R) are decorated with `@reactive.effect`. ::: @@ -120,7 +119,6 @@ app_ui = ui.page_fluid( ) def server(input, output, session): - @output @render.text def txt(): return f"n*2 is {input.n() * 2}" @@ -178,7 +176,6 @@ app_ui = ui.page_fluid( ) def server(input, output, session): - @output @render.text def txt(): return f"n*2 is {input.n() * 2}" @@ -241,7 +238,6 @@ app_ui = ui.page_fluid( ) def server(input, output, session): - @output @render.text def txt(): return f"n*2 is {input.n() * 2}" @@ -304,7 +300,6 @@ def server(input, output, session): def n(): return input.n() - @output @render.text def txt(): return f"n*2 is {n() * 2}" @@ -407,7 +402,6 @@ def server(input, output, session): input.reset() ui.update_slider("n", value=40) - @output @render.text def txt(): return f"n*2 is {val() * 2}" @@ -535,7 +529,6 @@ def server(input: Inputs, output: Outputs, session: Session): newVal = val() + 1 val.set(newVal) - @output @render.text def value(): return str(val())