Skip to content

Commit b807342

Browse files
authored
add quarto-document jump start example to gallery (#64)
* add quarto-document jump start example to extensions gallery * remove thumbnail
1 parent eb39f19 commit b807342

File tree

6 files changed

+160
-4
lines changed

6 files changed

+160
-4
lines changed

.github/workflows/extensions.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
integration-session-manager: extensions/integration-session-manager/**
3434
quarto-stock-report-python: extensions/quarto-stock-report-python/**
3535
portfolio-dashboard: extensions/portfolio-dashboard/**
36+
quarto-document: extensions/quarto-document/**
3637
3738
# Runs for each extension that has changed from `simple-extension-changes`
3839
# Lints and packages in preparation for tests and and release.
@@ -108,7 +109,7 @@ jobs:
108109
'$arr | split(",")' -c)
109110
echo "Successful extensions: $SUCCESSFUL_EXTENSIONS"
110111
echo "successful_extensions=$SUCCESSFUL_EXTENSIONS" >> "$GITHUB_OUTPUT"
111-
112+
112113
113114
# Runs Connect integration tests for each extension that were successfully linted and packaged
114115
simple-extension-connect-integration-tests:
@@ -124,9 +125,9 @@ jobs:
124125
runs-on: ubuntu-latest
125126
needs: [simple-extension-connect-integration-tests]
126127
# Only run if connect integration tests actually ran and produced valid output
127-
if: ${{
128-
always() &&
129-
needs.simple-extension-connect-integration-tests.result != 'skipped' &&
128+
if: ${{
129+
always() &&
130+
needs.simple-extension-connect-integration-tests.result != 'skipped' &&
130131
needs.simple-extension-connect-integration-tests.result != 'canceled' &&
131132
needs.simple-extension-connect-integration-tests.outputs.successful_extensions != '[]'
132133
}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Quarto Document
2+
3+
## About this example
4+
5+
This Quarto example shows how a basic document can present diagrams and
6+
interactivity.
7+
8+
## Learn more
9+
10+
* [Quarto](https://quarto.org)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
project:
2+
title: Quarto Document
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Quarto Document
3+
categories:
4+
- quarto
5+
---
6+
7+
This Quarto example shows how a basic document can present diagrams and
8+
interactivity.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Quarto Document
3+
format:
4+
html:
5+
echo: false
6+
---
7+
8+
Quarto enables you to weave together content and executable code into a
9+
finished document. To learn more about Quarto see <https://quarto.org>.
10+
11+
## Workflow diagram
12+
13+
This diagram depicts a simple workflow showing the
14+
[tidying](https://vita.had.co.nz/papers/tidy-data.html) and analysis of a data
15+
set with written findings reviewed by your peers.
16+
17+
```{mermaid}
18+
stateDiagram-v2
19+
direction LR
20+
21+
[*] --> tidy
22+
tidy --> analyze
23+
analyze --> tidy
24+
analyze --> write
25+
write --> review
26+
review --> write: feedback
27+
review --> accepted
28+
accepted --> [*]
29+
```
30+
31+
Your personal workflow may be more complicated than this example, but
32+
thankfully, Quarto lets you include
33+
[diagrams](https://quarto.org/docs/authoring/diagrams.html) to help you
34+
communicate how you work!
35+
36+
## Penguins
37+
38+
Quarto documents can incorporate interactive data exploration and analysis.
39+
One way of including these dynamic capabilities is by using [Observable
40+
JS](https://quarto.org/docs/interactive/ojs/) (OJS).
41+
42+
This is a simple example based on Allison Horst's [Palmer
43+
Penguins](https://allisonhorst.github.io/palmerpenguins/) dataset. Here we
44+
look at how penguin body mass varies across both sex and species (use the
45+
provided inputs to filter the dataset by bill length and island):
46+
47+
```{ojs}
48+
// https://observablehq.com/@observablehq/sample-datasets
49+
// https://allisonhorst.github.io/palmerpenguins/
50+
filtered = penguins.filter(function(penguin) {
51+
return bill_length_min < penguin.culmen_length_mm &&
52+
islands.includes(penguin.island);
53+
})
54+
```
55+
56+
```{ojs}
57+
//| panel: input
58+
59+
viewof bill_length_min = Inputs.range(
60+
[32, 50],
61+
{value: 35, step: 1, label: "Bill length (min):"}
62+
)
63+
viewof islands = Inputs.checkbox(
64+
["Torgersen", "Biscoe", "Dream"],
65+
{ value: ["Torgersen", "Biscoe"],
66+
label: "Islands:"
67+
}
68+
)
69+
```
70+
71+
::: {.panel-tabset}
72+
73+
74+
## Plot
75+
76+
```{ojs}
77+
Plot.rectY(filtered,
78+
Plot.binX(
79+
{y: "count"},
80+
{x: "body_mass_g", fill: "species", thresholds: 20}
81+
))
82+
.plot({
83+
facet: {
84+
data: filtered,
85+
x: "sex",
86+
y: "species",
87+
marginRight: 80
88+
},
89+
marks: [
90+
Plot.frame(),
91+
]
92+
}
93+
)
94+
```
95+
96+
## Data
97+
98+
```{ojs}
99+
Inputs.table(filtered)
100+
```
101+
102+
:::
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": 1,
3+
"locale": "en_US",
4+
"platform": "4.4.1",
5+
"metadata": {
6+
"appmode": "quarto-static",
7+
"primary_rmd": "index.qmd",
8+
"primary_html": null,
9+
"content_category": null,
10+
"has_parameters": false
11+
},
12+
"quarto": {
13+
"version": "1.7.13",
14+
"engines": ["markdown"]
15+
},
16+
"packages": null,
17+
"files": {
18+
"_quarto.yml": {
19+
"checksum": "e498dcc5956dba39a6df10ac9568fcb9"
20+
},
21+
"index.qmd": {
22+
"checksum": "52f82c15783f37b2de073e22e1b5a648"
23+
}
24+
},
25+
"users": null,
26+
"extension": {
27+
"name": "quarto-document",
28+
"title": "Quarto Document",
29+
"description": "This Quarto example shows how a basic document can present diagrams and interactivity.",
30+
"homepage": "https://github.com/posit-dev/connect-extensions/tree/main/extensions/quarto-document",
31+
"version": "1.0.0"
32+
}
33+
}

0 commit comments

Comments
 (0)