Skip to content

Commit

Permalink
Merge pull request #8 from posit-conf-2024/advanced-ui-edits
Browse files Browse the repository at this point in the history
Advanced UI edits, part 2
  • Loading branch information
garrettgman authored Aug 12, 2024
2 parents 0a44aba + 07e5b36 commit b316e06
Show file tree
Hide file tree
Showing 39 changed files with 85 additions and 147 deletions.
12 changes: 7 additions & 5 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion docs/apps/102-output/problem/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
shiny==1.0.0
shiny==1.0.0
shinywidgets
17 changes: 0 additions & 17 deletions docs/apps/103-table/index.qmd

This file was deleted.

Empty file removed docs/apps/103-table/problem/README
Empty file.
22 changes: 0 additions & 22 deletions docs/apps/103-table/problem/app.py

This file was deleted.

7 changes: 0 additions & 7 deletions docs/apps/103-table/problem/data_import.py

This file was deleted.

7 changes: 0 additions & 7 deletions docs/apps/103-table/problem/plots.py

This file was deleted.

3 changes: 0 additions & 3 deletions docs/apps/103-table/problem/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/apps/330-target-app/index.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "330 Taerget App"
title: "330 Target App"
---

{{< yourturnChild >}}
Expand Down
1 change: 0 additions & 1 deletion docs/apps/332-value-boxes/problem/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
theme="green"
):
"Save"

@render.text
def save():
return f"${input.number()}"
2 changes: 1 addition & 1 deletion docs/apps/334-target-app/problem/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
theme = app_theme
)

with ui.sidebar():
with ui.sidebar(class_="bg-primary-subtle"):
ui.input_select(
"account",
"Account",
Expand Down
2 changes: 0 additions & 2 deletions docs/apps/334-target-app/problem/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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",
)
Expand Down
2 changes: 1 addition & 1 deletion docs/apps/335-css/index.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "331 Starting App"
title: "335 CSS"
---

{{< yourturnChild >}}
Expand Down
2 changes: 0 additions & 2 deletions docs/exercises/express-101-run-app/problem/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions docs/exercises/express-102-ui-module/problem/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions docs/exercises/express-103-inputs/problem/requirements.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pandas
pathlib
plotly
shinywidgets
2 changes: 1 addition & 1 deletion docs/exercises/express-110-app/problem/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pandas
plotly
statmodels
statsmodels
4 changes: 2 additions & 2 deletions docs/exercises/express-301-cards/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
6 changes: 3 additions & 3 deletions docs/exercises/express-302-sidebars/index.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "302 Value Boxes"
title: "302 Sidebars"
---

{{< yourturnChild >}}
Expand All @@ -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())
```
6 changes: 3 additions & 3 deletions docs/exercises/express-303-value-boxes/index.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "303 Taerget App"
title: "303 Value Boxes"
---

{{< yourturnChild >}}
Expand All @@ -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())
```
4 changes: 2 additions & 2 deletions docs/exercises/express-304-columns/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
4 changes: 2 additions & 2 deletions docs/exercises/express-305-app/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
4 changes: 2 additions & 2 deletions docs/exercises/express-306-app/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
2 changes: 0 additions & 2 deletions docs/exercises/express-306-app/problem/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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",
)
Expand Down
4 changes: 2 additions & 2 deletions docs/exercises/express-307-themes/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
2 changes: 0 additions & 2 deletions docs/exercises/express-307-themes/problem/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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",
)
Expand Down
4 changes: 2 additions & 2 deletions docs/exercises/express-308-plot-themes/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
2 changes: 0 additions & 2 deletions docs/exercises/express-308-plot-themes/problem/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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",
)
Expand Down
4 changes: 2 additions & 2 deletions docs/exercises/express-309-valuebox-themes/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
2 changes: 0 additions & 2 deletions docs/exercises/express-309-valuebox-themes/problem/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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",
)
Expand Down
4 changes: 2 additions & 2 deletions docs/exercises/express-310-element-themes/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

ui.page_opts(
title="Model scoring dashboard",
theme = app_theme
# theme = app_theme
)

with ui.sidebar(class_="bg-primary-subtle"):
Expand Down
2 changes: 1 addition & 1 deletion docs/exercises/express-310-element-themes/problem/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

ui.page_opts(
title="Model scoring dashboard",
theme = app_theme
# theme = app_theme
)

with ui.sidebar():
Expand Down
2 changes: 0 additions & 2 deletions docs/exercises/express-310-element-themes/problem/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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",
)
Expand Down
4 changes: 2 additions & 2 deletions docs/exercises/express-311-style/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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())
```
Loading

0 comments on commit b316e06

Please sign in to comment.