Skip to content

Commit

Permalink
Removed the output decorator from the comparison page (#196)
Browse files Browse the repository at this point in the history
* Removed @output decorator

* Remove trailing whitespace

---------

Co-authored-by: Winston Chang <[email protected]>
  • Loading branch information
Sherwin-14 and wch committed Aug 5, 2024
1 parent 67e47c5 commit ee1ff68
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docs/comp-r-shiny.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
:::
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit ee1ff68

Please sign in to comment.