Skip to content

Commit

Permalink
Complete "hello, shiny express" section
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Jul 15, 2024
1 parent d9e7874 commit 784bf3c
Show file tree
Hide file tree
Showing 19 changed files with 273 additions and 163 deletions.
27 changes: 11 additions & 16 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,23 @@ website:
collapse-level: 4
contents:
- docs/course.qmd
- section: "Shiny express"
- section: "Hallo, Shiny express!"
contents:
- href: docs/shiny-express.qmd
text: Slides
- section: "Exercises"
contents:
- exercises/express-1-hello-world.qmd
- exercises/express-2-basic-ui.qmd
- exercises/express-3-reactivity.qmd
- exercises/express-4-dynamic-ui.qmd
- exercises/express-5-reactive-effect.qmd

- section: "Getting Started"
contents:
- href: docs/getting-started-slides.qmd
text: Slides
- section: "Exercises"
- exercises/express-01-hello-world.qmd
- exercises/express-02-debug.qmd
- exercises/express-03-filter.qmd
- exercises/express-04-plot.qmd
- section: "Still to move"
contents:
- exercises/1-hello-world.qmd
- exercises/2-debug.qmd
- exercises/3-add-filter.qmd
- exercises/4-add-plot.qmd
- exercises/express-12-basic-ui.qmd
- exercises/express-13-reactivity.qmd
- exercises/express-14-dynamic-ui.qmd
- exercises/express-15-reactive-effect.qmd

- section: "Reactivity"
contents:
- href: docs/reactivity-slides.qmd
Expand Down
17 changes: 17 additions & 0 deletions exercises/express-01-hello-world.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: "Hello Shiny"
---

```{python}
# | echo: false
import os
os.chdir("../")
from helpers import problem_tabs_core, problem_tabs_express
```


```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.0-hello-world")
```
23 changes: 23 additions & 0 deletions exercises/express-02-debug.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "Render data frame"
---

```{python}
# | echo: false
import os
os.chdir("../")
from helpers import problem_tabs_core, problem_tabs_express
```


```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.1-data-frame")
```

```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.2-debug")
```
36 changes: 36 additions & 0 deletions exercises/express-03-filter.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "Add input element"
---

```{python}
# | echo: false
import os
os.chdir("../")
from helpers import problem_tabs_core, problem_tabs_express
```

```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.3-filter-input")
```

```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.4-connect-filter-input")
```

```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.5-debug")
```

```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.6-debug")
```
18 changes: 18 additions & 0 deletions exercises/express-04-plot.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Add plot"
---

```{python}
# | echo: false
import os
os.chdir("../")
from helpers import problem_tabs_core, problem_tabs_express
```


```{python}
# | echo: false
# | output: asis
problem_tabs_express("1.7-add-plot")
```
71 changes: 0 additions & 71 deletions exercises/express-1-hello-world.qmd

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions slides/_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

from shiny.express import input, render, ui

# UI section
ui.input_slider(id = "n", label = "N", min = 0, max = 100, value = 20)

## Server section
@render.text
def txt():
return f"2 * n is {input.n() * 2}"
Loading

0 comments on commit 784bf3c

Please sign in to comment.