-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7387adb
commit 169b5d5
Showing
3 changed files
with
55 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: Hybrid Execution | ||
subtitle: Combine pre-rendered and client-side WebAssembly computation | ||
format: live-html | ||
engine: knitr | ||
--- | ||
|
||
{{< include ../_extensions/live/_knitr.qmd >}} | ||
|
||
Defining variables through OJS variables allows for a communication channel between various execution engines. | ||
|
||
## Build-time code execution | ||
|
||
Data can be evaluated and exported to be made availabe to OJS blocks at runtime, using Quarto's usual build-time code cell execution. | ||
|
||
#### Source | ||
````{.markdown filename="hybrid.qmd"} | ||
```{{r}} | ||
library(ggplot2) | ||
glimpse(diamonds) | ||
ojs_define(diamonds) | ||
``` | ||
```` | ||
|
||
#### Output | ||
```{r} | ||
library(ggplot2) | ||
head(diamonds) | ||
ojs_define(diamonds) | ||
``` | ||
|
||
## Runtime computation | ||
|
||
### OJS Cells | ||
|
||
```{ojs} | ||
diamonds | ||
``` | ||
|
||
### WebAssembly `quarto-live` cells | ||
|
||
````{.markdown filename="hybrid.qmd"} | ||
```{{webr}} | ||
#| input: | ||
#| - diamonds | ||
head(diamonds) | ||
``` | ||
```` | ||
|
||
```{webr} | ||
#| input: | ||
#| - diamonds | ||
head(diamonds) | ||
``` |