diff --git a/_quarto.yml b/_quarto.yml index 690ff8f..4396afd 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -53,7 +53,6 @@ website: contents: - docs/apps/101-input/index.qmd - docs/apps/102-output/index.qmd - - docs/apps/103-table/index.qmd - title: "Reactivity" contents: @@ -86,7 +85,7 @@ website: - section: "Exercises" contents: - docs/exercises/express-301-cards/index.qmd - - docs/exercises/express-302-sidebars/index.qmdi + - docs/exercises/express-302-sidebars/index.qmd - docs/exercises/express-303-value-boxes/index.qmd - docs/exercises/express-304-columns/index.qmd - docs/exercises/express-305-app/index.qmd @@ -98,9 +97,12 @@ website: - docs/exercises/express-311-style/index.qmd - section: "Apps" contents: - - docs/apps/301-cards/index.qmd - - docs/apps/302-dynamic-ui/index.qmd - - docs/apps/303-conditional-panel/index.qmd + - docs/apps/330-target-app/index.qmd + - docs/apps/331-starting-app/index.qmd + - docs/apps/332-value-boxes/index.qmd + - docs/apps/333-columns/index.qmd + - docs/apps/334-target-app/index.qmd + - docs/apps/335-css/index.qmd - title: "Workflow" contents: - section: "Slides" diff --git a/docs/apps/102-output/problem/requirements.txt b/docs/apps/102-output/problem/requirements.txt index cedf1cd..387d299 100644 --- a/docs/apps/102-output/problem/requirements.txt +++ b/docs/apps/102-output/problem/requirements.txt @@ -1 +1,2 @@ -shiny==1.0.0 \ No newline at end of file +shiny==1.0.0 +shinywidgets \ No newline at end of file diff --git a/docs/apps/103-table/index.qmd b/docs/apps/103-table/index.qmd deleted file mode 100644 index e3bcbc4..0000000 --- a/docs/apps/103-table/index.qmd +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "103 Table" ---- - -{{< yourturnChild >}} - -```{python} -# | echo: false -# | output: asis -import sys -helpers_path = "../../exercises/" -if helpers_path not in sys.path: - sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd - -problem_app_express(getcwd()) -``` diff --git a/docs/apps/103-table/problem/README b/docs/apps/103-table/problem/README deleted file mode 100644 index e69de29..0000000 diff --git a/docs/apps/103-table/problem/app.py b/docs/apps/103-table/problem/app.py deleted file mode 100644 index a775cbc..0000000 --- a/docs/apps/103-table/problem/app.py +++ /dev/null @@ -1,22 +0,0 @@ -from shiny.express import ui - -ui.input_select( - id="account", - label="Account", - choices=[ - "Berge & Berge", - "Fritsch & Fritsch", - "Hintz & Hintz", - "Mosciski and Sons", - "Wolff Ltd", -] -) - -ui.input_radio_buttons( - "variable", - "Select a variable to plot", - choices={ - "prod_score": "Product Score", - "training_score": "Training Score" - } -) \ No newline at end of file diff --git a/docs/apps/103-table/problem/data_import.py b/docs/apps/103-table/problem/data_import.py deleted file mode 100644 index ea4a4e1..0000000 --- a/docs/apps/103-table/problem/data_import.py +++ /dev/null @@ -1,7 +0,0 @@ -from pathlib import Path -import pandas as pd - -file_path = Path(__file__).parent / "simulated-data.csv" -df = pd.read_csv(file_path, dtype={"sub_account": str}) -df["date"] = pd.to_datetime(df["date"], errors="coerce") -df = df.drop(columns=["text"]) \ No newline at end of file diff --git a/docs/apps/103-table/problem/plots.py b/docs/apps/103-table/problem/plots.py deleted file mode 100644 index 5bf35ed..0000000 --- a/docs/apps/103-table/problem/plots.py +++ /dev/null @@ -1,7 +0,0 @@ -import plotly.express as px -from pandas import DataFrame - -def plot_var_distribution(df: DataFrame, var="prod_score"): - fig = px.histogram(df, x=var, nbins=50, title="Model scores") - fig.update_layout(xaxis_title="Score", yaxis_title="Density") - return fig \ No newline at end of file diff --git a/docs/apps/103-table/problem/requirements.txt b/docs/apps/103-table/problem/requirements.txt deleted file mode 100644 index 966f398..0000000 --- a/docs/apps/103-table/problem/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -shiny==1.0.0 -pandas -plotly \ No newline at end of file diff --git a/docs/apps/330-target-app/index.qmd b/docs/apps/330-target-app/index.qmd index 8b92434..e33f4c5 100644 --- a/docs/apps/330-target-app/index.qmd +++ b/docs/apps/330-target-app/index.qmd @@ -1,5 +1,5 @@ --- -title: "330 Taerget App" +title: "330 Target App" --- {{< yourturnChild >}} diff --git a/docs/apps/332-value-boxes/problem/app.py b/docs/apps/332-value-boxes/problem/app.py index e8b4754..b8ef3ce 100644 --- a/docs/apps/332-value-boxes/problem/app.py +++ b/docs/apps/332-value-boxes/problem/app.py @@ -8,7 +8,6 @@ theme="green" ): "Save" - @render.text def save(): return f"${input.number()}" \ No newline at end of file diff --git a/docs/apps/334-target-app/problem/app.py b/docs/apps/334-target-app/problem/app.py index 0e76f9b..3108c15 100644 --- a/docs/apps/334-target-app/problem/app.py +++ b/docs/apps/334-target-app/problem/app.py @@ -12,7 +12,7 @@ theme = app_theme ) -with ui.sidebar(): +with ui.sidebar(class_="bg-primary-subtle"): ui.input_select( "account", "Account", diff --git a/docs/apps/334-target-app/problem/plots.py b/docs/apps/334-target-app/problem/plots.py index 3bdaa74..590ff30 100644 --- a/docs/apps/334-target-app/problem/plots.py +++ b/docs/apps/334-target-app/problem/plots.py @@ -23,7 +23,6 @@ def plot_score_distribution(df: DataFrame, color = "blue"): def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorange", line_color="navy"): fpr, tpr, _ = roc_curve(df[true_col], df[pred_col]) - roc_auc = auc(fpr, tpr) roc_df = DataFrame({"fpr": fpr, "tpr": tpr}) @@ -33,7 +32,6 @@ def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorang + geom_abline(intercept=0, slope=1, color=line_color, linetype="dashed") + labs( title="Receiver Operating Characteristic (ROC)", - subtitle=f"AUC: {roc_auc.round(2)}", x="False Positive Rate", y="True Positive Rate", ) diff --git a/docs/apps/335-css/index.qmd b/docs/apps/335-css/index.qmd index f5aa327..e37ccb4 100644 --- a/docs/apps/335-css/index.qmd +++ b/docs/apps/335-css/index.qmd @@ -1,5 +1,5 @@ --- -title: "331 Starting App" +title: "335 CSS" --- {{< yourturnChild >}} diff --git a/docs/exercises/express-101-run-app/problem/requirements.txt b/docs/exercises/express-101-run-app/problem/requirements.txt deleted file mode 100644 index 9bcc3b2..0000000 --- a/docs/exercises/express-101-run-app/problem/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pandas -plotly \ No newline at end of file diff --git a/docs/exercises/express-102-ui-module/problem/requirements.txt b/docs/exercises/express-102-ui-module/problem/requirements.txt deleted file mode 100644 index 9bcc3b2..0000000 --- a/docs/exercises/express-102-ui-module/problem/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pandas -plotly \ No newline at end of file diff --git a/docs/exercises/express-103-inputs/problem/requirements.txt b/docs/exercises/express-103-inputs/problem/requirements.txt deleted file mode 100644 index 9bcc3b2..0000000 --- a/docs/exercises/express-103-inputs/problem/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pandas -plotly \ No newline at end of file diff --git a/docs/exercises/express-104-outputs/problem/requirements.txt b/docs/exercises/express-104-outputs/problem/requirements.txt index 6a15ec7..633ffac 100644 --- a/docs/exercises/express-104-outputs/problem/requirements.txt +++ b/docs/exercises/express-104-outputs/problem/requirements.txt @@ -1,3 +1,4 @@ pandas +pathlib plotly shinywidgets \ No newline at end of file diff --git a/docs/exercises/express-110-app/problem/requirements.txt b/docs/exercises/express-110-app/problem/requirements.txt index 7e04c66..409056d 100644 --- a/docs/exercises/express-110-app/problem/requirements.txt +++ b/docs/exercises/express-110-app/problem/requirements.txt @@ -1,3 +1,3 @@ pandas plotly -statmodels \ No newline at end of file +statsmodels \ No newline at end of file diff --git a/docs/exercises/express-301-cards/index.qmd b/docs/exercises/express-301-cards/index.qmd index 1c4dc51..ecd75ff 100644 --- a/docs/exercises/express-301-cards/index.qmd +++ b/docs/exercises/express-301-cards/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-302-sidebars/index.qmd b/docs/exercises/express-302-sidebars/index.qmd index 50923d5..7b8ddf3 100644 --- a/docs/exercises/express-302-sidebars/index.qmd +++ b/docs/exercises/express-302-sidebars/index.qmd @@ -1,5 +1,5 @@ --- -title: "302 Value Boxes" +title: "302 Sidebars" --- {{< yourturnChild >}} @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-303-value-boxes/index.qmd b/docs/exercises/express-303-value-boxes/index.qmd index 2b8961a..4a3d275 100644 --- a/docs/exercises/express-303-value-boxes/index.qmd +++ b/docs/exercises/express-303-value-boxes/index.qmd @@ -1,5 +1,5 @@ --- -title: "303 Taerget App" +title: "303 Value Boxes" --- {{< yourturnChild >}} @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-304-columns/index.qmd b/docs/exercises/express-304-columns/index.qmd index d3c1171..bdbd02c 100644 --- a/docs/exercises/express-304-columns/index.qmd +++ b/docs/exercises/express-304-columns/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-305-app/index.qmd b/docs/exercises/express-305-app/index.qmd index 96dd7a9..50333fb 100644 --- a/docs/exercises/express-305-app/index.qmd +++ b/docs/exercises/express-305-app/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-306-app/index.qmd b/docs/exercises/express-306-app/index.qmd index bb7073f..5c99744 100644 --- a/docs/exercises/express-306-app/index.qmd +++ b/docs/exercises/express-306-app/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-306-app/problem/plots.py b/docs/exercises/express-306-app/problem/plots.py index 3bdaa74..590ff30 100644 --- a/docs/exercises/express-306-app/problem/plots.py +++ b/docs/exercises/express-306-app/problem/plots.py @@ -23,7 +23,6 @@ def plot_score_distribution(df: DataFrame, color = "blue"): def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorange", line_color="navy"): fpr, tpr, _ = roc_curve(df[true_col], df[pred_col]) - roc_auc = auc(fpr, tpr) roc_df = DataFrame({"fpr": fpr, "tpr": tpr}) @@ -33,7 +32,6 @@ def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorang + geom_abline(intercept=0, slope=1, color=line_color, linetype="dashed") + labs( title="Receiver Operating Characteristic (ROC)", - subtitle=f"AUC: {roc_auc.round(2)}", x="False Positive Rate", y="True Positive Rate", ) diff --git a/docs/exercises/express-307-themes/index.qmd b/docs/exercises/express-307-themes/index.qmd index 3bc838f..34905b2 100644 --- a/docs/exercises/express-307-themes/index.qmd +++ b/docs/exercises/express-307-themes/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-307-themes/problem/plots.py b/docs/exercises/express-307-themes/problem/plots.py index 3bdaa74..590ff30 100644 --- a/docs/exercises/express-307-themes/problem/plots.py +++ b/docs/exercises/express-307-themes/problem/plots.py @@ -23,7 +23,6 @@ def plot_score_distribution(df: DataFrame, color = "blue"): def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorange", line_color="navy"): fpr, tpr, _ = roc_curve(df[true_col], df[pred_col]) - roc_auc = auc(fpr, tpr) roc_df = DataFrame({"fpr": fpr, "tpr": tpr}) @@ -33,7 +32,6 @@ def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorang + geom_abline(intercept=0, slope=1, color=line_color, linetype="dashed") + labs( title="Receiver Operating Characteristic (ROC)", - subtitle=f"AUC: {roc_auc.round(2)}", x="False Positive Rate", y="True Positive Rate", ) diff --git a/docs/exercises/express-308-plot-themes/index.qmd b/docs/exercises/express-308-plot-themes/index.qmd index 8341d3b..00c0e3d 100644 --- a/docs/exercises/express-308-plot-themes/index.qmd +++ b/docs/exercises/express-308-plot-themes/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-308-plot-themes/problem/plots.py b/docs/exercises/express-308-plot-themes/problem/plots.py index 3bdaa74..590ff30 100644 --- a/docs/exercises/express-308-plot-themes/problem/plots.py +++ b/docs/exercises/express-308-plot-themes/problem/plots.py @@ -23,7 +23,6 @@ def plot_score_distribution(df: DataFrame, color = "blue"): def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorange", line_color="navy"): fpr, tpr, _ = roc_curve(df[true_col], df[pred_col]) - roc_auc = auc(fpr, tpr) roc_df = DataFrame({"fpr": fpr, "tpr": tpr}) @@ -33,7 +32,6 @@ def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorang + geom_abline(intercept=0, slope=1, color=line_color, linetype="dashed") + labs( title="Receiver Operating Characteristic (ROC)", - subtitle=f"AUC: {roc_auc.round(2)}", x="False Positive Rate", y="True Positive Rate", ) diff --git a/docs/exercises/express-309-valuebox-themes/index.qmd b/docs/exercises/express-309-valuebox-themes/index.qmd index ceea1c8..46e123e 100644 --- a/docs/exercises/express-309-valuebox-themes/index.qmd +++ b/docs/exercises/express-309-valuebox-themes/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-309-valuebox-themes/problem/plots.py b/docs/exercises/express-309-valuebox-themes/problem/plots.py index 3bdaa74..590ff30 100644 --- a/docs/exercises/express-309-valuebox-themes/problem/plots.py +++ b/docs/exercises/express-309-valuebox-themes/problem/plots.py @@ -23,7 +23,6 @@ def plot_score_distribution(df: DataFrame, color = "blue"): def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorange", line_color="navy"): fpr, tpr, _ = roc_curve(df[true_col], df[pred_col]) - roc_auc = auc(fpr, tpr) roc_df = DataFrame({"fpr": fpr, "tpr": tpr}) @@ -33,7 +32,6 @@ def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorang + geom_abline(intercept=0, slope=1, color=line_color, linetype="dashed") + labs( title="Receiver Operating Characteristic (ROC)", - subtitle=f"AUC: {roc_auc.round(2)}", x="False Positive Rate", y="True Positive Rate", ) diff --git a/docs/exercises/express-310-element-themes/index.qmd b/docs/exercises/express-310-element-themes/index.qmd index c6dfc17..a136cc0 100644 --- a/docs/exercises/express-310-element-themes/index.qmd +++ b/docs/exercises/express-310-element-themes/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/exercises/express-310-element-themes/problem/app-solution.py b/docs/exercises/express-310-element-themes/problem/app-solution.py index 3108c15..27254eb 100644 --- a/docs/exercises/express-310-element-themes/problem/app-solution.py +++ b/docs/exercises/express-310-element-themes/problem/app-solution.py @@ -9,7 +9,7 @@ ui.page_opts( title="Model scoring dashboard", - theme = app_theme + # theme = app_theme ) with ui.sidebar(class_="bg-primary-subtle"): diff --git a/docs/exercises/express-310-element-themes/problem/app.py b/docs/exercises/express-310-element-themes/problem/app.py index 0e76f9b..4924ee4 100644 --- a/docs/exercises/express-310-element-themes/problem/app.py +++ b/docs/exercises/express-310-element-themes/problem/app.py @@ -9,7 +9,7 @@ ui.page_opts( title="Model scoring dashboard", - theme = app_theme + # theme = app_theme ) with ui.sidebar(): diff --git a/docs/exercises/express-310-element-themes/problem/plots.py b/docs/exercises/express-310-element-themes/problem/plots.py index 3bdaa74..590ff30 100644 --- a/docs/exercises/express-310-element-themes/problem/plots.py +++ b/docs/exercises/express-310-element-themes/problem/plots.py @@ -23,7 +23,6 @@ def plot_score_distribution(df: DataFrame, color = "blue"): def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorange", line_color="navy"): fpr, tpr, _ = roc_curve(df[true_col], df[pred_col]) - roc_auc = auc(fpr, tpr) roc_df = DataFrame({"fpr": fpr, "tpr": tpr}) @@ -33,7 +32,6 @@ def plot_auc_curve(df: DataFrame, true_col: str, pred_col: str, color="darkorang + geom_abline(intercept=0, slope=1, color=line_color, linetype="dashed") + labs( title="Receiver Operating Characteristic (ROC)", - subtitle=f"AUC: {roc_auc.round(2)}", x="False Positive Rate", y="True Positive Rate", ) diff --git a/docs/exercises/express-311-style/index.qmd b/docs/exercises/express-311-style/index.qmd index 0987bf8..df939e3 100644 --- a/docs/exercises/express-311-style/index.qmd +++ b/docs/exercises/express-311-style/index.qmd @@ -11,7 +11,7 @@ import sys helpers_path = "../../exercises/" if helpers_path not in sys.path: sys.path.append(helpers_path) -from helpers import problem_app_express, getcwd +from helpers import problem_tabs_express, getcwd -problem_app_express(getcwd()) +problem_tabs_express(getcwd()) ``` diff --git a/docs/shiny-express-slides.qmd b/docs/shiny-express-slides.qmd index ddfcbcf..fb46d9c 100644 --- a/docs/shiny-express-slides.qmd +++ b/docs/shiny-express-slides.qmd @@ -95,7 +95,7 @@ Director of Learning, Posit : {.striped} --> -## Goals +## Goals for this section 1. Understand the "whole game"/ big picture @@ -262,18 +262,30 @@ Shiny lets you quickly create reactive web apps without worrying about: And, these apps can scale from prototype to production-ready. -## Quiz {background-color=`{python} bgcolor`} +## Quiz - Where are the inputs? The Outputs?{background-color=`{python} bgcolor`} ![](../images/app-components.004.png) -## Quiz {background-color=`{python} bgcolor`} +## Quiz - Where are the inputs? The Outputs?{background-color=`{python} bgcolor`} ![](../images/app-components.005.png) -## Quiz {background-color=`{python} bgcolor`} +## Quiz - Where are the inputs? The Outputs?{background-color=`{python} bgcolor`} ![](../images/app-components.006.png) +## Tell me about Shiny Express + + +::: {.callout-important} +Shiny for Python has two _syntaxes_ for writing the same apps: + +1. Shiny Express - lightweight syntax informed by notebooks +1. Shiny Core - more verbose syntax similar to Shiny for R +::: + +Today, we will learn Shiny Express. + # Your first App ## Your turn @@ -391,10 +403,7 @@ Instructions ::: - -## Demo - -## Syntax +## Syntax Demo {{< yourview '101-input' >}} @@ -408,12 +417,11 @@ Notice: 1. A label to display 1. Input specific options -## The Shiny function reference +## How can you learn about input specific options? -How can you learn about input specific options? +The Shiny function reference - -![](../images/shiny-function-reference.png){height=700 fig-align="center"} +![](../images/shiny-function-reference.png){height=650 fig-align="center"} ::: aside @@ -437,7 +445,7 @@ What is the second thing a Shiny app needs? ::: -## Syntax +## Syntax Demo {{< yourview '102-output' >}} @@ -471,10 +479,6 @@ decorator(function, args) function ``` -## Syntax - -{{< yourview '103-table' >}} - ## Your turn {{< yourturn 'express-104-outputs' >}} @@ -489,6 +493,10 @@ Where are the instructions on how to build the outputs in this app? ## To make an app reactive... +Use an input value to build an output. + +## To make an app reactive... + Use an input value to build an output. \ @@ -572,9 +580,9 @@ Can we spot them in our sample code? Most Shiny app development consists of variations of these three things: -1. Add Inputs and other UI elements -2. Define outputs with render functions -3. Tell Shiny how to use inputs to build outputs +1. Add **Inputs** and other UI elements +2. Define **outputs** with render functions +3. Give Shiny **instructions** on how to use inputs to build outputs ## Weather data diff --git a/docs/ui-layout-slides.qmd b/docs/ui-layout-slides.qmd index 096e2c1..06015d5 100644 --- a/docs/ui-layout-slides.qmd +++ b/docs/ui-layout-slides.qmd @@ -35,8 +35,6 @@ from helpers import include_shiny_folder bgcolor = "whitesmoke" ``` -# Introduction - ## Goals You can fill your app with content, but can you organize it? @@ -55,6 +53,8 @@ This section is a bit of a survey. Just know: - Good UI design simplifies your application code - Intuitive UIs mean fewer questions +# Introduction + ## Where we're headed {{< yourview '330-target-app' >}} @@ -264,15 +264,16 @@ The `faicons` package provides [fontawesome](https://fontawesome.com/search?) ic ## Rows and columns What if you want to customize your layout more generally? -- What about? - - Different screen sizes? - - Mobile browsers? - - Different zoom levels? - - Nested UI containers? -- What we need is a responsive way to specify the size of things -- Enter `ui.layout_coilumns()` -## `ui.layout_columns()` +- What about? + - Different screen sizes? + - Mobile browsers? + - Different zoom levels? + - Nested UI containers? +- What we need is a responsive way to specify the size of things +- Enter `ui.layout_columns()` + +## `ui.layout_columns()` demo {{< yourview '333-columns' >}} @@ -337,7 +338,7 @@ with ui.nav_panel("A"): 2. Choose a function to provide navigation between panels. -## Nav panels +## Nav panels demo {{< yourview '333-columns' >}} @@ -365,7 +366,7 @@ Use `ui.page_opts()` to provide a title for the navbar. Call `ui.nav_spacer()` to push the panel labels to the right side of the navbar. ::: -![Navbars](images/layouts/navbars.png) +![Navbars](images/layouts/navbars.png){height=400 fig-align="center"} ::: aside diff --git a/docs/ui-themes-slides.qmd b/docs/ui-themes-slides.qmd index f9a07fc..612464a 100644 --- a/docs/ui-themes-slides.qmd +++ b/docs/ui-themes-slides.qmd @@ -40,7 +40,7 @@ bgcolor = "whitesmoke" ## Combine what you've learned -{{< yourturn 'express-306-new-app' >}} +{{< yourturn 'express-306-app' >}} ## Where we're headed @@ -194,7 +194,7 @@ Assign styles to: ## Adding CSS to a Shiny app -{{< yourview '315-css' >}} +{{< yourview '335-css' >}} ## To link an external style sheet @@ -229,7 +229,7 @@ ui.card_header( ) ``` -# Bootstrap classes +## Bootstrap classes ::: {.callout-tip} Bootstrap provides many predefined CSS classes. These are collections or coordinated style rules, ready to use pass to an element's `class_` parameter. @@ -300,4 +300,4 @@ This makes `www` a very good place to store things needed by a browser, like: ## Your Turn -{{< yourturn 'express-310-style' >}} \ No newline at end of file +{{< yourturn 'express-311-style' >}} \ No newline at end of file