I’m in seattle for
#PositConf2024 ! Out exploring today and then super excited to get up on stage on Tuesday morning and talk about some of the things I’ve been working on recently 😄 Say “Hi” if you see me, I’d be happy to stop and chat for a while about webR and WebAssembly if you like!
Have you ever given a presentation and wished you had an #rstats or #python console right there in your slides with you? Based on a great suggestion from a webR user, Quarto Drop is a #quarto extension that adds a fullscreen interactive console and code editor directly into a #quarto reveal.js presentation. The console is powered by #wasm, using #webR or #pyodide, and can be dropped down from above or hidden away with the click of a button or a shortcut key.
https://github.com/r-wasm/quarto-drop

GitHub - r-wasm/quarto-drop: Drop down an interactive R or Python console, code editor, and plotting window from the top of your Quarto slides.
Drop down an interactive R or Python console, code editor, and plotting window from the top of your Quarto slides. - r-wasm/quarto-drop
GitHubI'm at
#useR2024! Feel free to come and say "Hi" if you see me around and would like to chat about R and WebAssembly!
This extension isn't quite ready yet, it still needs a fair bit of work, but it's getting there! I'm taking a bunch of time to really make sure the system is as rock solid as I can possibly make it. Hopefully we can make the extension available for some wider testing fairly soon, and I'm looking forward to seeing the kinds of rich interactive documents authors are going to create once it's ready.
Also... it should work well with Python too, using #pyodide.
The reactive inputs can then feed through to exercises, with both user and solution code reacting to the changes. This means leaners can be given parametrised questions, or interact with exercises in a more engaging way than just typing in lines of solution code. Learners can experiment with parameters live and see how things really change.
Things start to get really fun when you introduce ojs blocks into the mix. Interactive code blocks can interface with the ojs variables that also exist in the Quarto document. Existing variables can be included in the R environment, and R variables can be output as ojs variables. Since ojs handles its own reactive runtime and has a collection of standard reactive inputs, it's possible to create dynamic client-side experiences with very little glue code at all.
Adding `hint` and `solution` blocks creates an exercise, similar to the output of {learnr}. Hints and solutions can be revealed by the learner when required, making use of Quarto's excellent code presentation tools such as syntax and line highlighting, and code annotations. Since we're running webR under the hood, user submitted solutions can be graded using either grading algorithms written in R, or using the {gradethis} R package to compare learner submitted code to the solution block.
With this new extension, including a ```{webr} block inserts a runnable sandbox code editor into your Quarto document. The code outputs here are not just the R console's standard text-based output, but rich content generated through the {knitr} engine. The sandbox editor can be used to interactively output a wide range of items, with text, tables, plots, HTML widgets, and even errors rendered nicely into the page.
This release of webR powers a new project I've been working over the last few months, aiming to improve integration of WebAssembly engines like webR with Quarto and ojs, with particular focus on re-creating interactive exercises in the style of {learnr}. The basic idea is to use the reactivity provided by ojs as the backend for interactive client-side code blocks, powered by WebAssembly and using JavaScript for rich and responsive output.
Coming soon to the
#webR app: Viewing the output of dynamic HTML tools and widgets produced by
#RStats!