Small Data SF
Posit, PBC
Posit, PBC
2024-09-23
With Quarto you can weave together narrative text and code to produce elegantly formatted output as documents, web pages, blog posts, books, and more…
Since Quarto 1.4!
Dashboards are composed of cards.
Cards are arranged into rows and columns.
Pages, tabsets, and sidebars allow for more advanced layouts.
Let’s make a dashboard, step-by-step
format: dashboarddashboard.qmd
dashboard.qmd

dashboard.qmd
---
title: "My first Quarto dashboard"
format: dashboard
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```dashboard.qmd
---
title: "My first Quarto dashboard"
format: dashboard
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```
dashboard.qmd
---
title: "My first Quarto dashboard"
format:
dashboard:
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```dashboard.qmd
---
title: "My first Quarto dashboard"
format:
dashboard:
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```
By default, cards are laid out in rows:
dashboard.qmd
---
title: "Rows"
format:
dashboard:
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
## Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```dashboard.qmd
---
title: "Rows"
format:
dashboard:
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
## Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```
Default value of orientation is rows:
dashboard.qmd
---
title: "Rows"
format:
dashboard:
orientation: rows
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
## Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```Setting orientation to columns makes each ## indicate a column instead of a row:
dashboard.qmd
---
title: "Columns"
format:
dashboard:
orientation: columns
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
## Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```dashboard.qmd
---
title: "Columns"
format:
dashboard:
orientation: columns
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
## Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```
dashboard.qmd
---
title: "Rows, then columns"
format:
dashboard:
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Overview
###
This dashboard summarizes an illuminating analysis of fuel economy of cars.
###
This is a car.
{fig-alt="Illustration of a teal color car."}
## Plots
### Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
### Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```dashboard.qmd
---
title: "Rows, then columns"
format:
dashboard:
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Overview
###
This dashboard summarizes an illuminating analysis of fuel economy of cars.
###
This is a car.
{fig-alt="Illustration of a teal color car."}
## Plots
### Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
### Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```
dashboard.qmd
---
title: "Rows, then columns"
format:
dashboard:
orientation: columns
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Overview
###
This dashboard summarizes an illuminating analysis of fuel economy of cars.
###
This is a car.
{fig-alt="Illustration of a teal color car."}
## Plots
### Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
### Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```dashboard.qmd
---
title: "Rows, then columns"
format:
dashboard:
orientation: columns
logo: images/beetle.png
---
```{python}
from plotnine import ggplot, aes, geom_point, geom_bar
from plotnine.data import mpg
```
## Overview
###
This dashboard summarizes an illuminating analysis of fuel economy of cars.
###
This is a car.
{fig-alt="Illustration of a teal color car."}
## Plots
### Scatter
```{python}
#| title: Highway vs. city mileage
(
ggplot(mpg, aes(x = "cty", y = "hwy"))
+ geom_point()
)
```
### Bar
```{python}
#| title: Drive types
(
ggplot(mpg, aes(x = "drv"))
+ geom_bar()
)
```
In your cloned version of posit-dev/smalldatasf-quarto-exercises (http://pos.it/smalldatasf-quarto-exercises), open on olympicdash-1.qmd.
Your goal is to create the following dashboard.

titles to code cells.images folder
05:00
Reorganize the cards into rows and columns as shown below.

05:00